From 06869f73547cf01a3fce67e1e9debb6d8f48bddf Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 17 Jul 2021 20:25:27 +0200 Subject: [PATCH 01/55] Update README.md added Jaldi --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 29072bb..caa3f57 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,8 @@ ## Download Releases here - https://rabcr.ga/ - - github - ## About A 2D game written with MonoGame that targets Win. @@ -15,9 +13,8 @@ A 2D game written with MonoGame that targets Win. - DirectX - .NET Framework: 4.7.2 - ## What I use -- Fonts: M PLUS Rounded, Sunflower, Tajawal, HanWangYenLight +- Fonts: M PLUS Rounded, Sunflower, Tajawal, HanWangYenLight, Jaldi - Some parts translated by Google translate :) ## Programing From 2cdb678b5f96285d7c8b4e701c2b99891d19479a Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sun, 18 Jul 2021 12:51:03 +0200 Subject: [PATCH 02/55] Iink to bad translate is now in release file --- rabcrClient/Relase.cs | 2 ++ rabcrClient/WindowsAndStates/Splash/FormBadTranslation.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rabcrClient/Relase.cs b/rabcrClient/Relase.cs index da1c3d5..ea2ff39 100644 --- a/rabcrClient/Relase.cs +++ b/rabcrClient/Relase.cs @@ -138,6 +138,8 @@ public const string // Report error stringRRE="https://***.php", + stringBadTranslate ="https://***.php", + // Send date through the anonymization gateway (hide ip) and check trolls // ... or it can go direct if you don't want to do, but its better to have gamejolt api code safe on the sever, because code its hidden! stringGameJoltServerGate="https://***.php?"; diff --git a/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.cs b/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.cs index b5dae88..701aa66 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.cs @@ -39,7 +39,7 @@ public partial class FormBadTranslation: Form { // Run Thread.Sleep(1000); - System.Diagnostics.Process.Start("https://geftgames.ga/rbt.php"+send); + System.Diagnostics.Process.Start(Release.stringBadTranslate+send); } else MessageBox.Show(Lang.Texts[352], Lang.Texts[241]); } else MessageBox.Show(Lang.Texts[353], Lang.Texts[241]); Close(); From d9ad2b3d0d8b30f50e856ee5511d1b09d11a0cad Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sun, 19 Dec 2021 09:20:15 +0100 Subject: [PATCH 03/55] update + snow better --- rabcrClient/AchievmentControl.cs | 52 +- rabcrClient/Commands.cs | 49 + rabcrClient/Default/Lang/Lang.xml | 529 +- .../Blocks/BlockBackgrounds/Ore/Aluminium.png | Bin 595 -> 416 bytes .../Blocks/BlockBackgrounds/Ore/Coal.png | Bin 287 -> 70 bytes .../Blocks/BlockBackgrounds/Ore/Copper.png | Bin 649 -> 451 bytes .../Blocks/BlockBackgrounds/Ore/Gold.png | Bin 668 -> 446 bytes .../Blocks/BlockBackgrounds/Ore/Iron.png | Bin 543 -> 386 bytes .../Blocks/BlockBackgrounds/Ore/Saltpeter.png | Bin 564 -> 386 bytes .../Blocks/BlockBackgrounds/Ore/Silver.png | Bin 612 -> 397 bytes .../Blocks/BlockBackgrounds/Ore/Sulfur.png | Bin 432 -> 332 bytes .../Blocks/BlockBackgrounds/Ore/Tin.png | Bin 562 -> 383 bytes .../Blocks/BlockBackgrounds/Other/Clay.png | Bin 526 -> 339 bytes .../BlockBackgrounds/Other/Cobblestone.png | Bin 245 -> 176 bytes .../Blocks/BlockBackgrounds/Other/Dirt.png | Bin 299 -> 221 bytes .../Blocks/BlockBackgrounds/Other/Gravel.png | Bin 264 -> 176 bytes .../Blocks/BlockBackgrounds/Other/RedSand.png | Bin 380 -> 260 bytes .../BlockBackgrounds/Other/Regolite.png | Bin 285 -> 243 bytes .../Blocks/BlockBackgrounds/Other/Sand.png | Bin 333 -> 252 bytes .../BlockBackgrounds/Stone/Anorthosite.png | Bin 596 -> 405 bytes .../Blocks/BlockBackgrounds/Stone/Basalt.png | Bin 403 -> 286 bytes .../Blocks/BlockBackgrounds/Stone/Diorit.png | Bin 618 -> 419 bytes .../BlockBackgrounds/Stone/Dolomite.png | Bin 588 -> 378 bytes .../Blocks/BlockBackgrounds/Stone/Flint.png | Bin 166 -> 154 bytes .../Blocks/BlockBackgrounds/Stone/Gabbro.png | Bin 540 -> 376 bytes .../Blocks/BlockBackgrounds/Stone/Gneiss.png | Bin 399 -> 284 bytes .../BlockBackgrounds/Stone/Limestone.png | Bin 441 -> 346 bytes .../BlockBackgrounds/Stone/Mudstone.png | Bin 396 -> 282 bytes .../BlockBackgrounds/Stone/Rhyolite.png | Bin 483 -> 344 bytes .../BlockBackgrounds/Stone/Sandstone.png | Bin 550 -> 390 bytes .../Blocks/BlockBackgrounds/Stone/Schist.png | Bin 462 -> 323 bytes .../Blocks/Stalactite/stalactite0.png | Bin 0 -> 169 bytes .../Blocks/Stalactite/stalactite1.png | Bin 0 -> 207 bytes .../Blocks/Stalactite/stalactite2.png | Bin 0 -> 165 bytes .../Blocks/Stalactite/stalactite3.png | Bin 0 -> 202 bytes .../Blocks/Stalactite/stalactite4.png | Bin 0 -> 233 bytes .../Blocks/Stalagmite/stalagmite0.png | Bin 0 -> 152 bytes .../Blocks/Stalagmite/stalagmite1.png | Bin 0 -> 207 bytes .../Blocks/Stalagmite/stalagmite2.png | Bin 0 -> 165 bytes .../Blocks/Stalagmite/stalagmite3.png | Bin 0 -> 233 bytes .../Blocks/Stalagmite/stalagmite4.png | Bin 0 -> 202 bytes rabcrClient/Functions/FastMath.cs | 13 +- rabcrClient/Functions/FastRandom.cs | 254 +- rabcrClient/GImageButton.cs | 2 +- rabcrClient/GenLiveObject.cs | 8 +- rabcrClient/InterLogic/Data/SoundEffects.cs | 2 +- .../Classic/Components/GButton.cs | 26 +- .../Classic/Components/GColor.cs | 12 +- .../Classic/Components/GTextBox.cs | 2 +- .../Classic/Components/GeDoPanel.cs | 4 +- .../DrawComponents/Classic/Help/GGeDo.cs | 2 +- .../Game/BlockType/AnimatedBlock.cs | 19 +- .../Game/BlockType/BasicWavingPlant.cs | 8 +- .../InterLogic/Game/BlockType/BoxBlock.cs | 10 +- .../InterLogic/Game/BlockType/CactusBlock.cs | 10 +- .../InterLogic/Game/BlockType/Chicken.cs | 152 +- rabcrClient/InterLogic/Game/BlockType/Fish.cs | 20 +- .../Game/BlockType/FruitPlantWaving.cs | 10 +- .../InterLogic/Game/BlockType/LeavesBlock.cs | 17 +- .../InterLogic/Game/BlockType/MFish.cs | 97 + rabcrClient/InterLogic/Game/BlockType/Mob.cs | 28 +- .../InterLogic/Game/BlockType/NormalBlock.cs | 2 +- .../InterLogic/Game/BlockType/Parrot.cs | 181 +- .../InterLogic/Game/BlockType/Plant.cs | 2 +- .../InterLogic/Game/BlockType/Rabbit.cs | 169 +- .../InterLogic/Game/BlockType/ScreenBlock.cs | 7 +- .../InterLogic/Game/BlockType/ShelfBlock.cs | 2 +- .../InterLogic/Game/BlockType/Water.cs | 15 +- .../InterLogic/Game/BlockType/WavingPlant.cs | 2 +- .../InterLogic/Game/Enums/BlocksIds.cs | 14 +- rabcrClient/InterLogic/Game/GameButton.cs | 5 +- rabcrClient/InterLogic/Game/GameDraw.cs | 152 +- rabcrClient/InterLogic/Game/GameMethods.cs | 3452 +- rabcrClient/InterLogic/Game/Structs.cs | 107 +- .../InterLogic/Game/Terrain/GenerateWorld.cs | 1980 +- .../InterLogic/Game/Terrain/MTerrain.cs | 201 +- .../Game/Terrain/MultiplayerMethods.cs | 1933 + .../InterLogic/Game/Terrain/Terrain.cs | 47 +- rabcrClient/InterLogic/Global/Global.cs | 28 +- rabcrClient/InterLogic/Global/Setting.cs | 4 +- rabcrClient/InterLogic/Graphics/Background.cs | 610 +- rabcrClient/InterLogic/Graphics/GeDo.cs | 177 +- .../InterLogic/Graphics/Screen/Rabcr.cs | 30 +- rabcrClient/InterLogic/ItemInv.cs | 2 +- rabcrClient/InterLogic/Lang.cs | 12 +- rabcrClient/InterLogic/Menu/Button.cs | 4 +- rabcrClient/InterLogic/Menu/ButtonCenter.cs | 8 +- .../InterLogic/Menu/ButtonCenterLang.cs | 2 +- .../Menu/Settings/SettingMessage.cs | 2 +- .../InterLogic/Multiplayer/CheckServer.cs | 71 +- .../Multiplayer/MultiplayerSystem.cs | 225 +- rabcrClient/InterLogic/TextDrawer.cs | 461 +- rabcrClient/LiveObject.cs | 10 +- rabcrClient/Particles.cs | 266 +- rabcrClient/Program.cs | 30 +- rabcrClient/Properties/Resources.resx | 54 +- rabcrClient/Relase.cs | 10 +- rabcrClient/Resources/Fonts licence OFL.txt | 2 +- .../GameStates/Game/GeneratePlanetSystem.cs | 2 +- .../GameStates/Game/Multiplayer.cs | 47272 +++++++++------- .../GameStates/Game/PlanetSystem.cs | 18 +- .../GameStates/Game/Singleplayer.cs | 5996 +- .../WindowsAndStates/GameStates/Menu.cs | 4 +- .../GameStates/Menu/Informations.cs | 18 +- .../GameStates/Menu/MainMenu.cs | 26 +- .../GameStates/Menu/MenuCharacter.cs | 2 +- .../GameStates/Menu/MenuLang.cs | 22 +- .../GameStates/Menu/MenuMultiplayer.cs | 38 +- .../GameStates/Menu/MenuSetting.cs | 2 +- .../GameStates/Menu/MenuSingleplayer.cs | 6 +- .../WindowsAndStates/GameStates/Start.cs | 16 +- .../Splash/AddSingleWorld.Designer.cs | 104 +- .../WindowsAndStates/Splash/AddSingleWorld.cs | 12 +- .../Splash/AddSingleWorld.resx | 54 +- .../Splash/CheckPassword.Designer.cs | 68 +- .../Splash/CheckPassword.resx | 54 +- .../Splash/EditSingleWorld.Designer.cs | 104 +- .../Splash/EditSingleWorld.resx | 54 +- .../Splash/FormAch.Designer.cs | 32 +- .../WindowsAndStates/Splash/FormAch.cs | 8 +- .../WindowsAndStates/Splash/FormAch.resx | 54 +- .../Splash/FormAchDetail.Designer.cs | 32 +- .../WindowsAndStates/Splash/FormAchDetail.cs | 4 +- .../Splash/FormAchDetail.resx | 54 +- .../Splash/FormAchGameJolt.Designer.cs | 36 +- .../Splash/FormAchGameJolt.cs | 28 +- .../Splash/FormAchGameJolt.resx | 54 +- .../Splash/FormBadTranslation.Designer.cs | 46 +- .../Splash/FormBadTranslation.resx | 54 +- .../Splash/FormColors.Designer.cs | 32 +- .../WindowsAndStates/Splash/FormColors.resx | 54 +- .../Splash/FormGiftCode.Designer.cs | 48 +- .../WindowsAndStates/Splash/FormGiftCode.cs | 28 +- .../WindowsAndStates/Splash/FormGiftCode.resx | 54 +- .../Splash/FormLogin.Designer.cs | 424 +- .../WindowsAndStates/Splash/FormLogin.cs | 426 +- .../WindowsAndStates/Splash/FormLogin.resx | 54 +- .../Splash/FormTest18Plus.Designer.cs | 33 +- .../WindowsAndStates/Splash/FormTest18Plus.cs | 12 +- .../Splash/FormTextInput.Designer.cs | 61 +- .../Splash/FormTextInput.resx | 54 +- .../WindowsAndStates/Splash/Message.cs | 16 +- .../Splash/Password.Designer.cs | 78 +- .../WindowsAndStates/Splash/Password.resx | 54 +- rabcrClient/app.manifest | 2 +- rabcrClient/packages.config | 2 +- rabcrClient/rabcrClient.csproj | 32 +- 147 files changed, 38252 insertions(+), 29091 deletions(-) create mode 100644 rabcrClient/Commands.cs create mode 100644 rabcrClient/Default/Textures/Blocks/Stalactite/stalactite0.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalactite/stalactite1.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalactite/stalactite2.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalactite/stalactite3.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalactite/stalactite4.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite0.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite1.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite2.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite3.png create mode 100644 rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite4.png create mode 100644 rabcrClient/InterLogic/Game/BlockType/MFish.cs create mode 100644 rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs diff --git a/rabcrClient/AchievmentControl.cs b/rabcrClient/AchievmentControl.cs index 4925ad0..9ced1ca 100644 --- a/rabcrClient/AchievmentControl.cs +++ b/rabcrClient/AchievmentControl.cs @@ -14,7 +14,7 @@ class AchievmentControl : Control{ int alpha=200; int need=255; Image image; - + enum State :byte{ None, Enter, @@ -123,23 +123,23 @@ enum State :byte{ //g.SmoothingMode = SmoothingMode.None; Font=new Font(Font.FontFamily,14); Size =new Size(Size.Width,64); - + Brush b = new LinearGradientBrush(ClientRectangle, Color.FromArgb((int)alpha,(int)alpha,(int)alpha), Color.FromArgb((int)alpha-40,(int)alpha-40,(int)alpha-40), 90); - - // Pen sb = new Pen(new SolidBrush(Color.Black)); - + + // Pen sb = new Pen(new SolidBrush(Color.Black)); + //Back g.DrawRectangle(new Pen(new LinearGradientBrush(ClientRectangle, Color.FromArgb(100,(int)alpha,(int)alpha,(int)alpha), Color.FromArgb(100,(int)alpha-40,(int)alpha-40,(int)alpha-40), 90)),new Rectangle(0, 0, Size.Width-1, Size.Height-1)); g.DrawRectangle(new Pen(new LinearGradientBrush(ClientRectangle, Color.FromArgb(200,(int)alpha,(int)alpha,(int)alpha), Color.FromArgb(200,(int)alpha-40,(int)alpha-40,(int)alpha-40), 90)),new Rectangle(1, 1, Size.Width-3, Size.Height-3)); g.FillRectangle(b,new Rectangle(2, 2, Size.Width-4, Size.Height-4)); g.InterpolationMode=InterpolationMode.NearestNeighbor; - + if (Image!=null)g.DrawImage(image, 0,0,64,64); if (Done) { g.DrawImage(rabcrClient.Properties.Resources.Done,new Point(Width-60,6)); - } + } g.InterpolationMode=InterpolationMode.HighQualityBicubic; - + g.TextContrast=0; g.TextRenderingHint=System.Drawing.Text.TextRenderingHint.AntiAlias; // if (Setting.TextShadow) { @@ -147,7 +147,7 @@ enum State :byte{ //g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Point(textX + 1 - (int)(g.MeasureString(Text, Font).Width / 2), textY + 1 - (int)(g.MeasureString(Text, Font).Height / 2))); //g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Point(textX + 1 - (int)(g.MeasureString(Text, Font).Width / 2), textY - (int)(g.MeasureString(Text, Font).Height / 2))); //g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Point(textX - (int)(g.MeasureString(Text, Font).Width / 2), textY + 1 - (int)(g.MeasureString(Text, Font).Height / 2))); - + g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(70+1, 32 - (int)(g.MeasureString(Text, Font).Height / 2)+0)); g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(70+0, 32 - (int)(g.MeasureString(Text, Font).Height / 2)+1)); g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(70+1, 32 - (int)(g.MeasureString(Text, Font).Height / 2)+1)); @@ -157,42 +157,42 @@ enum State :byte{ //g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(textX - (int)(g.MeasureString(Text, Font).Width / 2)+2, textY - (int)(g.MeasureString(Text, Font).Height / 2)+1)); //g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(textX - (int)(g.MeasureString(Text, Font).Width / 2)+1, textY - (int)(g.MeasureString(Text, Font).Height / 2)+2)); - + g.PixelOffsetMode = PixelOffsetMode.HighQuality; //} //Draw.Text(g, Font, Text, textX + 1 - (int)(g.MeasureString(Text, Font).Width / 2), textY + 1 - (int)(g.MeasureString(Text, Font).Height / 2)); //Draw.TextBig(g,Text, (int)((buttonSize.Width - g.MeasureString(Text, Font).Width)/2), (int)((buttonSize.Height - g.MeasureString(Text, Font).Height) / 2)); - + g.DrawString(Text, Font, new SolidBrush(Color.Black), new Point(70, 32 - (int)(g.MeasureString(Text, Font).Height / 2))); //ds.DrawText(g, textX - (int)(g.MeasureString(Text, Font).Width / 2), textY - (int)(g.MeasureString(Text, Font).Height / 2), new SolidBrush(Color.Gray)); //else ds.DrawText(g, textX - (int)(g.MeasureString(Text, Font).Width / 2), textY - (int)(g.MeasureString(Text, Font).Height / 2), new SolidBrush(Color.Black)); } - public static Bitmap SetBitmapOpacity(Bitmap image, float opacity) { - //create a Bitmap the size of the image provided - Bitmap bmp = new Bitmap(image.Width, image.Height); + public static Bitmap SetBitmapOpacity(Bitmap image, float opacity) { + //create a Bitmap the size of the image provided + Bitmap bmp = new Bitmap(image.Width, image.Height); - //create a graphics object from the image - using (Graphics gfx = Graphics.FromImage(bmp)) { + //create a graphics object from the image + using (Graphics gfx = Graphics.FromImage(bmp)) { - //create a color matrix object - ColorMatrix matrix = new ColorMatrix(); + //create a color matrix object + ColorMatrix matrix = new ColorMatrix(); - //set the opacity - matrix.Matrix33 = opacity; + //set the opacity + matrix.Matrix33 = opacity; matrix.Matrix00=-1; matrix.Matrix11 = matrix.Matrix22 = -1; - //create image attributes - ImageAttributes attributes = new ImageAttributes(); + //create image attributes + ImageAttributes attributes = new ImageAttributes(); - //set the color(opacity) of the image - attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); + //set the color(opacity) of the image + attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); - //now draw the image + //now draw the image gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes); } return bmp; - } + } } } diff --git a/rabcrClient/Commands.cs b/rabcrClient/Commands.cs new file mode 100644 index 0000000..0213e7b --- /dev/null +++ b/rabcrClient/Commands.cs @@ -0,0 +1,49 @@ +namespace rabcrClient { + public enum Command : byte { + Null, + CheckInMenu, //Status of server + Check, //Status of server + Blank, + + // Starting + GetStatus, // get req to join + Login, // Login into the server with pasword (or without) + LoggedState, // Server say ok or wrong + SetPassword, // Set password enter + Logout, // Logout of the server + Exit, // End + Message, // Send a text message to all the chat clients + + // World + SendingWorldData, //Get chunk of blocks + GetWorldData, + ListPlayersPositions, //get pos of player + + Request, // Check if player exists + EditTerrain, + + // Others + PlayersList, // Get a list of users in the chat room from the server + SomeoneLogout, + ConnectDuringGame, + PlayersTeleportMessageToTarget, + PlayersTeleportMessageToSource, + + // Player data + PlayerBasicStates, // lives, food, water, ... + PlayerInventory, // my inv, ... + EatFood, + SetInventory, + SetInventoryMachine, + SpawnChanged, + PlayerPosition, + JoinWorld, + + } + + enum ErrorJoinWorld { + None, + NotAllowedToJoin, + NotFound, + } +} diff --git a/rabcrClient/Default/Lang/Lang.xml b/rabcrClient/Default/Lang/Lang.xml index 2f5162a..3c63963 100644 --- a/rabcrClient/Default/Lang/Lang.xml +++ b/rabcrClient/Default/Lang/Lang.xml @@ -115,6 +115,7 @@ Generated in Vygenerováno za + Vêgenerovány za Vygenerový za Vygenerované za Generiert in @@ -199,6 +200,7 @@ Back Zpět + Zpátkê Wrócić Zpátky Zurück @@ -282,9 +284,11 @@ Main Obecné + Obecny Powšitkowne Vobecné Všeobecné + Všeobecny Allgemein 全般 General @@ -358,6 +362,7 @@ Keyboard Klávesy + Klávesê Tastatura Tastatur キーボード @@ -432,6 +437,7 @@ How to play Jak hrát + Jak hrát Kak hrać Wie man spielt Ako hrať @@ -513,6 +519,7 @@ Information Informace + Informace Informacije Informationen 情報 @@ -593,8 +600,9 @@ Singleplayer Hra pro jednoho Hra za jednoho - Hra pro jedného + Hra pro jedneho Hra pro jednyho + Hra pro jedného Hra pre jedného Einzelspieler シングルプレーヤー @@ -663,6 +671,8 @@ Multiplayer Hra více hráčů + Hra vic hráču + Hra víc hráčů Settings @@ -754,7 +764,7 @@ Close Ukončit Začinić - Ôkončet + Ôkončêt Schließen Ukončiť Quitter le jeu @@ -858,7 +868,8 @@ Add - Přidat + Přidat + Přêdat Aděrować Hinzufügen Pridať @@ -1102,7 +1113,8 @@ Error during loading - Neproběhlo správné načtení + Neproběhlo správné načtení + Mélka počas načteni Neprebehlo správne načítanie Ładunek nie został poprawnie załadowany ロード中のエラー @@ -1182,7 +1194,9 @@ Checked Zkontrolováno - Skontrolované + Skontrolované + Skontrolované + Skontrolovany Kontrolita Sprawdzone チェック済み @@ -1260,7 +1274,8 @@ The folder RabcrData has corrupted or missing content Složka RabcrData má požkozený nebo chybějící obsah - Složka RabcrData má požkozenej nebo chybějící obsah + Složka RabcrData má požkozenej nebo chybějící obsah + Složka RabcrData má požkozeny data nebo s chêbnym obsahem Zložka RabcrData má pożkodenia alebo chýbajúci obsah Folder RabcrData ma uszkodzoną lub brakującą zawartość フォルダーRabcrDataのコンテンツが破損しているか欠落しています @@ -1340,7 +1355,9 @@ Details - Podrobnosti + Podrobnosti + Podrobnostě + Podrobnostě 詳細 Einzelheiten Detalles @@ -1415,7 +1432,8 @@ Open - Otevřít + Otevřít + Otevř Wočinić Votevřít オープン @@ -1495,7 +1513,9 @@ Fly - Odletět + Odletět + Odlitnót + Odlétnout Lećeć Vodletět Odletieť @@ -1571,7 +1591,8 @@ Go to the menu - Zpět do menu + Zpět do menu + Zpátkê do menô Chodźić do menu Späť do menu Vá para o menu @@ -1659,7 +1680,8 @@ You died Šěsć morwy Právě jsi zemřel(a) - Právě si zemřel(a) + Zrovna si zemřel(a) + Zrovna si zemřel(a) Práve si zomrel(a) Você morreu Vi mortis @@ -1757,7 +1779,8 @@ Respawn in - Znovuzrodíš se za + Znovuzrodíš se za + Znovô se narodiš za Znovuzrodíš sa za Odrodzenie w Malaperigita eng @@ -1855,7 +1878,8 @@ Use - Použití + Použití + Póžeti Použitie Posługiwać się 使用する @@ -1934,7 +1958,8 @@ is number - je číslo + je číslo + je čislo Je číslo To liczba 数です @@ -2014,7 +2039,9 @@ Adjusting - Nastavuji + Nastavuji + Nastavuju + Nastavôjô Nastavujem Naregulowanie 調整中 @@ -2108,7 +2135,8 @@ Unknown error - Neznámá chyba + Neznámá chyba + Neznámá mélka Error desconocido Neznáma chyba Nieznany błąd @@ -2217,7 +2245,8 @@ Cancel - Zrušit + Zrušit + Anôlovat Přetorhnyć Abbrechen Zrušiť @@ -2299,7 +2328,8 @@ Apply - Použít + Použít + Póžit Wužiwać Übernehmen アプライ @@ -2380,7 +2410,8 @@ Name of the world - Název světa + Název světa + Méno sfěta Pomjenowanje swěta Názov sveta Nazwa świata @@ -2558,7 +2589,7 @@ Obtížnost ve světě Ćežkósć w swěće Vobtížnost ve světě - Obtižnost ve světě + Obťéžnost ve sfětě Schwierigkeit Obtiažnosť vo svete Dificuldade no mundo @@ -2649,7 +2680,7 @@ The size of the world Velikost světa Wulkósć swěta - Velêkosť světa + Velêkosť sfěta Veľkosť sveta Wielkość świata O tamanho do mundo @@ -2739,7 +2770,7 @@ Load world from file Načíst svět ze souboru Swět wobchadźeć wot dataja - Načést svět ze sóboru + Načést sfět ze sóborô Načítať svet zo súboru Załaduj świat z pliku Carregar mundo do arquivo @@ -2849,7 +2880,8 @@ Edit world - Upravit svět + Upravit svět + Ôpravêt sfět Wobdźěłać swět Bearbeiten Upraviť svet @@ -3033,7 +3065,8 @@ Remove world - Smazat svět + Smazat svět + Smazat sfět Wotstronić swět Löschen Zmazať svet @@ -3686,7 +3719,8 @@ Player - Postavička + Postavička + Postavêčka プレーヤー Charakter Jugador @@ -3764,7 +3798,8 @@ Gender - Pohlaví + Pohlaví + Pohlavi Splah Sex 性別 @@ -3843,7 +3878,8 @@ Depending on sex will be generated clothes - Podle pohlaví bude vygenerováno oblečení + Podle pohlaví bude vygenerováno oblečení + Podli pohlavi bôde včegenerované obšata Podľa pohlavia bude vygenerované oblečenie Odzież będzie generowana według płci 性別によって生成される服 @@ -3922,7 +3958,8 @@ Man - Muž + Muž + Môž Muž Mann @@ -3998,7 +4035,8 @@ Enabled - Zapnuto + Zapnuto + Zapnôté Aktiviert 有効化 Zapnuté @@ -4076,7 +4114,8 @@ Disabled - Vypnuto + Vypnuto + Vêpnôté Deaktiviert 無効 Vypnuté @@ -4235,7 +4274,8 @@ Mature player - Věk postavičky + Věk postavičky + Leta postavêčkê Dojrzały gracz Joueur mature Giocatore maturo @@ -4315,7 +4355,8 @@ Hair colour Hair color - Barva vlasů + Barva vlasů + Barva pačesů Haarfarbe Kolor włosów Farba vlasov @@ -4403,7 +4444,8 @@ White - Bílé + Bílé + Bily Běl Weiß 白毛 @@ -4482,7 +4524,8 @@ Vulavula - Blond + Blond + Blonďaty ブロンド毛 Rubio Biondo @@ -4538,7 +4581,8 @@ Ginger - Zrzavé + Zrzavé + Zrzavy Rot 赤毛 Ryšavé @@ -4613,7 +4657,8 @@ Brown - Hnědé + Hnědé + Hnědy Bruny Braun 褐毛 @@ -4687,7 +4732,8 @@ Black - Černé + Černé + Černy Čorny Schwarz 黒毛 @@ -4768,7 +4814,8 @@ Keyboard - Klávesnice + Klávesnice + Klávesnica Tastatur キーボード Klávesnica @@ -4917,7 +4964,8 @@ Move left - Pohyb doleva + Pohyb doleva + Pohnóti se doleva Links Pohyb doľava Aller à gauche @@ -5000,7 +5048,8 @@ Move right - Pohyb doprava + Pohyb doprava + Pohnóti se doprava Rechts Aller à droite Cammina verso destra @@ -5083,7 +5132,8 @@ Jumping - Skákání + Skákání + Vêskákováni Springen ジャンプ Skákanie @@ -5162,7 +5212,8 @@ Accelerate - Zrychlení + Zrychlení + Rêchléši pohêb Убрзати Kuharakisha Beschleunegen @@ -5316,7 +5367,8 @@ Message - Zpráva + Zpráva + Správa Nachricht Správa Mensaje @@ -5395,7 +5447,8 @@ Open bubble and write some text - Otevřít bublinu ke psaní + Otevřít bublinu ke psaní + Otevř žbolêno ke psani Votevřít bublinu ke psaní Otvoriť bublinu na písanie Chat @@ -5629,7 +5682,9 @@ Go from game to the menu - Ze hry do menu + Otevřít bublinu ke psaní + Ze hry do menu + Ze hrê do menô Od gry do menu ゲームからメニューへ Gehe vom Spiel zum Menü @@ -5708,7 +5763,8 @@ Language - Jazyk + Jazyk + Jazêk Rěč Sprache 言語 @@ -5790,7 +5846,8 @@ Game elements - Herní prvky + Herní prvky + Herni prvkê Herné prvky ゲーム要素 Elementos del juego @@ -5869,7 +5926,8 @@ Controls animations - Animace tlačítek, polí + Animace tlačítek, polí + Animace sklačidel, poli Contrôle les animations Kontrollerer animationer Animações de controles @@ -5949,7 +6007,8 @@ Game animations - Herní animace + Herní animace + Herni animace Animations de jeu Spilanimationer Animações de jogo @@ -6029,7 +6088,8 @@ Zoom - Přiblížení + Přiblížení + Přêbléžêni Vergrößern Priblíženie ズーム @@ -6093,7 +6153,8 @@ Type of scale - Typ roztáhnutí + Typ roztáhnutí + Têp roztáhnôti Stretch-Tipp Typ roztiahnutia Tipo di stiramento @@ -6281,7 +6342,8 @@ Loudness - Hlasitost + Hlasitost + Hlasêtost Lautstärke Hlasitosť ボリューム @@ -6353,7 +6415,7 @@ Music Hudźba Hlasitost písní - Hlasitost pêsniček + Hlasêtost vêbřenkováni môzekê Musik Hlasitosť piesní Muzyka @@ -6432,7 +6494,7 @@ Effects Hlasitost efektů - Hlasêtost efektô + Hlasêtost vêbřenkováni efektô Hlasitosť efektov 音響効果 Efekty @@ -6680,7 +6742,8 @@ Enter text - Zadajte text + Zadejte text + Zadéte text Wpisz tekst Entrez du texte Ingrese texto @@ -6781,7 +6844,8 @@ I've had 18 years Dosáhl jsem 18 let - Su starší 18 let + Su starší 18 let + Sô starši 18 let Dosiahol som 18 rokov Mi havis 18 jarojn У мене було 18 років @@ -6965,7 +7029,8 @@ you haven't 18 jste nezletilý jste nezletilej - ste nezletilý + ste nezletilý + ste nezletilé ste maloletý du bist minderjährig jesteś nieletni @@ -7160,7 +7225,8 @@ Without - Bez + Bez + Bes Ohne Sans Senza @@ -7239,7 +7305,8 @@ Proportion - Dle poměru + Dle poměru + Podli poměrô Podľa pomeru Proporción Proporzione @@ -7316,7 +7383,8 @@ Fill - Vyplnit + Vyplnit + Vêplnit Ausfüllen Vyplniť Wypełnij @@ -7403,7 +7471,8 @@ Window - Okenní + Okenní + Okenni Vokenní Fenster Okenné @@ -7481,7 +7550,8 @@ Maximized - Zvětšené + Zvětšené + Zvětšeny Maximalisiert Zväčšené Zmaksymalizowane @@ -7557,7 +7627,8 @@ Fullscreen - Celoobrazovkové + Celoobrazovkové + Celoobrazovkovy Vollbild Pełny ekran Plein écran @@ -7633,6 +7704,7 @@ Fast Rychlé + Spichavé Schnell Rýchle Szybki @@ -7726,7 +7798,8 @@ Medium - Střední + Střední + Středni Mittlere Stredná ミディアム @@ -7797,7 +7870,8 @@ Slow - Pomalé + Pomalé + Pomaly Langsam Powolny Lento @@ -7882,7 +7956,8 @@ Clothes and crafting - Oblečení a vyrábění + Oblečení a vyrábění + Obšata a vêráběni Bekleidung und Fertigung Oblečenie a vyrábanie Prendas de vestir y la fabricación @@ -7963,7 +8038,8 @@ Desk - Stůl + Stůl + Stul Tisch Stôl クラフトデスク @@ -8113,12 +8189,14 @@ Choose an item - Vyberte item + Vyberte item + Vêberte item Digitaka e dua na ka You can't breathe water - Nemůžeš dýchat vodu + Nemůžeš dýchat vodu + Nemužeš déchat vodô Nemôžeš dýchať vodu Vi ne povas spiri akvon No puedes respirar agua @@ -8214,7 +8292,8 @@ You should eat and drink Měl bys jíst a pít - Měl by si něco sníst a pít se + Měl bys něco sníst a pít se + Měl bês něco snist a napit se Mal by si jesť a piť Vi devas manĝi kaj trinki Deberías comer y beber @@ -8310,7 +8389,8 @@ Pay attention! Lava... - Dávej pozor! Láva... + Dávej pozor! Láva... + Dávé bacha! Láva... Dávaj pozor! Láva... ¡Presta atención! Lava... Passt auf! Lava... @@ -8399,8 +8479,9 @@ You were drawn to death Byl jsi utahán k smrti - Byl si utahán ke smrti - Byls utahanej ke smrti + Byls utahán ke smrti + Bêls ôtahán ke smrti + Byl si utahanej ke smrti Bol si uťahaný na smrť 死に疲れていました 死に疲れちょった @@ -8496,7 +8577,8 @@ Toadstool is poisonous - Muchomůrka je jedovatá + Muchomůrka je jedovatá + Môchomurka se dá jist jen jednó Muchotrávka je jedovatá Toadstool estas venena Toadstool es venenoso @@ -8593,7 +8675,8 @@ Fly - Přiletět + Přiletět + Přêlétnót Fliege Priletieť Flugu @@ -8668,7 +8751,8 @@ Create - Vytvořit + Vytvořit + Vêtvořit Erstellen Vytvoriť Stwórz @@ -8752,7 +8836,8 @@ Sewing machine - Šicí stroj + Šicí stroj + Šêci stroj Šijací stroj Kudromaŝino Màquina de cosir @@ -8830,7 +8915,8 @@ Macerator - Drtič + Drtič + Krôšedlo Mazerator Drvič Macerador @@ -9028,7 +9114,7 @@ Wooden box Dřevěná truhlice - Dřevěná trohleca + Dřevěná trôhleca Dřevěná kostna Dřevěná truhła Holztruhe @@ -9109,7 +9195,7 @@ Box Truhlice - Trohleca + Trôhleca Truhła Žigla Truhe @@ -9346,7 +9432,8 @@ Charger - Nabíječka + Nabíječka + Nabiječka Ladegerät Nabíjačka Ładowarka @@ -9550,7 +9637,8 @@ Folder with music - Složka s hudbou + Složka s hudbou + Složka s môzekó Zložka s hudbou Dosierujo kun muziko Folder z muzyką @@ -9629,7 +9717,8 @@ Shelf - Polička + Polička + Polêčka Gestell Polica Półka @@ -9771,7 +9860,8 @@ Rabigoncraft - The Most of My World Rabigoncraft - To nej z mého světa - Rabigoncraft - To nej z mýho světa + Rabigoncraft - To nej z mýho světa + Rabigoncraft - To né z myho sfěta Rabigoncraft - Das meiste von meiner Welt Rabigoncraft - To naj z môjho sveta Rabigoncraft - Najlepsze z mojego świata @@ -9864,7 +9954,8 @@ Creative - Tvořivá + Tvořivá + Tvořêvá Kreativ Tvorivá クリエイティブ @@ -9945,7 +10036,7 @@ Add new world Přidat nový svět - Přêdat nové svět + Přêdat nové sfět Přidat novej svět Pridať nový svět Dodaj nowy świat @@ -10026,7 +10117,9 @@ Hide spoiler - Skrýt náhled + Skrýt náhled + Skovat náhled + Skovat náhled Schovat náhled Skrejt náhled Skryť náhľad @@ -10116,7 +10209,8 @@ Create portable world - Zabalit svět do archivu + Zabalit svět do archivu + Zabalêt sfět do archivô Zabaliť svet do archívu Krei portebla mondo Crea un mundo portátil @@ -10207,7 +10301,8 @@ Deletes the whole world Smazat celý svět - Smazat celej svět + Smazat celej svět + Smazat celé sfět Odstráni celý svet Forigas la tutan mondon Elimina todo el mundo @@ -10303,7 +10398,9 @@ Where to save the world? - Kam uložit svět + Smazat celej svět + Kam ôložêt sfět + Kam uložit svět Kam uložiť svet Kie savi la mondon? ¿Dónde salvar al mundo? @@ -10635,7 +10732,8 @@ Large - Velký + Velký + Velké Velkej Groß Veľký @@ -10724,7 +10822,8 @@ Small - Malý + Malý + Malé Malej Klein Mały @@ -10814,7 +10913,8 @@ Research - Výzkum + Výzkum + Vézkôm Výskum リサーチ Esplorado @@ -11357,7 +11457,8 @@ Date of publication - Datum publikace + Datum publikace + Datôm pôblikace Das Datum der Veröffentlichung Dátum publikácie Dato de publikigo @@ -11436,7 +11537,9 @@ Programmed in - Naprogramováno ve + Naprogramováno ve + Naprogramováné ve + Naprogramováné ve Naprogramované v Programmiert in Programita eng @@ -11514,7 +11617,8 @@ With the help of MonoGame - Za pomocí MonoGame + Za pomocí MonoGame + pomuhlo MonoGame Mit Hilfe von MonoGame Prostredníctvom MonoGame Kun la helpo de MonoGame @@ -11613,8 +11717,10 @@ Made in - Naprogramováno v zemi - Naprogramované v krajine + Naprogramováno na + Naprogramované na + Naprogramované na + Naprogramované na 生産国 Fabriqué eng Enmetita @@ -11702,7 +11808,7 @@ Check if I'o using the latest version of the game Zkontrolovat zda používám nejnovější verzi hry - Zkontrolovat zda póživám nejnovějši verzi hry + Skontrolovat ešlê póživám nénovjéši verzi hrê Zkontrolovat či používam najnovšiu verzií hry Comprueba si estoy usando la última versión del juego Sprawdź, czy korzystam z najnowszej wersji gry @@ -11984,7 +12090,7 @@ Sign in Přihlášení - Přihlášeni + Přêhlášeni Prihlásenie サインイン Zaloguj się @@ -12064,7 +12170,8 @@ Choose a world - Vyberte si svět + Vyberte si svět + Vêberte si sfět Vyberte si svet Wybierz świat Elektu mondon @@ -12161,7 +12268,7 @@ All types Všechny položky - Všeckê položkê + Fšeckê položkê Všetky položky Ĉiuj tipoj Hemî celeb @@ -12243,7 +12350,9 @@ Rabcr world - Rabcr svět + Rabcr svět + Rabcr sfět + Rabcr sfět Rabcr svet Świat Rabcr Rabcr mondo @@ -12330,7 +12439,7 @@ Prepare for regeneration Připravit k přegenerování - Připravit k přegenerováni + Přêpravit k přegenerováni Pripraviť k pregenerovanie Preparu por regenerado Prepárate para la regeneración @@ -12419,7 +12528,7 @@ The following settings cannot be changed Následující nelze změnit v nastavení Následující nemůžet změnit v nastavení - Následujici nemužete změnit v nastaveni + Následôjici nemužete změnit v nastaveni Nasledujúce nemôžete zmeniť v nastavení Las siguientes configuraciones no se pueden cambiar Die folgenden Einstellungen können nicht geändert werden @@ -12517,7 +12626,7 @@ Left mouse button Levé tlačítko myši - Levy tlačitko na mêši + Levy stlačêdlo na mêši Levý tlačítko myši Ľavé tlačidlo myši Clic gauche @@ -12608,7 +12717,7 @@ Right mouse button Pravé tlačítko myši Pravý tlačítko myši - Pravy tlačitko mêši + Pravy stačêdlo mêši Pravé tlačidlo myši Prawy przycisk myszy Clic droit @@ -12779,7 +12888,7 @@ Hides/shows player Skryje/zobrazí hráče - Skrêje/zobrazi hráče + Sková/zobrazi hráče Schová/zobrazí hráče Skryje/zobrazí hráča Kaŝas/montras ludanton @@ -12869,7 +12978,7 @@ Hides/shows inventory Skryje/zobrazí inventář - Skrêje/zobrazi inventář + Sková/zobrazi inventář Schová/zobrazí inventář Skryje/zobrazí inventár Kaŝas/montras inventaron @@ -13152,7 +13261,8 @@ Breaking blocks, killing animals - Rozbíjení bloků, zabíjení zvířat + Rozbíjení bloků, zabíjení zvířat + Rozbijení bloku, zabijeni zviřat Rozbíjanie blokov, zabíjanie zvierat Blöcke brechen, Tiere töten Rompere blocchi, uccidere animali @@ -13244,7 +13354,8 @@ Adding blocks, eating, drinking, opening machines - Stavění bloků, konzumace jídla, pití, otevírání přístrojů + Stavění bloků, konzumace jídla, pití, otevírání přístrojů + Stavěni bloku, konzumace jidla, piti, otevirání přéstroju Stavění bloků, konzumace jídla, pití, votevírání přístrojů Stavanie blokov, konzumácia jedla, pitia, otváranie prístrojov Bausteine, Essen, Trinken, Öffnen von Geräten @@ -13334,7 +13445,8 @@ Walking - Chůze + Chůze + Chozeni Laufen Chodenie Chodzenie @@ -13425,7 +13537,8 @@ Loading game elements - Načítání herních prvků + Načítání herních prvků + Načétáni hernich prvku Načítanie herných prvkov Ładowanie elementów gry ゲーム要素の読み込み @@ -13504,7 +13617,8 @@ Loading was successful - Načítání bylo úspěšné + Načítání bylo úspěšné + Načétáni bêlo uspěšny Načítanie bolo úspešné Ładowanie przebiegło pomyślnie 読み込みに成功しました @@ -13583,7 +13697,8 @@ We've detected errors, check Data - Objevili jsme chyby, kontrolujte Data + Objevili jsme chyby, zkontrolujte Data + Vêštáralê sme mélkê, skontrolôjte Data Objavili sme chyby, kontrolujte Data Znaleźliśmy błędy, sprawdź dane エラーを検出しました。データを確認してください @@ -13817,7 +13932,8 @@ Error - Chyba + Chyba + Mélka Błąd エラー Erreur @@ -13906,7 +14022,8 @@ Crafting - Vyrábění + Vyrábění + Vêráběni Vyrábanie クラフト Basteln @@ -13976,7 +14093,8 @@ Flying mode - Létající mód + Létající mód + Litajici mód Flugmodus Lietajúci mód 飛行モード @@ -14054,7 +14172,8 @@ Right ctrl - Pravé ctrl + Pravé ctrl + Pravy ctrl Rechte Strg Práve Ctrl 右Ctrl @@ -14134,7 +14253,8 @@ Left ctrl - Levé ctrl + Levé ctrl + Levy ctrl Linke Strg Levé Ctrl 左Ctrl @@ -14211,7 +14331,8 @@ Left alt - Levé alt + Levé alt + Levy alt Linke Alt 左Alt Alt izquierdo @@ -14358,7 +14479,7 @@ Left shift Levý shift Levej shift - Lêvé shift + Levé shift Linke Shift 左Shift Shift izquierdo @@ -14568,7 +14689,8 @@ Application - Aplikace + Aplikace + Aplêkace Anwendungstaste Aplikácie アプリケーションキー @@ -14804,7 +14926,9 @@ Up - Nahoru + Nahoru + Navrch + Navrch Nach-oben Nahor @@ -15659,8 +15783,10 @@ 五倍 - Př. 1 Vyřešte rovnici 2*x-%num%=0 a číslo napište do pole Ex. 1 Solve the equation 2*x-%num%=0 and type the number in the box + Př. 1 Vyřešte rovnici 2*x-%num%=0 a číslo napište do pole + Př. 1 Vyřešte rovnicu 2*x-%num%=0 a číslo napište do pole + Př. 1 Vêřešte rovnicô 2*x-%num%=0 a čislo napište do pole Bsp. 1 Lösen Sie die Gleichung 2*x-%num%=0 und geben Sie die Zahl in das Feld ein 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力します Pr. 1 Vyriešte rovnicu 2*x-%num%=0 a do poľa zadajte číslo @@ -15846,7 +15972,9 @@ Verification of legal age - Ověření plnoletosti + Ověření plnoletosti + Ověřeni plnoletostě + Ověření plnoletostě Overenie plnoletosti Vérification de l'âge légal Verifica di età legale @@ -16009,7 +16137,8 @@ oxid uhličitý - oxid uhličitej + oxid uhličitej + oxid ôhlêčêté Carbon dioxide Oxid uhličitý Dióxido de carbono @@ -16158,7 +16287,8 @@ hydroxid sodný - hydroxid sodnej + hydroxid sodnej + hydroxid sodné Sodium hydroxide Hydroxid sodný Hidróxido de sodio @@ -16303,8 +16433,9 @@ Kaukamea - kyselina chlorovodíková Hydrochloric acid + kyselina chlorovodíková + kêselêna chlorovodiková Kyselina chlorovodíková Ácido clorhídrico Acide chlorhydrique @@ -16377,7 +16508,8 @@ Zadali jste špatné odpovědi! - Zadali jste špatný vodpovědi! + Zadali jste špatný vodpovědi! + Zadalê ste špatny odpovědi! Napsali ste špatné odpovědi! You have entered the wrong answers! Zadali ste nesprávne odpovede! @@ -16477,6 +16609,8 @@ Auto se pohybuje konstantní rychlostí %speed%km/h. Za kolik hodin urazí %length%km? s=v·t + Auto se pohêbôje konstantni rêchlosťó %speed%km/h. + Za kolêk hodin ôrazí %length%km? s=v·t The car moves at a constant speed of %speed%km/h. In what time does it travel %length%km? s=v·t Auto sa pohybuje konštantnou rýchlosťou %speed%km/h. @@ -16640,7 +16774,9 @@ Em que horas ele viaja %length%km? s=v·t Show more - Zobrazit více + Zobrazit více + Zobrazit víc + Zobrazit vic Zobraziť viac Pokaż więcej Mostrar mas @@ -16723,7 +16859,8 @@ Em que horas ele viaja %length%km? s=v·t Hide - Skrýt + Skrýt + Skovat Schovat Skrejt Skryť @@ -16805,7 +16942,8 @@ Em que horas ele viaja %length%km? s=v·t Show program details - Zobrazit detaily programu + Zobrazit detaily programu + Zobrazit detajlê programô Zobraziť detaily programu Hûrguliyên bernameyê nîşan bidin Mostrar detalles del programa @@ -16894,7 +17032,8 @@ Em que horas ele viaja %length%km? s=v·t Hide program details - Skrýt detaily programu + Skrýt detaily programu + Skovat detaily programô Schovat detaily programu Skrejt detaily programu Skryť detaily programu @@ -17080,7 +17219,8 @@ Em que horas ele viaja %length%km? s=v·t You ran out of air - Došel ti vzduch + Došel ti vzduch + Nebêls dlóho na luftô Zabrakło ci powietrza Došiel ti vzduch Elfogyott a levegő @@ -17177,7 +17317,8 @@ Em que horas ele viaja %length%km? s=v·t Apparatus for air production - Přístroj na tvorbu vzduchu + Přístroj na tvorbu vzduchu + Přéstroj na vêráběni luftô Urządzenia do produkcji powietrza Prístroj na tvorbu vzduchu Készülékek levegő előállításához @@ -17266,7 +17407,8 @@ Em que horas ele viaja %length%km? s=v·t You need a spacesuit to survive - Potřebuješ skafandr abys přežil + Potřebuješ skafandr aby si přežil + Môsiš mět skafandr abês přežil Urządzenia do produkcji powietrza Potrebuješ skafander aby si prežil Szüksége van egy kosztümre a túléléshez @@ -17364,7 +17506,8 @@ Em que horas ele viaja %length%km? s=v·t Worldwide Celosvetové - Celosvětové + Celosvětové + Celosvětovy Mundialmente Maailmanlaajuinen I hele verden @@ -17442,7 +17585,8 @@ Em que horas ele viaja %length%km? s=v·t Constructed - Umělé + Umělé + Ôměly Języki sztuczne Umelé jazyky Lenguajes artificiales @@ -17600,7 +17744,8 @@ Em que horas ele viaja %length%km? s=v·t African - Afrika + Afrika + Afrêka Afryka Afrika África @@ -17903,7 +18048,8 @@ Em que horas ele viaja %length%km? s=v·t Germanic - Germánské + Germánské + Germánsky Języki germańskie Germánske Lenguas germánicas @@ -17981,7 +18127,8 @@ Em que horas ele viaja %length%km? s=v·t Slavic Języki słowiańskie Slovanské jazyky - Slovanské jazyky + Slovanské jazyky + Slovansky jazšekê Lenguas eslavas Langues slaves Slawische Sprachen @@ -18047,7 +18194,8 @@ Em que horas ele viaja %length%km? s=v·t Romance - Románské jazyky + Románské jazyky + Románsky jazêkê Języki romańskie Románske jazyky Lenguas romances @@ -18125,7 +18273,8 @@ Em que horas ele viaja %length%km? s=v·t Celtic Języki celtyckie - Keltské jazyky + Keltské jazyky + Keltsky jazêkê Lenguas celtas Langues celtiques Keltische Sprachen @@ -18181,7 +18330,8 @@ Em que horas ele viaja %length%km? s=v·t Baltic - Baltské jazyky + Baltské jazyky + Baltsky jazêkê Języki bałtyckie Baltské jazyky Lenguas bálticas @@ -18250,7 +18400,8 @@ Em que horas ele viaja %length%km? s=v·t Finno-Ugric - Ugrofinské + Ugrofinské + Ugrofinsky Języki ugrofińskie Finsk-ugriske Фінно-угорські @@ -18291,7 +18442,8 @@ Em que horas ele viaja %length%km? s=v·t Other - Ostatní + Ostatní + Ostatni Inne Ostatné Otros @@ -18377,7 +18529,8 @@ Em que horas ele viaja %length%km? s=v·t Building world... - Sestavování světa... + Sestavování světa... + Sfět se nastrmélôje... Xây dựng thế giới... Zostavovanie sveta... Składanie świata... @@ -18456,7 +18609,7 @@ Em que horas ele viaja %length%km? s=v·t Moravia - Morava + Moravě , @@ -18510,7 +18663,8 @@ Em que horas ele viaja %length%km? s=v·t Graphics profile - Grafický profil + Grafický profil + Grafické profil Grafickej profil Grafický profil グラフィックプロファイル @@ -18586,12 +18740,11 @@ Em que horas ele viaja %length%km? s=v·t Proffil graffeg Fakamatala fakafoʻituitui ITukutuku vakayaloyalo - República Tcheca This setting will be applied after restart. Tohle nastavení bude aplikováno až po znovuspuštění. - Tohle nastaveni bôde aplikováno až po znovuspuštěni. + Tohle nastaveni bôde aplikováné až po znovôspôštěni. Toto nastavenie bude aplikované po znovuspustenie. この設定は再起動後に適用されます。 こん設定は再起動後に適用さるっ。 @@ -18683,7 +18836,8 @@ Em que horas ele viaja %length%km? s=v·t Basic - Základní + Základní + Základni Základné ベーシック Podstawowy @@ -18755,7 +18909,8 @@ Em que horas ele viaja %length%km? s=v·t Expanded Rozšířené - Rozšírené + Rozšírené + Rozšíreny 拡大 Rozszerzony Erweitert @@ -18832,7 +18987,9 @@ Em que horas ele viaja %length%km? s=v·t Advanced - Pokročilé + Pokročilé + Pokročilý + Pokročêly Pokročilé 上級 Zaawansowane @@ -18908,7 +19065,8 @@ Em que horas ele viaja %length%km? s=v·t Startup items - Začátečnické itemy + Začátečnické itemy + Začátečnicky itemê začiatočnícke itemy スタートアップアイテム Przedmioty dla początkujących @@ -18986,7 +19144,8 @@ Em que horas ele viaja %length%km? s=v·t General - Obecné + Obecné + Obecny Všeobecné 一般的な Ogólnie @@ -19057,7 +19216,8 @@ Em que horas ele viaja %length%km? s=v·t Skin colour - Barva kůže + Barva kůže + Barva kuže Farba kože 皮膚の色 Kolor skóry @@ -19137,7 +19297,8 @@ Em que horas ele viaja %length%km? s=v·t Hair - Vlasy + Vlasy + Pačesê Vlasy 髪の毛 Włosy @@ -19214,7 +19375,8 @@ Em que horas ele viaja %length%km? s=v·t Hair type - Typ vlasů + Typ vlasů + Têp pašes Typ vlasov 髪型 Typ włosów @@ -19293,7 +19455,8 @@ Em que horas ele viaja %length%km? s=v·t Hair colour - Barva vlasů + Barva vlasů + Barva pačes Farba vlasov 髪の色 Kolor włosów @@ -19373,6 +19536,7 @@ Em que horas ele viaja %length%km? s=v·t Eyes Oči + Okálê Oči Oczy @@ -19452,7 +19616,8 @@ Em que horas ele viaja %length%km? s=v·t Eyes type - Typ očí + Typ očí + Têp okálu Typ vočí Typ auglí Typ očí @@ -19532,7 +19697,8 @@ Em que horas ele viaja %length%km? s=v·t Eyes colour - Barva očí + Barva očí + Barva okálu Barva vočí Barva auglí Farba očí @@ -19695,7 +19861,7 @@ Em que horas ele viaja %length%km? s=v·t Moustache type Typ vousů Typ fousů - Têp fósu + Têp fósa Typ fúsu typ fúzov Typ brody @@ -19778,7 +19944,7 @@ Em que horas ele viaja %length%km? s=v·t Moustache colour Barva vousů Barva fousů - Barva fósu + Barva fósa Kolóra fúsů Farba fúzov 口ひげの色 @@ -19935,7 +20101,9 @@ Em que horas ele viaja %length%km? s=v·t Kid - Dítě + Dítě + Dětsko + Dětsko Dieťa キッド Dziecko @@ -20151,7 +20319,9 @@ Em que horas ele viaja %length%km? s=v·t Shadow - Stín + Stín + Tín + Tin Tieň Cień @@ -20228,8 +20398,8 @@ Em que horas ele viaja %length%km? s=v·t See the graphics control panel for more options その他のオプションについては、グラフィックコントロールパネルを参照してください Více nastavení naleznete v ovládacím panelu grafiky - Více nastavení najdete v ovládacím panelu grafiky - Vice nastaveni najdete v ovládacim panelô grafikê + Víc nastavení nandete v ovládacím panelu grafiky + Vic nastaveni nandete v ovládacim panelô grafikê Viac nastavení nájdete v ovládacom paneli grafiky Więcej ustawień można znaleźć w graficznym panelu sterowania Weitere Optionen finden Sie in der Grafiksteuerung @@ -20307,8 +20477,9 @@ Em que horas ele viaja %length%km? s=v·t Control panel is opening.|It takes a few seconds...||Not opening?|Check "NVIDIA Display Constrainer LS" service. - Otevírá se ovládací panel.|Vyčkejte tomu pár sekund...||Neotevírá se?|Zkontrolujte službu "NVIDIA Display Constrainer LS". - Otevírá se ovládací panel.|Počkejte tomu pár sekund...||Neotevírá se?|Zkontrolujte službu "NVIDIA Display Constrainer LS". + Otevírá se ovládací panel.|Vyčkejte pár sekund...||Neotevírá se?|Zkontrolujte službu "NVIDIA Display Constrainer LS". + Otvírá se ovládací panel.|Počkejte pár sekund...||Neotvírá se?|Skontrolujte službu "NVIDIA Display Constrainer LS". + Otvirá se ovládaci panel.|Počkéte pár sekund...||Neotvirá se?|Skontrolôjte slôžbô "NVIDIA Display Constrainer LS". Votevírá se ovládací panel.|Dejte tomu pár sekund...||Nevotevírá se?|Zkontrolujte službu "NVIDIA Display Constrainer LS". Otvára sa ovládací panel.|Dajte tomu pár sekúnd...||neotvára sa?|Skontrolujte službu "NVIDIA Display Constrainer LS". Panel sterowania otwiera się.|Daj mu kilka sekund...||Nie otwiera się?|Sprawdź usługę „NVIDIA Display Constrainer LS”. @@ -20388,7 +20559,8 @@ Em que horas ele viaja %length%km? s=v·t Graphics control panel グラフィックコントロールパネル - Ovládací panel grafiky + Ovládací panel grafiky + Ovládaci panel grafikê Ovládací panel grafiky Graficzny panel sterowania Grafik-Bedienfeld @@ -20466,7 +20638,9 @@ Em que horas ele viaja %length%km? s=v·t You can't play this world この世界は遊べない - Nemůžeš hrát tento svět + Nemůžeš hrát tento svět + Nemůžeš hrát tento sfět + Nemužeš hrát tento sfět Nemôžeš hrať tento svet Nie możesz grać na tym świecie Du kannst diese Welt nicht spielen @@ -20548,7 +20722,7 @@ Em que horas ele viaja %length%km? s=v·t この世界は古いバージョンで作成されているため、このバージョンと互換性がありません Tento svět byl vytvořen ve starší verzi, která není kompatibilní s nynější Tento svět byl vytvořen ve starší verzi, která néni kompatibilní s touhle - Tento svět bêl vêtvořené ve starši verzi, kerá neni kompatibilni s tóhle + Tento sfět bêl vêtvořené ve staré verzi, kerá néni kompatibilni s tóhle Tento svet bol vytvorený v staršej verzii, ktorá nie je kompatibilná s terajšou Ten świat został stworzony w starszej wersji, która nie jest kompatybilna z obecną Diese Welt wurde mit einer alten Version erstellt und ist daher nicht mit dieser Version kompatibel @@ -20767,6 +20941,7 @@ Em que horas ele viaja %length%km? s=v·t Error during loading game Chyba během načítání hry + Mélka počas načétání hrê Chyba počas čítania hry Błąd ładowania gry ゲームの読み込み中にエラーが発生しました @@ -20847,7 +21022,7 @@ Em que horas ele viaja %length%km? s=v·t Report bad translation Nahlásit špatný překlad - Nahlásit špatny překlad + Nahlásêt špatné překlad Nahlásit špatnej překlad Nahlásiť zlý preklad Zgłoś złe tłumaczenie @@ -59492,7 +59667,9 @@ Em que horas ele viaja %length%km? s=v·t Fly mode in creative - Létající mód v kreativním módu + Létající mod v kreativním modu + Létající mód v kreativním módu + Létajici mód v kreativnim módu Lietajúci mód v kreatívnom móde クリエイティブのフライモード Mode Fly en création diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Aluminium.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Aluminium.png index 8197b823051e5846db060406da540c564c539323..eda8c9efdde776fa5087eaaaec525edb409f91f8 100644 GIT binary patch delta 390 zcmV;10eSw@1fTa+Y+O`mi$goU`Zb z=g%|Gl-%b`r(ZNI2)6IO$^pX6JfHdee$F%9Zg;t?D(saaQ?Xi=WcMtiyqO`}eSN$8 zzTA!V732%VDt}Tdp|9NEdOO$MeSg2|zVz0WByUa;LP%A`btAo--F>yo@CpIgWJ0h7 zvD8(TvFfT;Nn$tI{W@`Wo*|?x*i90wYInQY?9R;YEFno|GYdp)n3)7wE+y&n_avN| kw@68PCjte6{`=_cKgswii)EFApa1{>07*qoM6N<$f>i~*i2wiq delta 571 zcmV-B0>u5G1JeYMBYy%KNklCEY@ZD3gadZDkcdjK0KHq~w*<>ak(meQHuf4o!hsNNQx>9anH z{K_+ey|k59xz*<(=tI`1NLu+o{`Cv&@5G{B3_3_ht|MmNqxCa=36WlPUvAMFIJQV(U*|+nsHx~w zfQg8x6DR19ec#96DD(EV9+zNY62+C7doGBRtU-gST2nJ%LJTq#6%FE-w?mlI{Z1l` zDt3ZQP>~oz$-SL*$c%qR5vh-23<)V%xV^p5tQ7$XG^Mnz+vwT~*V+N0*Q%oFY@HLW z_WHWVV>BfXw$+wX+Sf&8iU^`L))))SZ8Vi3`B@#1TWGt){{eUcaRJ(^AfNyM002ov JPDHLkV1jaG74!fA diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Coal.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Coal.png index dea7a6d21e6a80f4a71bda0039cb378b2023f35f..2a46a63949bc7d12c0fabdd750963462ce2caf8c 100644 GIT binary patch delta 51 zcmbQw| delta 270 zcmV+p0rCDup8}8>e*ypi0FaSrHUIzs=1D|BRCwBTQU?yhFbFimBT@eU-k!lm9x7_9 zns9@QQ}QAr#+T+PiLk0LkIq$O5G%oK|1|=lW99^4x|C9DRn?P|S@Y6#K438azHiR? z25e291#XByYHf}+?a$yA6*z&Xkm^m5)*2}GW$;+KKYV0bfA@XV3W6uV_jURJVASjo zGhGV3O>4QOZSDZXW}Ym{751@-7po=Nf@GiPSpnA1XFJ? z%zz%4PzbAozFB$Rs2kw2*{=o;wYBg2{LROuk|kwOz~N9p7o#4_pUd0<5X9II_)Z2k UqZB~p000002uVdwM6N<$f`rn0=Kufz diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Copper.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Copper.png index 9df435402958df38e445ac5dd1115f3a61c4bec4..668914e1bdba4af11712a677ca9a22cf618cb2ab 100644 GIT binary patch delta 426 zcmV;b0agBq1;Yc7BYy#kNkl~r=p_`cU7oHNgJ_EDend4K+D?; zLQb^-Q<7y=tA)tX3HdI}#`Xl0-x@gqi6{vXTt3giV#MYrO`$rw0(O z-)oW(7BGPXM1NWLRg%7?@7`w<30X2=#a;Jz? zLMB5F9I*5~UcF$s=^1?$bTfp{0gS&P)W>e>wLl Ul2f`Wj{pDw07*qoM6N<$f(F^rzW@LL delta 625 zcmV-%0*?K|1BnHYBYy%=Nkl!vr7ywYMmJ~aV<0KPOC=C2yhU0J>?!f^W zn9??(X=7X4roV&gcDwO(z&XAC{_CGEjSblZc7A-U z9GV#Zo{U1aY}dgkbDLFu{wi zTlJd|%lxW&Aq7H;5fR*tJrS&JTd%FXE(|x!JFV7T&Lz13xonRk0C3gZ^dkAXk#aYV zaMcO1Rw&xOA1TEJqu|3l&7xJTRlD8jwRO&Wfbp<%(|??_?_|5)_H=XF^Of?(={ohpV4X!VS0AL3ZNFxlcSk0<+zvTK!FequM~J0*S`S}7=+~(mdckSa zmEgkVa$)`bI~$TzQYk@83CrY{Xq*w9a*H{A`k>@WC_!_2`TOLqFU+P?3A<_6bZaFU z&6(s>F=`DVZngu;)dt7}B>36D8lv6gS%;>WVab6 z2c+%E^X?i3g3h_$q!Q$7QdU0kciuv3MEeYKFxm?VVmt`Z3;6yL9Uzke@KYwiB%c}}m^%s8H* zRFb+|*y62v4<0$?C8p;Xs(eOdcC?Z6?4YE{Xh z9U??P5&egN`-WH)=L;1V}t4Nl>bmWQPPr3YhcV7XwfPkh3S?3;=c#2mk{f z=M48r0tsY9#NM;d;B(KJ>Cbb2f3yL3pLw1E0`|;m@=f2N>={F@x0cU|6 P00000NkvXXu0mjfYNEUk delta 644 zcmV-~0(u%dN7ywXyBt=rx&9V~N&ek?V5)9b;zrnB< z7}h^UfgnYlxJj(|B8xYDIAk}KXWw9bVySQHs&jBzQ1q>vb=ehw*-MCjpo=A}*~MSli@068D+x-Srk)${h3 zjU=qswGwhTPN!2ij$@%S&LIY$F4h?fGorPr@741Tr3gCDatROjD{t}p<4bFG-7YvK zOh_`04kIobC6$nB(Y6UOdN&agBHGnWgK53nPwjO_bxD>@p3qz8jKf9S%ougPEVV95 z?OYm-XFNYmCV!^%vO95}B^S(QRX@KPrPcH95IiP~t5q2%ZyZJ_|NiHDS&CmT!#G9u zaHk^z0ok?9+uP|pniw$>>b)Zgue$Diu-&qqeM}Lpnb_^;#=977oXlKk5xfP;GF4qJ z$yT~S$EEQ#wcgAl2qjC zw@;lh$4szIUpzdlfU&Mqr{h2oskK7zi~+UAS5@g}Luh(@+HYUt@#u36AHyY=4G^-~ z^t7&OPJM~DUMY2Z_a&qZm^cgv03n6qoW@{(KE40<@1s;5&cKU80`<;uCbHM}Ig^WF zcqar3t^1X}`z+A;h4~=?Z>a* e_8}Zdn*IlB$z}cFs9=`>0000A!`xKZ#9Ub2( z>I@=eN+Y=LVq5@(53pE;ZCtoD87sV zTI%!kUIW7#$N{m)NR^U@Z?oePZ<@%w&L}6I&UG1w8JU~jpJq}rO~Z@lUHIYi&b=*w zR-cgO6zHKkIF|+LoX2yW7%UKc%B`U@jB}istrJb>Fw#0=ELWQ0bNPFvC!nIg-Pp{u5QPRY4;y*yXMK** z6-0#^)J#i+GD7b?JS;pu&bjt-Pb;jV+$#ZvQ1EE2O?h6=F@H#VtQ$osvMvUj(rn|L zow=w8JC&t!m({%$DD|M^3b*=cwUR#OdG`MO)}wTjF=7Aw%1BiTM!T^#t|DB!-kXvs zJYZy-78zJ`eQw|7P;K`~g}3fyl*G)(Y(!Ad`*JIa!jO<vzDos`X z{pUYEPwo}8*rRs9NkzK$HlYYkkc; z+1;C6V8)U%acJ5kX#q)|nKLuCEeVPL)6+H$rPR?I+vl9GuYWJ7L|aR;fRiNfaA`NO zEGqk)0~KoXT#(N0X7?Gd?R#yH1<0N`ptdiKqH}jQ1?=bIv19v3b0ol0+Piy_?ru^E z+cVP{C|D0!@>^SyBZ-o>soR1?BpW>il4Xh1^0CL$L7Q!9n)1ol9{*G+L}Z^iQ_0iG z?ncj0@4J}~KVWUqC%QAELXvxL8~ase>75XCH}BG!Ir2QFyLazG$3MhKGSnuC?Q>>4 z$2KrKJ2x9BkY>Z%ADPgRus#u5BeC3Mn{1k8CD4aL`Um@&@Z1252Iv3)002ovPDHLk FV1jCmt^@!8 delta 539 zcmV+$0_6RI1GEH?B!Bx!L_t(|+9gs=v)dpHL?AHOaoXhl|3hbb=%329oym04_}Py6 zrc0hKHXyB5yW(Fze>71ZkH5~j>*Y$M*7Y;^<2YU^hEj?o60L`ns+10wDHB`xzxI?8-FWRVgm4B2l)=ptrDx6 za;|xv=kt7?rfFT5ZQBNf(Migj^E5g@#1z?R-GqAVYdAdMot*}2Q2AV*W-thJP9aM4 zCs9DshmcZ0uX#S9&7b>kN%G^0_zG~^;jN`KPEXvKWH-9Wle!zrc$qLUkajCJ2|DQdG0wX-oCV~|2}N~zYmEGq(5 zfV3dWB~v04l-zw7t%ab_5J$dTE=bxoRm2QxR+^v;$~lnNFS|KM`G4j#v`7Z?jYu(u!pRs!>p1S^sX)^vVV dV07!;e-r|+PT>v(Y!Lte002ovPDHLkV1iEm1&ROw diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Silver.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Silver.png index 56a298978727714d052ed06f6d0bde0c22c3e89d..4975a85814128ca685a31234523daafb605e87f7 100644 GIT binary patch delta 371 zcmV-(0gV3S1dRibBYy!@Nkl(V);sGc$W#x1_{C0Q7&6T#YEc?V8o>NF)*f zC5Tr=3jq5w3jPQrz_$!kgrurSobEX%NdZZY&+$y`6I%oTQGYuia1NZaiEWec=sb@I zn@NarM1UeokRXe`mJ&NY_VYY_;mk-9g@4SF;Qk5KHugb9Q6%)!1C?ya0N5F!Ly<($ zwj9pP?92!x0iaWvl(hGC9q|oEP~=FvJ2Lsaya6 delta 588 zcmV-S0<-;%1LOpdBYy%bNklJEEcDnK+o8JFUNt>jk zXo)1ggTBY#zWqH|Glg*q{{8)Ju=c*LTJz;H5<*J3EBgK4a$nXtgs*>n<&Te#l21@# zG!v2cqZ{1kwn}RVsI^({n^Jh0FNg}H@!R{Gg7&#B&N*pf?SDXswdNELH@H$8D(WrO zT8-vy+xU4LUDEaCONxnzMTD8OHs^U9XJjHxI9M|nlTyqj@xTB4FdA#g&Uw~cYLPB6 zr(7!%)R?T%%nV97KkUzqTdR9YQnPn%+wR2JMb>rEOkKo#7h_aNr3pw6A@Fe?qcg_P zc|5{A$NhQ6^M5?gruFErrB-e1eS1iUVKB~n&N(}Sy=$d_6z=<;QUm~ICSuKers&5h zrA$b*3SXwt8X}}=499s&@5GEq-g{y#UEJV}v5&`N-=9(o|M~g?y=lX>HD-OBhjYX2 z^=7TjDM@SAVl5dFwbs%qU$3F$)S*jjr55MhD%>21Mkf?XC)}U%k+T_v%6n2nS6?AC=(0_dYj)V#+%;D$H zUyS4jW0?8Z??n+0-ZN4cIgZ^JE;(uDJ;rGY&*vkA2?3^Y4D-aFk4MhwkJlUY-fKYx z=W%rCpha*F*V?N0W2^Pc_38#2Q|2R{2(Yd9+sl=mmEP@OV@!ag&2YQSIh`p+1xlKv a6#oZ`ic_Ge6#Os%0000WIDwb-|Rt}3sNh3!maZusIes?P8IX)Dhutb`%ow@2z5_$BQu00000NkvXXu0mjf D7+aC| delta 406 zcmV;H0crls0yL8huz)Bc+GTBAu#TiFp_qJbOVEGX4%~{Yjv;LLs22S&%+sOO>OV?WR)^uKEEU( z9IUm@wGI)Pr4C!J%Wk{mL{XWW?T86-a;@X{{eBPUxAz}gZ4go`kc=8skP;Hw%5&l4 z4OLa;W}s)Tj(^D9!A36FpD{~T=6;K9Uzl05R#$Fw8KaI+BK?;%gd}MLDV^1TB9FiK zHP`L?9z=n@E};5MeVUBvg*`K`Db@2H(3eJFGXm(IetUnLnWu~KR0tAyN!8F1k{lUz z+X<~cJtyu0pdex31YROOQ9X;t{n7o{mX!4m>tOjEfDcahs{jB107*qoM6N<$f)8H8 A1ONa4 diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Tin.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Tin.png index 6fc9a24023b35736fe0fddc63985d1daddb10b55..8977a97b3bc9c0d3672f798915521cbb5d61481f 100644 GIT binary patch delta 356 zcmV-q0h|7^1pfk%B!5OpL_t(2kwsELmL)L=0yO{r$DQs(m_@37yYt0>0>mwHtyNW$ zN<}Hj-uvh0U+i}V2>NM~a|R$;pd{G_Kr(nM0HD9tMnbYmRYj6SNfiGW@MQp0q=*+W z2>?k;%O2Y#lhl2#uFqQCr3WuFgFs@hCPflJg1$R^KA-NUXn)%tdty*3vAQIEIlHP> zcXwAQNfO%tNl65sx%Ub+NtGlenFrpaNCBDg%(gQ#i9vK=Aix8D@kokDJhR6W+YSPd z4a9MB-3bY)R=28bj}InEK=8_{A_)ir9V)DUu6E z5uws`nn@5KL|yoPxUwTjjPGHWfn-TtRRQe*=;X|tGkfoIc4Dz_3OczskMv9u%<+Nu z-oL;5oSQ;-$3`W#6Ci=@I0zirIWv3j8`2~sX8a#e#SmIfrt8T70000<{h4k3oP1R*9`)|b590RQ#*QNEw2!Kz|Ip^)=e!uj7Jioq#$pHe0u;%>sxHA9(n12bFfYnykby?Hu6Lb1d z-L@QK6bUIU%aQ~D5rq(L*W0p05uQ^=AEoTaah%TQbxkow)j=%14+$YHF>YJFUe4G1 zt@l=2J&tPAS>${^|9F3xna){{<2Vk<`4j`)ZkKh<&*zt#n&}uC<9dI6xLa#=d)aEM zIwpf?+fJ`<*MBHs^s(2Y^`>gfe7W3NxYgZE;qG82GMz!KjiEt8*-Ptzc^}ef` zs*cg-bY@{#X+K7M}07@0@{=bTbXLPY<(uBm+QA|fJ7ln{dH1b;|}Iw&o?M7iHCJm;Ja8}#Q{ zr?ILoNz4Yh3A5RBCpXh>1k9-c029ByKHT}Yf1Ts{shMDU0X(BKKm_rPu b9De}?UlKySlZ2Zb00000NkvXXu0mjf;>`f& diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Clay.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Clay.png index 204944247193b91f0e8384aa3c4b8bff5b95df0e..f77e2b59111fd5ef4548d3a88c08ecff27f602d5 100644 GIT binary patch delta 312 zcmV-80muH11k(bLB!3!7L_t(2kv)>ju^2H7!vL*YOi?K%J!XX*ye~dzJR|By(m%g{ z%`k&L@x)W??iL6{_R2!Qndupx$FXQ>7lGv>whf9g<%~YlGmJkNO`ZV?$d(Y*PMQW` z853fVtfVe(kg@08L4X}=mf428@pl4vQ?GIUE&(x#bQixpQh!m&XbU*+QWb}t5nd{U z{+GvxDbC(6jOeRyCqyRuP2*D70m`qcFA>AflO1{tTR5ZP4ScOGohqR0GfC2$=NUIf z=K@d!!4lEczU$ZX+!2?Xt5s`+s^&04z8IcoV55j7QS#efY1lEK@riTOU383}<;KrE zARi@#=W>b^=rJ<>=mr)q*M0jgTc^Ell6#ADRoiOaguNEIiv0tUsrjsCkbrFf0000< KMNUMnLSTXdCy{Ib delta 500 zcmVm1<-kslw=!e&;UVyvz+XuYj4`vmMPBM z+jHXYpFjS*eZBnyHAXS$_#5!o&jtq0H2G#X^IA zlo!=huyTKBYnnuy(lR5&RseqKKl@+8?R7jO_yt>uy)kDI4D3^zfND;rvu5=;P zVzEzp)9jvKHoCDHVv8zTI6ayf0X6Fi6Kd-HL`D4GM}bNzh}a@UI9!`Ik#fVZmFXA4 zgF?Du3qsq>AT;hnkR@XCT6DUmQ>{!9q33Pjh}8nclx;A@7LQiX^4FBN)NnioO|=Jt z^EP}7nkuP+s;VrBZg4a8c3l@~>TU1MqK0P=hwmp=;Ipd!J?*(9y32h)^rPf!^{U6h q)@_k5fwOkAeX!=LU#I-@ss91iNMPudCDxn(0000@X_BVSx9`>uT6Mqz$K}Y=VWprVRTMO{sAu2Sb2I+Tn*j;0000dsGu z7>beiRM$ZgT3b>TdyKX%tz;_K*?1bRA*A~6OJF$PZ{DbC<2&fq1^;0+`t z7`!DIe1N1RgD;Q)BqbUAfJlnLUy30BNJ=vVNHYXVGn_ja^$BR^JWm(LkcwNZ2N|21 z9XOZ|FgU)B{r^9-RNN!I;#p>+SbaiX=xm4CD+C1^If7XEYRs6L48OkW%)XF*-|a$+ zqtjROY$5aI_H68T9tC{aAoQuNRYB8FZQhHrq`uix1f{tJ^XE@p`E?V+(WPA$DXU#1 zkDk?Mi->iM+IYYy`u%~~ugX3+Zs_7DdMy>j)#0x)Y1bU(g-@pWeYnq5y_oy$uUT~> Xi_fI@a?jNP1p|YptDnm{r-UW|LwsMU diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Gravel.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Gravel.png index 76d786f1efceaf7466f4f942963d00c9295864b3..07f5382ea0b39353db29845983aa23f815dfe0d7 100644 GIT binary patch delta 148 zcmV;F0Biq<065H74%}>TltiCugd1wM!0^w!hA+{3!;(+*-cmVQD6(&{`P&r{s9u{Q^!^EooEY3vDQ~WM)X-NwccDA+AP)DfayT}j zpu}Hlx{#U(Uy|vhrcroBkJ*Q?@mh&W{~8*%LWb+1@vsnU|CR+ccT0MONCOq|iA<(a)Fv|};ech{FxG)DeY*zpP002ovPDHLkV1gB@aBBbn delta 364 zcmZo+`olCqvYwfNfk8u;KNv_g2Ka=ycG}r>IXHAVI(9ocb~!n91Cg_HkF#^Pi%XA- zOSh|QkE?4hkaTnF1tNF%UJs8xAoBF=_w?-Z^6Cd7Z|@1--u*s46M)FqccQQF1V6ut zK;-W~$=`osK)|GcfXRV@lY@dL2M54B1NgF7uFVFX&Hdr&}s>m*>j%{uo zk}vn2%6Z#1(RjygCllVc*E?nX>;80XsebmUsphGD;Gw2xAG~h(0KLHA>FVdQ&MBb@ E0B-`AsQ>@~ diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Regolite.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Regolite.png index ca97a0db44114570a9270a31534494ddb39dd168..eda23e8e0448597db13df5d85524cf635b255a32 100644 GIT binary patch delta 226 zcmV<803H9G0`mco8Gix*005AYXf^-<0J=#;K~yM_g_2PY!!QU#?I`!Z!ajP?w+|p8 zskEW0LV%5d_<25(Y&CO4Tv0#>Nn%P!21!V=91iIeCVprH&FX-l(!m1h1bnpWB@2~; z7RmhB!c%m7fe7x-)d2r2iKg3v7U8Nmwvo2s-#x2AqI^~ zwCzopr E06O`G761SM diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Sand.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Sand.png index d5612c913743e4bdff28efc96f417601d71c8607..35fade543fe2d2f12fec39a0363ae882d15dc556 100644 GIT binary patch delta 225 zcmV<703QF%0{j7xBYyzHNklG|9SkQN|I4uGDfcqg$h~~J+X&jL?!^s?N!o#NDz{OYOr%Q z&`qgphHdepb6{}3O=HEP!6~IAf!y@df=qa!@+uv&3RbxO}@1h^vDnj31=r{MO>U$K6^2%ZC?1DWspqJ@pxn b3QX${6`f%4<$VEk00000NkvXXu0mjfh%aTx delta 307 zcmV-30nGmV0nGxCBYy!DNklX=+L$eBXaTdn(0oU$0NXFQId@$z zx`m*;bSiu1Z?8>^ZV;lUr7GAXN%qVKs;ftGKDvnzc+pULDu3C@KI|X>v>&_sqVvih zlP0=QP<(@e_JOv*s2YtD&6M`^uaoMf6b5Kp25X|-_)|tJ+%&481D3+a27^7ZE{zTp zYL=!Q3_y>Ak!30F1N9|41N08l68hY7f&K00fhe41eF7jBYy#0NklFyL}k8?6~BcLKW%Rb5?C;_Xj=0*xED0Z`@k=70T;T`s#CgSWd{ilG!I zAW-bsvM)lC1OivlR!GRQl9D3|cZRZcNpic#D^i{3k%Bqq#*rjll$`F8yWK3hb2X^< z`^QMuiAa$o3nV4U?#{ED9d|WW&-17KwxUQ8c2N!7MY)~%ejm_wSGjk-E=vX^Ud3%= zZ!}2B?cD9{d~~{ccT8hRmISe>GPaUlcezaN&7Kwn-G6GLNWg!aR8@DsyoRp+&?ShJ zylvj>0<*ijm$T_^A)|J`>mcuWveDcnnrCKa=PvI$h25%Fe*{GA>F)3bNt?{+qJNA? Z_%FWB1wZ$Edd~m=002ovPDHLkV1ghAyW9W( delta 572 zcmV-C0>k~41JneNBYy%LNkl~gS&ydHr<{p0vwNr z)9H}1Y}+P8)V4m3E`^7jh9T#I*LQ#3KYZ(B9RLxTQXN3};6bl1FSV4+GKyrx#F$I2 zV{J{>bw$8&tf^!TkCcvIexqM6m;Es0fXY-EP+MU-@AscyUxrdd7$Ptt9C99zvy4P6 z5^mTw5DEnE2!C$-TJz=QexJ9d^L;)NcVM89`FblQC+4=yx;{LhnR!GKF>_&B-P&sF z<3T`6d&v56$6m1H*88$Gvk2rsOey7@mvyzSt*H>XgIY)t2y1Osb9YsDOr=WB%uEn9 zr?wBq&j`VUh>@58Fy(wc9d}c8bARg^9^cF;BI)>G`mOFu*`U z*&Pl#}Lnx7$xM z?`Gg$k~LIGO}of2xjRv^)-W0qm!Wz<4{)G)S=^nF0K-B1rvC%$_FgUTbOAL00000< KMNUMnLSTY>y%eJW diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Basalt.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Basalt.png index c57cf1aafc0db298c3e5829b4d3edec5129ef87e..e4ace661b962216a2f744b282b6a528ed252dd5a 100644 GIT binary patch delta 259 zcmV+e0sQ`x1D*nqBYyzpNkl``_2jfP`kz6S2ie?()+|F|SP;zJlWT!NOv-8+O^!~VoOwSVB+v5mR~C{6$X002ov JPDHLkV1g<$d~E;# delta 377 zcmV-<0fzpb0+R!fBYy!}Nkl;5;Ye`9B&&=~Y zPV7`w0+Il2lOzcez}Q9doD;$`okNP`*Vpbo_jlqXT1t|MW`732%#7VLAV^9ANHPf! z03IU&qH|6X0suar4+s!91ptsFw?KC%F5BlEiX^o}^7;F(yKjf@Atwen6W!@^`j)#8 zNnVuFnz3yXwqr;V2#KEQZUB4lz4uy6Qi3ETNLCez0!b*bZFH~CUiDI+dAB9ldy}-M z93zMWz;P&1a{~sDaVh@RdNfM+8 zijro0A^;Nrz1BLFkVKLMU?YVB0D`0>kljtO-|zQ*-}mPpZ+}WvMNl?CktC~&B&F-R zy1QSmm&c!czTYpv=j&2{gMegrSJic0YpsV5h&%&GDvC~E>)flVx~r?IZ6^`c-Ktva z>TVFRJ!6|B0FopV^nKs6N7D6rt+jex-IZkTy%T$E@9$1PQZpxEldMu#m2}8<71#0z zNE~}+X6*J10Dtk>+RRQw5=a$G4Pf>-C)~DA(ZqZ21E(Ys5=8+3U>lgkO|q(z%%1TM zAhNr3FRlb{&G$=FFkO22Z*&Ov0yNrNOsxwCn9nf&xb5F%wA#aSWil ofPQqSDk;g#%6E~GR7PpqEs}_00000NkvXXt^-0~g1A+<;Q#;t delta 594 zcmV-Y0I~Hm1ob zF3VFXWvz96-)NI_uBC#6T=KSUj5DE$Kmrj3?{m(zlo(=8`F}hN=kq{BA^4ONC>3H{ z=0!L+gb*LMM+lxV=G=gY`>`M1lhzWT)XD@0rAQMI!LQHX_uFlKKG#?7ofAUFnAUCO zLgZ42&{|uT$~bF`xxQcF9n#kg_?Q+O|E9W7l=Ll-u9$ZC&?u z>-!!RnZ^hKjB|PYd7bCEl+yS8c^dm+u(kt$oO23+)w*rlzV9(6g-ArwjjrTuwEq92 zlsbIyJ`kZMr2r&Y zdr}Iwb>H`+Fy=#e%nxwAGi?(?@FDmRUfU*xK!9l+t?jg?7?Uw3*BVoJy*!MUQ7KhQ zA*}@fB1_g%K?pYt#uy>Eb54_fEX%UY{_rqeE{s+0eb;r}+gq(Hc>iX*w$&*`O;j1% gkDUll?TMB855cNLFH?^4cK`qY07*qoM6N<$f-dSJMgRZ+ diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Dolomite.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Dolomite.png index fcdb3f3cda67a358675e433b81438764d7469902..3ae0dacf31d3cf357e87c99bef0dba503a617ba9 100644 GIT binary patch delta 352 zcmV-m0iXWN1o{GyBYy!wNklFEObP(5LefGPo%{`~%( zIZ1%-wkyf*CXpn`c9kUoyJ?s0pUskVwadE!c6WCJ-rd-GH7#&eQAx_SEd>O#NoEFi z_pQjCCC1X5kt`7)8)uUpfLv8NB)hm|fh2)sl-OP`+@~cZsedIUcTa$gBy*)wx%e)f za1YZ-1OQ1uiX>Z=l5FV;Hc8Ueon4YIDgygLoWy0@LYwSv^Tk`b47<7ud3Te&RgiXp zcOJ`CMk29Y-I8WBli3CS6L!XS6uxmuyP28K^PJ}-xi^0W$tLFg3m`V^%;$NY&vWJw zs@rywK65yc-C0$3Nq7UCb3V^AXCQW2l1S3oJ##=?RaLUANtl_P+wJb^ZUjm5HEuwX y@nJ}^L0JBVK(YHens80H?j#8AB)2^PLHq+Ak{L4SK0&Mi0000N zO_{+AAgxxPM8DtPb4pyB5Yiv~>+!gSFkfd)Ms=MOJPb}7jcZw!S}M8TosOs5?Vk4C z8l#kwEM8w;?vEwa%(a%Bpn_LxwCyb^A^YB`j{ePatql>zn16Ly4+p<)+m=%6x_O?7 zbQS_$sN|Az7R=K$S!)_{S{uiy)Y4n4q>LfdoQ&_%9$RB-fzs=af`2-irqMaqT0@^H2LM(C7~Xp#Dz)VrlqN!>^z1ZrT>1E2fj=EU_dOe_5(l?2uxrQ zY&f+ATm>bFOPV5mNE`?XP?5va+7XY+@5xav3&8p9H-YibL+H51UpmM-qw93lK6lR* fM-Vmd&u;PsrdcD2>8W-A00000NkvXXu0mjfW<@k9 delta 138 zcmV;50CoSG0j2?vB!6v5L_t(|+C`4RZ3ICK!$_a2OaJ8r!+Xqb@-jd}68Gmbo|6(n zE1&=(vGcrMz9lmKfnU*a08I8M6!X;VpmHXKbmwLZMBTXxh ze}!h}oO9063~5qC;D|- zCvghLF_5H*MpktCs!e+@C`s(c1|2^}Tr*qUI)SA3=fN$(wtMZ$EDLdvDuytvRnTh7bv}6i!4$6k#A(YY_l2v)TfLNPj$T2@VjRF0}xX zh_v2WBs>X;YAGHT;pf*YGmh5|5N69vmnk4*CIBE3BC47YqkpQInpIrxbGio-yV*F;?RFz3B61Ju(t2Z&j0C_rFE^*-ctu3-t=3vw14PIK0Dz1P z_Yf`-c^rFYMucQUX7<)gtB9DHX727HRn?B;7-Q5@-Q7%Yw@n_;XRXa6HW2`r*EQ#e z03so#*KzdT0e_%~Fp;^@uit;9Rzzar%!JHLV5Zg@B9tN#jtGEot$FObFqPg}*R}7j zwpCS?BKP|P0o&HUUN2_WwK8*@=a?rEi7vgab*=U9^PjnwQcM>yU2|^R2AO6$#)*hb zM49nzonwSYs}&$K;n?@cFgGbBGc!|FYiX46Jrcu1b$dZ30=hdQ&M_lGL`ta<5gtpI zj4=|zO*2Edm>Ch782}RVJO=@0MrO`yx`n7NGgC7}lu~PJx)uP4NO&OPaqMnB#>h-0 zR07*qoM6N<$ Eg0ptw(*OVf diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Gneiss.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Gneiss.png index 99657b4d810fdb7e99585282f2ca378609d37397..363870c1401b4b02e62f6c2553891ba8c3b16967 100644 GIT binary patch delta 257 zcmV+c0sj7v1DpboBYyznNklxN6NNAcE00NxXe3**pyK$Q}^0?NuO06B$(RyJ_XqX%E3Zu?hR|&2k zYQT1KU=T>1^SI%vAkU<|y_|{GIYD|A&ChjbI~&_Ql4^dyyXY=6i+=L$rn+W_e$OqjEd0mQi?LH*w{(vrl^wrR00000NkvXX Hu0mjfXRdp^ delta 373 zcmV-*0gC>d0*?cbBYy!_Nkl8^_Z6o~`kc_|d_An^`E-=6U z`!zTea>;WSP&yuDNYe{{;K?>4@*$9cqdp*MQn=YrC}JMS!<6QDE_ZOLwVN9vhb}@D zDQnncLIPa&*znc*vW6?}U^6R`!Y>Bq`Cbns$4uqLj)6coV1I$Q#4ek;@1wA+wklN~ zdDdFrFRJwj8H|=p;w{L$6mrR?V!eJe5bB^Xcns==#`LIQ#n{J2~p5iJ~ z(4>P*v@TdTxo%C084C%yJWDrKmaxe&5LB>yhe)kTz_K?NtK{G>ROVm)(8~Z1=nW}$ z^90dw>n^hlPj2&Sh{#Em1Jn_-{ljRh^uv4k*^GwftE=#TkO%9) Tn%x_u00000NkvXXu0mjfg0!-R diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Limestone.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Limestone.png index f798fdfc0ef0c86c05d78b9730c36dd654b5c794..bb262497288d84bcbb875194e25d5c0d7a76aa10 100644 GIT binary patch delta 319 zcmV-F0l@yb1KI+RB!3}EL_t(2kwub0b|oH{g;5g}5G9086+}F9e@K!@bab|tuqPB5M?mN3#TZ~|w}Px}NK$|b9=$qB5>_ik zDgi2a3V?C$nYnYnb&^VT)k$h$Nk82w&;dB;%+CYB5L2O(N`F<-sm}W$QzzA{7?SnH z(Gl}bxD5r<=Tv>FuX72@r0U?{NQdY5RH{Cw`qPeeVM%4BRE(mJV@Xw?>W_{#?#n(_ zQi#s_9w0^PR2_Qf7Ul(n)c*;Yu{MyLq^s96)nCBtOdfm)F(=hABJeInLO@a1t4$`7 z^QO3+%bN%6PB^$X1(k4ce6}*eZ$@t*Phx8ooO{1tnpZ`VP2)NPB&CxK@DGuP-jJXf RfPMe~002ovPDHLkV1moIk`e#_ delta 415 zcmV;Q0bu^x0=WZ_B!7TOL_t(|+BK3vk`zf01Lcay>K+VuFF)eWzqqXJ4op{NXb%N< z$z*b=e|-P8j?e4y1!|w~uaAFbE_+oUk}_M^F7V8reRkEuZZHU!y(CFWA_**v8*GtG z_jV3Utwoash!oB)2bKN;$Tz{@Z0?ASTe*Xy;fU6(t z@l|y9TNFSNv|YLtu0CJ?;)1dlc%Q$(lwAi#0*ny03f$FCf!+2Jp1H2qe>x&44(uBP zfZOg~$7e~ntCpmho!R^P00V`EZjarr)xF-5!Bur65ohL7GIKEnCauJ7yP>-JnQXAV zq7jPA6j+(rXMdv9Rs9q$-0S$1BpFGHOv!yOB_)~ckIZ$qm(q9{B$8|P70T7P5m7Qb zGuTox*JK*(T43oIpMS?{Ny?13qMOy9gsO!Lmm=3fKuJmV-WQ21`+kSPjZ4y8rzBUq z4qVA(ayh>%ngA?}V#Kxp>l+*vmC zE(fJ~x+JjM7K7NXFKoh?xSp*6AFbJzCb45lNdr2Ca3F5+FL**)YV|ck_;kbJ9p!93 zi%WV_jvc$(p5K(DJRGiNCSa}%CUh07<=QPIA4YXX_ob#u>Lco;FWG4xKnFkup!OcE z8G&a<+)f>9LT#4U70(%7W`ST>rJkO=FX4Q%+}>jd@gMj@ul-2eDpvpi002ovPDHLk FV1n+ZKxOIO%33opTOA`}zKyncYP|$0MsGO%lYJu`S8nbl2kZ`7X^y zNJ7ZAP?KydSyDM;L6e=CBtRNtDFjksXf~8hJY!3enn*y~zJE$dZ7If}q!im@8$ci- zXeCKbA_M?uW^CK%bsA4-+ZNfSyAQBQ8_+KA7q7r2q_jfG%1*n_(-ufeL9{)zn?SR> z*=*(8F!xrh{!-gv8is{^wZM zxvop1l=AiU^=qQM?^`e)#NfVksjBnqI<&i6du*iL{dJwBW6N%vW_JPTQ3JAM*;d-T zlN$=}B8A3&c^=WWW4%|U%-cv_`@-15NWe)d(K2J9u_PsFU8?a9B#V;f9{|S}+p@KH Qw*UYD07*qoM6N<$g0Hx>O#lD@ diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Rhyolite.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Rhyolite.png index fdfcfdec9309c403e0911f5eca29e160b154d86d..4d4041496c73a4b14c7673cf733b2b5530ec3556 100644 GIT binary patch delta 317 zcmV-D0mA;{1K0wPB!3@CL_t(2ku{Rh4P`k9L(d^8XRFy(ru~UMAKXVIqC~gB zUth$TIrp4L6gj8Bgz= zQ#EC2Y!VQLvB)oG=Ki`$8M9k)pxn1oOoyl4Xfsv{#QcHw#=a?eu>bO2~EiS)K()f~pBg)=H+#4Ss P00000NkvXXu0mjf0neB{ delta 457 zcmV;)0XF{F0^GWFQybEFjalZW39!^wkc<%(pVAG<5LVGO$lt?^Xh(tt6JwE4kJrmNo zpXc-Z`Tg} zxpNV!n)`l#{d~Vq-}enVq&_E*VRJfD=RN-dw-{5(@-WY300000NkvXXu0mjf0FmQW diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Sandstone.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Sandstone.png index 120819b7f3aee8a65ceb062b3ef7e6260239b8f7..7fa2574608b613b83f4fbda57c2837d45ce771d4 100644 GIT binary patch delta 363 zcmV-x0hIox1cn2UB!5jwL_t(2kv)<@j$J_r1Ivb)oF=EswQ|CF-F6o5D+q}V;Icq} z|NI7KXLh{fUC&66Hfd9YM7cNj=VyaK)>JNPo7}hb-U>-*KtR#91yYPaO`C9U?#X!& zp3$r{Ei~Jkg2!}t!#-3EYHf@gyy3yA=}=sU*FhxB#9z79Kg2S9DysJU&czD=_A+80Zs@)9B;6{Vz=RjgUh0_4!Uy$_LQ z!Sd&NqM~iZ8)TAH+?>txKs#r?Rx{XYMAed}5v~TgZSURtJT%?qUHKpP&9pk4!ER2@ z+50NM$JLB&FroxXQl7@mz31#rDHzh;zCI-*Fub4BOOtzZ^A8{y4%ag2X2Jjf002ov JPDHLkV1mA1wt4^n delta 525 zcmV+o0`mQa1EvI!B!BHmL_t(|+6BQ2veP&a1MNzN^R>r2-;miXP+p=2S zch0e2KYu*#+qSA!we2CbnK2_dBcVyjDwH5r0O`Y&K~lIb#2)8MIASm&kdZOi3Y&>q z1_5A9OP?{Pk69}T(>zZCF{>Xh@4Il8?QZK0R0zp54Uy-^zkiaq_T?#}Gn_^Jc>BJO z;~@CFyp7R5eU{S5VY8oFB(bs;X-&rw=WAZqIL?>>wj7iBU6!UQU^NxBrLNDXZl77f znDf65cP^%;QWipxxc8k&z{MWVr{0Q|mfi^^t^p7zw=ds_$@jl%3-d&{kIR;7&+lJT z#JvY0j^F8ni+?Tme{@+X!8w5_%ct~9nXN5WZ?`0}wZ-|SQdpR%m30NlJP%ebZ6h%y z5n@(0klS*nOjH92faotmGF+9QE7z)8!H&3CU>S!_R%=Nrrc4>B{q;d&s>Wr5Euw{V zk^^wde#9Ky?xaj$wMNRO;$wgf*UoGxo0SThew>y^AAiE>qdgu3%Xx98mBJ+6_n1lD z>(>ps1SC^zzJJ3i@lCE#NP>augebF6Cj25by7mN!Nb1c--*uswH$TTXd#Md#oWx>c z1wI8d-yhmekjybGNhN~9XUFJ!Z_DlZ&6Wo5R9AtG_a7BP-)G=D&i?_nuUqQCvc`4* P0000kK$I&VLVfl=mTEhX{h8sh3Ld z_urqH0oq>Yx~`T2fh37BA)1-_{QR8jDkM3?R`=CQ?Y-+ys?` za(WfjB&)gV&l`_v?i7b7t0u;`b2$Y5x zqk4P^cM-Q`X0`|h3t^>S0#8c6t^h5ufv9>m$W!+{kK?#2bJEmxH)($1Pc?aq_3QN3 zy(0L4&wHfLuA%#|bo5*W{PQyO@xGT&=G)qe%xoMT&|lw?EXJ=a8p zNJcCekYlUDTA7(NVa(X@z1Q$( ze+&SguWomW>hA8&wJ<$Bim0lYnKnrnnak5NGj?`&WOR*jC9Y?AT-Du8(qq^FNZu;j zNpWV@lc6*Qz<+g3w|mA=YG$fB^o^mEC`lAxfcM_6jtJW@Jj1mBj2$6KB58XthR;4Q zp4UTC5wIg7G9n`)49rZP&jAsc3O%o7KqQ#;*_5OZ8PfNX#60`jrtZ)0AKMXOIHb&& zail_V_W6Q5&Z-6w)c$M$-Mw;+Cn6#ljOwB!qPu4-5-rbbMMhWOeZ{!9_C5eIqPk{= ef?<#EKK}ugTuJ$=1meX20000pA=KtIOIUitSd-GubmH+ww|Nr0rW4>(U6wZSwHODq|H#R2fKK7U4l8}&? z=WOW5x?WO3BJN@E2d-5d>zk%ataESp|LXtz|LI2-H#9!nFCO>uAveQH55;iVZ)+uh P)-ZUw`njxgN@xNA#vndr literal 0 HcmV?d00001 diff --git a/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite1.png b/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite1.png new file mode 100644 index 0000000000000000000000000000000000000000..36abb3266a37ef9b104dbe11f32e9990273b9f77 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpkSk? zi(`n!#H)RVT!$P4T<=#g6iZ3#Pjp_gb;GtV0pH{fIB_sady1AEJjDEBbAhlE&+Xr{ zB>&a(Ff;53_hu-si!?meyNhkZhoyGE(k7;{ykmHHl5@rKLo=nXZ;?-LDOkw0Yz^zI zm#l{pD>Rty_8TPqP**=PbIc|B10x$}rHZ!gX{b0CQIfJh^6gzbbzTPAlFqpwp+Ru?m56g;2*jbXjGLJLFabdVJcp00i_ I>zopr0Kg_SEC2ui literal 0 HcmV?d00001 diff --git a/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite3.png b/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite3.png new file mode 100644 index 0000000000000000000000000000000000000000..aa13a74f477e6324422ea74aaae713ab84287086 GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpkR%s zi(`n!#I@%(@*Z;FaeFAfVBz9ZL6NN+gDwVca%FSy6rG_Eq~g&3OyEgTxoCar&H1{{ z9qj4$mXo`d8`MQCcN9LLYRR_!UWo0#GV}YJsxC4WoMl+R{9qpYUn!maE3PgN6>FIM xc+=+YBL`yGYHNylzolL<6p3Sb+-m=X_nxKQ`@}$hpfea4JYD@<);T3K0RY*sNIU=l literal 0 HcmV?d00001 diff --git a/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite4.png b/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite4.png new file mode 100644 index 0000000000000000000000000000000000000000..eb9320c1f0ce1d5c7e8078daf6018d87d8e25d80 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpx|sz z7sn8diA#G7xehsqu&N6QSg#g|JD^>`#{V>yMO*vmu~WuJ;(SyOMrbom-FVYwv0^VX z_wW1Cat|(C>e{ND|LUGyeoWi1Jf?M5BCmdBn9-gsF6tn6uYCjWLAD0&0F#y%Cz%?U zTRvTiX%Kn!kjdimkoULoKmXr&QJ3Mu4__ozB&K}O6i7};5Kv#@ATpmRaD~zwE|rB6 x)<5*W{=fbI|9|~|>BpBoxK__`qd|v@!S}cLqmG*|&H_zk@O1TaS?83{1OOi+HX#52 literal 0 HcmV?d00001 diff --git a/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite1.png b/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite1.png new file mode 100644 index 0000000000000000000000000000000000000000..36abb3266a37ef9b104dbe11f32e9990273b9f77 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpkSk? zi(`n!#H)RVT!$P4T<=#g6iZ3#Pjp_gb;GtV0pH{fIB_sady1AEJjDEBbAhlE&+Xr{ zB>&a(Ff;53_hu-si!?meyNhkZhoyGE(k7;{ykmHHl5@rKLo=nXZ;?-LDOkw0Yz^zI zm#l{pD>Rty_8TPqP**=PbIc|B10x$}rHZ!gX{b0CQIfJh^6gzbbzTPAlFqpwp+Ru?m56g;2*jbXjGLJLFabdVJcp00i_ I>zopr0Kg_SEC2ui literal 0 HcmV?d00001 diff --git a/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite3.png b/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite3.png new file mode 100644 index 0000000000000000000000000000000000000000..eb9320c1f0ce1d5c7e8078daf6018d87d8e25d80 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpx|sz z7sn8diA#G7xehsqu&N6QSg#g|JD^>`#{V>yMO*vmu~WuJ;(SyOMrbom-FVYwv0^VX z_wW1Cat|(C>e{ND|LUGyeoWi1Jf?M5BCmdBn9-gsF6tn6uYCjWLAD0&0F#y%Cz%?U zTRvTiX%Kn!kjdimkFIM xc+=+YBL`yGYHNylzolL<6p3Sb+-m=X_nxKQ`@}$hpfea4JYD@<);T3K0RY*sNIU=l literal 0 HcmV?d00001 diff --git a/rabcrClient/Functions/FastMath.cs b/rabcrClient/Functions/FastMath.cs index 7614d0a..bebef93 100644 --- a/rabcrClient/Functions/FastMath.cs +++ b/rabcrClient/Functions/FastMath.cs @@ -52,6 +52,11 @@ static class FastMath { float dx=x1-x2, dy=y1-y2; return (float)System.Math.Sqrt(dx*dx+dy*dy); } + + public static int Distance(int x1, int y1, float x2, float y2) { + float dx=x1-x2, dy=y1-y2; + return (int)System.Math.Sqrt(dx*dx+dy*dy); + } /// /// Smooth linear function /// @@ -72,7 +77,7 @@ static class FastMath { return (int)System.Math.Sqrt(dx*dx+dy*dy); } - public static Color Lerp(Color value1, Color value2, float amount) { + public static Color Lerp(Color value1, Color value2, float amount) { float _amount=1-amount; return new Color( (byte)(value1.R*_amount + value2.R*amount), @@ -91,12 +96,12 @@ static class FastMath { //---┘ -╯ /// Smooth linear function /// From 0 to 1 - public static float Smooth(float input) { + public static float Smooth(float input) { if (input<0.5f) return 2*input*input; else return -2*(input-1)*(input-1)+1; } - public unsafe static float InvSqrt3 (float x) { + public unsafe static float InvSqrt3(float x) { float xhalf = 0.5f*x; int i = *(int*)&x; i = 0x5f3759df - (i>>1); @@ -104,7 +109,7 @@ static class FastMath { x *= (1.5f - xhalf*x*x); return x; } - + public static int Abs(int input) => input>=0 ? input: -input; public static float Abs(float input) => input>=0f ? input: -input; diff --git a/rabcrClient/Functions/FastRandom.cs b/rabcrClient/Functions/FastRandom.cs index b767fa8..5a99f8e 100644 --- a/rabcrClient/Functions/FastRandom.cs +++ b/rabcrClient/Functions/FastRandom.cs @@ -3,32 +3,34 @@ using System.Collections.Generic; namespace rabcrClient { - public class FastRandom { + public static class FastRandom { #region Data Members // Constants const double DOUBLE_UNIT = 1.0 / ( int.MaxValue + 1.0 ); // State Fields - ulong x_, y_; + static ulong + x_ = (ulong)Guid.NewGuid().GetHashCode(), + y_ = (ulong)Guid.NewGuid().GetHashCode(); // Buffer for optimized bit generation - ulong buffer; + static ulong buffer; - int freeBuffer; + static int freeBuffer; #endregion #region Constructor /// Constructs a new generator using two random Guid hash codes as a seed. - public FastRandom() { - y_ = (ulong)Guid.NewGuid().GetHashCode(); - x_ = (ulong)Guid.NewGuid().GetHashCode(); - } + //public static FastRandom() { + // y_; + // x_ + //} /// Constructs a new generator with the supplied seed. /// The seed value. - public FastRandom(ulong seed) { + public static void SetSeed(ulong seed) { x_=seed<<3; x_=seed>>3; } @@ -37,14 +39,16 @@ public class FastRandom { #region Public Methods /// Generates a pseudorandom boolean. /// A pseudorandom boolean. - public bool Bool() { + public static bool Bool() { if (freeBuffer > 0) { freeBuffer--; return ((buffer>>=1) & 1) == 0; } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; + y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; @@ -54,33 +58,59 @@ public class FastRandom { return (buffer & 1) == 0; } - public int Int2() { + public static int Int2() { if (freeBuffer > 0) { freeBuffer--; return (int)((buffer>>=1) & 1); } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; - + buffer = y_ + temp_x; freeBuffer=64-1; return (int)(buffer & 1); } - public int Int4() { + public static int IntPlusMinusOne() { + if (freeBuffer > 0) { + freeBuffer--; + return (int)((buffer>>=1) & 1); + } + + x_ ^= x_ << 23; + + ulong temp_x = y_; + + y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); + x_ = temp_x; + + buffer = y_ + temp_x; + + freeBuffer=64-1; + int z=(int)(buffer & 2); + #if DEBUG + if (z!=2 && z!=0) throw new Exception(); + #endif + + return z-1; + } + + public static int Int4() { if (freeBuffer > 1) { freeBuffer-=2; return (int)((buffer>>=2) & 0x00000000000003); } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; @@ -90,34 +120,34 @@ public class FastRandom { return (int)(buffer & 0x00000000000003); } - public int Int8() { + public static int Int8() { if (freeBuffer > 2) { freeBuffer-=3; return (int)((buffer>>=3) & 0x00000000000007); } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; buffer = y_ + temp_x; - + freeBuffer=64-3; return (int)(buffer & 0x00000000000007); } - public int Int16() { + public static int Int16() { if (freeBuffer > 3) { freeBuffer-=4; - int y=(int)((buffer>>=3) & 0x0000000000000F); - return y; + return (int)((buffer>>=3) & 0x0000000000000F); } - ulong temp_x = y_; + x_ ^= x_ << 23; - x_ ^= x_ << 23; + ulong temp_x = y_; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; @@ -127,19 +157,20 @@ public class FastRandom { return (int)(buffer & 0x0000000000000F); } - public void Byte2(List list) { + public static void Byte2(List list) { if (freeBuffer > 0) { freeBuffer--; list.Add((byte)((buffer>>=1) & 1)); return; } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; - + buffer = y_ + temp_x; freeBuffer=64-1; @@ -149,15 +180,16 @@ public class FastRandom { /// Generates a pseudorandom byte. /// A pseudorandom byte. - public byte Byte() { + public static byte Byte() { if (freeBuffer >= 8) { freeBuffer-=8; return (byte)((buffer>>=8) & 0x000000000000FF); } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; @@ -167,15 +199,16 @@ public class FastRandom { return (byte)(buffer & 0x000000000000FF); } - public byte Byte128_Plus128() { + public static byte Byte128_Plus128() { if (freeBuffer >= 7) { freeBuffer-=7; return (byte)((buffer>>=7) & 0x0000000000007F + 128); } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; @@ -185,16 +218,17 @@ public class FastRandom { return (byte)(buffer & 0x0000000000007F + 128); } - public void Byte(List list) { + public static void Byte(List list) { if (freeBuffer >= 8) { freeBuffer-=8; list.Add((byte)((buffer>>=8) & 0x000000000000FF)); return; } + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); x_ = temp_x; @@ -207,22 +241,26 @@ public class FastRandom { /// Generates a pseudorandom 32-bit unsigned integer. /// A pseudorandom 32-bit unsigned integer. - public uint UInt() { - ulong temp_x=y_; + public static uint UInt() { x_^=x_<<23; + + ulong temp_x=y_; + y_=x_^y_^(x_>>17)^(y_>>26); x_=temp_x; return (uint)(y_+temp_x); } - + /// Generates a pseudorandom double between 0 and 1 non-inclusive. /// A pseudorandom double. - public double Double() { + public static double Double() { + + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; @@ -231,164 +269,216 @@ public class FastRandom { /// Generates a pseudorandom float between 0 and 1 non-inclusive. /// A pseudorandom double. - public float Float() { + public static float Float() { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (float)(DOUBLE_UNIT * (0x7FFFFFFF & (y_ + temp_x))); } + + public static float Rotatin() { + x_ ^= x_ << 23; + + ulong temp_x = y_; + + y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); + x_ = temp_x; + + return (float)(DOUBLE_UNIT * (0x7FFFFFFF & (y_ + temp_x)))*6.28318530717958647693f; + } #endregion - public bool Bool_20Percent() { + public static bool Bool_20Percent() { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.2; } - public bool Bool_33_333Percent() { + public static bool Bool_33_333Percent() { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.33333333333; } - public bool Bool_10Percent() { - ulong temp_x = y_; + public static bool Bool_10Percent() { - x_ ^= x_ << 23; + x_ ^= x_ << 23; + ulong temp_x = y_; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.1; } - public bool Bool_11_111Percent() { - ulong temp_x = y_; + public static bool Bool_11_111Percent() { - x_ ^= x_ << 23; + x_ ^= x_ << 23; + ulong temp_x = y_; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.11111111111111; } - public bool Bool_5_555Percent() { - ulong temp_x = y_; + public static bool Bool_5_555Percent() { - x_ ^= x_ << 23; + x_ ^= x_ << 23; + ulong temp_x = y_; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.0555555555555556; } - public bool Bool_2Percent() { - ulong temp_x = y_; + public static bool Bool_2Percent() { - x_ ^= x_ << 23; + x_ ^= x_ << 23; + ulong temp_x = y_; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.02; } - public bool Bool_5Percent() { + public static bool Bool_5Percent() { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.05; } - public bool Bool_75Percent() { - ulong temp_x = y_; + public static bool Bool_75Percent() { x_^=x_<<23; + + ulong temp_x = y_; + y_=x_^y_^(x_>>17)^(y_>>26); x_=temp_x; - return (DOUBLE_UNIT*(0x7FFFFFFF&(temp_x+y_)))<0.75; + + return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x+y_))) < 0.75; } - - public bool Bool_1Percent() { - ulong temp_x = y_; + + public static bool Bool_1Percent() { x_^=x_<<23; + ulong temp_x = y_; y_=x_^y_^(x_>>17)^(y_>>26); x_=temp_x; return (DOUBLE_UNIT*(0x7FFFFFFF&(temp_x+y_)))<0.01; } - - public bool Bool_25Percent() => Int4()==1; - public bool Bool_12_5Percent() { + public static bool Bool_25Percent() { + if (freeBuffer > 1) { + freeBuffer-=2; + return (int)((buffer>>=2) & 0x00000000000003)==1; + } + + x_ ^= x_ << 23; + ulong temp_x = y_; + + y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 ); + x_ = temp_x; + + buffer = y_ + temp_x; + + freeBuffer=64-2; + return (int)(buffer & 0x00000000000003)==1; + } + + public static bool Bool_12_5Percent() { x_^=x_<<23; + + ulong temp_x = y_; + y_=x_^y_^(x_>>17)^(y_>>26); x_=temp_x; + return (DOUBLE_UNIT*(0x7FFFFFFF&(temp_x+y_)))<0.125; } - public byte Byte3() { + public static byte Byte3() { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (byte)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * 3); } - public int Int3() { + public static int Int3() { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (int)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * 3); } - - public int Int5() { + + public static int Int5() { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (int)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * 5); } - public Color ColorMonogame() => new Color(UInt() | 0xFF000000); + public static Color ColorMonogame() { + x_^=x_<<23; + + ulong temp_x=y_; + + y_=x_^y_^(x_>>17)^(y_>>26); + x_=temp_x; + + return new((uint)(y_+temp_x) | 0xFF000000); + } - public unsafe System.Drawing.Color ColorSystemDrawing() { - uint r=UInt() | 0xFF000000; + public static unsafe System.Drawing.Color ColorSystemDrawing() { + uint r = UInt() | 0xFF000000; return System.Drawing.Color.FromArgb(*(int*)&r); } - public int Int(int minValue, int maxValue) { + public static int Int(int minValue, int maxValue) { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; return (int)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * (maxValue-minValue)) + minValue; } - - public int Int(int value) { + + public static int Int(int value) { + x_ ^= x_ << 23; + ulong temp_x = y_; - x_ ^= x_ << 23; y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26); x_ = temp_x; diff --git a/rabcrClient/GImageButton.cs b/rabcrClient/GImageButton.cs index 0bcd97d..e692c7b 100644 --- a/rabcrClient/GImageButton.cs +++ b/rabcrClient/GImageButton.cs @@ -25,7 +25,7 @@ public enum State :byte{ SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true); BackColor =Color.FromArgb(0,255,255,255); - (timer=new Timer { + (timer=new Timer { Interval=40 }).Tick+=Timer_Tick; } diff --git a/rabcrClient/GenLiveObject.cs b/rabcrClient/GenLiveObject.cs index 9039dd9..4599413 100644 --- a/rabcrClient/GenLiveObject.cs +++ b/rabcrClient/GenLiveObject.cs @@ -3,7 +3,7 @@ namespace rabcrClient { // For generating, (little bit bigger ram) - public abstract class GenLiveObject { + public abstract class GenLiveObject { public int IdNumber; public static int TotalCreated; @@ -14,7 +14,7 @@ class GenCactus : GenLiveObject { public UShortAndByte Root; public List Titles; - public GenCactus(int x, int y) { + public GenCactus(int x, int y) { Root=new UShortAndByte((ushort)x, (byte)y); Titles=new List(); IdNumber=TotalCreated; @@ -30,7 +30,7 @@ public class GenTree : GenLiveObject { public List TitlesLeaves; public List TitlesWood; - public GenTree(int x, int y) { + public GenTree(int x, int y) { Root=new UShortAndByte((ushort)x, (byte)y); TitlesLeaves=new List(); TitlesWood=new List(); @@ -43,7 +43,7 @@ public class GenTree : GenLiveObject { public void AddWood(int x, int y) => TitlesWood.Add(new UShortAndByte((ushort)x, (byte)y)); } - enum LiveObjectType : byte{ + enum LiveObjectType : byte{ Grass, Plant, Cactus, diff --git a/rabcrClient/InterLogic/Data/SoundEffects.cs b/rabcrClient/InterLogic/Data/SoundEffects.cs index bd5b697..ac5926d 100644 --- a/rabcrClient/InterLogic/Data/SoundEffects.cs +++ b/rabcrClient/InterLogic/Data/SoundEffects.cs @@ -1,7 +1,7 @@ namespace rabcrClient { static class SoundEffects { public static volatile Microsoft.Xna.Framework.Audio.SoundEffect - + // Eating Eat, diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs index d127dd3..2780903 100644 --- a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs +++ b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs @@ -68,18 +68,18 @@ public enum Orientation :byte{ } public Orientation SetOrientation { - get => currentOrientation; - set { + get => currentOrientation; + set { currentOrientation = value; Invalidate(); } } public bool Disamble { - get => disamble; - set { - disamble = value; - Invalidate(); + get => disamble; + set { + disamble = value; + Invalidate(); } } @@ -150,8 +150,8 @@ public enum Orientation :byte{ sb = new Pen(new SolidBrush(Color.Black)); } - int SizeBounds3=SizeBounds/3, - SizeBounds6=SizeBounds/6, + int SizeBounds3=SizeBounds/3, + SizeBounds6=SizeBounds/6, SizeBounds2=SizeBounds/2; using (Bitmap nb=new Bitmap(buttonSize.Width, buttonSize.Height)) { @@ -279,7 +279,7 @@ public enum Orientation :byte{ Size buttonSize=new Size(Size.Width-3,Size.Height-3); Pen sb = new Pen(new SolidBrush(Color.Black)); Brush b = new LinearGradientBrush(ClientRectangle, Color.FromArgb(alpha, alpha, alpha), Color.FromArgb(alpha-40, alpha-40, alpha-40), 90); - + using (Bitmap nb=new Bitmap(buttonSize.Width,buttonSize.Height)) { if (Orientation.Left==currentOrientation) { using (Graphics g2 = Graphics.FromImage(nb)) { @@ -328,7 +328,7 @@ public enum Orientation :byte{ } } - int smallW=(int)(buttonSize.Width*Constants.TextBlur)+2, + int smallW=(int)(buttonSize.Width*Constants.TextBlur)+2, smallH=(int)(buttonSize.Height*Constants.TextBlur)+2; shadow?.Dispose(); @@ -343,13 +343,13 @@ public enum Orientation :byte{ } BitmapData bdout=shadow.LockBits(new Rectangle(0, 0, smallW, smallH), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); - + byte* pointer = (byte*)bdout.Scan0.ToPointer(); - + // one third of alpha byte* max=pointer+smallW*smallH*4; for (pointer+=3; pointer selected; - set { - selected = value; - Invalidate(); + get => selected; + set { + selected = value; + Invalidate(); } } @@ -268,7 +268,7 @@ enum State :byte{ g.DrawImage(nb, new Point(1, 1)); if (!Custom) g.FillRectangle(new SolidBrush(color),new Rectangle(4,4,buttonSize.Width-4-2,buttonSize.Height-4-2)); - + // NativeMethods.Text(g, Constants.font14,Text,pos.X,pos.Y,255); }else if (State.Click==currentState){ // if (shadow!=null) { @@ -385,7 +385,7 @@ enum State :byte{ g2.DrawRectangle(sb, new Rectangle(0, 0, buttonSize.Width-1, buttonSize.Height-1)); } - + using (Bitmap small=new Bitmap((int)(buttonSize.Width*Constants.TextBlur)+2, (int)(buttonSize.Height*Constants.TextBlur)+2)){ using (Graphics gT = Graphics.FromImage(small)) { gT.CompositingQuality=CompositingQuality.HighQuality; diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs index 4b01d4f..f496dd7 100644 --- a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs +++ b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs @@ -82,7 +82,7 @@ public partial class GTextBox:UserControl { public string TextInTextBox { - get => textBox.Text; + get => textBox.Text; set => textBox.Text=value; } diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs index 802db2b..2711528 100644 --- a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs +++ b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs @@ -89,13 +89,13 @@ public class GeDoPanel : Control{ protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); - if (gedo!=null) + if (gedo!=null) gedo.Click=true; } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); - if (gedo!=null) + if (gedo!=null) gedo.Click=false; } diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs index df99348..4e9e986 100644 --- a/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs +++ b/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs @@ -968,7 +968,7 @@ public class GGeDoStringRandom : GGeDoString{ public override void Draw(Graphics g) { brush.Dispose(); - brush=new SolidBrush(Rabcr.random.ColorSystemDrawing()/* Color.FromArgb(Rabcr.random.Byte(),Rabcr.random.Byte(),Rabcr.random.Byte())*/); + brush=new SolidBrush(FastRandom.ColorSystemDrawing()/* Color.FromArgb(FastRandom.Byte(),FastRandom.Byte(),FastRandom.Byte())*/); NativeMethods.Text(g, text, X, Y, brush); } } diff --git a/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs b/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs index 282ec0e..f3a8d92 100644 --- a/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs +++ b/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs @@ -2,14 +2,14 @@ using Microsoft.Xna.Framework.Graphics; namespace rabcrClient { - class AnimatedBlock :Block{ + class AnimatedBlock:Block { public float screen; public float imageSpeed = 0; readonly int height, width; readonly float divideC; public Vector2 Position; public Texture2D Texture; - + Rectangle rec; public AnimatedBlock(Texture2D texture, Vector2 position, int w, int h, ushort id) { Texture = texture; @@ -18,17 +18,30 @@ class AnimatedBlock :Block{ height = h; Id=id; divideC=(Texture.Width-w)/(float)width; + rec=new Rectangle(width*(int)screen, 0, width, height); } + private AnimatedBlock(){ } + public override void Draw() { screen+=imageSpeed; if (screen>=divideC) screen = 0; + rec.X=width*(int)screen; - Rabcr.spriteBatch.Draw(Texture, Position, new Rectangle(width*(int)screen,0,width,height), ColorWhite); + Rabcr.spriteBatch.Draw(Texture, Position, rec/*new Rectangle(width*(int)screen, 0, width, height)*/, ColorWhite); } public override Block CloneDown() { AnimatedBlock a = new AnimatedBlock(Texture, Position, width, height, Id); + /* AnimatedBlock a = new AnimatedBlock{ + Texture=Texture, + Id=Id, + height=height, + width=width, + divideC=divideC, + Position=Position, + rec=rec, + };*/ Position.Y+=16; return a; } diff --git a/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs b/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs index 9e976ab..466544f 100644 --- a/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs +++ b/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs @@ -7,7 +7,7 @@ public class BasicWavingPlant: Block{ #region Varibles public Vector2 Position; public Texture2D Texture; - + readonly Vector2 vecOrigin; public int ticks; public float offsed; @@ -23,12 +23,12 @@ public class BasicWavingPlant: Block{ ticks=0; } - public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f)/*(ticks/100f)*/, vecOrigin, 1f, SpriteEffects.None, 0); + public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f)/*(ticks/100f)*/, vecOrigin, 1f, SpriteEffects.None, 0); - public NormalBlock TurnOff() => new NormalBlock { + public NormalBlock TurnOff() => new NormalBlock { Texture=Texture, Position=Position, - Id=Id + Id=Id }; public override Block CloneDown() => null; diff --git a/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs b/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs index f6af5c6..a9c3c9e 100644 --- a/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs +++ b/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Graphics; namespace rabcrClient { - internal class BoxBlock:Block{ + public class BoxBlock:Block { public ItemInv[] Inv; public Vector2 Position; public Texture2D Texture; @@ -14,10 +14,16 @@ internal class BoxBlock:Block{ Inv=new ItemInv[max]; } + private BoxBlock(){ } + public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, ColorWhite); public override Block CloneDown() { - BoxBlock b=new BoxBlock(Texture, Id, Position, Inv.Length); + BoxBlock b=new BoxBlock{ + Texture=Texture, + Position=Position, + Id=Id, + };//Texture, Id, Position, Inv.Length); b.Position.Y+=16; return b; } diff --git a/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs b/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs index 7e7d45a..0ef8952 100644 --- a/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs +++ b/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs @@ -19,16 +19,12 @@ public class CactusBlock:Block{ Position = position; } - // public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, ColorWhite); - - - public void SetOrigin() { + public void SetOrigin() { vecOrigin=-new Vector2(Position.X-cactus.Root.X*16/*+*/-8, Position.Y-cactus.Root.Y*16/*-8*/-8/*-16*/); - } - public override void Draw() { - if (cactus!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, cactus.angle, vecOrigin, 1f, SpriteEffects.None, 0); + public override void Draw() { + if (cactus!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, cactus.angle, vecOrigin, 1f, SpriteEffects.None, 0); } public override Block CloneDown() { diff --git a/rabcrClient/InterLogic/Game/BlockType/Chicken.cs b/rabcrClient/InterLogic/Game/BlockType/Chicken.cs index fa6f0eb..c6a962e 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Chicken.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Chicken.cs @@ -15,44 +15,158 @@ class Chicken :Mob{ public bool needToChangeChunk; public MoveType moveType; - public Chicken(/*ushort id,*/ byte height, /*byte lives, */int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat/*, Random rnd*/) { - //Height=height; - // Position.Y=((float)height)*16; + public Chicken(byte height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) { Position=new Vector2(x*16,height*16); TextureWalk = chTextureWalk; TextureEat = chTextureEat; - // Lives=lives; Frame=0; Eat=false; Dir=dir; Id=(ushort)BlockId.Chicken; } - public Chicken(/*ushort id,*/ int height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) { - // Height=height; - // Position.Y=/*((float)*/height/*)*/*16; + public Chicken(int height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) { + Position=new Vector2(x*16,height*16); + TextureWalk = chTextureWalk; + TextureEat = chTextureEat; + + Frame=0; + Eat=false; + Dir=dir; + Id=(ushort)BlockId.Chicken; + } + + public unsafe override byte[] Save() { + ushort id=Id; + byte* mbytes=(byte*)&id; + + return new byte[] { + mbytes[1], + mbytes[0], + Height, + Dir ? (byte)1 : (byte)0 + }; + } + + public override void Draw() { + Frame+=8; + + if (Eat) { + if (Frame>=TextureEat.Width) { + Frame=0; + Eat=false; + if (FastRandom.Int(3)==1)Dir=!Dir; + } + + if (Dir) Rabcr.spriteBatch.Draw(TextureEat, Position,new Rectangle(Frame/16*16,0,16,16), Color.White); + else Rabcr.spriteBatch.Draw(TextureEat, Position, new Rectangle(Frame/16*16,0,16,16), Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); + } else { + if (move) { + switch (moveType){ + case MoveType.Walk: + moveCount--; + if (moveCount==0) { + move=false; + needToChangeChunk=true; + } + + if (Frame>=TextureWalk.Width) { + Frame=0; + } + + if (Dir) Position.X+=0.25f; + else Position.X-=0.25f; + break; + + case MoveType.Fall: + moveCount--; + if (moveCount==0) { + move=false; + needToChangeChunk=true; + } + + if (Frame>=TextureWalk.Width) { + Frame=0; + } + if (Dir) {Position.X+=0.25f; Position.Y+=0.25f;} + else {Position.X-=0.25f; Position.Y+=0.25f;} + break; + + case MoveType.Jump: + moveCount--; + if (moveCount==0) { + move=false; + needToChangeChunk=true; + } + + if (Frame>=TextureWalk.Width) { + Frame=0; + } + + if (Dir) {Position.X+=0.25f; Position.Y-=0.25f;} + else {Position.X-=0.25f; Position.Y-=0.25f;} + break; + } + } else { + if (Frame>=TextureWalk.Width) { + Frame=0; + Eat=FastRandom.Int(5)==1; + if (FastRandom.Bool_20Percent())Dir=!Dir; + } + } + + if (Dir) Rabcr.spriteBatch.Draw(TextureWalk, Position,new Rectangle(Frame/16*16,0,16,16), Color.White); + else Rabcr.spriteBatch.Draw(TextureWalk, Position, new Rectangle(Frame/16*16,0,16,16), Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); + } + } + } + + class MChicken :MMob{ + + public byte Frame; + public bool Eat; + + readonly Texture2D TextureWalk, TextureEat; + + public bool move; + public byte moveCount; + public short lastChunkID; + public bool needToChangeChunk; + public MoveType moveType; + + public MChicken(byte height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) { Position=new Vector2(x*16,height*16); TextureWalk = chTextureWalk; TextureEat = chTextureEat; - // Lives=lives; Frame=0; Eat=false; Dir=dir; Id=(ushort)BlockId.Chicken; } - public unsafe override byte[] Save() { + public MChicken(int height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) { + Position=new Vector2(x*16,height*16); + TextureWalk = chTextureWalk; + TextureEat = chTextureEat; + + Frame=0; + Eat=false; + Dir=dir; + Id=(ushort)BlockId.Chicken; + } + + public unsafe override byte[] Save() { ushort id=Id; - byte* mbytes=(byte*)&id ; - - return new byte[]{ - mbytes[1], - mbytes[0], - Height, - Dir ? (byte)1 : (byte)0 + byte* mbytes=(byte*)&id; + + return new byte[] { + mbytes[1], + mbytes[0], + Height, + Dir ? (byte)1 : (byte)0 }; } @@ -63,7 +177,7 @@ class Chicken :Mob{ if (Frame>=TextureEat.Width) { Frame=0; Eat=false; - if (Rabcr.random.Int(3)==1)Dir=!Dir; + if (FastRandom.Int(3)==1)Dir=!Dir; } if (Dir) Rabcr.spriteBatch.Draw(TextureEat, Position,new Rectangle(Frame/16*16,0,16,16), Color.White); @@ -119,8 +233,8 @@ class Chicken :Mob{ } else { if (Frame>=TextureWalk.Width) { Frame=0; - Eat=Rabcr.random.Int(5)==1; - if (Rabcr.random.Bool_20Percent())Dir=!Dir; + Eat=FastRandom.Int(5)==1; + if (FastRandom.Bool_20Percent())Dir=!Dir; } } diff --git a/rabcrClient/InterLogic/Game/BlockType/Fish.cs b/rabcrClient/InterLogic/Game/BlockType/Fish.cs index c7afbdf..de7e435 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Fish.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Fish.cs @@ -34,15 +34,15 @@ class Fish :Mob{ Id=(ushort)BlockId.Fish; } - public unsafe override byte[] Save(){ + public unsafe override byte[] Save(){ ushort id=Id; byte* mbytes=(byte*)&id; - - return new byte[]{ + + return new byte[]{ mbytes[1], - mbytes[0], - Height, - Dir ? (byte)1 : (byte)0 + mbytes[0], + Height, + Dir ? (byte)1 : (byte)0 }; } @@ -51,15 +51,15 @@ class Fish :Mob{ else Position.X+=speed; - if (Rabcr.random.Bool()) speed += .01f; else speed -= .01f; + if (FastRandom.Bool()) speed += .01f; else speed -= .01f; if (speed < .01) speed += .01f; if (speed > 2) speed -= .01f; } public override void Draw() { - if (Rabcr.random.Int(10)==1){ - if (Rabcr.random.Bool_12_5Percent()) Frame=!Frame; - if (Rabcr.random.Int(20)==1) Dir=!Dir; + if (FastRandom.Bool_10Percent()){ + if (FastRandom.Bool_12_5Percent()) Frame=!Frame; + if (FastRandom.Bool_5Percent()) Dir=!Dir; } if (Dir){ diff --git a/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs b/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs index 407bf58..0475bed 100644 --- a/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs +++ b/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs @@ -7,15 +7,15 @@ public class FruitPlantWaving:Plant{ public int ticks; public float offsed; - public FruitPlantWaving(bool right) { + public FruitPlantWaving(bool right) { vecOrigin=new Vector2(8, 16); if (!right)offsed=FastMath.PI; ticks=0; } - - public override void Draw() => Rabcr.spriteBatch.Draw(GrowTexture, Position+vecOrigin, drawRectangle, Color.White, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f), vecOrigin, 1f, SpriteEffects.None, 0); - - public Plant TurnOff() => new Plant { + + public override void Draw() => Rabcr.spriteBatch.Draw(GrowTexture, Position+vecOrigin, drawRectangle, Color.White, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f), vecOrigin, 1f, SpriteEffects.None, 0); + + public Plant TurnOff() => new Plant { GrowTexture=GrowTexture, Position=Position, Id=Id, diff --git a/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs b/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs index a6d8cd3..3dc8726 100644 --- a/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs +++ b/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs @@ -8,13 +8,13 @@ public class LeavesBlock:Block{ public Vector2 Position; public Texture2D Texture; public Tree tree; - + Vector2 vecOrigin; public Color Color; #endregion - public LeavesBlock() { - Color=ColorWhite; + private LeavesBlock() { + // Color=ColorWhite; } public LeavesBlock(Texture2D texture, ushort id, Vector2 position) { @@ -24,20 +24,21 @@ public class LeavesBlock:Block{ Color=ColorWhite; } - public void SetOrigin() { + public void SetOrigin() { vecOrigin=-new Vector2(Position.X-tree.Root.X*16/*+*/-8, Position.Y-tree.Root.Y*16/*-8*/+8/*-16*/); } public override void Draw() { - if (tree!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, Color, tree.angle, vecOrigin, 1f, SpriteEffects.None, 0); - else Rabcr.spriteBatch.Draw(Texture, Position, Color); + if (tree!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, Color, tree.angle, vecOrigin, 1f, SpriteEffects.None, 0f); + else Rabcr.spriteBatch.Draw(Texture, Position, Color); } public override Block CloneDown() { - LeavesBlock n = new LeavesBlock{ + LeavesBlock n = new LeavesBlock { Texture=Texture, Id=Id, - Position=Position + Position=Position, + Color=ColorWhite, }; n.Position.Y+=16; return n; diff --git a/rabcrClient/InterLogic/Game/BlockType/MFish.cs b/rabcrClient/InterLogic/Game/BlockType/MFish.cs new file mode 100644 index 0000000..88ffee1 --- /dev/null +++ b/rabcrClient/InterLogic/Game/BlockType/MFish.cs @@ -0,0 +1,97 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace rabcrClient { + class MFish :MMob{ + // public bool IsLeft; + public float speed; + bool Frame; + readonly Texture2D Texture1, Texture2; + + public MFish(/*ushort id, */byte height, int x, bool dir, Texture2D fishTexture1, Texture2D fishTexture2) { + // Height=height; + Position=new Vector2(x*16+2,/*Height*/height*16+3); + Texture1 = fishTexture1; + Texture2 = fishTexture2; + Dir=dir; + // random=rnd; + //Lives=lives; + Frame=false; + speed = 1; + Id=(ushort)BlockId.Fish; + } + + public MFish(/*ushort id,*/ int height, int x, bool dir, Texture2D fishTexture1, Texture2D fishTexture2) { + // Height=height; + Position=new Vector2(x*16+2,/*Height*/height*16+3); + Texture1 = fishTexture1; + Texture2 = fishTexture2; + Dir=dir; + // random=rnd; + //Lives=lives; + Frame=false; + speed = 1; + Id=(ushort)BlockId.Fish; + } + + public unsafe override byte[] Save(){ + ushort id=Id; + byte* mbytes=(byte*)&id; + + return new byte[]{ + mbytes[1], + mbytes[0], + Height, + Dir ? (byte)1 : (byte)0 + }; + } + + public override void Update() { + if (Dir) Position.X-=speed; + else Position.X+=speed; + + + if (FastRandom.Bool()) speed += .01f; else speed -= .01f; + if (speed < .01) speed += .01f; + if (speed > 2) speed -= .01f; + } + + public override void Draw() { + if (FastRandom.Bool_10Percent()){ + if (FastRandom.Bool_12_5Percent()) Frame=!Frame; + if (FastRandom.Bool_5Percent()) Dir=!Dir; + } + + if (Dir){ + if (Frame) Rabcr.spriteBatch.Draw(Texture1, Position, Color.White); + else Rabcr.spriteBatch.Draw(Texture2, Position, Color.White); + } else { + if (Frame) Rabcr.spriteBatch.Draw(Texture1, Position, null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); + else Rabcr.spriteBatch.Draw(Texture2, Position, null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); + } + + } + } +} +/* +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace rabcrClient { + public class Mob { + //public bool Dir; + public byte Height; + public byte Id; + public Vector2 position; + + public Mob() { } + + public Mob(byte id, byte height, Vector2 pos) { + Id=id; + Height=height; + position=pos; + } + + public void Draw(SpriteBatch s){ } + } +}*/ \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/BlockType/Mob.cs b/rabcrClient/InterLogic/Game/BlockType/Mob.cs index 6809713..ef6fc6a 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Mob.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Mob.cs @@ -2,34 +2,42 @@ namespace rabcrClient { public abstract class Mob { - public byte Height{ - get { return (byte)(Position.Y/16);} - set{ Position.Y=((float)value)*16;} + + public byte Height { + get { return (byte)(Position.Y/16); } + set { Position.Y=((float)value)*16; } } + public ushort Id; public Vector2 Position; public bool Dir; - + public float Lives; + public float MaxLives; protected Mob() { } - public virtual byte[] Save(){ return null;} + public virtual byte[] Save() => null; - public virtual void Update(){ } + public virtual void Update() { } - public virtual void Draw(){ } + public virtual void Draw() { } } public abstract class MMob { - public byte Height { get { return (byte)(Position.Y/16); } set { Position.Y=((float)value)*16; } } - public byte Id; + public byte Height { + get { return (byte)(Position.Y/16); } + set { Position.Y=((float)value)*16; } + } + public ushort Id; public Vector2 Position; public bool Dir; - public bool Exists = true; + public MBlockState Exists; protected MMob() { } + public virtual byte[] Save() => null; + public virtual void Update() { } public virtual void Draw() { } diff --git a/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs b/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs index 12a213b..1fef230 100644 --- a/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs +++ b/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs @@ -20,7 +20,7 @@ public class NormalBlock:Block{ public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, ColorWhite); public override Block CloneDown() { - NormalBlock n = new NormalBlock{ + NormalBlock n = new NormalBlock { Texture=Texture, Id=Id, Position=Position diff --git a/rabcrClient/InterLogic/Game/BlockType/Parrot.cs b/rabcrClient/InterLogic/Game/BlockType/Parrot.cs index d3d3bc7..6893504 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Parrot.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Parrot.cs @@ -4,7 +4,7 @@ namespace rabcrClient { class Parrot:Mob { - + #region Varibles const float BirdSpeed=1f; @@ -20,7 +20,6 @@ class Parrot:Mob { #endregion public unsafe Parrot(byte height, int x, bool dir, Texture2D textureStill, Texture2D textureFlying) { - // PositionFlyTo=Pos; Position=new Vector2(x*16, height*16); Flying=false; Dir=dir; @@ -28,7 +27,7 @@ class Parrot:Mob { TextureFlying = textureFlying; Frame=0; Id=(ushort)BlockId.MobParrot; - } + } public unsafe Parrot(byte height, int x, bool dir, Vector2 Pos, Texture2D textureStill, Texture2D textureFlying) { PositionFlyTo=Pos; @@ -39,38 +38,38 @@ class Parrot:Mob { TextureFlying = textureFlying; Frame=0; Id=(ushort)BlockId.MobParrot; - } + } - public unsafe override byte[] Save(){ - ushort - id=Id, + public unsafe override byte[] Save(){ + ushort + id=Id, flyToX=(ushort)PositionFlyTo.X; - byte* + byte* mbytes=(byte*)&id, mbytesFlyToX=(byte*)&flyToX; - if (Flying) - return new byte[]{ - mbytes[1], - mbytes[0], - Flying? (byte)1 : (byte)0, - Height, - Dir ? (byte)1 : (byte)0, + if (Flying) + return new byte[]{ + mbytes[1], + mbytes[0], + Flying? (byte)1 : (byte)0, + Height, + Dir ? (byte)1 : (byte)0, - mbytesFlyToX[1], - mbytesFlyToX[0], + mbytesFlyToX[1], + mbytesFlyToX[0], (byte)(PositionFlyTo.Y/16f) }; - else return - new byte[]{ - mbytes[1], - mbytes[0], - Flying? (byte)1 : (byte)0, - Height, - Dir ? (byte)1 : (byte)0, + else return + new byte[]{ + mbytes[1], + mbytes[0], + Flying? (byte)1 : (byte)0, + Height, + Dir ? (byte)1 : (byte)0, }; } - + public Parrot(int height, int x, bool dir, bool Flying, Texture2D textureStill, Texture2D textureFlying) { Position=new Vector2(x*16, height*16); TextureStill = textureStill; @@ -81,9 +80,129 @@ class Parrot:Mob { Id=(ushort)BlockId.MobParrot; } - public void UpdateFlying() { - if (FastMath.DistanceInt(Position.X,Position.Y, PositionFlyTo.X,PositionFlyTo.Y)<=BirdSpeed*2) { - + public void UpdateFlying() { + if (FastMath.DistanceInt(Position.X,Position.Y, PositionFlyTo.X,PositionFlyTo.Y)<=BirdSpeed*2) { + + Position=PositionFlyTo; + Flying=false; + + // invoke to check existence of destination flight + /*if (*/StopFlying.Invoke();//) { + //} + + } else { + Position+=SpeedVector; + } + } + + public void SetFlying(int x, int y) { + Flying=true; + + PositionFlyTo.X=x; + PositionFlyTo.Y=y; + + Vector2 RawSpeedVector=new Vector2(PositionFlyTo.X-Position.X, PositionFlyTo.Y-Position.Y); + float vecSize=(float)Math.Sqrt(RawSpeedVector.X*RawSpeedVector.X+RawSpeedVector.Y*RawSpeedVector.Y); + + SpeedVector=RawSpeedVector/vecSize*BirdSpeed; + Dir=SpeedVector.X>0; + } + + public override void Draw() { + if (Flying) { + UpdateFlying(); + + // Frames + Frame+=10; + if (Frame>TextureFlying.Width-35)Frame-=TextureFlying.Width-35; + + // Draw + if (Dir) Rabcr.spriteBatch.Draw(TextureFlying/*Rabcr.Pixel*/, Position, new Rectangle((int)(Frame/16)*16,0,16,16), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0); + else Rabcr.spriteBatch.Draw(TextureFlying, Position, new Rectangle((int)(Frame/16)*16,0,16,16), Color.White); + } else Rabcr.spriteBatch.Draw(TextureStill, new Vector2(Position.X+5,Position.Y-10), Color.White); + } + } + + class MParrot:MMob { + + #region Varibles + const float BirdSpeed=1f; + + public bool Flying; + public int Frame; + public Vector2 PositionFlyTo; + + public delegate bool EventStopFly(); + public event EventStopFly StopFlying; + + readonly Texture2D TextureStill, TextureFlying; + Vector2 SpeedVector; + #endregion + + public unsafe MParrot(byte height, int x, bool dir, Texture2D textureStill, Texture2D textureFlying) { + Position=new Vector2(x*16, height*16); + Flying=false; + Dir=dir; + TextureStill = textureStill; + TextureFlying = textureFlying; + Frame=0; + Id=(ushort)BlockId.MobParrot; + } + + public unsafe MParrot(byte height, int x, bool dir, Vector2 Pos, Texture2D textureStill, Texture2D textureFlying) { + PositionFlyTo=Pos; + Position=new Vector2(x*16, height*16); + Flying=true; + Dir=dir; + TextureStill = textureStill; + TextureFlying = textureFlying; + Frame=0; + Id=(ushort)BlockId.MobParrot; + } + + public unsafe override byte[] Save(){ + ushort + id=Id, + flyToX=(ushort)PositionFlyTo.X; + byte* + mbytes=(byte*)&id, + mbytesFlyToX=(byte*)&flyToX; + + if (Flying) + return new byte[] { + mbytes[1], + mbytes[0], + Flying? (byte)1 : (byte)0, + Height, + Dir ? (byte)1 : (byte)0, + + mbytesFlyToX[1], + mbytesFlyToX[0], + (byte)(PositionFlyTo.Y/16f) + }; + else return + new byte[]{ + mbytes[1], + mbytes[0], + Flying? (byte)1 : (byte)0, + Height, + Dir ? (byte)1 : (byte)0, + }; + } + + public MParrot(int height, int x, bool dir, bool Flying, Texture2D textureStill, Texture2D textureFlying) { + Position=new Vector2(x*16, height*16); + TextureStill = textureStill; + TextureFlying = textureFlying; + this.Flying=Flying; + Frame=0; + Dir=dir; + Id=(ushort)BlockId.MobParrot; + } + + public void UpdateFlying() { + if (FastMath.DistanceInt(Position.X,Position.Y, PositionFlyTo.X,PositionFlyTo.Y)<=BirdSpeed*2) { + Position=PositionFlyTo; Flying=false; @@ -91,14 +210,14 @@ class Parrot:Mob { /*if (*/StopFlying.Invoke();//) { //} - } else { + } else { Position+=SpeedVector; } } - public void SetFlying(int x, int y) { + public void SetFlying(int x, int y) { Flying=true; - + PositionFlyTo.X=x; PositionFlyTo.Y=y; diff --git a/rabcrClient/InterLogic/Game/BlockType/Plant.cs b/rabcrClient/InterLogic/Game/BlockType/Plant.cs index 8e5c84a..6763024 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Plant.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Plant.cs @@ -36,7 +36,7 @@ public class Plant{ public virtual void Draw() => Rabcr.spriteBatch.Draw(GrowTexture, Position, drawRectangle, Color.White); - public FruitPlantWaving TurnToWavingPlant(bool right)=>new FruitPlantWaving(right){ + public FruitPlantWaving TurnToWavingPlant(bool right)=>new FruitPlantWaving(right){ GrowTexture=GrowTexture, Position=Position, Id=Id, diff --git a/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs b/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs index 9572c81..5d1b102 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs @@ -3,7 +3,6 @@ namespace rabcrClient { class Rabbit:Mob { - public byte Frame; public bool needToChangeChunk; public bool move; @@ -14,44 +13,43 @@ class Rabbit:Mob { readonly Texture2D TextureWalk, TextureEat, TextureJump; public Texture2D thisTexture; + Rectangle rec; - public Rabbit(/*ushort id,*/ byte height, /*byte lives,*/ int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) { - // Height=height; - // Position.Y=height*16; + public Rabbit(byte height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) { Position=new Vector2(x*16,height*16); TextureWalk = textureWalk; TextureEat = textureEat; TextureJump = textureJump; - // Lives=lives; + Frame=0; Dir=dir; Id=(ushort)BlockId.Rabbit; thisTexture=TextureEat; + rec=new Rectangle((int)(Frame/16f)*16, 0, 16, 16); } - public Rabbit(/*ushort id,*/ int height, /*byte lives,*/ int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) { - // Height=height; + public Rabbit(int height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat, Texture2D textureJump) { Position.Y=height*16; Position=new Vector2(x*16,Height*16); TextureWalk = textureWalk; TextureEat = textureEat; TextureJump = textureJump; - // Lives=lives; Frame=0; Dir=dir; - Id=(ushort)BlockId.Rabbit; + Id=(ushort)BlockId.Rabbit; thisTexture=TextureEat; + rec=new Rectangle((int)(Frame/16f)*16, 0, 16, 16); } - public unsafe override byte[] Save() { + public unsafe override byte[] Save() { ushort id=Id; - byte* mbytes=(byte*)&id ; - - return new byte[]{ - mbytes[1], - mbytes[0], - Height, - Dir ? (byte)1 : (byte)0 + byte* mbytes=(byte*)&id; + + return new byte[]{ + mbytes[1], + mbytes[0], + Height, + Dir ? (byte)1 : (byte)0 }; } @@ -118,13 +116,144 @@ class Rabbit:Mob { switchtoWalk=false;/*System.Console.WriteLine("switch walk");*/ } else { // System.Console.WriteLine(thisTexture.Name); - if (Rabcr.random.Bool()){ + if (FastRandom.Bool()){ + if (thisTexture==TextureEat) { + if (FastRandom.Bool()){thisTexture=TextureWalk; /*System.Console.WriteLine("switch tex jump");*/} + }else{ //System.Console.WriteLine("?"); + thisTexture=TextureEat;//System.Console.WriteLine("switch tex eat"); + } + if (FastRandom.Bool()){Dir=!Dir;/*System.Console.WriteLine("switch dir");*/ } + } + + + } + } + } + rec.X=(int)(Frame/16f)*16; + + if (Dir) Rabcr.spriteBatch.Draw(thisTexture, Position, rec/*new Rectangle((int)(Frame/16f)*16,0,16,16)*/, Color.White); + else Rabcr.spriteBatch.Draw(thisTexture, Position, rec/*new Rectangle((int)(Frame/16f)*16,0,16,16)*/, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); + } + } + + class MRabbit:MMob { + public byte Frame; + public bool needToChangeChunk; + public bool move; + public short lastChunkID; + public byte moveCount; + public bool switchtoWalk; + public MoveType moveType; + + readonly Texture2D TextureWalk, TextureEat, TextureJump; + public Texture2D thisTexture; + + public MRabbit(byte height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) { + Position=new Vector2(x*16,height*16); + TextureWalk = textureWalk; + TextureEat = textureEat; + TextureJump = textureJump; + + Frame=0; + Dir=dir; + Id=(ushort)BlockId.Rabbit; + thisTexture=TextureEat; + } + + public MRabbit(int height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat, Texture2D textureJump) { + Position.Y=height*16; + Position=new Vector2(x*16,Height*16); + TextureWalk = textureWalk; + TextureEat = textureEat; + TextureJump = textureJump; + Frame=0; + Dir=dir; + Id=(ushort)BlockId.Rabbit; + thisTexture=TextureEat; + } + + public unsafe override byte[] Save() { + ushort id=Id; + byte* mbytes=(byte*)&id; + + return new byte[]{ + mbytes[1], + mbytes[0], + Height, + Dir ? (byte)1 : (byte)0 + }; + } + + public override void Draw() { + Frame+=10; + if (move) { + switch (moveType){ + case MoveType.Walk: + if (Dir) Position.X+=0.25f; + else Position.X-=0.25f; + + moveCount--; + if (moveCount==0) { + move=false; + needToChangeChunk=true; + thisTexture=TextureEat; + } + + if (Frame>=thisTexture.Width) { + Frame=0; + } + break; + + case MoveType.Fall: + if (Dir){ Position.X+=0.25f; Position.Y+=0.25f; } + else {Position.X-=0.25f; Position.Y+=0.25f; } + + moveCount--; + if (moveCount==0) { + move=false; + needToChangeChunk=true; + thisTexture=TextureEat; + } + + if (Frame>=thisTexture.Width) { + Frame=0; + } + break; + + case MoveType.Jump: + if (Dir) {Position.X+=0.25f; Position.Y-=0.25f; } + else {Position.X-=0.25f; Position.Y-=0.25f; } + + moveCount--; + if (moveCount==0) { + move=false; + needToChangeChunk=true; + thisTexture=TextureEat; + } + + if (Frame>=thisTexture.Width) { + Frame=0; + } + break; + + } + } else { + if (Frame>=thisTexture.Width){ + Frame=0; + + if (switchtoWalk){ + move=true; + thisTexture=TextureJump; + switchtoWalk=false;/*System.Console.WriteLine("switch walk");*/ + } else { + // System.Console.WriteLine(thisTexture.Name); + if (FastRandom.Bool()){ if (thisTexture==TextureEat) { - if (Rabcr.random.Bool()){thisTexture=TextureWalk; /*System.Console.WriteLine("switch tex jump");*/} + if (FastRandom.Bool()){thisTexture=TextureWalk; /*System.Console.WriteLine("switch tex jump");*/} }else{ //System.Console.WriteLine("?"); thisTexture=TextureEat;//System.Console.WriteLine("switch tex eat"); } - if (Rabcr.random.Bool()){Dir=!Dir;/*System.Console.WriteLine("switch dir");*/ } + if (FastRandom.Bool()){Dir=!Dir;/*System.Console.WriteLine("switch dir");*/ } } diff --git a/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs b/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs index dbc2509..f5ec2bc 100644 --- a/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs +++ b/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs @@ -4,8 +4,8 @@ namespace rabcrClient { class ScreenBlock : Block{//static =no animation (fence,label) - public int screen; Rectangle rectangle; + public int screen; public Vector2 Position; public Texture2D Texture; @@ -17,9 +17,10 @@ class ScreenBlock : Block{//static =no animation (fence,label) } public int Screen { - set{ + set { screen=value; - rectangle = new Rectangle(rectangle.Width * screen,0, rectangle.Width, rectangle.Height); + rectangle.X=rectangle.Width * screen; + // rectangle = new Rectangle(rectangle.Width * screen,0, rectangle.Width, rectangle.Height); } } diff --git a/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs b/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs index 302eb34..a66b382 100644 --- a/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs +++ b/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs @@ -17,7 +17,7 @@ class ShelfBlock:Block{ Id=id; Inv=new ItemInv[max]; ColorItem=ColorWhite; - SmalItemRectangle=new Rectangle((int)position.X+2,(int)position.Y+2,12,12); + SmalItemRectangle=new Rectangle((int)position.X+2, (int)position.Y+2, 12, 12); } public override void Draw() { diff --git a/rabcrClient/InterLogic/Game/BlockType/Water.cs b/rabcrClient/InterLogic/Game/BlockType/Water.cs index 9268724..5eb070e 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Water.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Water.cs @@ -11,27 +11,28 @@ class Water : Block{ Vector2 pos; public Rectangle rec; - public void Mass(int value){ - if ((GetMass=value)==255){ + public void Mass(int value) { + if ((GetMass=value)==255) { Fill=true; return; } else { Fill=false; int h=(int)(16*(GetMass/255f)); - pos = new Vector2(Position.X,Position.Y+16-h); + pos = new Vector2(Position.X, Position.Y+16-h); rec = new Rectangle(0, 16-h, 16, h); } } - public void MassNoFill(int value){ + + public void MassNoFill(int value) { GetMass=value; Fill=false; int h=(int)(16*(GetMass/255f)); - pos = new Vector2(Position.X,Position.Y+16-h); + pos = new Vector2(Position.X, Position.Y+16-h); rec = new Rectangle(0, 16-h, 16, h); } - public Water(){ } + private Water(){ } public Water(Texture2D texture, ushort type, Vector2 position) { Texture = texture; @@ -67,7 +68,7 @@ class Water : Block{ } public override Block CloneDown() { - Water w = new Water{ + Water w = new Water { Texture=Texture, Id=Id, Position=Position, diff --git a/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs b/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs index de1a83f..70a37c4 100644 --- a/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs +++ b/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs @@ -15,7 +15,7 @@ // public int ticks; // #endregion -// // public abstract void Draw(); +// // public abstract void Draw(); // public abstract object TurnOff(); // } diff --git a/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs b/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs index 3626558..24e82ab 100644 --- a/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs +++ b/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs @@ -22,14 +22,14 @@ WaterBlock, WaterSalt, - - Barrel, - - _MoreInLoad, - + Barrel, + + + _MoreInLoad, + Lava, - + #region Trees OakLeaves, OakWood, @@ -339,4 +339,6 @@ ChristmasBallPurple, ChristmasBallLightGreen, MobParrot, + Spawner, // for server, place where are players spawned + Teleporter // for gates - other places in current world or another world } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/GameButton.cs b/rabcrClient/InterLogic/Game/GameButton.cs index 6c23786..46272d8 100644 --- a/rabcrClient/InterLogic/Game/GameButton.cs +++ b/rabcrClient/InterLogic/Game/GameButton.cs @@ -6,13 +6,12 @@ class GameButtonMedium { #region Varibles int fill=255; - // int needBeFill=255; Color color; public Texture2D texture; public string text; - /*float*/int Xp,Yp; + int Xp,Yp; int TextPositionX, TextPositionY; Vector2 TexturePositon; Text Ttext; @@ -48,7 +47,7 @@ class GameButtonMedium { } void SetText(){ - Ttext=new Text(text,TextPositionX, TextPositionY,BitmapFont.bitmapFont18); + Ttext=new Text(text,TextPositionX, TextPositionY, BitmapFont.bitmapFont18); } public bool Update() { diff --git a/rabcrClient/InterLogic/Game/GameDraw.cs b/rabcrClient/InterLogic/Game/GameDraw.cs index f30af60..a4b0004 100644 --- a/rabcrClient/InterLogic/Game/GameDraw.cs +++ b/rabcrClient/InterLogic/Game/GameDraw.cs @@ -1,153 +1,19 @@ using Microsoft.Xna.Framework; -//using Microsoft.Xna.Framework.Graphics; namespace rabcrClient { - class GameDraw { - static readonly Color - //color_r200_g200_b200_a100= new Color(200,200,200,100), - //color_r0_g0_b0_a200 = new Color(0,0,0,200), - //color_r10_g140_b255 = new Color(10,140,255), - //color_r128_g128_b128= new Color(128,128,128), - //color_r128_g128_b128_a128= new Color(128,128,128,128), - //color_r150_g150_b150= new Color(150,150,150), - color_r0_g0_b0_a100 = new Color(0,0,0,100)//, - //color_r255_g0_b0_a100 = new Color(255, 0, 0, 100), - //color_r200_g200_b200=new Color(200, 200, 200), - // lampColorLight=new Color(255, 255, 220, 255) - ; - // static Vector2 vector_x0_y4; - // public static void DrawItemInInventory(Texture2D texture, ItemInv inv, int x, int y) { - // switch (inv){ - // case ItemInvTool16 item: - // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White); - - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.GetCount*0.3f), 3), Color.Green); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.GetCount*0.3f), y+29, 28-(int)(item.GetCount*0.3), 3), Color.Red); - // return; - - // case ItemInvTool32 item: - // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.GetCount*0.3f), 3), Color.Green); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.GetCount*0.3f), y+29, 28-(int)(item.GetCount*0.3), 3), Color.Red); - // return; - - // case ItemInvBasic16 item: - // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White); - // return; - - // case ItemInvBasic32 item: - // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - // return; - // } - - // //if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White); - // //else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - // //else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height),texture.Width*2,texture.Height*2), Color.White); - - // //if (inv.X<(short)Items._SystemMaxTools){ - // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); - // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(inv.Y*0.3f), 3), Color.Green); - // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(inv.Y*0.3f), y+29, 28-(int)(inv.Y*0.3), 3), Color.Red); - // //}else if (inv.Y!=1) DrawTextShadowMin(x, y+20,inv.Y/*.ToString()*/); - //} - - //public static void DrawItemInInventory(Texture2D texture, ItemNonInv inv, int x, int y) { - // switch (inv){ - // case ItemNonInvTool item: - // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White); - - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.Count*0.3f), 3), Color.Green); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.Count*0.3f), y+29, 28-(int)(item.Count*0.3), 3), Color.Red); - // return; - - // case ItemNonInvBasicColoritzedNonStackable item: - // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), item.color); - // return; - - // case ItemNonInvBasic item: - // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White); - // return; - - // case ItemNonInvNonStackable item: - // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - // return; + static readonly Color color_r0_g0_b0_a100 = new Color(0,0,0,100); - // case ItemNonInvFood item: - // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.Count*0.3f), 3), new Color(item.Descay/item.DescayMaximum,1-item.Descay/item.DescayMaximum,0)); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.Count*0.3f), y+29, 28-(int)(item.Count*0.3), 3), Color.White); - // return; - // } - - // //if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White); - // //else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - // //else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height),texture.Width*2,texture.Height*2), Color.White); - - // //if (inv.X<(short)Items._SystemMaxTools){ - // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); - // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(inv.Y*0.3f), 3), Color.Green); - // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(inv.Y*0.3f), y+29, 28-(int)(inv.Y*0.3), 3), Color.Red); - // //}else if (inv.Y!=1) DrawTextShadowMin(x, y+20,inv.Y/*.ToString()*/); - //} - - //public static void DrawItemInInventory(Texture2D texture, int invX, int invY, int x, int y) { - - // if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White); - // else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - // else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height),texture.Width*2,texture.Height*2), Color.White); - - // if (invX<(short)Items._SystemMaxTools){ - // int invYY=(int)(invY*0.3f); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, invYY/*(int)(invY*0.3f)*/, 3), Color.Green); - // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+invYY/*(int)(invY*0.3f)*/, y+29, 28-invYY/*(int)(invY*0.3)*/, 3), Color.Red); - // }else if (invY!=1) DrawTextShadowMin(x, y+20,invY/*.ToString()*/); - //} - - //public static void DrawItemInInventory(Texture2D texture, int count, int x, int y) { - // if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y, 32, 32), Color.White); - // else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White); - // else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+16-texture.Width, y+16-texture.Height, texture.Width*2, texture.Height*2), Color.White); - - // if (count!=1) DrawTextShadowMin(x, y+20, count/*.ToString()*/); - //} - - public static void DrawTextShadowMin(int x, int y, int i) { + /* public static void DrawTextShadowMin(int x, int y, int i) { string str=i.ToString(); - //if (Setting.BetterFont) { - // if (Constants.Shadow)Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0); - // Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x, y), Color.Black, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0); - //} else { - /* if (Constants.Shadow)*/Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100); - Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x,y), Color.Black); - //} - } - public static void DrawTextShadowMin(int x, int y, string str, Color c) { + Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100); + Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x, y), Color.Black); + }*/ - //if (Setting.BetterFont) { - // if (Constants.Shadow)Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0); - // Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x, y), Color.Black, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0); - //} else { - /*if (Constants.Shadow)*/Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100); - Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x,y), c); - //} + public static void DrawTextShadowMin(int x, int y, string str, Color c) { + Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100); + Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x, y), c); } - - //public static void DrawTextShadowMin(int x, int y, string str, Color c) { - // if (Setting.BetterFont) { - // if (Constants.Shadow) Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x+0.5f, y+0.5f), color_r128_g128_b128_a128*(c.A/255f), 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None,0); - // Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x, y), c, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0); - // } else { - // if (Constants.Shadow) Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r128_g128_b128_a128*(c.A/255f)); - // Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x, y), c); - // } - //} } -} +} \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/GameMethods.cs b/rabcrClient/InterLogic/Game/GameMethods.cs index d5785b2..8fef7f8 100644 --- a/rabcrClient/InterLogic/Game/GameMethods.cs +++ b/rabcrClient/InterLogic/Game/GameMethods.cs @@ -5,7 +5,6 @@ using System.Diagnostics; #endif - namespace rabcrClient { public class CraftingIn{ public ItemNonInv[] ItemSlot; @@ -192,97 +191,96 @@ public class CraftingOut { static class GameMethods { - public static bool IsHalfShadowBlock(ushort id) { - switch (id) { - case (ushort)BlockId.AcaciaLeaves: return true; - case (ushort)BlockId.AppleLeaves: return true; - case (ushort)BlockId.AppleLeavesWithApples: return true; - case (ushort)BlockId.AppleLeavesBlossom: return true; - case (ushort)BlockId.CherryLeaves: return true; - case (ushort)BlockId.CherryLeavesBlossom: return true; - case (ushort)BlockId.CherryLeavesWithCherries: return true; - case (ushort)BlockId.EucalyptusLeaves: return true; - case (ushort)BlockId.KapokLeaves: return true; - case (ushort)BlockId.LemonLeaves: return true; - case (ushort)BlockId.LemonLeavesWithLemons: return true; - case (ushort)BlockId.LindenLeaves: return true; - case (ushort)BlockId.MangroveLeaves: return true; - case (ushort)BlockId.OakLeaves: return true; - case (ushort)BlockId.OliveLeaves: return true; - case (ushort)BlockId.OliveLeavesWithOlives: return true; - case (ushort)BlockId.OrangeLeaves: return true; - case (ushort)BlockId.OrangeLeavesWithOranges: return true; - case (ushort)BlockId.PineLeaves: return true; - case (ushort)BlockId.PlumLeaves: return true; - case (ushort)BlockId.PlumLeavesBlossom: return true; - case (ushort)BlockId.PlumLeavesWithPlums: return true; - case (ushort)BlockId.RubberTreeLeaves: return true; - case (ushort)BlockId.SpruceLeaves: return true; - case (ushort)BlockId.WillowLeaves: return true; - - case (ushort)BlockId.Ice: return true; - case (ushort)BlockId.WaterBlock: return true; - case (ushort)BlockId.WaterSalt: return true; - } - return false; - } + public static bool IsHalfShadowBlock(ushort id) { + return id switch { + (ushort)BlockId.AcaciaLeaves => true, + (ushort)BlockId.AppleLeaves => true, + (ushort)BlockId.AppleLeavesWithApples => true, + (ushort)BlockId.AppleLeavesBlossom => true, + (ushort)BlockId.CherryLeaves => true, + (ushort)BlockId.CherryLeavesBlossom => true, + (ushort)BlockId.CherryLeavesWithCherries => true, + (ushort)BlockId.EucalyptusLeaves => true, + (ushort)BlockId.KapokLeaves => true, + (ushort)BlockId.LemonLeaves => true, + (ushort)BlockId.LemonLeavesWithLemons => true, + (ushort)BlockId.LindenLeaves => true, + (ushort)BlockId.MangroveLeaves => true, + (ushort)BlockId.OakLeaves => true, + (ushort)BlockId.OliveLeaves => true, + (ushort)BlockId.OliveLeavesWithOlives => true, + (ushort)BlockId.OrangeLeaves => true, + (ushort)BlockId.OrangeLeavesWithOranges => true, + (ushort)BlockId.PineLeaves => true, + (ushort)BlockId.PlumLeaves => true, + (ushort)BlockId.PlumLeavesBlossom => true, + (ushort)BlockId.PlumLeavesWithPlums => true, + (ushort)BlockId.RubberTreeLeaves => true, + (ushort)BlockId.SpruceLeaves => true, + (ushort)BlockId.WillowLeaves => true, + (ushort)BlockId.Ice => true, + (ushort)BlockId.WaterBlock => true, + (ushort)BlockId.WaterSalt => true, + _ => false, + }; + } - public static bool IsLeaves(ushort id) { - switch (id) { - case (ushort)BlockId.AcaciaLeaves: return true; - case (ushort)BlockId.AppleLeaves: return true; - case (ushort)BlockId.AppleLeavesWithApples: return true; - case (ushort)BlockId.AppleLeavesBlossom: return true; - case (ushort)BlockId.CherryLeaves: return true; - case (ushort)BlockId.CherryLeavesBlossom: return true; - case (ushort)BlockId.CherryLeavesWithCherries: return true; - case (ushort)BlockId.EucalyptusLeaves: return true; - case (ushort)BlockId.KapokLeaves: return true; - case (ushort)BlockId.LemonLeaves: return true; - case (ushort)BlockId.LemonLeavesWithLemons: return true; - case (ushort)BlockId.LindenLeaves: return true; - case (ushort)BlockId.MangroveLeaves: return true; - case (ushort)BlockId.OakLeaves: return true; - case (ushort)BlockId.OliveLeaves: return true; - case (ushort)BlockId.OliveLeavesWithOlives: return true; - case (ushort)BlockId.OrangeLeaves: return true; - case (ushort)BlockId.OrangeLeavesWithOranges: return true; - case (ushort)BlockId.PineLeaves: return true; - case (ushort)BlockId.PlumLeaves: return true; - case (ushort)BlockId.PlumLeavesBlossom: return true; - case (ushort)BlockId.PlumLeavesWithPlums: return true; - case (ushort)BlockId.RubberTreeLeaves: return true; - case (ushort)BlockId.SpruceLeaves: return true; - case (ushort)BlockId.WillowLeaves: return true; - } - return false; - } + public static bool IsLeaves(ushort id) { + return id switch { + (ushort)BlockId.AcaciaLeaves => true, + (ushort)BlockId.AppleLeaves => true, + (ushort)BlockId.AppleLeavesWithApples => true, + (ushort)BlockId.AppleLeavesBlossom => true, + (ushort)BlockId.CherryLeaves => true, + (ushort)BlockId.CherryLeavesBlossom => true, + (ushort)BlockId.CherryLeavesWithCherries => true, + (ushort)BlockId.EucalyptusLeaves => true, + (ushort)BlockId.KapokLeaves => true, + (ushort)BlockId.LemonLeaves => true, + (ushort)BlockId.LemonLeavesWithLemons => true, + (ushort)BlockId.LindenLeaves => true, + (ushort)BlockId.MangroveLeaves => true, + (ushort)BlockId.OakLeaves => true, + (ushort)BlockId.OliveLeaves => true, + (ushort)BlockId.OliveLeavesWithOlives => true, + (ushort)BlockId.OrangeLeaves => true, + (ushort)BlockId.OrangeLeavesWithOranges => true, + (ushort)BlockId.PineLeaves => true, + (ushort)BlockId.PlumLeaves => true, + (ushort)BlockId.PlumLeavesBlossom => true, + (ushort)BlockId.PlumLeavesWithPlums => true, + (ushort)BlockId.RubberTreeLeaves => true, + (ushort)BlockId.SpruceLeaves => true, + (ushort)BlockId.WillowLeaves => true, + _ => false, + }; + } - public static bool IsSelectedShears(ushort id) { - switch (id) { - case (ushort)Items.ShearsCopper: return true; + public static bool IsSelectedShears(ushort id) { + switch (id) { + case (ushort)Items.ShearsCopper: return true; case (ushort)Items.ShearsBronze: return true; case (ushort)Items.ShearsGold: return true; case (ushort)Items.ShearsIron: return true; case (ushort)Items.ShearsSteel: return true; case (ushort)Items.ShearsAluminium: return true; } - - return false; - } - public static bool IsSelectedKnife(ushort id) { - switch (id) { - case (ushort)Items.KnifeCopper: return true; - case (ushort)Items.KnifeBronze: return true; - case (ushort)Items.KnifeGold: return true; - case (ushort)Items.KnifeIron: return true; - case (ushort)Items.KnifeSteel: return true; - case (ushort)Items.KnifeAluminium: return true; - } return false; } + public static bool IsSelectedKnife(ushort id) { + return id switch { + (ushort)Items.KnifeCopper => true, + (ushort)Items.KnifeBronze => true, + (ushort)Items.KnifeGold => true, + (ushort)Items.KnifeIron => true, + (ushort)Items.KnifeSteel => true, + (ushort)Items.KnifeAluminium => true, + _ => false, + }; + } + public static int GetItemNameId(ushort id) { switch (id) { // Blocks @@ -855,132 +853,119 @@ static class GameMethods { } public static ushort ToolToBasic(ushort i) { - switch (i) { - case (ushort)Items.BucketOil: return (ushort)Items.Bucket; - case (ushort)Items.BucketWater: return (ushort)Items.Bucket; - case (ushort)Items.TorchElectricON: return (ushort)Items.TorchElectricOFF; - case (ushort)Items.LighterON: return (ushort)Items.LighterOFF; - - case (ushort)Items.BottleOil: return (ushort)Items.Bottle; - case (ushort)Items.BottleWater: return (ushort)Items.Bottle; - - case (ushort)Items.ElectricDrill: return (ushort)Items.ElectricDrillOff; - case (ushort)Items.ElectricSaw: return (ushort)Items.ElectricSawOff; - } - return (ushort)Items.None; + return i switch { + (ushort)Items.BucketOil => (ushort)Items.Bucket, + (ushort)Items.BucketWater => (ushort)Items.Bucket, + (ushort)Items.TorchElectricON => (ushort)Items.TorchElectricOFF, + (ushort)Items.LighterON => (ushort)Items.LighterOFF, + (ushort)Items.BottleOil => (ushort)Items.Bottle, + (ushort)Items.BottleWater => (ushort)Items.Bottle, + (ushort)Items.ElectricDrill => (ushort)Items.ElectricDrillOff, + (ushort)Items.ElectricSaw => (ushort)Items.ElectricSawOff, + _ => (ushort)Items.None, + }; } public static int ToolMax(ushort id) { //max uses - switch (id) { + return id switch { + (ushort)Items.AxeStone => 50, + (ushort)Items.PickaxeStone => 50, + (ushort)Items.ShovelStone => 50, + (ushort)Items.HoeStone => 50, + (ushort)Items.HoeCopper => 200, + (ushort)Items.KnifeCopper => 200, + (ushort)Items.SawCopper => 200, + (ushort)Items.ShearsCopper => 200, + (ushort)Items.HammerCopper => 200, + (ushort)Items.PickaxeCopper => 200, + (ushort)Items.ShovelCopper => 200, + (ushort)Items.AxeCopper => 200, + (ushort)Items.HammerBronze => 250, + (ushort)Items.HoeBronze => 250, + (ushort)Items.KnifeBronze => 250, + (ushort)Items.SawBronze => 250, + (ushort)Items.ShearsBronze => 250, + (ushort)Items.PickaxeBronze => 250, + (ushort)Items.ShovelBronze => 250, + (ushort)Items.AxeBronze => 250, + (ushort)Items.AxeIron => 300, + (ushort)Items.HammerIron => 300, + (ushort)Items.HoeIron => 300, + (ushort)Items.PickaxeIron => 300, + (ushort)Items.ShovelIron => 300, + (ushort)Items.KnifeIron => 300, + (ushort)Items.SawIron => 300, + (ushort)Items.ShearsIron => 300, + (ushort)Items.AxeSteel => 350, + (ushort)Items.HammerSteel => 350, + (ushort)Items.HoeSteel => 350, + (ushort)Items.PickaxeSteel => 350, + (ushort)Items.ShovelSteel => 350, + (ushort)Items.KnifeSteel => 350, + (ushort)Items.SawSteel => 350, + (ushort)Items.ShearsSteel => 350, + (ushort)Items.AxeAluminium => 150, + (ushort)Items.HammerAluminium => 150, + (ushort)Items.HoeAluminium => 150, + (ushort)Items.PickaxeAluminium => 150, + (ushort)Items.ShovelAluminium => 150, + (ushort)Items.KnifeAluminium => 150, + (ushort)Items.SawAluminium => 150, + (ushort)Items.ShearsAluminium => 150, + (ushort)Items.AxeGold => 5, + (ushort)Items.HammerGold => 5, + (ushort)Items.HoeGold => 5, + (ushort)Items.PickaxeGold => 5, + (ushort)Items.ShovelGold => 5, + (ushort)Items.KnifeGold => 5, + (ushort)Items.SawGold => 5, + (ushort)Items.ShearsGold => 5, + (ushort)Items.ElectricDrill => 400, + (ushort)Items.ElectricSaw => 400, + (ushort)Items.TorchElectricON => 400, + (ushort)Items.Gun => 1000, + (ushort)Items.AirTank => 1000, + (ushort)Items.AirTank2 => 2000, + (ushort)Items.BucketWater => 255, + (ushort)Items.BucketOil => 255, + (ushort)Items.BottleOil => 50, + (ushort)Items.BottleWater => 50, + (ushort)Items.TorchON => 100, + (ushort)Items.DyeArmy => 50, + (ushort)Items.DyeBlack => 50, + (ushort)Items.DyeBlue => 50, + (ushort)Items.DyeBrown => 50, + (ushort)Items.DyeDarkBlue => 50, + (ushort)Items.DyeDarkGray => 50, + (ushort)Items.DyeDarkGreen => 50, + (ushort)Items.DyeDarkRed => 50, + (ushort)Items.DyeGold => 50, + (ushort)Items.DyeGray => 50, + (ushort)Items.DyeGreen => 50, + (ushort)Items.DyeLightBlue => 50, + (ushort)Items.DyeLightGray => 50, + (ushort)Items.DyeLightGreen => 50, + (ushort)Items.DyeMagenta => 50, + (ushort)Items.DyeOlive => 50, + (ushort)Items.DyeOrange => 50, + (ushort)Items.DyePink => 50, + (ushort)Items.DyePurple => 50, + (ushort)Items.DyeRed => 50, + (ushort)Items.DyeRoseQuartz => 50, + (ushort)Items.DyeSpringGreen => 50, + (ushort)Items.DyeTeal => 50, + (ushort)Items.DyeViolet => 50, + (ushort)Items.DyeWhite => 50, + (ushort)Items.DyeYellow => 50, + (ushort)Items.ItemBattery => 99, + _ => throw new System.Exception("Tool " + (Items)id + " not found in switch above"), + }; - case (ushort)Items.AxeStone: return 50; - case (ushort)Items.PickaxeStone: return 50; - case (ushort)Items.ShovelStone: return 50; - case (ushort)Items.HoeStone: return 50; - case (ushort)Items.HoeCopper: return 200; - case (ushort)Items.KnifeCopper: return 200; - case (ushort)Items.SawCopper: return 200; - case (ushort)Items.ShearsCopper: return 200; - case (ushort)Items.HammerCopper: return 200; - case (ushort)Items.PickaxeCopper: return 200; - case (ushort)Items.ShovelCopper: return 200; - case (ushort)Items.AxeCopper: return 200; - - case (ushort)Items.HammerBronze: return 250; - case (ushort)Items.HoeBronze: return 250; - case (ushort)Items.KnifeBronze: return 250; - case (ushort)Items.SawBronze: return 250; - case (ushort)Items.ShearsBronze: return 250; - case (ushort)Items.PickaxeBronze: return 250; - case (ushort)Items.ShovelBronze: return 250; - case (ushort)Items.AxeBronze: return 250; - - case (ushort)Items.AxeIron: return 300; - case (ushort)Items.HammerIron: return 300; - case (ushort)Items.HoeIron: return 300; - case (ushort)Items.PickaxeIron: return 300; - case (ushort)Items.ShovelIron: return 300; - case (ushort)Items.KnifeIron: return 300; - case (ushort)Items.SawIron: return 300; - case (ushort)Items.ShearsIron: return 300; - - case (ushort)Items.AxeSteel: return 350; - case (ushort)Items.HammerSteel: return 350; - case (ushort)Items.HoeSteel: return 350; - case (ushort)Items.PickaxeSteel: return 350; - case (ushort)Items.ShovelSteel: return 350; - case (ushort)Items.KnifeSteel: return 350; - case (ushort)Items.SawSteel: return 350; - case (ushort)Items.ShearsSteel: return 350; - - case (ushort)Items.AxeAluminium: return 150; - case (ushort)Items.HammerAluminium: return 150; - case (ushort)Items.HoeAluminium: return 150; - case (ushort)Items.PickaxeAluminium: return 150; - case (ushort)Items.ShovelAluminium: return 150; - case (ushort)Items.KnifeAluminium: return 150; - case (ushort)Items.SawAluminium: return 150; - case (ushort)Items.ShearsAluminium: return 150; - - case (ushort)Items.AxeGold: return 5; - case (ushort)Items.HammerGold: return 5; - case (ushort)Items.HoeGold: return 5; - case (ushort)Items.PickaxeGold: return 5; - case (ushort)Items.ShovelGold: return 5; - case (ushort)Items.KnifeGold: return 5; - case (ushort)Items.SawGold: return 5; - case (ushort)Items.ShearsGold: return 5; - - case (ushort)Items.ElectricDrill: return 400; - case (ushort)Items.ElectricSaw: return 400; - - case (ushort)Items.TorchElectricON: return 400; - - case (ushort)Items.Gun: return 1000; - case (ushort)Items.AirTank: return 1000; - case (ushort)Items.AirTank2: return 2000; - - case (ushort)Items.BucketWater: return 255; - case (ushort)Items.BucketOil: return 255; - case (ushort)Items.BottleOil: return 50; - case (ushort)Items.BottleWater: return 50; - - case (ushort)Items.TorchON : return 100; - - case (ushort)Items.DyeArmy: return 50; - case (ushort)Items.DyeBlack: return 50; - case (ushort)Items.DyeBlue: return 50; - case (ushort)Items.DyeBrown: return 50; - case (ushort)Items.DyeDarkBlue: return 50; - case (ushort)Items.DyeDarkGray: return 50; - case (ushort)Items.DyeDarkGreen: return 50; - case (ushort)Items.DyeDarkRed: return 50; - case (ushort)Items.DyeGold: return 50; - case (ushort)Items.DyeGray: return 50; - case (ushort)Items.DyeGreen: return 50; - case (ushort)Items.DyeLightBlue: return 50; - case (ushort)Items.DyeLightGray: return 50; - case (ushort)Items.DyeLightGreen: return 50; - case (ushort)Items.DyeMagenta: return 50; - case (ushort)Items.DyeOlive: return 50; - case (ushort)Items.DyeOrange: return 50; - case (ushort)Items.DyePink: return 50; - case (ushort)Items.DyePurple: return 50; - case (ushort)Items.DyeRed: return 50; - case (ushort)Items.DyeRoseQuartz: return 50; - case (ushort)Items.DyeSpringGreen: return 50; - case (ushort)Items.DyeTeal: return 50; - case (ushort)Items.DyeViolet: return 50; - case (ushort)Items.DyeWhite: return 50; - case (ushort)Items.DyeYellow: return 50; - case (ushort)Items.ItemBattery: return 99; - } - #if DEBUG - throw new System.Exception("Tool "+(Items)id+" not found in switch above"); - #else +#if DEBUG +#else return -1; - #endif +#endif } //public static int BurnWoodInFurnace(ushort id){ @@ -1007,425 +992,381 @@ static class GameMethods { //} public static bool IsCompostable(ushort id) { - switch (id) { - case (ushort)Items.Alore: return true; - case (ushort)Items.Apple: return true; - case (ushort)Items.AppleLeaves: return true; - case (ushort)Items.AppleLeavesWithApples: return true; - case (ushort)Items.AppleSapling: return true; - case (ushort)Items.Ash: return true; - case (ushort)Items.Banana: return true; - case (ushort)Items.Blueberries: return true; - case (ushort)Items.Boletus: return true; - case (ushort)Items.CactusBig: return true; - case (ushort)Items.CactusSmall: return true; - case (ushort)Items.Carrot: return true; - case (ushort)Items.Champignon: return true; - case (ushort)Items.Cherry: return true; - case (ushort)Items.CherryLeaves: return true; - case (ushort)Items.CherryLeavesWithCherries: return true; - case (ushort)Items.CherrySapling: return true; - case (ushort)Items.Cloth: return true; - case (ushort)Items.CoalDust: return true; - case (ushort)Items.Coral: return true; - case (ushort)Items.Dandelion: return true; - case (ushort)Items.FishMeat: return true; - case (ushort)Items.Flax: return true; - case (ushort)Items.FlaxSeeds: return true; - case (ushort)Items.GrassBlockClay: return true; - case (ushort)Items.GrassBlockDesert: return true; - case (ushort)Items.GrassBlockForest: return true; - case (ushort)Items.GrassBlockHills: return true; - case (ushort)Items.GrassBlockJungle: return true; - case (ushort)Items.GrassBlockPlains: return true; - case (ushort)Items.GrassDesert: return true; - case (ushort)Items.GrassForest: return true; - case (ushort)Items.GrassHills: return true; - case (ushort)Items.GrassJungle: return true; - case (ushort)Items.GrassPlains: return true; - case (ushort)Items.Hay: return true; - case (ushort)Items.HayBlock: return true; - case (ushort)Items.Heater: return true; - case (ushort)Items.Leave: return true; - case (ushort)Items.Lemon: return true; - case (ushort)Items.LemonLeaves: return true; - case (ushort)Items.LemonLeavesWithLemons: return true; - case (ushort)Items.LemonSapling: return true; - case (ushort)Items.LindenLeaves: return true; - case (ushort)Items.LindenSapling: return true; - case (ushort)Items.MudIngot: return true; - case (ushort)Items.OakLeaves: return true; - case (ushort)Items.OakSapling: return true; - case (ushort)Items.Onion: return true; - case (ushort)Items.Orange: return true; - case (ushort)Items.OrangeLeaves: return true; - case (ushort)Items.OrangeLeavesWithOranges: return true; - case (ushort)Items.OrangeSapling: return true; - case (ushort)Items.Paper: return true; - case (ushort)Items.Peas: return true; - case (ushort)Items.PineLeaves: return true; - case (ushort)Items.PineSapling: return true; - case (ushort)Items.PlantBlueberry: return true; - case (ushort)Items.PlantCarrot: return true; - case (ushort)Items.PlantOnion: return true; - case (ushort)Items.PlantOrchid: return true; - case (ushort)Items.PlantPeas: return true; - case (ushort)Items.PlantRashberry: return true; - case (ushort)Items.PlantRose: return true; - case (ushort)Items.PlantStrawberry: return true; - case (ushort)Items.PlantViolet: return true; - case (ushort)Items.Plum: return true; - case (ushort)Items.PlumLeaves: return true; - case (ushort)Items.PlumLeavesWithPlums: return true; - case (ushort)Items.PlumSapling: return true; - case (ushort)Items.RabbitMeat: return true; - case (ushort)Items.RabbitMeatCooked: return true; - case (ushort)Items.Rashberry: return true; - case (ushort)Items.Rope: return true; - case (ushort)Items.Seaweed: return true; - case (ushort)Items.Seeds: return true; - case (ushort)Items.Stick: return true; - case (ushort)Items.Sticks: return true; - case (ushort)Items.Strawberry: return true; - case (ushort)Items.SugarCane: return true; - case (ushort)Items.WheatStraw: return true; - case (ushort)Items.Yarn: return true; - case (ushort)Items.GrassBlockCompost: return true; - case (ushort)Items.Egg: return true; - case (ushort)Items.boiledEgg: return true; - case (ushort)Items.Saltpeter: return true; - default: return false; - } + return id switch { + (ushort)Items.Alore => true, + (ushort)Items.Apple => true, + (ushort)Items.AppleLeaves => true, + (ushort)Items.AppleLeavesWithApples => true, + (ushort)Items.AppleSapling => true, + (ushort)Items.Ash => true, + (ushort)Items.Banana => true, + (ushort)Items.Blueberries => true, + (ushort)Items.Boletus => true, + (ushort)Items.CactusBig => true, + (ushort)Items.CactusSmall => true, + (ushort)Items.Carrot => true, + (ushort)Items.Champignon => true, + (ushort)Items.Cherry => true, + (ushort)Items.CherryLeaves => true, + (ushort)Items.CherryLeavesWithCherries => true, + (ushort)Items.CherrySapling => true, + (ushort)Items.Cloth => true, + (ushort)Items.CoalDust => true, + (ushort)Items.Coral => true, + (ushort)Items.Dandelion => true, + (ushort)Items.FishMeat => true, + (ushort)Items.Flax => true, + (ushort)Items.FlaxSeeds => true, + (ushort)Items.GrassBlockClay => true, + (ushort)Items.GrassBlockDesert => true, + (ushort)Items.GrassBlockForest => true, + (ushort)Items.GrassBlockHills => true, + (ushort)Items.GrassBlockJungle => true, + (ushort)Items.GrassBlockPlains => true, + (ushort)Items.GrassDesert => true, + (ushort)Items.GrassForest => true, + (ushort)Items.GrassHills => true, + (ushort)Items.GrassJungle => true, + (ushort)Items.GrassPlains => true, + (ushort)Items.Hay => true, + (ushort)Items.HayBlock => true, + (ushort)Items.Heater => true, + (ushort)Items.Leave => true, + (ushort)Items.Lemon => true, + (ushort)Items.LemonLeaves => true, + (ushort)Items.LemonLeavesWithLemons => true, + (ushort)Items.LemonSapling => true, + (ushort)Items.LindenLeaves => true, + (ushort)Items.LindenSapling => true, + (ushort)Items.MudIngot => true, + (ushort)Items.OakLeaves => true, + (ushort)Items.OakSapling => true, + (ushort)Items.Onion => true, + (ushort)Items.Orange => true, + (ushort)Items.OrangeLeaves => true, + (ushort)Items.OrangeLeavesWithOranges => true, + (ushort)Items.OrangeSapling => true, + (ushort)Items.Paper => true, + (ushort)Items.Peas => true, + (ushort)Items.PineLeaves => true, + (ushort)Items.PineSapling => true, + (ushort)Items.PlantBlueberry => true, + (ushort)Items.PlantCarrot => true, + (ushort)Items.PlantOnion => true, + (ushort)Items.PlantOrchid => true, + (ushort)Items.PlantPeas => true, + (ushort)Items.PlantRashberry => true, + (ushort)Items.PlantRose => true, + (ushort)Items.PlantStrawberry => true, + (ushort)Items.PlantViolet => true, + (ushort)Items.Plum => true, + (ushort)Items.PlumLeaves => true, + (ushort)Items.PlumLeavesWithPlums => true, + (ushort)Items.PlumSapling => true, + (ushort)Items.RabbitMeat => true, + (ushort)Items.RabbitMeatCooked => true, + (ushort)Items.Rashberry => true, + (ushort)Items.Rope => true, + (ushort)Items.Seaweed => true, + (ushort)Items.Seeds => true, + (ushort)Items.Stick => true, + (ushort)Items.Sticks => true, + (ushort)Items.Strawberry => true, + (ushort)Items.SugarCane => true, + (ushort)Items.WheatStraw => true, + (ushort)Items.Yarn => true, + (ushort)Items.GrassBlockCompost => true, + (ushort)Items.Egg => true, + (ushort)Items.boiledEgg => true, + (ushort)Items.Saltpeter => true, + _ => false, + }; } - public static bool IsLeave(ushort id) { - switch (id) { + public static bool IsLeave(ushort id) { + return id switch { // Frequent leaves - case (ushort)BlockId.SpruceLeaves: return true; - + (ushort)BlockId.SpruceLeaves => true, // Frequent branches - case (ushort)BlockId.OakBranches: return true; - case (ushort)BlockId.LindenBranches: return true; - case (ushort)BlockId.WillowBranches: return true; - + (ushort)BlockId.OakBranches => true, + (ushort)BlockId.LindenBranches => true, + (ushort)BlockId.WillowBranches => true, // Fruit branches - case (ushort)BlockId.AppleBranches: return true; - case (ushort)BlockId.CherryBranches: return true; - case (ushort)BlockId.PlumBranches: return true; - + (ushort)BlockId.AppleBranches => true, + (ushort)BlockId.CherryBranches => true, + (ushort)BlockId.PlumBranches => true, // Non-frequent leaves - case (ushort)BlockId.WillowLeaves: return true; - case (ushort)BlockId.OakLeaves: return true; - case (ushort)BlockId.LindenLeaves: return true; - + (ushort)BlockId.WillowLeaves => true, + (ushort)BlockId.OakLeaves => true, + (ushort)BlockId.LindenLeaves => true, // Fruit leaves - case (ushort)BlockId.AppleLeaves: return true; - case (ushort)BlockId.AppleLeavesBlossom: return true; - case (ushort)BlockId.AppleLeavesWithApples: return true; - - case (ushort)BlockId.CherryLeaves: return true; - case (ushort)BlockId.CherryLeavesBlossom: return true; - case (ushort)BlockId.CherryLeavesWithCherries: return true; - - case (ushort)BlockId.PlumLeaves: return true; - case (ushort)BlockId.PlumLeavesBlossom: return true; - case (ushort)BlockId.PlumLeavesWithPlums: return true; - + (ushort)BlockId.AppleLeaves => true, + (ushort)BlockId.AppleLeavesBlossom => true, + (ushort)BlockId.AppleLeavesWithApples => true, + (ushort)BlockId.CherryLeaves => true, + (ushort)BlockId.CherryLeavesBlossom => true, + (ushort)BlockId.CherryLeavesWithCherries => true, + (ushort)BlockId.PlumLeaves => true, + (ushort)BlockId.PlumLeavesBlossom => true, + (ushort)BlockId.PlumLeavesWithPlums => true, // Leaves in Hot biomes - case (ushort)BlockId.OrangeLeaves: return true; - case (ushort)BlockId.OrangeLeavesWithOranges: return true; - - case (ushort)BlockId.OliveLeaves: return true; - case (ushort)BlockId.OliveLeavesWithOlives: return true; - - case (ushort)BlockId.LemonLeaves: return true; - case (ushort)BlockId.LemonLeavesWithLemons: return true; - - case (ushort)BlockId.PineLeaves: return true; - case (ushort)BlockId.AcaciaLeaves: return true; - case (ushort)BlockId.EucalyptusLeaves: return true; - case (ushort)BlockId.MangroveLeaves: return true; - - case (ushort)BlockId.RubberTreeLeaves: return true; - - case (ushort)BlockId.KapokLeaves: return true; - case (ushort)BlockId.KapokLeacesFlowering: return true; - case (ushort)BlockId.KapokLeacesFibre: return true; - - } - return false; + (ushort)BlockId.OrangeLeaves => true, + (ushort)BlockId.OrangeLeavesWithOranges => true, + (ushort)BlockId.OliveLeaves => true, + (ushort)BlockId.OliveLeavesWithOlives => true, + (ushort)BlockId.LemonLeaves => true, + (ushort)BlockId.LemonLeavesWithLemons => true, + (ushort)BlockId.PineLeaves => true, + (ushort)BlockId.AcaciaLeaves => true, + (ushort)BlockId.EucalyptusLeaves => true, + (ushort)BlockId.MangroveLeaves => true, + (ushort)BlockId.RubberTreeLeaves => true, + (ushort)BlockId.KapokLeaves => true, + (ushort)BlockId.KapokLeacesFlowering => true, + (ushort)BlockId.KapokLeacesFibre => true, + _ => false, + }; } #region Blocks from Items public static ushort BackBlockFromItem(ushort item) { - switch (item) { - + return item switch { // Blocks - case (ushort)Items.Lava: return (ushort)BlockId.Lava; - + (ushort)Items.Lava => (ushort)BlockId.Lava, // Backs - case (ushort)Items.BackCobblestone: return (ushort)BlockId.BackCobblestone; - case (ushort)Items.BackSand: return (ushort)BlockId.BackSand; - case (ushort)Items.BackDirt: return (ushort)BlockId.BackDirt; - case (ushort)Items.BackAluminium: return (ushort)BlockId.BackAluminium; - case (ushort)Items.BackAnorthosite: return (ushort)BlockId.BackAnorthosite; - case (ushort)Items.BackBasalt: return (ushort)BlockId.BackBasalt; - case (ushort)Items.BackClay: return (ushort)BlockId.BackClay; - case (ushort)Items.BackCoal: return (ushort)BlockId.BackCoal; - case (ushort)Items.BackCopper: return (ushort)BlockId.BackCopper; - case (ushort)Items.BackDiorit: return (ushort)BlockId.BackDiorit; - case (ushort)Items.BackDolomite: return (ushort)BlockId.BackDolomite; - case (ushort)Items.BackFlint: return (ushort)BlockId.BackFlint; - case (ushort)Items.BackGabbro: return (ushort)BlockId.BackGabbro; - case (ushort)Items.BackGneiss: return (ushort)BlockId.BackGneiss; - case (ushort)Items.BackGold: return (ushort)BlockId.BackGold; - case (ushort)Items.BackGravel: return (ushort)BlockId.BackGravel; - case (ushort)Items.BackIron: return (ushort)BlockId.BackIron; - case (ushort)Items.BackLimestone: return (ushort)BlockId.BackLimestone; - case (ushort)Items.BackMudstone: return (ushort)BlockId.BackMudstone; - case (ushort)Items.BackRedSand: return (ushort)BlockId.BackRedSand; - case (ushort)Items.BackRegolite: return (ushort)BlockId.BackRegolite; - case (ushort)Items.BackRhyolite: return (ushort)BlockId.BackRhyolite; - case (ushort)Items.BackSaltpeter: return (ushort)BlockId.BackSaltpeter; - case (ushort)Items.BackSandstone: return (ushort)BlockId.BackSandstone; - case (ushort)Items.BackSchist: return (ushort)BlockId.BackSchist; - case (ushort)Items.BackSilver: return (ushort)BlockId.BackSilver; - case (ushort)Items.BackSulfur: return (ushort)BlockId.BackSulfur; - case (ushort)Items.BackTin: return (ushort)BlockId.BackTin; - + (ushort)Items.BackCobblestone => (ushort)BlockId.BackCobblestone, + (ushort)Items.BackSand => (ushort)BlockId.BackSand, + (ushort)Items.BackDirt => (ushort)BlockId.BackDirt, + (ushort)Items.BackAluminium => (ushort)BlockId.BackAluminium, + (ushort)Items.BackAnorthosite => (ushort)BlockId.BackAnorthosite, + (ushort)Items.BackBasalt => (ushort)BlockId.BackBasalt, + (ushort)Items.BackClay => (ushort)BlockId.BackClay, + (ushort)Items.BackCoal => (ushort)BlockId.BackCoal, + (ushort)Items.BackCopper => (ushort)BlockId.BackCopper, + (ushort)Items.BackDiorit => (ushort)BlockId.BackDiorit, + (ushort)Items.BackDolomite => (ushort)BlockId.BackDolomite, + (ushort)Items.BackFlint => (ushort)BlockId.BackFlint, + (ushort)Items.BackGabbro => (ushort)BlockId.BackGabbro, + (ushort)Items.BackGneiss => (ushort)BlockId.BackGneiss, + (ushort)Items.BackGold => (ushort)BlockId.BackGold, + (ushort)Items.BackGravel => (ushort)BlockId.BackGravel, + (ushort)Items.BackIron => (ushort)BlockId.BackIron, + (ushort)Items.BackLimestone => (ushort)BlockId.BackLimestone, + (ushort)Items.BackMudstone => (ushort)BlockId.BackMudstone, + (ushort)Items.BackRedSand => (ushort)BlockId.BackRedSand, + (ushort)Items.BackRegolite => (ushort)BlockId.BackRegolite, + (ushort)Items.BackRhyolite => (ushort)BlockId.BackRhyolite, + (ushort)Items.BackSaltpeter => (ushort)BlockId.BackSaltpeter, + (ushort)Items.BackSandstone => (ushort)BlockId.BackSandstone, + (ushort)Items.BackSchist => (ushort)BlockId.BackSchist, + (ushort)Items.BackSilver => (ushort)BlockId.BackSilver, + (ushort)Items.BackSulfur => (ushort)BlockId.BackSulfur, + (ushort)Items.BackTin => (ushort)BlockId.BackTin, // Wood - case (ushort)Items.WoodApple: return (ushort)BlockId.AppleWood; - case (ushort)Items.WoodCherry: return (ushort)BlockId.CherryWood; - case (ushort)Items.WoodLemon: return (ushort)BlockId.LemonWood; - case (ushort)Items.WoodLinden: return (ushort)BlockId.LindenWood; - case (ushort)Items.WoodOak: return (ushort)BlockId.OakWood; - case (ushort)Items.WoodOrange: return (ushort)BlockId.OrangeWood; - case (ushort)Items.WoodPine: return (ushort)BlockId.PineWood; - case (ushort)Items.WoodPlum: return (ushort)BlockId.PlumWood; - case (ushort)Items.WoodSpruce: return (ushort)BlockId.SpruceWood; - case (ushort)Items.AcaciaWood: return (ushort)BlockId.AcaciaWood; - case (ushort)Items.EucalyptusWood: return (ushort)BlockId.EucalyptusWood; - case (ushort)Items.KapokWood: return (ushort)BlockId.KapokWood; - case (ushort)Items.MangroveWood: return (ushort)BlockId.MangroveWood; - case (ushort)Items.OliveWood: return (ushort)BlockId.OliveWood; - case (ushort)Items.RubberTreeWood: return (ushort)BlockId.RubberTreeWood; - case (ushort)Items.WillowWood: return (ushort)BlockId.WillowWood; - - - case (ushort)Items.Glass: return (ushort)BlockId.Glass; - case (ushort)Items.AdvancedSpaceBack: return (ushort)BlockId.AdvancedSpaceBack; - case (ushort)Items.AdvancedSpaceWindow: return (ushort)BlockId.AdvancedSpaceWindow; - } - - return (ushort)BlockId.None; + (ushort)Items.WoodApple => (ushort)BlockId.AppleWood, + (ushort)Items.WoodCherry => (ushort)BlockId.CherryWood, + (ushort)Items.WoodLemon => (ushort)BlockId.LemonWood, + (ushort)Items.WoodLinden => (ushort)BlockId.LindenWood, + (ushort)Items.WoodOak => (ushort)BlockId.OakWood, + (ushort)Items.WoodOrange => (ushort)BlockId.OrangeWood, + (ushort)Items.WoodPine => (ushort)BlockId.PineWood, + (ushort)Items.WoodPlum => (ushort)BlockId.PlumWood, + (ushort)Items.WoodSpruce => (ushort)BlockId.SpruceWood, + (ushort)Items.AcaciaWood => (ushort)BlockId.AcaciaWood, + (ushort)Items.EucalyptusWood => (ushort)BlockId.EucalyptusWood, + (ushort)Items.KapokWood => (ushort)BlockId.KapokWood, + (ushort)Items.MangroveWood => (ushort)BlockId.MangroveWood, + (ushort)Items.OliveWood => (ushort)BlockId.OliveWood, + (ushort)Items.RubberTreeWood => (ushort)BlockId.RubberTreeWood, + (ushort)Items.WillowWood => (ushort)BlockId.WillowWood, + (ushort)Items.Glass => (ushort)BlockId.Glass, + (ushort)Items.AdvancedSpaceBack => (ushort)BlockId.AdvancedSpaceBack, + (ushort)Items.AdvancedSpaceWindow => (ushort)BlockId.AdvancedSpaceWindow, + _ => (ushort)BlockId.None, + }; } public static ushort SolidBlockFromItem(ushort item) { - switch (item) { + return item switch { // Stone - case (ushort)Items.StoneBasalt: return (ushort)BlockId.StoneBasalt; - case (ushort)Items.StoneDiorit: return (ushort)BlockId.StoneDiorit; - case (ushort)Items.StoneDolomite: return (ushort)BlockId.StoneDolomite; - case (ushort)Items.StoneGabbro: return (ushort)BlockId.StoneGabbro; - case (ushort)Items.StoneGneiss: return (ushort)BlockId.StoneGneiss; - case (ushort)Items.StoneLimestone: return (ushort)BlockId.StoneLimestone; - case (ushort)Items.StoneRhyolite: return (ushort)BlockId.StoneRhyolite; - case (ushort)Items.StoneSandstone: return (ushort)BlockId.StoneSandstone; - case (ushort)Items.StoneSchist: return (ushort)BlockId.StoneSchist; - + (ushort)Items.StoneBasalt => (ushort)BlockId.StoneBasalt, + (ushort)Items.StoneDiorit => (ushort)BlockId.StoneDiorit, + (ushort)Items.StoneDolomite => (ushort)BlockId.StoneDolomite, + (ushort)Items.StoneGabbro => (ushort)BlockId.StoneGabbro, + (ushort)Items.StoneGneiss => (ushort)BlockId.StoneGneiss, + (ushort)Items.StoneLimestone => (ushort)BlockId.StoneLimestone, + (ushort)Items.StoneRhyolite => (ushort)BlockId.StoneRhyolite, + (ushort)Items.StoneSandstone => (ushort)BlockId.StoneSandstone, + (ushort)Items.StoneSchist => (ushort)BlockId.StoneSchist, // Ore - case (ushort)Items.OreAluminium: return (ushort)BlockId.OreAluminium; - case (ushort)Items.OreCopper: return (ushort)BlockId.OreCopper; - case (ushort)Items.OreGold: return (ushort)BlockId.OreGold; - case (ushort)Items.OreIron: return (ushort)BlockId.OreIron; - case (ushort)Items.OreSilver: return (ushort)BlockId.OreSilver; - case (ushort)Items.OreTin: return (ushort)BlockId.OreTin; - case (ushort)Items.OreCoal: return (ushort)BlockId.OreCoal; - case (ushort)Items.OreSulfur: return (ushort)BlockId.OreSulfur; - case (ushort)Items.OreSaltpeter: return (ushort)BlockId.OreSaltpeter; - + (ushort)Items.OreAluminium => (ushort)BlockId.OreAluminium, + (ushort)Items.OreCopper => (ushort)BlockId.OreCopper, + (ushort)Items.OreGold => (ushort)BlockId.OreGold, + (ushort)Items.OreIron => (ushort)BlockId.OreIron, + (ushort)Items.OreSilver => (ushort)BlockId.OreSilver, + (ushort)Items.OreTin => (ushort)BlockId.OreTin, + (ushort)Items.OreCoal => (ushort)BlockId.OreCoal, + (ushort)Items.OreSulfur => (ushort)BlockId.OreSulfur, + (ushort)Items.OreSaltpeter => (ushort)BlockId.OreSaltpeter, // Blocks - case (ushort)Items.Dirt: return (ushort)BlockId.Dirt; - case (ushort)Items.Gravel: return (ushort)BlockId.Gravel; - case (ushort)Items.Stonerubble: return (ushort)BlockId.Cobblestone; - case (ushort)Items.Sand: return (ushort)BlockId.Sand; - case (ushort)Items.Ice: return (ushort)BlockId.Ice; - case (ushort)Items.Compost: return (ushort)BlockId.Compost; - + (ushort)Items.Dirt => (ushort)BlockId.Dirt, + (ushort)Items.Gravel => (ushort)BlockId.Gravel, + (ushort)Items.Stonerubble => (ushort)BlockId.Cobblestone, + (ushort)Items.Sand => (ushort)BlockId.Sand, + (ushort)Items.Ice => (ushort)BlockId.Ice, + (ushort)Items.Compost => (ushort)BlockId.Compost, // Grass - case (ushort)Items.GrassBlockDesert: return (ushort)BlockId.GrassBlockDesert; - case (ushort)Items.GrassBlockForest: return (ushort)BlockId.GrassBlockForest; - case (ushort)Items.GrassBlockHills: return (ushort)BlockId.GrassBlockHills; - case (ushort)Items.GrassBlockJungle: return (ushort)BlockId.GrassBlockJungle; - case (ushort)Items.GrassBlockPlains: return (ushort)BlockId.GrassBlockPlains; - case (ushort)Items.GrassBlockCompost: return (ushort)BlockId.GrassBlockCompost; - + (ushort)Items.GrassBlockDesert => (ushort)BlockId.GrassBlockDesert, + (ushort)Items.GrassBlockForest => (ushort)BlockId.GrassBlockForest, + (ushort)Items.GrassBlockHills => (ushort)BlockId.GrassBlockHills, + (ushort)Items.GrassBlockJungle => (ushort)BlockId.GrassBlockJungle, + (ushort)Items.GrassBlockPlains => (ushort)BlockId.GrassBlockPlains, + (ushort)Items.GrassBlockCompost => (ushort)BlockId.GrassBlockCompost, // Artifical - case (ushort)Items.Roof1: return (ushort)BlockId.Roof1; - case (ushort)Items.Roof2: return (ushort)BlockId.Roof2; - case (ushort)Items.Bricks: return (ushort)BlockId.Bricks; - - case (ushort)Items.Door: return (ushort)BlockId.DoorClose; - case (ushort)Items.Planks: return (ushort)BlockId.Planks; - - case (ushort)Items.AdvancedSpaceBlock: return (ushort)BlockId.AdvancedSpaceBlock; - case (ushort)Items.AdvancedSpaceFloor: return (ushort)BlockId.AdvancedSpaceFloor; - case (ushort)Items.AdvancedSpacePart1: return (ushort)BlockId.AdvancedSpacePart1; - case (ushort)Items.AdvancedSpacePart2: return (ushort)BlockId.AdvancedSpacePart2; - case (ushort)Items.AdvancedSpacePart3: return (ushort)BlockId.AdvancedSpacePart3; - case (ushort)Items.AdvancedSpacePart4: return (ushort)BlockId.AdvancedSpacePart4; - - case (ushort)Items.Snow: return (ushort)BlockId.Snow; - - } - - return (ushort)BlockId.None; + (ushort)Items.Roof1 => (ushort)BlockId.Roof1, + (ushort)Items.Roof2 => (ushort)BlockId.Roof2, + (ushort)Items.Bricks => (ushort)BlockId.Bricks, + (ushort)Items.Door => (ushort)BlockId.DoorClose, + (ushort)Items.Planks => (ushort)BlockId.Planks, + (ushort)Items.AdvancedSpaceBlock => (ushort)BlockId.AdvancedSpaceBlock, + (ushort)Items.AdvancedSpaceFloor => (ushort)BlockId.AdvancedSpaceFloor, + (ushort)Items.AdvancedSpacePart1 => (ushort)BlockId.AdvancedSpacePart1, + (ushort)Items.AdvancedSpacePart2 => (ushort)BlockId.AdvancedSpacePart2, + (ushort)Items.AdvancedSpacePart3 => (ushort)BlockId.AdvancedSpacePart3, + (ushort)Items.AdvancedSpacePart4 => (ushort)BlockId.AdvancedSpacePart4, + (ushort)Items.Snow => (ushort)BlockId.Snow, + _ => (ushort)BlockId.None, + }; } public static ushort TopBlockFromItem(ushort item) { - switch (item) { - case (ushort)Items.ChristmasStar: return (ushort)BlockId.ChristmasStar; - - case (ushort)Items.Egg: return (ushort)BlockId.EggDrop; - case (ushort)Items.BucketForRubber: return (ushort)BlockId.BucketForRubber; - case (ushort)Items.Shelf: return (ushort)BlockId.Shelf; - case (ushort)Items.Barrel: return (ushort)BlockId.Barrel; - case (ushort)Items.BoxWooden: return (ushort)BlockId.BoxWooden; - case (ushort)Items.BoxAdv: return (ushort)BlockId.BoxAdv; - case (ushort)Items.OxygenMachine: return (ushort)BlockId.OxygenMachine; - + return item switch { + (ushort)Items.ChristmasStar => (ushort)BlockId.ChristmasStar, + (ushort)Items.Egg => (ushort)BlockId.EggDrop, + (ushort)Items.BucketForRubber => (ushort)BlockId.BucketForRubber, + (ushort)Items.Shelf => (ushort)BlockId.Shelf, + (ushort)Items.Barrel => (ushort)BlockId.Barrel, + (ushort)Items.BoxWooden => (ushort)BlockId.BoxWooden, + (ushort)Items.BoxAdv => (ushort)BlockId.BoxAdv, + (ushort)Items.OxygenMachine => (ushort)BlockId.OxygenMachine, // Leaves - case (ushort)Items.AppleLeaves: return (ushort)BlockId.AppleLeaves; - case (ushort)Items.LemonLeavesWithLemons: return (ushort)BlockId.LemonLeavesWithLemons; - case (ushort)Items.LindenLeaves: return (ushort)BlockId.LindenLeaves; - case (ushort)Items.OakLeaves: return (ushort)BlockId.OakLeaves; - case (ushort)Items.OrangeLeaves: return (ushort)BlockId.OrangeLeaves; - case (ushort)Items.SpruceLeaves: return (ushort)BlockId.SpruceLeaves; - case (ushort)Items.PlumLeavesWithPlums: return (ushort)BlockId.PlumLeavesWithPlums; - case (ushort)Items.PlumLeaves: return (ushort)BlockId.PlumLeaves; - case (ushort)Items.PineLeaves: return (ushort)BlockId.PineLeaves; - case (ushort)Items.OrangeLeavesWithOranges: return (ushort)BlockId.OrangeLeavesWithOranges; - case (ushort)Items.AppleLeavesWithApples: return (ushort)BlockId.AppleLeavesWithApples; - case (ushort)Items.CherryLeaves: return (ushort)BlockId.CherryLeaves; - case (ushort)Items.CherryLeavesWithCherries: return (ushort)BlockId.CherryLeavesWithCherries; - case (ushort)Items.LemonLeaves: return (ushort)BlockId.LemonLeaves; - - case (ushort)Items.WillowLeaves: return (ushort)BlockId.WillowLeaves; - case (ushort)Items.WillowWood: return (ushort)BlockId.WillowWood; - case (ushort)Items.MangroveLeaves: return (ushort)BlockId.MangroveLeaves; - case (ushort)Items.MangroveWood: return (ushort)BlockId.MangroveWood; - case (ushort)Items.EucalyptusLeaves: return (ushort)BlockId.EucalyptusLeaves; - case (ushort)Items.EucalyptusWood: return (ushort)BlockId.EucalyptusWood; - case (ushort)Items.OliveLeavesWithOlives: return (ushort)BlockId.OliveLeavesWithOlives; - case (ushort)Items.OliveLeaves: return (ushort)BlockId.OliveLeaves; - case (ushort)Items.OliveWood: return (ushort)BlockId.OliveWood; - case (ushort)Items.RubberTreeLeaves: return (ushort)BlockId.RubberTreeLeaves; - case (ushort)Items.RubberTreeWood: return (ushort)BlockId.RubberTreeWood; - case (ushort)Items.AcaciaLeaves: return (ushort)BlockId.AcaciaLeaves; - case (ushort)Items.AcaciaWood: return (ushort)BlockId.AcaciaWood; - case (ushort)Items.KapokLeacesFlowering: return (ushort)BlockId.KapokLeacesFlowering; - case (ushort)Items.KapokLeavesFibre: return (ushort)BlockId.KapokLeacesFibre; - case (ushort)Items.KapokLeaves: return (ushort)BlockId.KapokLeaves; - case (ushort)Items.KapokWood: return (ushort)BlockId.KapokWood; - case (ushort)Items.WillowSapling: return (ushort)BlockId.WillowSapling; - case (ushort)Items.MangroveSapling: return (ushort)BlockId.MangroveSapling; - case (ushort)Items.EucalyptusSapling: return (ushort)BlockId.EucalyptusSapling; - case (ushort)Items.OliveSapling: return (ushort)BlockId.OliveSapling; - case (ushort)Items.RubberTreeSapling: return (ushort)BlockId.RubberTreeSapling; - case (ushort)Items.AcaciaSapling: return (ushort)BlockId.AcaciaSapling; - case (ushort)Items.KapokSapling: return (ushort)BlockId.KapokSapling; - + (ushort)Items.AppleLeaves => (ushort)BlockId.AppleLeaves, + (ushort)Items.LemonLeavesWithLemons => (ushort)BlockId.LemonLeavesWithLemons, + (ushort)Items.LindenLeaves => (ushort)BlockId.LindenLeaves, + (ushort)Items.OakLeaves => (ushort)BlockId.OakLeaves, + (ushort)Items.OrangeLeaves => (ushort)BlockId.OrangeLeaves, + (ushort)Items.SpruceLeaves => (ushort)BlockId.SpruceLeaves, + (ushort)Items.PlumLeavesWithPlums => (ushort)BlockId.PlumLeavesWithPlums, + (ushort)Items.PlumLeaves => (ushort)BlockId.PlumLeaves, + (ushort)Items.PineLeaves => (ushort)BlockId.PineLeaves, + (ushort)Items.OrangeLeavesWithOranges => (ushort)BlockId.OrangeLeavesWithOranges, + (ushort)Items.AppleLeavesWithApples => (ushort)BlockId.AppleLeavesWithApples, + (ushort)Items.CherryLeaves => (ushort)BlockId.CherryLeaves, + (ushort)Items.CherryLeavesWithCherries => (ushort)BlockId.CherryLeavesWithCherries, + (ushort)Items.LemonLeaves => (ushort)BlockId.LemonLeaves, + (ushort)Items.WillowLeaves => (ushort)BlockId.WillowLeaves, + (ushort)Items.WillowWood => (ushort)BlockId.WillowWood, + (ushort)Items.MangroveLeaves => (ushort)BlockId.MangroveLeaves, + (ushort)Items.MangroveWood => (ushort)BlockId.MangroveWood, + (ushort)Items.EucalyptusLeaves => (ushort)BlockId.EucalyptusLeaves, + (ushort)Items.EucalyptusWood => (ushort)BlockId.EucalyptusWood, + (ushort)Items.OliveLeavesWithOlives => (ushort)BlockId.OliveLeavesWithOlives, + (ushort)Items.OliveLeaves => (ushort)BlockId.OliveLeaves, + (ushort)Items.OliveWood => (ushort)BlockId.OliveWood, + (ushort)Items.RubberTreeLeaves => (ushort)BlockId.RubberTreeLeaves, + (ushort)Items.RubberTreeWood => (ushort)BlockId.RubberTreeWood, + (ushort)Items.AcaciaLeaves => (ushort)BlockId.AcaciaLeaves, + (ushort)Items.AcaciaWood => (ushort)BlockId.AcaciaWood, + (ushort)Items.KapokLeacesFlowering => (ushort)BlockId.KapokLeacesFlowering, + (ushort)Items.KapokLeavesFibre => (ushort)BlockId.KapokLeacesFibre, + (ushort)Items.KapokLeaves => (ushort)BlockId.KapokLeaves, + (ushort)Items.KapokWood => (ushort)BlockId.KapokWood, + (ushort)Items.WillowSapling => (ushort)BlockId.WillowSapling, + (ushort)Items.MangroveSapling => (ushort)BlockId.MangroveSapling, + (ushort)Items.EucalyptusSapling => (ushort)BlockId.EucalyptusSapling, + (ushort)Items.OliveSapling => (ushort)BlockId.OliveSapling, + (ushort)Items.RubberTreeSapling => (ushort)BlockId.RubberTreeSapling, + (ushort)Items.AcaciaSapling => (ushort)BlockId.AcaciaSapling, + (ushort)Items.KapokSapling => (ushort)BlockId.KapokSapling, // Blocks - case (ushort)Items.SnowTop: return (ushort)BlockId.SnowTop; - case (ushort)Items.Glass: return (ushort)BlockId.Glass; - case (ushort)Items.Oil: return (ushort)BlockId.Oil; - case (ushort)Items.BucketWater: return (ushort)BlockId.WaterBlock; - case (ushort)Items.Stick: return (ushort)BlockId.BranchWithout; - + (ushort)Items.SnowTop => (ushort)BlockId.SnowTop, + (ushort)Items.Glass => (ushort)BlockId.Glass, + (ushort)Items.Oil => (ushort)BlockId.Oil, + (ushort)Items.BucketWater => (ushort)BlockId.WaterBlock, + (ushort)Items.Stick => (ushort)BlockId.BranchWithout, // Saplings - case (ushort)Items.AppleSapling: return (ushort)BlockId.AppleSapling; - case (ushort)Items.OrangeSapling: return (ushort)BlockId.OrangeSapling; - case (ushort)Items.PineSapling: return (ushort)BlockId.PineSapling; - case (ushort)Items.CherrySapling: return (ushort)BlockId.CherrySapling; - case (ushort)Items.PlumSapling: return (ushort)BlockId.PlumSapling; - case (ushort)Items.LemonSapling: return (ushort)BlockId.LemonSapling; - - case (ushort)Items.OakSapling: return (ushort)BlockId.OakSapling; - case (ushort)Items.SpruceSapling: return (ushort)BlockId.SpruceSapling; - case (ushort)Items.LindenSapling: return (ushort)BlockId.LindenSapling; - + (ushort)Items.AppleSapling => (ushort)BlockId.AppleSapling, + (ushort)Items.OrangeSapling => (ushort)BlockId.OrangeSapling, + (ushort)Items.PineSapling => (ushort)BlockId.PineSapling, + (ushort)Items.CherrySapling => (ushort)BlockId.CherrySapling, + (ushort)Items.PlumSapling => (ushort)BlockId.PlumSapling, + (ushort)Items.LemonSapling => (ushort)BlockId.LemonSapling, + (ushort)Items.OakSapling => (ushort)BlockId.OakSapling, + (ushort)Items.SpruceSapling => (ushort)BlockId.SpruceSapling, + (ushort)Items.LindenSapling => (ushort)BlockId.LindenSapling, // Flowers - case (ushort)Items.Alore: return (ushort)BlockId.Alore; - case (ushort)Items.PlantRose: return (ushort)BlockId.Rose; - case (ushort)Items.PlantViolet: return (ushort)BlockId.Violet; - case (ushort)Items.Dandelion: return (ushort)BlockId.Dandelion; - case (ushort)Items.PlantOrchid: return (ushort)BlockId.Orchid; - case (ushort)Items.CactusBig: return (ushort)BlockId.CactusBig; - case (ushort)Items.CactusSmall: return (ushort)BlockId.CactusSmall; - + (ushort)Items.Alore => (ushort)BlockId.Alore, + (ushort)Items.PlantRose => (ushort)BlockId.Rose, + (ushort)Items.PlantViolet => (ushort)BlockId.Violet, + (ushort)Items.Dandelion => (ushort)BlockId.Dandelion, + (ushort)Items.PlantOrchid => (ushort)BlockId.Orchid, + (ushort)Items.CactusBig => (ushort)BlockId.CactusBig, + (ushort)Items.CactusSmall => (ushort)BlockId.CactusSmall, // Grass - case (ushort)Items.GrassDesert: return (ushort)BlockId.GrassDesert; - case (ushort)Items.GrassForest: return (ushort)BlockId.GrassForest; - case (ushort)Items.GrassHills: return (ushort)BlockId.GrassHills; - case (ushort)Items.GrassJungle: return (ushort)BlockId.GrassJungle; - case (ushort)Items.GrassPlains: return (ushort)BlockId.GrassPlains; - + (ushort)Items.GrassDesert => (ushort)BlockId.GrassDesert, + (ushort)Items.GrassForest => (ushort)BlockId.GrassForest, + (ushort)Items.GrassHills => (ushort)BlockId.GrassHills, + (ushort)Items.GrassJungle => (ushort)BlockId.GrassJungle, + (ushort)Items.GrassPlains => (ushort)BlockId.GrassPlains, // Artifical Blocks - case (ushort)Items.Door: return (ushort)BlockId.DoorOpen; - + (ushort)Items.Door => (ushort)BlockId.DoorOpen, // Mechanical - case (ushort)Items.Desk: return (ushort)BlockId.Desk; - case (ushort)Items.Flag: return (ushort)BlockId.Flag; - case (ushort)Items.Ladder: return (ushort)BlockId.Ladder; - case (ushort)Items.TorchON: return (ushort)BlockId.BurningTorch; - + (ushort)Items.Desk => (ushort)BlockId.Desk, + (ushort)Items.Flag => (ushort)BlockId.Flag, + (ushort)Items.Ladder => (ushort)BlockId.Ladder, + (ushort)Items.TorchON => (ushort)BlockId.BurningTorch, // Electrical - case (ushort)Items.Lamp: return (ushort)BlockId.Lamp; - case (ushort)Items.Radio: return (ushort)BlockId.Radio; - case (ushort)Items.WindMill: return (ushort)BlockId.Windmill; - case (ushort)Items.Label: return (ushort)BlockId.Label; - case (ushort)Items.Rocket: return (ushort)BlockId.Rocket; - case (ushort)Items.SewingMachine: return (ushort)BlockId.SewingMachine; - - case (ushort)Items.FurnaceElectric: return (ushort)BlockId.FurnaceElectric; - case (ushort)Items.Macerator: return (ushort)BlockId.Macerator; - case (ushort)Items.WaterMill: return (ushort)BlockId.Watermill; - case (ushort)Items.SolarPanel: return (ushort)BlockId.SolarPanel; - case (ushort)Items.Miner: return (ushort)BlockId.Miner; - case (ushort)Items.Charger: return (ushort)BlockId.Charger; - case (ushort)Items.FurnaceStone: return (ushort)BlockId.FurnaceStone; - case (ushort)Items.Composter: return (ushort)BlockId.Composter; - } - - return (ushort)BlockId.None; + (ushort)Items.Lamp => (ushort)BlockId.Lamp, + (ushort)Items.Radio => (ushort)BlockId.Radio, + (ushort)Items.WindMill => (ushort)BlockId.Windmill, + (ushort)Items.Label => (ushort)BlockId.Label, + (ushort)Items.Rocket => (ushort)BlockId.Rocket, + (ushort)Items.SewingMachine => (ushort)BlockId.SewingMachine, + (ushort)Items.FurnaceElectric => (ushort)BlockId.FurnaceElectric, + (ushort)Items.Macerator => (ushort)BlockId.Macerator, + (ushort)Items.WaterMill => (ushort)BlockId.Watermill, + (ushort)Items.SolarPanel => (ushort)BlockId.SolarPanel, + (ushort)Items.Miner => (ushort)BlockId.Miner, + (ushort)Items.Charger => (ushort)BlockId.Charger, + (ushort)Items.FurnaceStone => (ushort)BlockId.FurnaceStone, + (ushort)Items.Composter => (ushort)BlockId.Composter, + _ => (ushort)BlockId.None, + }; } public static ushort PlantFromItem(ushort item) { - switch (item) { - case (ushort)Items.Strawberry: return (ushort)BlockId.Strawberry; - case (ushort)Items.PlantBlueberry: return (ushort)BlockId.Blueberry; - case (ushort)Items.PlantRashberry: return (ushort)BlockId.Rashberry; - - case (ushort)Items.PlantOnion: return (ushort)BlockId.Onion; - case (ushort)Items.PlantPeas: return (ushort)BlockId.Peas; - case (ushort)Items.PlantCarrot: return (ushort)BlockId.Carrot; - case (ushort)Items.Peas: return (ushort)BlockId.Peas; - case (ushort)Items.Carrot: return (ushort)BlockId.Carrot; - case (ushort)Items.Onion: return (ushort)BlockId.Onion; - } - - return (ushort)BlockId.None; + return item switch { + (ushort)Items.Strawberry => (ushort)BlockId.Strawberry, + (ushort)Items.PlantBlueberry => (ushort)BlockId.Blueberry, + (ushort)Items.PlantRashberry => (ushort)BlockId.Rashberry, + (ushort)Items.PlantOnion => (ushort)BlockId.Onion, + (ushort)Items.PlantPeas => (ushort)BlockId.Peas, + (ushort)Items.PlantCarrot => (ushort)BlockId.Carrot, + (ushort)Items.Peas => (ushort)BlockId.Peas, + (ushort)Items.Carrot => (ushort)BlockId.Carrot, + (ushort)Items.Onion => (ushort)BlockId.Onion, + _ => (ushort)BlockId.None, + }; } public static ushort MobFromItem(ushort item) { - switch (item) { - case (ushort)Items.AnimalRabbit: return (ushort)BlockId.Rabbit; - case (ushort)Items.AnimalChicken: return (ushort)BlockId.Chicken; - case (ushort)Items.AnimalFish: return (ushort)BlockId.Fish; - case (ushort)Items.AnimalParrot: return (ushort)BlockId.MobParrot; - } - - return (ushort)BlockId.None; + return item switch { + (ushort)Items.AnimalRabbit => (ushort)BlockId.Rabbit, + (ushort)Items.AnimalChicken => (ushort)BlockId.Chicken, + (ushort)Items.AnimalFish => (ushort)BlockId.Fish, + (ushort)Items.AnimalParrot => (ushort)BlockId.MobParrot, + _ => (ushort)BlockId.None, + }; } #endregion @@ -1465,75 +1406,71 @@ static class GameMethods { return true; } - public static bool IsBlockOnGrowing(ushort id) { - switch (id){ - case (ushort)BlockId.Dirt: return true; - case (ushort)BlockId.Compost: return true; - case (ushort)BlockId.Clay: return true; - - case (ushort)BlockId.GrassBlockPlains: return true; - case (ushort)BlockId.GrassBlockHills: return true; - case (ushort)BlockId.GrassBlockJungle: return true; - case (ushort)BlockId.GrassBlockDesert: return true; - case (ushort)BlockId.GrassBlockForest: return true; - case (ushort)BlockId.GrassBlockClay: return true; - case (ushort)BlockId.GrassBlockCompost: return true; - - case (ushort)BlockId.GrassBlockSnowPlains: return true; - case (ushort)BlockId.GrassBlockSnowHills: return true; - case (ushort)BlockId.GrassBlockSnowJungle: return true; - case (ushort)BlockId.GrassBlockSnowDesert: return true; - case (ushort)BlockId.GrassBlockSnowForest: return true; - case (ushort)BlockId.GrassBlockSnowClay: return true; - case (ushort)BlockId.GrassBlockSnowCompost: return true; - - default: return false; - } + public static bool IsBlockOnGrowing(ushort id) { + return id switch { + (ushort)BlockId.Dirt => true, + (ushort)BlockId.Compost => true, + (ushort)BlockId.Clay => true, + (ushort)BlockId.GrassBlockPlains => true, + (ushort)BlockId.GrassBlockHills => true, + (ushort)BlockId.GrassBlockJungle => true, + (ushort)BlockId.GrassBlockDesert => true, + (ushort)BlockId.GrassBlockForest => true, + (ushort)BlockId.GrassBlockClay => true, + (ushort)BlockId.GrassBlockCompost => true, + (ushort)BlockId.GrassBlockSnowPlains => true, + (ushort)BlockId.GrassBlockSnowHills => true, + (ushort)BlockId.GrassBlockSnowJungle => true, + (ushort)BlockId.GrassBlockSnowDesert => true, + (ushort)BlockId.GrassBlockSnowForest => true, + (ushort)BlockId.GrassBlockSnowClay => true, + (ushort)BlockId.GrassBlockSnowCompost => true, + _ => false, + }; } public static bool IsDirtPlaceable(ushort id) { - switch (id) { - case (ushort)BlockId.OakSapling: return true; - case (ushort)BlockId.OrangeSapling: return true; - case (ushort)BlockId.PineSapling: return true; - case (ushort)BlockId.PlumSapling: return true; - case (ushort)BlockId.SpruceSapling: return true; - case (ushort)BlockId.AppleSapling: return true; - case (ushort)BlockId.CherrySapling: return true; - case (ushort)BlockId.LemonSapling: return true; - case (ushort)BlockId.LindenSapling: return true; - case (ushort)BlockId.AcaciaSapling: return true; - case (ushort)BlockId.EucalyptusSapling: return true; - case (ushort)BlockId.KapokSapling: return true; - case (ushort)BlockId.MangroveSapling: return true; - case (ushort)BlockId.OliveSapling: return true; - case (ushort)BlockId.RubberTreeSapling: return true; - case (ushort)BlockId.WillowSapling: return true; - case (ushort)BlockId.Rose: return true; - case (ushort)BlockId.Dandelion: return true; - case (ushort)BlockId.Heather: return true; - case (ushort)BlockId.Orchid: return true; - case (ushort)BlockId.Violet: return true; - case (ushort)BlockId.Alore: return true; - case (ushort)BlockId.Boletus: return true; - case (ushort)BlockId.BranchFull: return true; - case (ushort)BlockId.Champignon: return true; - case (ushort)BlockId.GrassDesert: return true; - case (ushort)BlockId.GrassForest: return true; - case (ushort)BlockId.GrassHills: return true; - case (ushort)BlockId.GrassJungle: return true; - case (ushort)BlockId.GrassPlains: return true; - case (ushort)BlockId.Toadstool: return true; - case (ushort)BlockId.EggDrop: return true; - case (ushort)BlockId.Rocks: return true; - } - return false; + return id switch { + (ushort)BlockId.OakSapling => true, + (ushort)BlockId.OrangeSapling => true, + (ushort)BlockId.PineSapling => true, + (ushort)BlockId.PlumSapling => true, + (ushort)BlockId.SpruceSapling => true, + (ushort)BlockId.AppleSapling => true, + (ushort)BlockId.CherrySapling => true, + (ushort)BlockId.LemonSapling => true, + (ushort)BlockId.LindenSapling => true, + (ushort)BlockId.AcaciaSapling => true, + (ushort)BlockId.EucalyptusSapling => true, + (ushort)BlockId.KapokSapling => true, + (ushort)BlockId.MangroveSapling => true, + (ushort)BlockId.OliveSapling => true, + (ushort)BlockId.RubberTreeSapling => true, + (ushort)BlockId.WillowSapling => true, + (ushort)BlockId.Rose => true, + (ushort)BlockId.Dandelion => true, + (ushort)BlockId.Heather => true, + (ushort)BlockId.Orchid => true, + (ushort)BlockId.Violet => true, + (ushort)BlockId.Alore => true, + (ushort)BlockId.Boletus => true, + (ushort)BlockId.BranchFull => true, + (ushort)BlockId.Champignon => true, + (ushort)BlockId.GrassDesert => true, + (ushort)BlockId.GrassForest => true, + (ushort)BlockId.GrassHills => true, + (ushort)BlockId.GrassJungle => true, + (ushort)BlockId.GrassPlains => true, + (ushort)BlockId.Toadstool => true, + (ushort)BlockId.EggDrop => true, + (ushort)BlockId.Rocks => true, + _ => false, + }; } public static CraftingRecipe[] Craft(ushort id) { - switch (id) { - case (ushort)Items.AngelHair: - return new CraftingRecipe[] { + return id switch { + (ushort)Items.AngelHair => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateGold, 1)), @@ -1541,9 +1478,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AngelHair,2) ), - }; - case (ushort)Items.MediumStone: - return new CraftingRecipe[] { + }, + (ushort)Items.MediumStone => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BigStone, 1)), @@ -1557,10 +1493,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.MediumStone, 3) ), - }; - - case (ushort)Items.SmallStone: - return new CraftingRecipe[] { + }, + (ushort)Items.SmallStone => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.MediumStone, 1)), @@ -1581,10 +1515,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SmallStone, 3) ), - }; - - case (ushort)Items.HammerCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.HammerCopper => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperIngot,1)), @@ -1593,10 +1525,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HammerCopper) ) - }; - - case (ushort)Items.HammerAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.HammerAluminium => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1)), @@ -1605,10 +1535,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HammerAluminium) ) - }; - - case (ushort)Items.HammerSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.HammerSteel => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.SteelIngot,1)), @@ -1617,10 +1545,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HammerSteel) ) - }; - - case (ushort)Items.ShearsSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsSteel => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ShearsHeadSteel,1)), @@ -1628,10 +1554,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShearsSteel) ) - }; - - case (ushort)Items.ShovelBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelBronze => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadBronze,1)), @@ -1639,10 +1563,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShovelBronze) ) - }; - - case (ushort)Items.DyeBrown: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeBrown => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)), @@ -1650,10 +1572,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeBrown) ) - }; - - case (ushort)Items.DyeMagenta: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeMagenta => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlue)), @@ -1661,10 +1581,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeMagenta) ) - }; - - case (ushort)Items.DyeOrange: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeOrange => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeYellow)), @@ -1672,10 +1590,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeOrange) ) - }; - - case (ushort)Items.DyeTeal: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeTeal => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlue)), @@ -1683,10 +1599,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeTeal) ) - }; - - case (ushort)Items.DyeArmy: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeArmy => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBrown)), @@ -1695,10 +1609,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeArmy) ) - }; - - case (ushort)Items.DyeRoseQuartz: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeRoseQuartz => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)), @@ -1706,10 +1618,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeRoseQuartz) ) - }; - - case (ushort)Items.DyePink: - return new CraftingRecipe[] { + }, + (ushort)Items.DyePink => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)), @@ -1717,10 +1627,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyePink) ) - }; - - case (ushort)Items.DyeLightBlue: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeLightBlue => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)), @@ -1728,10 +1636,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeLightBlue) ) - }; - - case (ushort)Items.DyeLightGreen: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeLightGreen => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)), @@ -1739,10 +1645,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeLightGreen) ) - }; - - case (ushort)Items.DyeDarkGreen: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeDarkGreen => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)), @@ -1750,10 +1654,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeDarkGreen) ) - }; - - case (ushort)Items.DyeDarkBlue: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeDarkBlue => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)), @@ -1761,10 +1663,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeDarkBlue) ) - }; - - case (ushort)Items.DyeDarkRed: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeDarkRed => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)), @@ -1772,10 +1672,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.DyeDarkRed) ) - }; - - case (ushort)Items.OxygenMachine: - return new CraftingRecipe[] { + }, + (ushort)Items.OxygenMachine => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Charger,1)), @@ -1792,10 +1690,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.OxygenMachine,1) ) - }; - - case (ushort)Items.AirTank: - return new CraftingRecipe[] { + }, + (ushort)Items.AirTank => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)), @@ -1806,10 +1702,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AirTank,1) ) - }; - - case (ushort)Items.AirTank2: - return new CraftingRecipe[] { + }, + (ushort)Items.AirTank2 => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,2)), @@ -1820,10 +1714,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AirTank2,1) ) - }; - - case (ushort)Items.Gun: - return new CraftingRecipe[] { + }, + (ushort)Items.Gun => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)), @@ -1834,10 +1726,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Gun,1) ) - }; - - case (ushort)Items.Ammo: - return new CraftingRecipe[] { + }, + (ushort)Items.Ammo => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,2)), @@ -1847,10 +1737,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Ammo,5) ) - }; - - case (ushort)Items.Gunpowder: - return new CraftingRecipe[] { + }, + (ushort)Items.Gunpowder => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Saltpeter, 5)), @@ -1859,10 +1747,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Gunpowder,7) ) - }; - - case (ushort)Items.BucketForRubber: - return new CraftingRecipe[] { + }, + (ushort)Items.BucketForRubber => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Bucket,1)), @@ -1870,10 +1756,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BucketForRubber,1) ) - }; - - case (ushort)Items.HoeBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeBronze => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadBronze,1)), @@ -1881,10 +1765,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HoeBronze) ) - }; - - case (ushort)Items.HoeCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeCopper => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadCopper, 1)), @@ -1892,10 +1774,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HoeCopper) ) - }; - - case (ushort)Items.HoeIron: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeIron => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadIron, 1)), @@ -1903,10 +1783,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HoeIron) ) - }; - - case (ushort)Items.HoeGold: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeGold => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadGold, 1)), @@ -1914,10 +1792,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HoeGold) ) - }; - - case (ushort)Items.HoeAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeAluminium => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadAluminium, 1)), @@ -1925,10 +1801,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HoeAluminium) ) - }; - - case (ushort)Items.Composter: - return new CraftingRecipe[] { + }, + (ushort)Items.Composter => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks,4)), @@ -1939,10 +1813,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BowlEmpty,1) ) - }; - - case (ushort)Items.BowlEmpty: - return new CraftingRecipe[] { + }, + (ushort)Items.BowlEmpty => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks,1)), @@ -1950,10 +1822,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BowlEmpty,1) ) - }; - - case (ushort)Items.TorchOFF: - return new CraftingRecipe[] { + }, + (ushort)Items.TorchOFF => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -1973,10 +1843,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.TorchOFF,1) ) - }; - - case (ushort)Items.PickaxeIron: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeIron => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -1984,10 +1852,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.PickaxeIron) ) - }; - - case (ushort)Items.PickaxeCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeCopper => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -1995,10 +1861,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.PickaxeCopper) ) - }; - - case (ushort)Items.PickaxeGold: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeGold => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2006,10 +1870,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.PickaxeGold) ) - }; - - case (ushort)Items.PickaxeSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeSteel => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2017,10 +1879,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.PickaxeSteel) ) - }; - - case (ushort)Items.PickaxeAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeAluminium => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2028,10 +1888,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.PickaxeAluminium) ) - }; - - case (ushort)Items.PickaxeBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeBronze => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2039,10 +1897,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.PickaxeCopper) ) - }; - - case (ushort)Items.KnifeCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeCopper => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2050,10 +1906,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.KnifeCopper) ) - }; - - case (ushort)Items.KnifeBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeBronze => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2061,10 +1915,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.KnifeBronze) ) - }; - - case (ushort)Items.KnifeGold: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeGold => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2072,10 +1924,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.KnifeGold) ) - }; - - case (ushort)Items.KnifeSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeSteel => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2083,10 +1933,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.KnifeSteel) ) - }; - - case (ushort)Items.HoeSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeSteel => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2094,10 +1942,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HoeSteel) ) - }; - - case (ushort)Items.AxeSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeSteel => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2105,10 +1951,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.AxeSteel) ) - }; - - case (ushort)Items.AxeBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeBronze => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2116,10 +1960,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.AxeBronze) ) - }; - - case (ushort)Items.AxeCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeCopper => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2127,10 +1969,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.AxeCopper) ) - }; - - case (ushort)Items.AxeAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeAluminium => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2138,10 +1978,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.AxeAluminium) ) - }; - - case (ushort)Items.KnifeIron: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeIron => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2149,10 +1987,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.KnifeIron) ) - }; - - case (ushort)Items.KnifeAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeAluminium => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2160,11 +1996,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.KnifeAluminium) ) - }; - - - case (ushort)Items.SewingMachine: - return new CraftingRecipe[] { + }, + (ushort)Items.SewingMachine => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron,1)), @@ -2174,10 +2007,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SewingMachine, 1) ) - }; - - case (ushort)Items.Charger: - return new CraftingRecipe[] { + }, + (ushort)Items.Charger => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ @@ -2190,10 +2021,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Charger,1) ) - }; - - case (ushort)Items.HoeStone: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeStone => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[] { new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)), @@ -2201,10 +2030,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HoeStone) ) - }; - - case (ushort)Items.AxeIron: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeIron => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AxeHeadIron,1)), @@ -2212,10 +2039,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.AxeIron) ) - }; - - case (ushort)Items.TorchElectricON: - return new CraftingRecipe[] { + }, + (ushort)Items.TorchElectricON => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Bulb,1)), @@ -2225,10 +2050,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.TorchElectricON) ) - }; - - case (ushort)Items.ShovelIron: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelIron => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1)), @@ -2236,10 +2059,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShovelIron) ) - }; - - case (ushort)Items.ShovelAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelAluminium => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1)), @@ -2247,10 +2068,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShovelAluminium) ) - }; - - case (ushort)Items.ShovelCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelCopper => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadCopper,1)), @@ -2258,10 +2077,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShovelCopper) ) - }; - - case (ushort)Items.AxeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadIron => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)), @@ -2269,10 +2086,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AxeHeadIron, 4) ) - }; - - case (ushort)Items.PickaxeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadIron => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)), @@ -2280,10 +2095,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.PickaxeHeadIron, 4) ) - }; - - case (ushort)Items.ShovelHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadIron => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)), @@ -2291,11 +2104,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.ShovelHeadIron, 4) ) - }; - - - case (ushort)Items.BronzeDust: - return new CraftingRecipe[] { + }, + (ushort)Items.BronzeDust => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperDust, 3)), @@ -2303,10 +2113,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.CopperDust, 4) ) - }; - - case (ushort)Items.WaterMill: - return new CraftingRecipe[] { + }, + (ushort)Items.WaterMill => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper, 2)), @@ -2316,16 +2124,11 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.WaterMill,1) ) - }; - - - case (ushort)Items.Stonerubble: - return new CraftingRecipe[] { + }, + (ushort)Items.Stonerubble => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SmallStone, 4),new ItemNonInvBasic((ushort)Items.Stonerubble, 4)) - }; - - case (ushort)Items.Bricks: - return new CraftingRecipe[] { + }, + (ushort)Items.Bricks => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.OneBrick, 4)), @@ -2335,10 +2138,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Bricks,1) ) - }; - - case (ushort)Items.Leave: - return new CraftingRecipe[] { + }, + (ushort)Items.Leave => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn(new ItemNonInvBasic((ushort)Items.Sticks,1)), new CraftingOut[]{ @@ -2355,10 +2156,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.Stick, 2)) } ), - }; - - case (ushort)Items.Ladder: - return new CraftingRecipe[] { + }, + (ushort)Items.Ladder => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 10)), @@ -2366,10 +2165,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Ladder,1) ) - }; - - case (ushort)Items.Flag: - return new CraftingRecipe[] { + }, + (ushort)Items.Flag => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2377,10 +2174,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Flag,1) ) - }; - - case (ushort)Items.Shelf: - return new CraftingRecipe[] { + }, + (ushort)Items.Shelf => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 5)), @@ -2389,10 +2184,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Shelf,1) ) - }; - - case (ushort)Items.Barrel: - return new CraftingRecipe[] { + }, + (ushort)Items.Barrel => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 10)), @@ -2402,10 +2195,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Barrel,1) ) - }; - - case (ushort)Items.BoxWooden: - return new CraftingRecipe[] { + }, + (ushort)Items.BoxWooden => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 7)), @@ -2414,10 +2205,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BoxWooden,1) ) - }; - - case (ushort)Items.BoxAdv: - return new CraftingRecipe[] { + }, + (ushort)Items.BoxAdv => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.plateAluminium, 2)), @@ -2427,10 +2216,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Shelf,1) ) - }; - - case (ushort)Items.Sticks: - return new CraftingRecipe[] { + }, + (ushort)Items.Sticks => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.OakLeaves,1)), @@ -2441,10 +2228,8 @@ static class GameMethods { new CraftingIn[]{CraftingRecipe.AnySapling(1)}, new CraftingOut[]{ new CraftingOut(new ItemNonInvBasic((ushort)Items.Sticks, 1)) } ) - }; - - case (ushort)Items.WheatSeeds: - return new CraftingRecipe[] { + }, + (ushort)Items.WheatSeeds => new CraftingRecipe[] { new CraftingRecipe( new ItemNonInvBasic((ushort)Items.WheatStraw,1), new CraftingOut[] { @@ -2452,10 +2237,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1)) } ) - }; - - case (ushort)Items.Seeds: - return new CraftingRecipe[] { + }, + (ushort)Items.Seeds => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{new ItemNonInvBasic((ushort)Items.WheatSeeds,1), new ItemNonInvBasic((ushort)Items.FlaxSeeds,1) }) @@ -2471,10 +2254,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.Hay, 1)), } ) - }; - - case (ushort)Items.Desk: - return new CraftingRecipe[] { + }, + (ushort)Items.Desk => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BigStone,1)), @@ -2482,10 +2263,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Desk,1) ) - }; - - case (ushort)Items.CoalDust: - return new CraftingRecipe[] { + }, + (ushort)Items.CoalDust => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.ItemCoal,1), new ItemNonInvBasic((ushort)Items.OreCoal,1),new ItemNonInvBasic((ushort)Items.CoalWood,1) }), @@ -2493,10 +2272,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.CoalDust,2) ) - }; - - case (ushort)Items.Hay: - return new CraftingRecipe[] { + }, + (ushort)Items.Hay => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.HayBlock,1)), @@ -2509,10 +2286,8 @@ static class GameMethods { }, new CraftingOut[]{ new CraftingOut( new ItemNonInvBasic((ushort)Items.Hay, 4)),new CraftingOut(new ItemNonInvBasic((ushort)Items.WheatSeeds,1)) } ), - }; - - case (ushort)Items.Gravel: - return new CraftingRecipe[] { + }, + (ushort)Items.Gravel => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.BigStone,1) , new ItemNonInvBasic((ushort)Items.MediumStone,2),new ItemNonInvBasic((ushort)Items.SmallStone,4)}), @@ -2520,10 +2295,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Gravel,1) ) - }; - - case (ushort)Items.Stick: - return new CraftingRecipe[] { + }, + (ushort)Items.Stick => new CraftingRecipe[] { new CraftingRecipe( new ItemNonInvBasic((ushort)Items.Sticks,1), new CraftingOut[]{ @@ -2538,10 +2311,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 3)) } ), - }; - - case (ushort)Items.StoneHead: - return new CraftingRecipe[] { + }, + (ushort)Items.StoneHead => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BigStone,1)), @@ -2553,10 +2324,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.MediumStone,3), 0.3f) } ) - }; - - case (ushort)Items.PickaxeStone: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeStone => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)), @@ -2564,10 +2333,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.PickaxeStone) ) - }; - - case (ushort)Items.AxeStone: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeStone => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)), @@ -2575,10 +2342,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.AxeStone) ) - }; - - case (ushort)Items.ShovelStone: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelStone => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)), @@ -2586,16 +2351,11 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShovelStone) ) - }; - - case (ushort)Items.HayBlock: - return new CraftingRecipe[] { + }, + (ushort)Items.HayBlock => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Hay,4),new ItemNonInvBasic((ushort)Items.HayBlock, 1)) - }; - - - case (ushort)Items.PlateCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateCopper => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperIngot,1)), @@ -2603,10 +2363,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.PlateCopper, 2) ) - }; - - case (ushort)Items.plateAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.plateAluminium => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1)), @@ -2614,10 +2372,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.plateAluminium, 2) ) - }; - - case (ushort)Items.PlateIron: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateIron => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)), @@ -2625,10 +2381,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.PlateIron, 2) ) - }; - - case (ushort)Items.PlateBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateBronze => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BronzeIngot, 1)), @@ -2636,10 +2390,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.PlateBronze, 2) ) - }; - - case (ushort)Items.PlateGold: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateGold => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.GoldIngot, 1)), @@ -2647,10 +2399,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.PlateGold, 2) ) - }; - - case (ushort)Items.FurnaceElectric: - return new CraftingRecipe[] { + }, + (ushort)Items.FurnaceElectric => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron, 4)), @@ -2660,10 +2410,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.FurnaceElectric,1) ) - }; - - case (ushort)Items.Macerator: - return new CraftingRecipe[] { + }, + (ushort)Items.Macerator => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron, 2)), @@ -2677,10 +2425,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Macerator,1) ) - }; - - case (ushort)Items.Radio: - return new CraftingRecipe[] { + }, + (ushort)Items.Radio => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BigCircuit, 2)), @@ -2689,10 +2435,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Radio,1) ) - }; - - case (ushort)Items.Label: - return new CraftingRecipe[] { + }, + (ushort)Items.Label => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BareLabel, 2)), @@ -2700,10 +2444,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Label,1) ) - }; - - case (ushort)Items.BareLabel: - return new CraftingRecipe[] { + }, + (ushort)Items.BareLabel => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,1)), @@ -2711,10 +2453,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BareLabel, 4) ) - }; - - case (ushort)Items.Sand: - return new CraftingRecipe[] { + }, + (ushort)Items.Sand => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Gravel,1)), @@ -2736,10 +2476,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Sand,1) ), - }; - - case (ushort)Items.ShearsCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsCopper => new CraftingRecipe[] { //new CraftingRecipe( // new CraftingIn[]{ // new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,1)), @@ -2756,10 +2494,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShearsCopper) ) - }; - - case (ushort)Items.ShearsBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsBronze => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ShearsHeadBronze,1)), @@ -2768,11 +2504,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShearsBronze) ) - }; - - - case (ushort)Items.ShearsIron: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsIron => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ShearsHeadIron,1)), @@ -2781,11 +2514,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShearsIron) ) - }; - - - case (ushort)Items.AdvancedSpaceBlock: - return new CraftingRecipe[] { + }, + (ushort)Items.AdvancedSpaceBlock => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.plateAluminium, 2)), @@ -2795,10 +2525,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock, 2) ) - }; - - case (ushort)Items.Miner: - return new CraftingRecipe[] { + }, + (ushort)Items.Miner => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.ElectricDrill,1)), @@ -2809,10 +2537,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Miner,1) ) - }; - - case (ushort)Items.Diode: - return new CraftingRecipe[] { + }, + (ushort)Items.Diode => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BareLabel,1)), @@ -2820,10 +2546,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Diode, 4) ) - }; - - case (ushort)Items.HammerBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.HammerBronze => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BronzeIngot,1)), @@ -2832,10 +2556,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.HammerBronze,1) ) - }; - - case (ushort)Items.HammerIron: - return new CraftingRecipe[] { + }, + (ushort)Items.HammerIron => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)), @@ -2844,10 +2566,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.HammerIron,1) ) - }; - - case (ushort)Items.SawCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.SawCopper => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,1)), @@ -2856,10 +2576,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.SawCopper) ) - }; - - case (ushort)Items.SawBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.SawBronze => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateBronze,1)), @@ -2868,10 +2586,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.SawBronze) ) - }; - - case (ushort)Items.SawIron: - return new CraftingRecipe[] { + }, + (ushort)Items.SawIron => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron,1)), @@ -2880,10 +2596,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.SawIron) ) - }; - - case (ushort)Items.ElectricDrill: - return new CraftingRecipe[] { + }, + (ushort)Items.ElectricDrill => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)), @@ -2895,11 +2609,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ElectricDrill) ) - }; - - - case (ushort)Items.ElectricSaw: - return new CraftingRecipe[] { + }, + (ushort)Items.ElectricSaw => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron, 3)), @@ -2911,10 +2622,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ElectricSaw) ) - }; - - case (ushort)Items.Rocket: - return new CraftingRecipe[] { + }, + (ushort)Items.Rocket => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.plateAluminium, 16)), @@ -2929,11 +2638,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Rocket,1) ) - }; - - - case (ushort)Items.Door: - return new CraftingRecipe[] { + }, + (ushort)Items.Door => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 3)), @@ -2943,10 +2649,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Door,1) ) - }; - - case (ushort)Items.Yarn: - return new CraftingRecipe[] { + }, + (ushort)Items.Yarn => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)), @@ -2954,13 +2658,9 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Yarn,1) ) - }; - - case (ushort)Items.Rope: - return new CraftingRecipe[] {new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Yarn, 3), new ItemNonInvBasic((ushort)Items.Rope,1))}; - - case (ushort)Items.Nail: - return new CraftingRecipe[] { + }, + (ushort)Items.Rope => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Yarn, 3), new ItemNonInvBasic((ushort)Items.Rope, 1)) }, + (ushort)Items.Nail => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)), @@ -2968,10 +2668,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Nail, 10) ) - }; - - case (ushort)Items.Roof1: - return new CraftingRecipe[] { + }, + (ushort)Items.Roof1 => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Bricks,1)), @@ -2979,10 +2677,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Roof1, 2) ) - }; - - case (ushort)Items.Roof2: - return new CraftingRecipe[] { + }, + (ushort)Items.Roof2 => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Bricks,1)), @@ -2990,11 +2686,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Roof2, 2) ) - }; - - - case (ushort)Items.FurnaceStone: - return new CraftingRecipe[] { + }, + (ushort)Items.FurnaceStone => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.MediumStone, 6), new ItemNonInvBasic((ushort)Items.BigStone,4), new ItemNonInvBasic((ushort)Items.SmallStone,8)}), @@ -3002,10 +2695,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.FurnaceStone,1) ) - }; - - case (ushort)Items.MudIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.MudIngot => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Clay, 1), new ItemNonInvBasic((ushort)Items.MudIngot, 1)), new CraftingRecipe( new CraftingIn[]{ @@ -3015,10 +2706,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.MudIngot,1) ) - }; - - case (ushort)Items.ItemBattery: - return new CraftingRecipe[] { + }, + (ushort)Items.ItemBattery => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Lemon,1)), @@ -3027,10 +2716,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ItemBattery,1) ) - }; - - case (ushort)Items.BigCircuit: - return new CraftingRecipe[] { + }, + (ushort)Items.BigCircuit => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Circuit, 1)), @@ -3043,10 +2730,8 @@ static class GameMethods { new ItemNonInvBasic((ushort)Items.BigCircuit,1) ), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Circuit, 3),new ItemNonInvBasic((ushort)Items.BigCircuit,1)) - }; - - case (ushort)Items.Bucket: - return new CraftingRecipe[] { + }, + (ushort)Items.Bucket => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 2)), @@ -3061,10 +2746,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Bucket,1) ) - }; - - case (ushort)Items.Bulb: - return new CraftingRecipe[] { + }, + (ushort)Items.Bulb => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Label,1)), @@ -3074,10 +2757,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Bulb,1) ) - }; - - case (ushort)Items.Circuit: - return new CraftingRecipe[] { + }, + (ushort)Items.Circuit => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper, 1)), @@ -3088,10 +2769,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Circuit,1) ) - }; - - case (ushort)Items.SolarPanel: - return new CraftingRecipe[] { + }, + (ushort)Items.SolarPanel => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Silicium, 1)), @@ -3101,12 +2780,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SolarPanel,1) ) - }; - - - - case (ushort)Items.WindMill: - return new CraftingRecipe[] { + }, + (ushort)Items.WindMill => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Motor, 1)), @@ -3120,10 +2795,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.WindMill,1) ) - }; - - case (ushort)Items.AdvancedSpaceWindow: - return new CraftingRecipe[] { + }, + (ushort)Items.AdvancedSpaceWindow => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)), @@ -3132,10 +2805,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AdvancedSpaceWindow,1) ) - }; - - case (ushort)Items.AdvancedSpaceFloor: - return new CraftingRecipe[] { + }, + (ushort)Items.AdvancedSpaceFloor => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)), @@ -3143,10 +2814,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AdvancedSpaceFloor,1) ) - }; - - case (ushort)Items.AdvancedSpacePart1: - return new CraftingRecipe[] { + }, + (ushort)Items.AdvancedSpacePart1 => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)), @@ -3154,10 +2823,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AdvancedSpacePart1,1) ) - }; - - case (ushort)Items.AdvancedSpacePart2: - return new CraftingRecipe[] { + }, + (ushort)Items.AdvancedSpacePart2 => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)), @@ -3165,10 +2832,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AdvancedSpacePart2,1) ) - }; - - case (ushort)Items.AdvancedSpacePart3: - return new CraftingRecipe[] { + }, + (ushort)Items.AdvancedSpacePart3 => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)), @@ -3176,10 +2841,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AdvancedSpacePart3,1) ) - }; - - case (ushort)Items.AdvancedSpacePart4: - return new CraftingRecipe[] { + }, + (ushort)Items.AdvancedSpacePart4 => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)), @@ -3187,10 +2850,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AdvancedSpacePart4,1) ) - }; - - case (ushort)Items.Lamp: - return new CraftingRecipe[] { + }, + (ushort)Items.Lamp => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Bulb, 1)), @@ -3205,10 +2866,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Lamp,1) ) - }; - - case (ushort)Items.Cloth: - return new CraftingRecipe[] { + }, + (ushort)Items.Cloth => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 2)), @@ -3216,10 +2875,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Cloth,1) ) - }; - - case (ushort)Items.AxeGold: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeGold => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)), @@ -3227,10 +2884,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.AxeGold) ) - }; - - case (ushort)Items.ShovelGold: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelGold => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)), @@ -3238,10 +2893,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShovelGold) ) - }; - - case (ushort)Items.ShovelSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelSteel => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)), @@ -3249,10 +2902,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShovelSteel) ) - }; - - case (ushort)Items.ShearsAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsAluminium => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)), @@ -3260,20 +2911,18 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShearsAluminium) ) - }; - - // case (ushort)Items.ShovelGold: - //return new CraftingRecipe[] { - // new CraftingRecipe( - // new CraftingIn[]{ - // new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)), - // new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadGold, 1)) - // }, - // new ItemNonInvTool((ushort)Items.ShovelGold) - // ) - //}; - case (ushort)Items.ShearsGold: - return new CraftingRecipe[] { + }, + // case (ushort)Items.ShovelGold: + //return new CraftingRecipe[] { + // new CraftingRecipe( + // new CraftingIn[]{ + // new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)), + // new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadGold, 1)) + // }, + // new ItemNonInvTool((ushort)Items.ShovelGold) + // ) + //}; + (ushort)Items.ShearsGold => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 2)), @@ -3281,10 +2930,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.ShearsGold) ) - }; - - case (ushort)Items.HammerGold: - return new CraftingRecipe[] { + }, + (ushort)Items.HammerGold => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)), @@ -3293,10 +2940,8 @@ static class GameMethods { }, new ItemNonInvTool((ushort)Items.HammerGold) ) - }; - - case (ushort)Items.Motor: - return new CraftingRecipe[] { + }, + (ushort)Items.Motor => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)), @@ -3306,10 +2951,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Motor,1) ) - }; - - case (ushort)Items.Rod: - return new CraftingRecipe[] { + }, + (ushort)Items.Rod => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.IronIngot, 1), new ItemNonInvBasic((ushort)Items.BronzeIngot, 1) }), @@ -3317,10 +2960,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Rod, 2) ) - }; - - case (ushort)Items.Condenser: - return new CraftingRecipe[] { + }, + (ushort)Items.Condenser => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.plateAluminium, 1), new ItemNonInvBasic((ushort)Items.PlateCopper, 1) }), @@ -3329,10 +2970,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Condenser, 5) ) - }; - - case (ushort)Items.Rezistance: - return new CraftingRecipe[] { + }, + (ushort)Items.Rezistance => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.CoalWood,1)), @@ -3340,15 +2979,11 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Rezistance, 5) ) - }; - - case (ushort)Items.Tranzistor: - return new CraftingRecipe[] { + }, + (ushort)Items.Tranzistor => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Diode, 2), new ItemNonInvBasic((ushort)Items.Tranzistor, 1)) - }; - - case (ushort)Items.Planks: - return new CraftingRecipe[] { + }, + (ushort)Items.Planks => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ CraftingRecipe.AnyWood(1), @@ -3359,16 +2994,14 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.WoodDust,1), 0.5f) } ) - }; - - default: return null; - } + }, + _ => null, + }; } public static CraftingRecipe[] Bake(ushort id) { - switch (id) { - case (ushort)Items.ChristmasBallGray: - return new CraftingRecipe[] { + return id switch { + (ushort)Items.ChristmasBallGray => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Glass,1)), @@ -3376,10 +3009,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.ChristmasBallGray) ) - }; - - case (ushort)Items.ChristmasStar: - return new CraftingRecipe[] { + }, + (ushort)Items.ChristmasStar => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Glass,1)), @@ -3387,10 +3018,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.ChristmasStar) ) - }; - - case (ushort)Items.SteelIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.SteelIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn( @@ -3420,9 +3049,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.SteelIngot, 1)) } ) - }; - case (ushort)Items.DyeBlue: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeBlue => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Blueberries, 1)), @@ -3433,10 +3061,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 1)) } ) - }; - - case (ushort)Items.DyeViolet: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeViolet => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlantViolet, 1)), @@ -3447,15 +3073,11 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 1)) } ) - }; - - case (ushort)Items.boiledEgg: - return new CraftingRecipe[] { + }, + (ushort)Items.boiledEgg => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Egg, 1), new ItemNonInvFood((ushort)Items.boiledEgg, 1, 0)) - }; - - case (ushort)Items.DyeRed: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeRed => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn( @@ -3468,10 +3090,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeRed, 1) ) - }; - - case (ushort)Items.DyeGreen: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeGreen => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Leave, 1)), @@ -3482,10 +3102,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 1)) } ) - }; - - case (ushort)Items.DyeOrange: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeOrange => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvFood((ushort)Items.Carrot, 1, 0.5f)), @@ -3493,10 +3111,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeOrange, 1) ) - }; - - case (ushort)Items.DyeSpringGreen: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeSpringGreen => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvFood((ushort)Items.Peas, 1, 0.5f)), @@ -3504,10 +3120,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeSpringGreen, 1) ) - }; - - case (ushort)Items.DyeYellow: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeYellow => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn( @@ -3520,10 +3134,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeYellow, 1) ) - }; - - case (ushort)Items.DyeDarkGreen: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeDarkGreen => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvFood((ushort)Items.Seaweed, 1, 0.5f)), @@ -3531,10 +3143,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeDarkGreen, 1) ) - }; - - case (ushort)Items.DyeBrown: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeBrown => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn( @@ -3548,10 +3158,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeBrown, 1) ) - }; - - case (ushort)Items.DyeLightGray: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeLightGray => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Ash, 1)), @@ -3559,10 +3167,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeLightGray, 1) ) - }; - - case (ushort)Items.DyeGray: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeGray => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn( @@ -3577,10 +3183,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeGray, 1) ) - }; - - case (ushort)Items.DyeBlack: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeBlack => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.CoalDust, 1)), @@ -3588,10 +3192,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeBlack, 1) ) - }; - - case (ushort)Items.DyeWhite: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeWhite => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Saltpeter, 1)), @@ -3599,10 +3201,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeWhite, 1) ) - }; - - case (ushort)Items.DyeGold: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeGold => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.GoldDust, 1)), @@ -3610,10 +3210,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeGold, 1) ) - }; - - case (ushort)Items.DyeRoseQuartz: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeRoseQuartz => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlantRose, 1)), @@ -3621,10 +3219,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.DyeRoseQuartz, 1) ) - }; - - case (ushort)Items.TestTube: - return new CraftingRecipe[] { + }, + (ushort)Items.TestTube => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn( new ItemNonInv[]{ @@ -3634,82 +3230,54 @@ static class GameMethods { ), new CraftingOut(new ItemNonInvBasic((ushort)Items.TestTube,1)) ), - }; - - case (ushort)Items.TorchON: - return new CraftingRecipe[] { + }, + (ushort)Items.TorchON => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.TorchOFF,1),new ItemNonInvTool((ushort)Items.TorchON,1)), - }; - - case (ushort)Items.Bottle: - return new CraftingRecipe[] { + }, + (ushort)Items.Bottle => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Plastic,1),new ItemNonInvBasic((ushort)Items.Bottle,1)), - }; - - case (ushort)Items.ShovelHeadSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadSteel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadSteel,1)), - }; - - case (ushort)Items.AxeHeadGold: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadGold => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadGold,1)), - }; - - case (ushort)Items.DyeOlive: - return new CraftingRecipe[] { + }, + (ushort)Items.DyeOlive => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInvBasic((ushort)Items.Olive,1)), new CraftingIn(new ItemNonInvBasic((ushort)Items.TestTube,1)) }, - + new ItemNonInvBasic((ushort)Items.DyeOlive,1) ) - }; - - case (ushort)Items.HoeHeadBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeHeadBronze => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadBronze,1)), - }; - - case (ushort)Items.HoeHeadCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeHeadCopper => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadCopper,1)), - }; - - case (ushort)Items.HoeHeadAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeHeadAluminium => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadAluminium,1)), - }; - - case (ushort)Items.HoeHeadSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeHeadSteel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadSteel,1)), - }; - - case (ushort)Items.HoeHeadGold: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeHeadGold => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadGold,1)), - }; - - case (ushort)Items.HoeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.HoeHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadIron,1)), - }; - - case (ushort)Items.RabbitMeatCooked: - return new CraftingRecipe[] { + }, + (ushort)Items.RabbitMeatCooked => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.RabbitMeat,1), new ItemNonInvBasic((ushort)Items.RabbitMeatCooked,1)), - }; - - case (ushort)Items.RabbitMeatCookedWithSalt: - return new CraftingRecipe[] { + }, + (ushort)Items.RabbitMeatCookedWithSalt => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.RabbitMeat,1), new ItemNonInvBasic((ushort)Items.RabbitMeatCookedWithSalt,1)), - }; - - case (ushort)Items.Plastic: - return new CraftingRecipe[] { + }, + (ushort)Items.Plastic => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Rubber,1)), @@ -3719,10 +3287,8 @@ static class GameMethods { new ItemNonInvBasic((ushort)Items.Plastic,1) ), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Bottle,1), new ItemNonInvBasic((ushort)Items.Plastic,1)) - }; - - case (ushort)Items.BowlWithMushrooms: - return new CraftingRecipe[] { + }, + (ushort)Items.BowlWithMushrooms => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BowlEmpty,1)), @@ -3733,10 +3299,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BowlWithMushrooms,1) ) - }; - - case (ushort)Items.BowlWithVegetables: - return new CraftingRecipe[] { + }, + (ushort)Items.BowlWithVegetables => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.BowlEmpty,1)), @@ -3747,195 +3311,119 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BowlWithVegetables,1) ) - }; - - case (ushort)Items.plateAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.plateAluminium => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1), new ItemNonInvBasic((ushort)Items.plateAluminium, 2)) - }; - - case (ushort)Items.OneBrick: - return new CraftingRecipe[] { + }, + (ushort)Items.OneBrick => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MudIngot,1), new ItemNonInvBasic((ushort)Items.OneBrick, 1)) - }; - - case (ushort)Items.BareLabel: - return new CraftingRecipe[] { + }, + (ushort)Items.BareLabel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.BareLabel, 3)) - }; - - case (ushort)Items.PlateBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateBronze => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.PlateBronze, 2)) - }; - - case (ushort)Items.PlateCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateCopper => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.PlateCopper, 2)) - }; - - case (ushort)Items.PlateGold: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateGold => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.PlateGold, 2)) - }; - - case (ushort)Items.PlateIron: - return new CraftingRecipe[] { + }, + (ushort)Items.PlateIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot, 1), new ItemNonInvBasic((ushort)Items.PlateIron, 2)) - }; - - case (ushort)Items.FishMeatCooked: - return new CraftingRecipe[] { + }, + (ushort)Items.FishMeatCooked => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.FishMeat,1), new ItemNonInvBasic((ushort)Items.FishMeatCooked,1)) - }; - - case (ushort)Items.AxeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadIron,1)) - }; - - case (ushort)Items.AxeHeadCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadCopper => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadCopper,1)) - }; - - case (ushort)Items.AxeHeadBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadBronze => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadBronze,1)) - }; - - case (ushort)Items.AxeHeadAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadAluminium => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadAluminium,1)) - }; - - case (ushort)Items.AxeHeadSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadSteel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadSteel,1)) - }; - - case (ushort)Items.PickaxeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadIron,1)) - }; - - case (ushort)Items.PickaxeHeadCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadCopper => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadCopper,1)) - }; - - case (ushort)Items.PickaxeHeadBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadBronze => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadBronze,1)) - }; - - case (ushort)Items.PickaxeHeadGold: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadGold => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadGold,1)) - }; - - case (ushort)Items.PickaxeHeadAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadAluminium => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadAluminium,1)) - }; - - case (ushort)Items.PickaxeHeadSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadSteel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadSteel,1)) - }; - - case (ushort)Items.ShovelHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1)) - }; - - case (ushort)Items.ShovelHeadCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadCopper => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadCopper,1)) - }; - - case (ushort)Items.ShovelHeadBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadBronze => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadBronze,1)) - }; - - case (ushort)Items.ShovelHeadGold: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadGold => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadGold,1)) - }; - - case (ushort)Items.ShovelHeadAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadAluminium => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadAluminium,1)) - }; - - case (ushort)Items.ShearsHeadAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsHeadAluminium => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadAluminium,1)) - }; - - case (ushort)Items.ShearsHeadCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsHeadCopper => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadCopper,1)) - }; - - case (ushort)Items.ShearsHeadBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsHeadBronze => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadBronze,1)) - }; - - case (ushort)Items.ShearsHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadIron,1)) - }; - - case (ushort)Items.ShearsHeadGold: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsHeadGold => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadGold,1)) - }; - - case (ushort)Items.ShearsHeadSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.ShearsHeadSteel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadSteel,1)) - }; - - case (ushort)Items.KnifeHeadSteel: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeHeadSteel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadSteel,1)) - }; - - case (ushort)Items.KnifeHeadCopper: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeHeadCopper => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadCopper,1)) - }; - - case (ushort)Items.KnifeHeadBronze: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeHeadBronze => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadBronze,1)) - }; - - case (ushort)Items.KnifeHeadGold: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeHeadGold => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadGold,1)) - }; - - case (ushort)Items.KnifeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadIron,1)) - }; - - case (ushort)Items.KnifeHeadAluminium: - return new CraftingRecipe[] { + }, + (ushort)Items.KnifeHeadAluminium => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadAluminium,1)) - }; - - case (ushort)Items.Glass: - return new CraftingRecipe[] { + }, + (ushort)Items.Glass => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Sand,1), new ItemNonInvBasic((ushort)Items.Glass,1)) - }; - - case (ushort)Items.Rubber: - return new CraftingRecipe[] { + }, + (ushort)Items.Rubber => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInv[]{ @@ -3945,10 +3433,8 @@ static class GameMethods { new ItemNonInvBasic((ushort)Items.Rubber,1) ) //new CraftingRecipe((ushort)Items.Resin, (ushort)Items.Rubber) - }; - - case (ushort)Items.Ash: - return new CraftingRecipe[] { + }, + (ushort)Items.Ash => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInv[]{ @@ -3959,15 +3445,11 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Ash,1) ) - }; - - case (ushort)Items.CoalWood: - return new CraftingRecipe[] { + }, + (ushort)Items.CoalWood => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Planks, 2), new ItemNonInvBasic((ushort)Items.CoalWood, 1)) - }; - - case (ushort)Items.Silicium: - return new CraftingRecipe[] { + }, + (ushort)Items.Silicium => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInvTool((ushort)Items.ItemBattery)), @@ -3980,10 +3462,8 @@ static class GameMethods { new CraftingOut(new ItemNonInvTool((ushort)Items.ItemBattery, 1)), } ) - }; - - case (ushort)Items.AluminiumIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.AluminiumIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInvTool((ushort)Items.ItemBattery)), @@ -4002,10 +3482,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.AluminiumIngot,1) ) - }; - - case (ushort)Items.IronIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.IronIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn( new ItemNonInv[]{ @@ -4021,10 +3499,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.IronIngot,1) ) - }; - - case (ushort)Items.SilverIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.SilverIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn( new ItemNonInv[]{ @@ -4034,10 +3510,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SilverIngot,1) ) - }; - - case (ushort)Items.CopperIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.CopperIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ @@ -4049,10 +3523,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.CopperIngot,1) ) - }; - - case (ushort)Items.GoldIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.GoldIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{new CraftingIn( new ItemNonInv[]{ @@ -4063,10 +3535,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.GoldIngot,1) ) - }; - - case (ushort)Items.BronzeIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.BronzeIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.ItemCopper, 3), new ItemNonInvBasic((ushort)Items.CopperIngot, 3)}), @@ -4082,31 +3552,25 @@ static class GameMethods { new ItemNonInvBasic((ushort)Items.BronzeIngot, 2) ), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.PlateBronze, 2),new ItemNonInvBasic((ushort)Items.BronzeIngot, 2)), - }; - - case (ushort)Items.TinIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.TinIngot => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.ItemTin, 1), new ItemNonInvBasic((ushort)Items.TinDust, 2), new ItemNonInvBasic((ushort)Items.OreTin, 1)}) }, new ItemNonInvBasic((ushort)Items.TinIngot,1) ) - }; - - default: return null; - } + }, + _ => null, + }; } public static CraftingRecipe[] Clothes(ushort id) { - switch (id) { - case (ushort)Items.boiledEgg: - return new CraftingRecipe[] { + return id switch { + (ushort)Items.boiledEgg => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Egg,1), new ItemNonInvBasic((ushort)Items.boiledEgg,1)) - }; - - case (ushort)Items.BucketForRubber: - return new CraftingRecipe[] { + }, + (ushort)Items.BucketForRubber => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInvBasic((ushort)Items.Bucket, 1)), @@ -4114,10 +3578,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BucketForRubber, 1) ) - }; - - case (ushort)Items.Hat: - return new CraftingRecipe[] { + }, + (ushort)Items.Hat => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth, 1)), @@ -4125,10 +3587,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Hat, 1) ) - }; - - case (ushort)Items.Crown: - return new CraftingRecipe[] { + }, + (ushort)Items.Crown => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateGold, 2)), @@ -4138,11 +3598,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Crown, 1) ) - }; - - - case (ushort)Items.Cap: - return new CraftingRecipe[] { + }, + (ushort)Items.Cap => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4150,11 +3607,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Cap, 1) ) - }; - - - case (ushort)Items.SpaceHelmet: - return new CraftingRecipe[] { + }, + (ushort)Items.SpaceHelmet => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4164,15 +3618,11 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SpaceHelmet, 1) ) - }; - - case (ushort)Items.FormalShoes: - return new CraftingRecipe[] { + }, + (ushort)Items.FormalShoes => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,1), new ItemNonInvBasic((ushort)Items.FormalShoes,1)) - }; - - case (ushort)Items.Pumps: - return new CraftingRecipe[] { + }, + (ushort)Items.Pumps => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4180,15 +3630,11 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Pumps, 1) ) - }; - - case (ushort)Items.Sneakers: - return new CraftingRecipe[] { + }, + (ushort)Items.Sneakers => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,1),new ItemNonInvBasic((ushort)Items.Sneakers,1)) - }; - - case (ushort)Items.SpaceBoots: - return new CraftingRecipe[] { + }, + (ushort)Items.SpaceBoots => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4196,19 +3642,15 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SpaceBoots, 1) ) - }; - - - case (ushort)Items.BikiniDown: - return new CraftingRecipe[] { + }, + (ushort)Items.BikiniDown => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)) }, new ItemNonInvBasic((ushort)Items.BikiniDown,1) ) - }; - + }, //case (ushort)Items.BlueBikini: // return new CraftingRecipe[] { // new CraftingRecipe( @@ -4219,45 +3661,32 @@ static class GameMethods { // new ItemNonInv((ushort)Items.BlueBikini, 1) // ) // }; - - - case (ushort)Items.Underpants: - return new CraftingRecipe[] { + (ushort)Items.Underpants => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)) }, new ItemNonInvBasic((ushort)Items.Underpants, 1) ) - }; - - - case (ushort)Items.BoxerShorts: - return new CraftingRecipe[] { + }, + (ushort)Items.BoxerShorts => new CraftingRecipe[] { new CraftingRecipe( new ItemNonInvBasic((ushort)Items.Cloth,1), new ItemNonInvBasic((ushort)Items.BoxerShorts,1) ) - }; - - + }, //case (ushort)Items.GrayUnderpants: // return new CraftingRecipe[] { // new CraftingRecipe((ushort)Items.Cloth, (ushort)Items.GrayUnderpants) // }; - - - case (ushort)Items.Panties: - return new CraftingRecipe[] { + (ushort)Items.Panties => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)) }, new ItemNonInvBasic((ushort)Items.Panties, 1) ) - }; - - + }, //case (ushort)Items.PantiesRed: // return new CraftingRecipe[] { // new CraftingRecipe( @@ -4268,10 +3697,7 @@ static class GameMethods { // new ItemNonInv((ushort)Items.PantiesRed, 1) // ) // }; - - - case (ushort)Items.Swimsuit: - return new CraftingRecipe[] { + (ushort)Items.Swimsuit => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4279,55 +3705,41 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Swimsuit, 1) ) - }; - - - case (ushort)Items.Dress: - return new CraftingRecipe[] { + }, + (ushort)Items.Dress => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,3)) }, new ItemNonInvBasic((ushort)Items.Dress, 1) ) - }; - - - case (ushort)Items.TShirt: - return new CraftingRecipe[] { + }, + (ushort)Items.TShirt => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,2)) }, new ItemNonInvBasic((ushort)Items.TShirt, 1) ) - }; - - - //case (ushort)Items.LightBlueTShirt: - // return new CraftingRecipe[] { - // new CraftingRecipe( - // new CraftingIn[]{ - // new CraftingIn(new ItemNonInv((ushort)Items.Cloth,2)), - // new CraftingIn(new ItemNonInvBasic((ushort)Items.Blueberries), - // }, - // new ItemNonInv((ushort)Items.LightBlueTShirt, 1) - // ) - // }; - - - case (ushort)Items.Shirt: - return new CraftingRecipe[] { + }, + //case (ushort)Items.LightBlueTShirt: + // return new CraftingRecipe[] { + // new CraftingRecipe( + // new CraftingIn[]{ + // new CraftingIn(new ItemNonInv((ushort)Items.Cloth,2)), + // new CraftingIn(new ItemNonInvBasic((ushort)Items.Blueberries), + // }, + // new ItemNonInv((ushort)Items.LightBlueTShirt, 1) + // ) + // }; + (ushort)Items.Shirt => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,2), new ItemNonInvBasic((ushort)Items.Shirt, 1)) - }; - + }, //case (ushort)Items.Dress: // return new CraftingRecipe[] { // new CraftingRecipe(new ItemNonInv((ushort)Items.Cloth,3), new ItemNonInv((ushort)Items.WhiteDress, 1)) // }; - - case (ushort)Items.CoatArmy: - return new CraftingRecipe[] { + (ushort)Items.CoatArmy => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[] { new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,3)), @@ -4335,15 +3747,11 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.CoatArmy, 1) ) - }; - - case (ushort)Items.Coat: - return new CraftingRecipe[] { + }, + (ushort)Items.Coat => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,3), new ItemNonInvBasic((ushort)Items.Coat, 1)) - }; - - case (ushort)Items.JacketDenim: - return new CraftingRecipe[] { + }, + (ushort)Items.JacketDenim => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[] { new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,2)), @@ -4351,10 +3759,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.JacketDenim,1) ) - }; - - case (ushort)Items.JacketFormal: - return new CraftingRecipe[] { + }, + (ushort)Items.JacketFormal => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,2)), @@ -4362,8 +3768,7 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.JacketFormal,1) ) - }; - + }, //case (ushort)Items.jac: // return new CraftingRecipe[] { // new CraftingRecipe( @@ -4374,9 +3779,7 @@ static class GameMethods { // new ItemNonInvBasic((ushort)Items.Jacket // ) // }; - - case (ushort)Items.JacketShort: - return new CraftingRecipe[] { + (ushort)Items.JacketShort => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4384,11 +3787,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.JacketShort,1) ) - }; - - - case (ushort)Items.SpaceSuit: - return new CraftingRecipe[] { + }, + (ushort)Items.SpaceSuit => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4399,10 +3799,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SpaceSuit,1) ) - }; - - case (ushort)Items.ArmyTrousers: - return new CraftingRecipe[] { + }, + (ushort)Items.ArmyTrousers => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4410,20 +3808,16 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.ArmyTrousers,1) ) - }; - - case (ushort)Items.Skirt: - return new CraftingRecipe[] { + }, + (ushort)Items.Skirt => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)) }, new ItemNonInvBasic((ushort)Items.Skirt,1) ) - }; - - case (ushort)Items.Jeans: - return new CraftingRecipe[] { + }, + (ushort)Items.Jeans => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4431,8 +3825,7 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Jeans,1) ) - }; - + }, //case (ushort)Items.Skirt: // return new CraftingRecipe[] { // new CraftingRecipe( @@ -4444,10 +3837,7 @@ static class GameMethods { // new ItemNonInvBasic((ushort)Items.PinkSkirt // ) // }; - - - case (ushort)Items.Shorts: - return new CraftingRecipe[] { + (ushort)Items.Shorts => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4455,11 +3845,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Shorts, 1) ) - }; - - - case (ushort)Items.SpaceTrousers: - return new CraftingRecipe[] { + }, + (ushort)Items.SpaceTrousers => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4468,10 +3855,8 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.SpaceTrousers,1) ) - }; - - case (ushort)Items.Bra: - return new CraftingRecipe[] { + }, + (ushort)Items.Bra => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4479,8 +3864,7 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Bra,1) ) - }; - + }, //case (ushort)Items.PurpleBra: // return new CraftingRecipe[] { // new CraftingRecipe( @@ -4492,8 +3876,6 @@ static class GameMethods { // new ItemNonInv((ushort)Items.PurpleBra, 1) // ) // }; - - //case (ushort)Items.RedBra: // return new CraftingRecipe[] { // new CraftingRecipe( @@ -4504,9 +3886,7 @@ static class GameMethods { // new ItemNonInv((ushort)Items.RedBra, 1) // ) // }; - - case (ushort)Items.BikiniTop: - return new CraftingRecipe[] { + (ushort)Items.BikiniTop => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4515,8 +3895,7 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.BikiniTop,1) ) - }; - + }, //case (ushort)Items.TopBlueBikini: // return new CraftingRecipe[] { // new CraftingRecipe( @@ -4528,9 +3907,7 @@ static class GameMethods { // new ItemNonInvBasic((ushort)Items.TopBlueBikini // ) // }; - - case (ushort)Items.Backpack: - return new CraftingRecipe[] { + (ushort)Items.Backpack => new CraftingRecipe[] { new CraftingRecipe( new CraftingIn[]{ new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)), @@ -4538,21 +3915,17 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.Backpack,1) ) - }; - - default: return null; - } + }, + _ => null, + }; } public static CraftingRecipe[] ToDust(ushort id) { - switch (id) { - case (ushort)Items.StoneHead: - return new CraftingRecipe[] { + return id switch { + (ushort)Items.StoneHead => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1), new ItemNonInvBasic((ushort)Items.StoneHead, 1)), - }; - - case (ushort)Items.IronDust: - return new CraftingRecipe[] { + }, + (ushort)Items.IronDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.IronDust, 2)), new CraftingRecipe( new ItemNonInvBasic((ushort)Items.ItemIron,1), @@ -4573,27 +3946,19 @@ static class GameMethods { }, new ItemNonInvBasic((ushort)Items.IronDust,2) ) - }; - - case (ushort)Items.CopperDust: - return new CraftingRecipe[] { + }, + (ushort)Items.CopperDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.CopperDust,2)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemCopper,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.CopperDust,3),0.75f)) - }; - - case (ushort)Items.BareLabel: - return new CraftingRecipe[] { + }, + (ushort)Items.BareLabel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BareLabel,1), new ItemNonInvBasic((ushort)Items.CopperDust,1)), - }; - - case (ushort)Items.TinDust: - return new CraftingRecipe[] { + }, + (ushort)Items.TinDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.TinIngot,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.TinDust,2),0.75f)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemTin,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.TinDust,1),0.75f)) - }; - - case (ushort)Items.BronzeDust: - return new CraftingRecipe[] { + }, + (ushort)Items.BronzeDust => new CraftingRecipe[] { new CraftingRecipe ( new CraftingIn[] { new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperIngot, 3)), @@ -4602,113 +3967,73 @@ static class GameMethods { new ItemNonInvBasic((ushort)Items.BronzeDust, 8) ), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.BronzeDust,2)) - }; - - case (ushort)Items.AluminiumDust: - return new CraftingRecipe[] { + }, + (ushort)Items.AluminiumDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot, 1), new ItemNonInvBasic((ushort)Items.AluminiumDust, 2)) - }; - - case (ushort)Items.WoodDust: - return new CraftingRecipe[] { + }, + (ushort)Items.WoodDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Stick,1), new ItemNonInvBasic((ushort)Items.WoodDust, 4)) - }; - - case (ushort)Items.GoldDust: - return new CraftingRecipe[] { + }, + (ushort)Items.GoldDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1), new ItemNonInvBasic((ushort)Items.GoldDust, 2)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemGold,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.GoldDust,3), 0.75f)) - }; - - case (ushort)Items.CoalDust: - return new CraftingRecipe[] { + }, + (ushort)Items.CoalDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.OreCoal,1), new ItemNonInvBasic((ushort)Items.CoalDust, 2)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CoalWood,1), new ItemNonInvBasic((ushort)Items.CoalDust, 2)) - }; - - case (ushort)Items.SilverDust: - return new CraftingRecipe[] { + }, + (ushort)Items.SilverDust => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SilverIngot,1), new ItemNonInvBasic((ushort)Items.SilverDust, 2)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemSilver,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.SilverDust,3), 0.75f)) - }; - - case (ushort)Items.CopperIngot: - return new CraftingRecipe[] { + }, + (ushort)Items.CopperIngot => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Label,1), new ItemNonInvBasic((ushort)Items.BareLabel,1)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CoalWood,1), new ItemNonInvBasic((ushort)Items.BareLabel, 2)) - }; - - case (ushort)Items.Gravel: - return new CraftingRecipe[] { + }, + (ushort)Items.Gravel => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1),new ItemNonInvBasic((ushort)Items.Gravel,1)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MediumStone, 2), new ItemNonInvBasic((ushort)Items.Gravel,1)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SmallStone, 4), new ItemNonInvBasic((ushort)Items.Gravel,1)), - }; - - case (ushort)Items.Sand: - return new CraftingRecipe[] { + }, + (ushort)Items.Sand => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Gravel,1), new ItemNonInvBasic((ushort)Items.Sand, 1)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Bricks,1), new ItemNonInvBasic((ushort)Items.Sand, 1)) - }; - - case (ushort)Items.WheatSeeds: - return new CraftingRecipe[] { + }, + (ushort)Items.WheatSeeds => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.WheatStraw,1), new ItemNonInvBasic((ushort)Items.WheatSeeds,1)) - }; - - case (ushort)Items.AxeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.AxeHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadIron,1)) - }; - - case (ushort)Items.PickaxeHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.PickaxeHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadIron,1)) - }; - - case (ushort)Items.ShovelHeadIron: - return new CraftingRecipe[] { + }, + (ushort)Items.ShovelHeadIron => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1)) - }; - - case (ushort)Items.Seeds: - return new CraftingRecipe[] { + }, + (ushort)Items.Seeds => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Hay,1), new ItemNonInvBasic((ushort)Items.Seeds,1)) - }; - - case (ushort)Items.Leave: - return new CraftingRecipe[] { + }, + (ushort)Items.Leave => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.OakLeaves,1), new ItemNonInvBasic((ushort)Items.Seeds, 4)) - }; - - case (ushort)Items.Yarn: - return new CraftingRecipe[] { + }, + (ushort)Items.Yarn => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,1), new ItemNonInvBasic((ushort)Items.Yarn, 2)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Rope,1), new ItemNonInvBasic((ushort)Items.Yarn, 1)), - }; - - case (ushort)Items.Cloth: - return new CraftingRecipe[] { + }, + (ushort)Items.Cloth => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Flag,1), new ItemNonInvBasic((ushort)Items.Cloth, 2)) - }; - - case (ushort)Items.Hay: - return new CraftingRecipe[] { + }, + (ushort)Items.Hay => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.HayBlock,1), new ItemNonInvBasic((ushort)Items.Hay, 2)) - }; - - case (ushort)Items.BucketWater: - return new CraftingRecipe[] { + }, + (ushort)Items.BucketWater => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Bucket,1), new ItemNonInvBasic((ushort)Items.Lemon, 4)), - }; - - case (ushort)Items.FlaxSeeds: - return new CraftingRecipe[] { + }, + (ushort)Items.FlaxSeeds => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Flax,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.FlaxSeeds,2),0.75f)) - }; - - case (ushort)Items.Label: - return new CraftingRecipe[] { + }, + (ushort)Items.Label => new CraftingRecipe[] { new CraftingRecipe( new ItemNonInvBasic((ushort)Items.Lamp,1), new CraftingOut[]{ @@ -4763,34 +4088,25 @@ static class GameMethods { new CraftingOut(new ItemNonInvBasic((ushort)Items.Motor, 1)) } ), - }; - - case (ushort)Items.SmallStone: - return new CraftingRecipe[] { + }, + (ushort)Items.SmallStone => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MediumStone,1), new ItemNonInvBasic((ushort)Items.SmallStone, 2)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1), new ItemNonInvBasic((ushort)Items.SmallStone, 4)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Stonerubble,1), new ItemNonInvBasic((ushort)Items.SmallStone, 4)), - }; - - case (ushort)Items.MediumStone: - return new CraftingRecipe[] { + }, + (ushort)Items.MediumStone => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1), new ItemNonInvBasic((ushort)Items.MediumStone, 2)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Stonerubble,1), new ItemNonInvBasic((ushort)Items.MediumStone, 2)), - }; - - case (ushort)Items.Stonerubble: - return new CraftingRecipe[] { + }, + (ushort)Items.Stonerubble => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SmallStone, 4), new ItemNonInvBasic((ushort)Items.Stonerubble, 1)), new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MediumStone, 2), new ItemNonInvBasic((ushort)Items.Stonerubble, 1)) - }; - - case (ushort)Items.Stick: - return new CraftingRecipe[] { + }, + (ushort)Items.Stick => new CraftingRecipe[] { new CraftingRecipe(new CraftingIn[]{ CraftingRecipe.AnyWood(1) }, new ItemNonInvBasic((ushort)Items.Stick, 4)) - }; - - default: return null; - } + }, + _ => null, + }; } public static int FoodMaxCount(ushort id) { @@ -5163,215 +4479,193 @@ static class GameMethods { } public static bool IsItemInvBasic32(ushort id) { - switch (id) { - case (ushort)Items.AngelHair: return true; - case (ushort)Items.ChristmasBallGray: return true; - case (ushort)Items.ChristmasBallBlue: return true; - case (ushort)Items.ChristmasBallLightGreen: return true; - case (ushort)Items.ChristmasBallOrange: return true; - case (ushort)Items.ChristmasBallPink: return true; - case (ushort)Items.ChristmasBallPurple: return true; - case (ushort)Items.ChristmasBallRed: return true; - case (ushort)Items.ChristmasBallYellow: return true; - case (ushort)Items.ChristmasBallTeal: return true; - case (ushort)Items.Rope: return true; - case (ushort)Items.Nail: return true; - case (ushort)Items.Bottle: return true; - case (ushort)Items.Flag: return true; - case (ushort)Items.Diode: return true; - case (ushort)Items.Tranzistor: return true; - case (ushort)Items.Rezistance: return true; - case (ushort)Items.Motor: return true; - case (ushort)Items.ElectricDrillOff: return true; - case (ushort)Items.ElectricSawOff: return true; - case (ushort)Items.LighterOFF: return true; - case (ushort)Items.TorchElectricOFF: return true; - case (ushort)Items.Condenser: return true; - case (ushort)Items.Rod: return true; - case (ushort)Items.Ammo: return true; + return id switch { + (ushort)Items.AngelHair => true, + (ushort)Items.ChristmasBallGray => true, + (ushort)Items.ChristmasBallBlue => true, + (ushort)Items.ChristmasBallLightGreen => true, + (ushort)Items.ChristmasBallOrange => true, + (ushort)Items.ChristmasBallPink => true, + (ushort)Items.ChristmasBallPurple => true, + (ushort)Items.ChristmasBallRed => true, + (ushort)Items.ChristmasBallYellow => true, + (ushort)Items.ChristmasBallTeal => true, + (ushort)Items.Rope => true, + (ushort)Items.Nail => true, + (ushort)Items.Bottle => true, + (ushort)Items.Flag => true, + (ushort)Items.Diode => true, + (ushort)Items.Tranzistor => true, + (ushort)Items.Rezistance => true, + (ushort)Items.Motor => true, + (ushort)Items.ElectricDrillOff => true, + (ushort)Items.ElectricSawOff => true, + (ushort)Items.LighterOFF => true, + (ushort)Items.TorchElectricOFF => true, + (ushort)Items.Condenser => true, + (ushort)Items.Rod => true, + (ushort)Items.Ammo => true, //case (ushort)Items.ItemBattery: return true; - case (ushort)Items.Label: return true; - case (ushort)Items.BareLabel: return true; - case (ushort)Items.Bricks: return true; - case (ushort)Items.plateAluminium: return true; - case (ushort)Items.PlateBronze: return true; - case (ushort)Items.PlateIron: return true; - case (ushort)Items.PlateGold: return true; - case (ushort)Items.PlateCopper: return true; - case (ushort)Items.MudIngot: return true; - case (ushort)Items.Bulb: return true; - - case (ushort)Items.CopperIngot: return true; - case (ushort)Items.TinIngot: return true; - case (ushort)Items.BronzeIngot: return true; - case (ushort)Items.GoldIngot: return true; - case (ushort)Items.SilverIngot: return true; - case (ushort)Items.IronIngot: return true; - case (ushort)Items.SteelIngot: return true; - case (ushort)Items.AluminiumIngot: return true; - - - case (ushort)Items.Egg: return true; - case (ushort)Items.TinEmpty: return true; - case (ushort)Items.Circuit: return true; - case (ushort)Items.BigCircuit: return true; - case (ushort)Items.WindMill: return true; - case (ushort)Items.OneBrick: return true; - case (ushort)Items.TestTube: return true; - - - case (ushort)Items.AxeHeadCopper: return true; - case (ushort)Items.AxeHeadBronze: return true; - case (ushort)Items.AxeHeadGold: return true; - case (ushort)Items.AxeHeadIron: return true; - case (ushort)Items.AxeHeadSteel: return true; - case (ushort)Items.AxeHeadAluminium: return true; - - case (ushort)Items.ShovelHeadCopper: return true; - case (ushort)Items.ShovelHeadBronze: return true; - case (ushort)Items.ShovelHeadGold: return true; - case (ushort)Items.ShovelHeadIron: return true; - case (ushort)Items.ShovelHeadSteel: return true; - case (ushort)Items.ShovelHeadAluminium: return true; - - case (ushort)Items.PickaxeHeadCopper: return true; - case (ushort)Items.PickaxeHeadBronze: return true; - case (ushort)Items.PickaxeHeadGold: return true; - case (ushort)Items.PickaxeHeadIron: return true; - case (ushort)Items.PickaxeHeadSteel: return true; - case (ushort)Items.PickaxeHeadAluminium: return true; - - case (ushort)Items.ShearsHeadCopper: return true; - case (ushort)Items.ShearsHeadBronze: return true; - case (ushort)Items.ShearsHeadGold: return true; - case (ushort)Items.ShearsHeadIron: return true; - case (ushort)Items.ShearsHeadSteel: return true; - case (ushort)Items.ShearsHeadAluminium: return true; - - case (ushort)Items.KnifeHeadCopper: return true; - case (ushort)Items.KnifeHeadBronze: return true; - case (ushort)Items.KnifeHeadGold: return true; - case (ushort)Items.KnifeHeadIron: return true; - case (ushort)Items.KnifeHeadSteel: return true; - case (ushort)Items.KnifeHeadAluminium: return true; - - } - return false; + (ushort)Items.Label => true, + (ushort)Items.BareLabel => true, + (ushort)Items.Bricks => true, + (ushort)Items.plateAluminium => true, + (ushort)Items.PlateBronze => true, + (ushort)Items.PlateIron => true, + (ushort)Items.PlateGold => true, + (ushort)Items.PlateCopper => true, + (ushort)Items.MudIngot => true, + (ushort)Items.Bulb => true, + (ushort)Items.CopperIngot => true, + (ushort)Items.TinIngot => true, + (ushort)Items.BronzeIngot => true, + (ushort)Items.GoldIngot => true, + (ushort)Items.SilverIngot => true, + (ushort)Items.IronIngot => true, + (ushort)Items.SteelIngot => true, + (ushort)Items.AluminiumIngot => true, + (ushort)Items.Egg => true, + (ushort)Items.TinEmpty => true, + (ushort)Items.Circuit => true, + (ushort)Items.BigCircuit => true, + (ushort)Items.WindMill => true, + (ushort)Items.OneBrick => true, + (ushort)Items.TestTube => true, + (ushort)Items.AxeHeadCopper => true, + (ushort)Items.AxeHeadBronze => true, + (ushort)Items.AxeHeadGold => true, + (ushort)Items.AxeHeadIron => true, + (ushort)Items.AxeHeadSteel => true, + (ushort)Items.AxeHeadAluminium => true, + (ushort)Items.ShovelHeadCopper => true, + (ushort)Items.ShovelHeadBronze => true, + (ushort)Items.ShovelHeadGold => true, + (ushort)Items.ShovelHeadIron => true, + (ushort)Items.ShovelHeadSteel => true, + (ushort)Items.ShovelHeadAluminium => true, + (ushort)Items.PickaxeHeadCopper => true, + (ushort)Items.PickaxeHeadBronze => true, + (ushort)Items.PickaxeHeadGold => true, + (ushort)Items.PickaxeHeadIron => true, + (ushort)Items.PickaxeHeadSteel => true, + (ushort)Items.PickaxeHeadAluminium => true, + (ushort)Items.ShearsHeadCopper => true, + (ushort)Items.ShearsHeadBronze => true, + (ushort)Items.ShearsHeadGold => true, + (ushort)Items.ShearsHeadIron => true, + (ushort)Items.ShearsHeadSteel => true, + (ushort)Items.ShearsHeadAluminium => true, + (ushort)Items.KnifeHeadCopper => true, + (ushort)Items.KnifeHeadBronze => true, + (ushort)Items.KnifeHeadGold => true, + (ushort)Items.KnifeHeadIron => true, + (ushort)Items.KnifeHeadSteel => true, + (ushort)Items.KnifeHeadAluminium => true, + _ => false, + }; } public static bool IsItemInvTool32(ushort id) { - switch (id) { + return id switch { // Hoe - case (ushort)Items.HoeStone: return true; - case (ushort)Items.HoeCopper: return true; - case (ushort)Items.HoeBronze: return true; - case (ushort)Items.HoeIron: return true; - case (ushort)Items.HoeGold: return true; - case (ushort)Items.HoeAluminium: return true; - case (ushort)Items.HoeSteel: return true; - + (ushort)Items.HoeStone => true, + (ushort)Items.HoeCopper => true, + (ushort)Items.HoeBronze => true, + (ushort)Items.HoeIron => true, + (ushort)Items.HoeGold => true, + (ushort)Items.HoeAluminium => true, + (ushort)Items.HoeSteel => true, // Knife - case (ushort)Items.KnifeCopper: return true; - case (ushort)Items.KnifeBronze: return true; - case (ushort)Items.KnifeIron: return true; - case (ushort)Items.KnifeSteel: return true; - case (ushort)Items.KnifeAluminium: return true; - case (ushort)Items.KnifeGold: return true; - + (ushort)Items.KnifeCopper => true, + (ushort)Items.KnifeBronze => true, + (ushort)Items.KnifeIron => true, + (ushort)Items.KnifeSteel => true, + (ushort)Items.KnifeAluminium => true, + (ushort)Items.KnifeGold => true, // Pickaxe - case (ushort)Items.PickaxeStone: return true; - case (ushort)Items.PickaxeIron: return true; - case (ushort)Items.PickaxeCopper: return true; - case (ushort)Items.PickaxeBronze: return true; - case (ushort)Items.PickaxeSteel: return true; - case (ushort)Items.PickaxeGold: return true; - case (ushort)Items.PickaxeAluminium: return true; - + (ushort)Items.PickaxeStone => true, + (ushort)Items.PickaxeIron => true, + (ushort)Items.PickaxeCopper => true, + (ushort)Items.PickaxeBronze => true, + (ushort)Items.PickaxeSteel => true, + (ushort)Items.PickaxeGold => true, + (ushort)Items.PickaxeAluminium => true, // Axe - case (ushort)Items.AxeStone: return true; - case (ushort)Items.AxeIron: return true; - case (ushort)Items.AxeSteel: return true; - case (ushort)Items.AxeAluminium: return true; - case (ushort)Items.AxeCopper: return true; - case (ushort)Items.AxeBronze: return true; - case (ushort)Items.AxeGold: return true; - + (ushort)Items.AxeStone => true, + (ushort)Items.AxeIron => true, + (ushort)Items.AxeSteel => true, + (ushort)Items.AxeAluminium => true, + (ushort)Items.AxeCopper => true, + (ushort)Items.AxeBronze => true, + (ushort)Items.AxeGold => true, // Shovel - case (ushort)Items.ShovelStone: return true; - case (ushort)Items.ShovelIron: return true; - case (ushort)Items.ShovelSteel: return true; - case (ushort)Items.ShovelAluminium: return true; - case (ushort)Items.ShovelGold: return true; - case (ushort)Items.ShovelCopper: return true; - case (ushort)Items.ShovelBronze: return true; - + (ushort)Items.ShovelStone => true, + (ushort)Items.ShovelIron => true, + (ushort)Items.ShovelSteel => true, + (ushort)Items.ShovelAluminium => true, + (ushort)Items.ShovelGold => true, + (ushort)Items.ShovelCopper => true, + (ushort)Items.ShovelBronze => true, // Saw - case (ushort)Items.SawCopper: return true; - case (ushort)Items.SawBronze: return true; - case (ushort)Items.SawIron: return true; - case (ushort)Items.SawGold: return true; - case (ushort)Items.SawSteel: return true; - case (ushort)Items.SawAluminium: return true; - + (ushort)Items.SawCopper => true, + (ushort)Items.SawBronze => true, + (ushort)Items.SawIron => true, + (ushort)Items.SawGold => true, + (ushort)Items.SawSteel => true, + (ushort)Items.SawAluminium => true, // Hammer - case (ushort)Items.HammerBronze: return true; - case (ushort)Items.HammerIron: return true; - case (ushort)Items.HammerCopper: return true; - case (ushort)Items.HammerAluminium: return true; - case (ushort)Items.HammerGold: return true; - case (ushort)Items.HammerSteel: return true; - + (ushort)Items.HammerBronze => true, + (ushort)Items.HammerIron => true, + (ushort)Items.HammerCopper => true, + (ushort)Items.HammerAluminium => true, + (ushort)Items.HammerGold => true, + (ushort)Items.HammerSteel => true, // Shears - case (ushort)Items.ShearsCopper: return true; - case (ushort)Items.ShearsBronze: return true; - case (ushort)Items.ShearsIron: return true; - case (ushort)Items.ShearsAluminium: return true; - case (ushort)Items.ShearsGold: return true; - case (ushort)Items.ShearsSteel: return true; - + (ushort)Items.ShearsCopper => true, + (ushort)Items.ShearsBronze => true, + (ushort)Items.ShearsIron => true, + (ushort)Items.ShearsAluminium => true, + (ushort)Items.ShearsGold => true, + (ushort)Items.ShearsSteel => true, // Electric - case (ushort)Items.ElectricDrill: return true; - case (ushort)Items.ElectricSaw: return true; - - case (ushort)Items.TorchElectricON: return true; - - case (ushort)Items.BottleOil: return true; - case (ushort)Items.BottleSaltWater: return true; - case (ushort)Items.BottleWater: return true; - case (ushort)Items.Gun: return true; - - case (ushort)Items.LighterON: return true; - case (ushort)Items.AirTank2: return true; - case (ushort)Items.AirTank: return true; - - case (ushort)Items.DyeArmy: return true; - case (ushort)Items.DyeBlack: return true; - case (ushort)Items.DyeBlue: return true; - case (ushort)Items.DyeBrown: return true; - case (ushort)Items.DyeDarkBlue: return true; - case (ushort)Items.DyeDarkGray: return true; - case (ushort)Items.DyeDarkGreen: return true; - case (ushort)Items.DyeDarkRed: return true; - case (ushort)Items.DyeGold: return true; - case (ushort)Items.DyeGray: return true; - case (ushort)Items.DyeGreen: return true; - case (ushort)Items.DyeLightBlue: return true; - case (ushort)Items.DyeLightGray: return true; - case (ushort)Items.DyeLightGreen: return true; - case (ushort)Items.DyeMagenta: return true; - case (ushort)Items.DyeOlive: return true; - case (ushort)Items.DyeOrange: return true; - case (ushort)Items.DyePink: return true; - case (ushort)Items.DyePurple: return true; - case (ushort)Items.DyeRed: return true; - case (ushort)Items.DyeRoseQuartz: return true; - case (ushort)Items.DyeSpringGreen: return true; - case (ushort)Items.DyeTeal: return true; - case (ushort)Items.DyeViolet: return true; - case (ushort)Items.DyeWhite: return true; - case (ushort)Items.DyeYellow: return true; - } - return false; + (ushort)Items.ElectricDrill => true, + (ushort)Items.ElectricSaw => true, + (ushort)Items.TorchElectricON => true, + (ushort)Items.BottleOil => true, + (ushort)Items.BottleSaltWater => true, + (ushort)Items.BottleWater => true, + (ushort)Items.Gun => true, + (ushort)Items.LighterON => true, + (ushort)Items.AirTank2 => true, + (ushort)Items.AirTank => true, + (ushort)Items.DyeArmy => true, + (ushort)Items.DyeBlack => true, + (ushort)Items.DyeBlue => true, + (ushort)Items.DyeBrown => true, + (ushort)Items.DyeDarkBlue => true, + (ushort)Items.DyeDarkGray => true, + (ushort)Items.DyeDarkGreen => true, + (ushort)Items.DyeDarkRed => true, + (ushort)Items.DyeGold => true, + (ushort)Items.DyeGray => true, + (ushort)Items.DyeGreen => true, + (ushort)Items.DyeLightBlue => true, + (ushort)Items.DyeLightGray => true, + (ushort)Items.DyeLightGreen => true, + (ushort)Items.DyeMagenta => true, + (ushort)Items.DyeOlive => true, + (ushort)Items.DyeOrange => true, + (ushort)Items.DyePink => true, + (ushort)Items.DyePurple => true, + (ushort)Items.DyeRed => true, + (ushort)Items.DyeRoseQuartz => true, + (ushort)Items.DyeSpringGreen => true, + (ushort)Items.DyeTeal => true, + (ushort)Items.DyeViolet => true, + (ushort)Items.DyeWhite => true, + (ushort)Items.DyeYellow => true, + _ => false, + }; } public static bool IsItemInvFood16(ushort id) { @@ -5679,7 +4973,7 @@ static class GameMethods { public static bool ItemsCanBeFill(ushort itemId, byte Liquid, ref int max, ref ushort newId){ switch (Liquid) { - + case (byte)LiquidId.Water: switch (itemId) { case (ushort)Items.Bucket: @@ -5819,7 +5113,7 @@ static class GameMethods { newId=(ushort)Items.ChristmasBallGray; max=50; return true; - + case (ushort)Items.ChristmasBallYellow: newId=(ushort)Items.ChristmasBallGray; max=50; @@ -6154,7 +5448,7 @@ static class GameMethods { return; } - public static float FurnaceStoneBurnWood(ushort id) { + public static float FurnaceStoneBurnWood(ushort id) { switch (id) { case (ushort)Items.WoodOak: return 0.25f; case (ushort)Items.WoodPine: return 0.25f; @@ -6174,7 +5468,7 @@ static class GameMethods { case (ushort)Items.EucalyptusWood: return 0.225f; case (ushort)Items.AcaciaWood: return 0.225f; case (ushort)Items.KapokWood: return 0.22f; - + case (ushort)Items.OreCoal: return 0.5f; case (ushort)Items.Stick: return 0.02f; case (ushort)Items.Paper: return 0.05f; diff --git a/rabcrClient/InterLogic/Game/Structs.cs b/rabcrClient/InterLogic/Game/Structs.cs index 7d28ffa..6998acf 100644 --- a/rabcrClient/InterLogic/Game/Structs.cs +++ b/rabcrClient/InterLogic/Game/Structs.cs @@ -1,60 +1,38 @@ using Microsoft.Xna.Framework; +using System; using System.Collections.Generic; -//namespace rabcrClient { -public class/*struct*/ DInt { - public int X, Y; - // public bool Defined; - //static DInt zero=new DInt(0, 0), - // notDefined=new DInt(0, 0){ Defined=false }; - - //public static DInt Zero => zero; +public class DInt : IEquatable{ - //public static DInt NotDefined => notDefined; + public int X, Y; public DInt () { } public DInt (int x, int y) { X = x; Y = y; - // Defined=true; } - //public DInt (Vector2 vec) { - // X = (int)vec.X; - // Y = (int)vec.Y; - // // Defined=true; - // } - -// public Vector2 Vector() => new Vector2(X, Y); + public Vector2 ToVector() => new Vector2(X, Y); public DInt Clone() => (DInt)MemberwiseClone(); -} -//public class InventorySlot { -// public Texture2D Texture; -// public int Id, Count; + public bool Equals(DInt other) => X==other.X && Y==other.Y; -// public InventorySlot() { -// Id = 0; -// Count = 0; -// } + public void Deconstruct(out int x, out int y) { + x = X; + y = Y; + } -// public InventorySlot(int id, int count) { -// Id = id; -// Count = count; -// } -//} + public static bool operator != (DInt value1, DInt value2) => value1.X != value2.X || value1.Y != value2.Y; + public static bool operator == (DInt value1, DInt value2) => value1.X == value2.X && value1.Y == value2.Y; -public /*class*/struct ShortAndByte { +} + +public struct ShortAndByte { public short X; public byte Y; - //public ShortAndByte() { - // X = 0; - // Y = 0; - //} - public ShortAndByte(int x, int y) { X=(short)x; Y=(byte)y; @@ -64,71 +42,14 @@ X = x; Y = y; } - -// public Vector2 Vector() => new Vector2(X, Y); } public struct UShortAndByte { public ushort X; public byte Y; - //public UShortAndByte(int x, int y) { - // X=(short)x; - // Y=(byte)y; - //} - public UShortAndByte(ushort x, byte y) { X = x; Y = y; } - - //public Vector2 Vector() => new Vector2(X, Y); -} - -public class DListInt { - public List List1, List2; - - //public DListInt () { - // List1=new List(); - // List2=new List(); - //} - - //public DListInt (List list1, List list2) { - // List1=list1; - // List2=list2; - //} - - //public DListInt (List list1, DInt list2Item) { - // List1=list1; - // List2=new List { - // list2Item - // }; - //} - - //public DListInt (DInt list1Item, List list2) { - // List2=list2; - // List1=new List { - // list1Item - // }; - //} - - //public DListInt (DInt list1Item, DInt list2Item) { - // List1=new List { - // list1Item - // }; - - // List2=new List { - // list2Item - // }; - //} - - //public DListInt (List list) { - // List1=list; - // List2=list; - //} - - //public DListInt (List list1, DInt[] list2) { - // List1=list1; - // List2=list2.ToList(); - //} } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs index 00d8336..49d6ed5 100644 --- a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs +++ b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading; -namespace rabcrClient { - public class GenDataBasic { +namespace rabcrClient { + public class GenDataBasic { public ushort Id; public virtual void SaveTop(List list) { } @@ -74,87 +76,23 @@ enum Biome :byte { SpaceStation, } - public class GenDataWater: GenDataBasic{ - public override void SaveTop(List list) { + public class GenDataWater: GenDataBasic{ + public override void SaveTop(List list) { list.Add(255); } - } - + } + public class GenerateWorld { - //readonly GenDataBasic - // (ushort)BlockId.Gravel =new GenDataBasic{ Id=(ushort)BlockId. Gravel }, - // (ushort)BlockId.Sand =new GenDataBasic{ Id=(ushort)BlockId. Sand }, - // (ushort)BlockId.Cobblestone=new GenDataBasic{ Id=(ushort)BlockId. Cobblestone }, - // (ushort)BlockId.Snow =new GenDataBasic{ Id=(ushort)BlockId. Snow }, - // (ushort)BlockId.Dandelion =new GenDataBasic{ Id=(ushort)BlockId. Dandelion }, - // (ushort)BlockId.SnowTop =new GenDataBasic{ Id=(ushort)BlockId. SnowTop }, - // (ushort)BlockId.Coral =new GenDataBasic{ Id=(ushort)BlockId. Coral }, - // (ushort)BlockId.GrassBlockHills =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockHills }, - // (ushort)BlockId.GrassBlockForest =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockForest }, - // (ushort)BlockId.GrassBlockJungle =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockJungle }, - // (ushort)BlockId.GrassBlockDesert =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockDesert }, - // (ushort)BlockId.GrassBlockPlains =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockPlains }, - // (ushort)BlockId.GrassBlockClay =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockClay }, - // (ushort)BlockId.Heater =new GenDataBasic{ Id=(ushort)BlockId. Heather }, - // (ushort)BlockId.Rocks =new GenDataBasic{ Id=(ushort)BlockId. Rocks }, - // (ushort)BlockId.GrassHills =new GenDataBasic{ Id=(ushort)BlockId. GrassHills }, - // (ushort)BlockId.GrassJungle =new GenDataBasic{ Id=(ushort)BlockId. GrassJungle }, - // (ushort)BlockId.GrassDesert =new GenDataBasic{ Id=(ushort)BlockId. GrassDesert }, - // (ushort)BlockId.GrassForest =new GenDataBasic{ Id=(ushort)BlockId. GrassForest }, - // (ushort)BlockId.GrassPlains =new GenDataBasic{ Id=(ushort)BlockId. GrassPlains }, - // (ushort)BlockId.Alore =new GenDataBasic{ Id=(ushort)BlockId. Alore }, - // (ushort)BlockId.BranchALittle1 =new GenDataBasic{ Id=(ushort)BlockId. BranchALittle1 }, - // (ushort)BlockId.BranchALittle2 =new GenDataBasic{ Id=(ushort)BlockId. BranchALittle2 }, - // (ushort)BlockId.BranchFull =new GenDataBasic{ Id=(ushort)BlockId. BranchFull }, - // (ushort)BlockId.BranchWithout =new GenDataBasic{ Id=(ushort)BlockId. BranchWithout }, - // (ushort)BlockId.Boletus =new GenDataBasic{ Id=(ushort)BlockId. Boletus }, - // (ushort)BlockId.Toadstool =new GenDataBasic{ Id=(ushort)BlockId. Toadstool }, - // (ushort)BlockId.Champignon =new GenDataBasic{ Id=(ushort)BlockId. Champignon }, - // (ushort)BlockId.Rose =new GenDataBasic{ Id=(ushort)BlockId. Rose }, - // (ushort)BlockId.Violet =new GenDataBasic{ Id=(ushort)BlockId. Violet }, - // (ushort)BlockId.Orchid =new GenDataBasic{ Id=(ushort)BlockId. Orchid }, - // (ushort)BlockId.Ice =new GenDataBasic{ Id=(ushort)BlockId. Ice }, - // (ushort)BlockId.Seaweed =new GenDataBasic{ Id=(ushort)BlockId. Seaweed }, - // (ushort)BlockId.Water =new GenDataWater{ Id=(ushort)BlockId. WaterBlock }, - // waterSalt =new GenDataWater{ Id=(ushort)BlockId. WaterSalt }, - // (ushort)BlockId.StoneBasalt =new GenDataBasic{ Id=(ushort)BlockId. StoneBasalt }, - // (ushort)BlockId.StoneDiorit =new GenDataBasic{ Id=(ushort)BlockId. StoneDiorit }, - // (ushort)BlockId.StoneDolomite =new GenDataBasic{ Id=(ushort)BlockId. StoneDolomite }, - // (ushort)BlockId.StoneGabbro =new GenDataBasic{ Id=(ushort)BlockId. StoneGabbro }, - // (ushort)BlockId.StoneGneiss =new GenDataBasic{ Id=(ushort)BlockId. StoneGneiss }, - // clay =new GenDataBasic{ Id=(ushort)BlockId. Clay }, - // (ushort)BlockId.StoneLimestone =new GenDataBasic{ Id=(ushort)BlockId. StoneLimestone }, - // (ushort)BlockId.StoneRhyolite =new GenDataBasic{ Id=(ushort)BlockId. StoneRhyolite }, - // (ushort)BlockId.OreAluminium =new GenDataBasic{ Id=(ushort)BlockId. OreAluminium }, - // (ushort)BlockId.OreCopper =new GenDataBasic{ Id=(ushort)BlockId. OreCopper }, - // (ushort)BlockId.OreGold =new GenDataBasic{ Id=(ushort)BlockId. OreGold }, - // (ushort)BlockId.OreIron =new GenDataBasic{ Id=(ushort)BlockId. OreIron }, - // (ushort)BlockId.OreSaltpeter =new GenDataBasic{ Id=(ushort)BlockId. OreSaltpeter }, - // (ushort)BlockId.OreSilver =new GenDataBasic{ Id=(ushort)BlockId. OreSilver }, - // (ushort)BlockId.OreSulfur =new GenDataBasic{ Id=(ushort)BlockId. OreSulfur }, - // (ushort)BlockId.OreTin =new GenDataBasic{ Id=(ushort)BlockId. OreTin }, - // (ushort)BlockId.Oil =new GenDataBasic{ Id=(ushort)BlockId. Oil }, - // (ushort)BlockId.MudStone =new GenDataBasic{ Id=(ushort)BlockId. MudStone }, - // (ushort)BlockId.StoneSandstone =new GenDataBasic{ Id=(ushort)BlockId. StoneSandstone }, - // (ushort)BlockId.StoneSchist =new GenDataBasic{ Id=(ushort)BlockId. StoneSchist }, - // (ushort)BlockId.GrassBlockCompost =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockCompost }, - // (ushort)BlockId.Compost =new GenDataBasic{ Id=(ushort)BlockId. Compost }, - // (ushort)BlockId.Regolite =new GenDataBasic{ Id=(ushort)BlockId. Regolite }, - // (ushort)BlockId.Anorthosite =new GenDataBasic{ Id=(ushort)BlockId. Anorthosite }, - // (ushort)BlockId.Lava =new GenDataBasic{ Id=(ushort)BlockId. Lava }, - // (ushort)BlockId.RedSand =new GenDataBasic{ Id=(ushort)BlockId. RedSand }, - // (ushort)BlockId.OreCoal =new GenDataBasic{ Id=(ushort)BlockId. OreCoal }, - // (ushort)BlockId.Dirt =new GenDataBasic{ Id=(ushort)BlockId. Dirt }; - - void SetLeave(GChunk chunk, int x, int y, ushort id, GenTree tree){ + + void SetLeave(GChunk chunk, int x, int y, ushort id, GenTree tree){ if (chunk.TopBlocks[y]==0){ - chunk.TopBlocks[y]=id; + chunk.TopBlocks[y]=id; byte by=(byte)y; tree.AddLeave(x, by); - if (chunk.SetLightPosHalf) { + if (chunk.SetLightPosHalf) { if (y LiveObjects = new List(); - //enum Biome :byte { - // SaltOcean, - // // SugarOcean, - - // HotPlains, - // //_polar, - // Arctic, - // //CoolTemperateDesertScrub, - // //ArticMountains, - - // // _Subarctic, - // Tundra, - // // ArcticAlpineDesert, - - // //_Mild, - // Bog, - // // Wetland, - // // TemperateFreshWaterSwampForest, - // // Saltmarsh, - // Subtropics, - // // Heath, - - // //_Tropical, - // Desert, - // Savanna, - // Mangrove, - - // //WarmTemperateDesert, - - // TropicalRainforest, - // WetTundra, - // Taiga, - // Swamp, - // Plains, - // LeaveForest, - // Jungle, - // ColdTaiga, - // DryTundra, - // Fen, - // ArcticPlains, - // BothForest, - // Beach, - // SpruceForest, - // HumidSubtropical, - //} - + enum HotBiome:byte{ None, @@ -261,13 +154,13 @@ enum ChangerBiome: byte{ void GenerateBiome(WetBiome wet, HotBiome hot, ChangerBiome changer, bool IsOceanNear) { switch (hot) { - case HotBiome.Ocean: + case HotBiome.Ocean: BiomeOcean(); BiomeOceanUp(); return; - - case HotBiome.Arctic: + + case HotBiome.Arctic: switch (wet) { case WetBiome.Low: BiomeCoolTemperateDesertScrub(); @@ -277,9 +170,9 @@ enum ChangerBiome: byte{ BiomePoles(changer); return; } - - case HotBiome.Subarctic: + + case HotBiome.Subarctic: switch (wet) { case WetBiome.Low: BiomeDryTundra(/*changer*/); @@ -293,9 +186,9 @@ enum ChangerBiome: byte{ BiomeTundra(/*changer*/); return; } - - case HotBiome.ColdTaiga: + + case HotBiome.ColdTaiga: switch (wet) { case WetBiome.Low: BiomePlains(/*changer,wet,hot*/); @@ -309,9 +202,9 @@ enum ChangerBiome: byte{ BiomeColdTaiga(/*changer*/); return; } - - case HotBiome.Taiga: + + case HotBiome.Taiga: switch (wet) { case WetBiome.Low: BiomePlains(/*changer,wet,hot*/); @@ -325,9 +218,9 @@ enum ChangerBiome: byte{ BiomeTaiga(/*changer*/); return; } - - case HotBiome.SpruceForest: + + case HotBiome.SpruceForest: switch (wet) { case WetBiome.Low: BiomePlains(/*changer,wet,hot*/); @@ -341,9 +234,9 @@ enum ChangerBiome: byte{ BiomeSpruceForest(/*changer*/); return; } - - case HotBiome.BothForest: + + case HotBiome.BothForest: switch (wet) { case WetBiome.Low: BiomePlains(/*changer,wet,hot*/); @@ -357,9 +250,9 @@ enum ChangerBiome: byte{ BiomeBothForest(/*changer*/); return; } - - case HotBiome.LeaveForest: + + case HotBiome.LeaveForest: switch (wet) { case WetBiome.Low: BiomePlains(/*changer,wet,hot*/); @@ -373,9 +266,9 @@ enum ChangerBiome: byte{ BiomeLeaveForest(/*changer*/); return; } - - case HotBiome.Subtropics: + + case HotBiome.Subtropics: switch (wet) { case WetBiome.Low: BiomeSubtropicsPlains(/*changer*/); @@ -389,14 +282,14 @@ enum ChangerBiome: byte{ BiomeSubtropics(/*changer*/); return; } - - case HotBiome.Desert: + + case HotBiome.Desert: BiomeDesert(/*changer,wet*/); return; - - case HotBiome.Savanna: + + case HotBiome.Savanna: switch (wet) { case WetBiome.Low: BiomeSubtropicsPlains(/*changer*/); @@ -414,9 +307,9 @@ enum ChangerBiome: byte{ BiomeSavana(/*changer,wet*/); return; } - - case HotBiome.Tropical: + + case HotBiome.Tropical: if (IsOceanNear){ BiomeMangrove(); return; @@ -435,21 +328,21 @@ enum ChangerBiome: byte{ return; } } - + } } List GeneratePartOfBiomes(){ List Biomes=new List(); - int ocean=random.Int(12)+1; - // int ocean2=random.Int(12); + int ocean=FastRandom.Int(12)+1; + // int ocean2=FastRandom.Int(12); for (int i = 1; i<13; i++) { if (i==ocean) { Biomes.Add(new BiomeExt(){ Temterature=HotBiome.Ocean }); } else { - switch (random.Int3()){ + switch (FastRandom.Int3()){ case 2: Biomes.Add(new BiomeExt(){ Temterature=(HotBiome)(i+2), @@ -529,7 +422,7 @@ public enum WorldSize : byte{ bool hill=true; int treeChange=/*9*/2; - //random random; + //FastRandom FastRandom; int biomeSize; readonly string playedWorld; @@ -543,18 +436,18 @@ public enum WorldSize : byte{ ushort plantPrefer; int plantSeek; - readonly FastRandom random; + // readonly FastRandom FastRandom; public GenerateWorld(string dir, WorldSize ws) { playedWorld=dir; - random=Rabcr.random; - // _boolBits=(uint)/*~*/random.Int(); + // FastRandom=Rabcr.FastRandom; + // _boolBits=(uint)/*~*/FastRandom.Int(); // type=ntype; currentWorldSize=ws; } void AddCactus(int x, int y, int height, ushort id) { - + GChunk chunk = terrain[x]; @@ -563,7 +456,7 @@ public enum WorldSize : byte{ int to=y-height; - for (; y>to; y--) { + for (; y>to; y--) { if (chunk.TopBlocks[y]!=0) break; chunk.TopBlocks[y]=id; cactus.Add(x, y); @@ -656,10 +549,14 @@ public enum WorldSize : byte{ else Biomes[i].Humidity=WetBiome.Low; } - foreach (BiomeExt biome in Biomes){ + foreach (BiomeExt biome in Biomes) { GenerateBiome(biome.Humidity,biome.Temterature,biome.Changer,biome.oceanIndex==1); } + for (int i=100; i { - (byte)(/*random.Int2()*/random.Int2()-1), - (byte)(/*random.Int2()*/random.Int2()-1), + (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1), + (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1), 0, - (byte)(/*random.Int2()*/random.Int2()-1), + (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1), - (byte)(/*random.Int2()*/random.Int2()-1), + (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1), 1, - (byte)(/*random.Int2()*/random.Int2()-1), - (byte)(/*random.Int2()*/random.Int2()-1) + (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1), + (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1) }; @@ -728,10 +618,6 @@ public enum WorldSize : byte{ } Save("Moon"); - - // File.WriteAllText(playedWorld + @"\MoonGenerated.txt", (terrain.Count-7).ToString()); - // Finish=true; - // Console.WriteLine("Vygenerováno za "+(((DateTime.Now-now).TotalMilliseconds)/1000f).ToString(".000")+"s"); } void GenerateMars() { @@ -741,18 +627,18 @@ public enum WorldSize : byte{ biomes=new List { 0, - random.Byte3(), + FastRandom.Byte3(), 1, - random.Byte3(), + FastRandom.Byte3(), 3, - random.Byte3(), + FastRandom.Byte3(), 0, 0, - random.Byte3(), + FastRandom.Byte3(), 1, - random.Byte3(), + FastRandom.Byte3(), 2, - random.Byte3(), + FastRandom.Byte3(), 0, }; @@ -805,16 +691,16 @@ public enum WorldSize : byte{ if (terrainHeight>52+5+2) terrainHeight--; else if (terrainHeight<49+6+2) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=4+random.Int5(); + terrainChange=4+FastRandom.Int5(); } else terrainChange--; if (seabedChange<0) { seabedSand=!seabedSand; - seabedChange=10+random.Int(20); + seabedChange=10+FastRandom.Int(20); } else seabedChange--; chunk.LightPosFull=terrainHeight; @@ -825,17 +711,17 @@ public enum WorldSize : byte{ // Water for (int yy=53; yy54){ - if (random.Bool()) { - if (random.Bool()) chunk.BackBlocks[terrainHeight-1]=(ushort)BlockId.Seaweed; + if (FastRandom.Bool()) { + if (FastRandom.Bool()) chunk.BackBlocks[terrainHeight-1]=(ushort)BlockId.Seaweed; else chunk.BackBlocks[terrainHeight-1]=(ushort)BlockId.Coral; - } + } } // Seabed @@ -859,7 +745,7 @@ public enum WorldSize : byte{ // Terrain height if (terrainChange<0) { terrainHeight--; - terrainChange=3+random.Int3(); + terrainChange=3+FastRandom.Int3(); } else terrainChange--; chunk.LightPosFull=terrainHeight; @@ -870,15 +756,15 @@ public enum WorldSize : byte{ // Water for (int yy=53; yy3) dirtHeight--; // else if (dirtHeight<2) dirtHeight++; // else { - // if (random.Bool()) dirtHeight++; + // if (FastRandom.Bool()) dirtHeight++; // else dirtHeight--; // } - // dirtChange=1+random.Int3(); + // dirtChange=1+FastRandom.Int3(); // } else dirtChange--; // chunk.LightPos=terrainHeight; @@ -932,8 +818,8 @@ public enum WorldSize : byte{ // for (int yy=terrainHeight; yy3) dirtHeight--; // else if (dirtHeight<2) dirtHeight++; // else { - // if (random.Bool()) dirtHeight++; + // if (FastRandom.Bool()) dirtHeight++; // else dirtHeight--; // } - // dirtChange=1+random.Int3(); + // dirtChange=1+FastRandom.Int3(); // } else dirtChange--; // chunk.LightPos=terrainHeight; @@ -1002,8 +888,8 @@ public enum WorldSize : byte{ // for (int yy=terrainHeight; yy53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - if (changer==ChangerBiome.Low) terrainChange=2+random.Int3(); - else if (changer==ChangerBiome.Medium) terrainChange=2+random.Int2(); - else terrainChange=1+random.Int2(); + if (changer==ChangerBiome.Low) terrainChange=2+FastRandom.Int3(); + else if (changer==ChangerBiome.Medium) terrainChange=2+FastRandom.Int2(); + else terrainChange=1+FastRandom.Int2(); } else terrainChange--; // Height (ushort)BlockId.Dirt @@ -1063,10 +949,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -1075,7 +961,7 @@ public enum WorldSize : byte{ } chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Snow; - if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; + if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height (ushort)BlockId.Dirt @@ -1107,10 +993,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -1118,12 +1004,12 @@ public enum WorldSize : byte{ if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; - else if (random.Bool_10Percent())chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; + if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; + else if (FastRandom.Bool_10Percent())chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; if (seabedChange<0) { grass=!grass; - seabedChange=10+random.Int(20); + seabedChange=10+FastRandom.Int(20); } else seabedChange--; if (grass) { @@ -1137,7 +1023,7 @@ public enum WorldSize : byte{ void BiomeTundra(/*ChangerBiome changer*/) { for (; pos52) terrainHeight--; else if (terrainHeight<49) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=4+random.Int5(); + terrainChange=4+FastRandom.Int5(); } else terrainChange--; // Height Dirt @@ -1157,36 +1043,36 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool()) { - if (random.Bool_5Percent()){ + if (FastRandom.Bool()) { + if (FastRandom.Bool_5Percent()){ chunk.AddRabbit((byte)(terrainHeight-1)); } chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills; - if (random.Bool_20Percent()) { - if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather; + if (FastRandom.Bool_20Percent()) { + if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills; } } else { - if (random.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice; + if (FastRandom.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice; else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Snow; - if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; + if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; } for (int b=terrainHeight+1; b52) terrainHeight--; else if (terrainHeight<47) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=4+random.Int5(); + terrainChange=4+FastRandom.Int5(); } else terrainChange--; // Height Dirt @@ -1217,26 +1103,26 @@ public enum WorldSize : byte{ if (dirtHeight>2) dirtHeight--; else if (dirtHeight<1) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool_20Percent()){ + if (FastRandom.Bool_20Percent()){ chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills; - if (random.Bool_12_5Percent()) { - if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; + if (FastRandom.Bool_12_5Percent()) { + if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills; } } else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; - if (random.Bool()) { + if (FastRandom.Bool()) { chunk.SolidBlocks[1/*dirtHeight*/+terrainHeight]=(ushort)BlockId.Cobblestone; GenerateUnderSurface(chunk, terrainHeight+dirtHeight+1); } else GenerateUnderSurface(chunk, terrainHeight+1); @@ -1247,7 +1133,7 @@ public enum WorldSize : byte{ void BiomeWetTundra() { for (; pos52) terrainHeight--; else if (terrainHeight<50) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=4+random.Int5(); + terrainChange=4+FastRandom.Int5(); } else terrainChange--; // Height (ushort)BlockId.Dirt @@ -1267,35 +1153,35 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool()) { - if (random.Bool_5Percent()) chunk.AddRabbit((byte)(terrainHeight-1)); + if (FastRandom.Bool()) { + if (FastRandom.Bool_5Percent()) chunk.AddRabbit((byte)(terrainHeight-1)); chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills; - if (random.Bool_20Percent()) { - if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather; + if (FastRandom.Bool_20Percent()) { + if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills; } } else { - if (random.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice; + if (FastRandom.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice; else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Snow; - if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; + if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop; } for (int b=terrainHeight+1; b52) terrainHeight--; else if (terrainHeight<49) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=4+random.Int5(); + terrainChange=4+FastRandom.Int5(); } else terrainChange--; // Height (ushort)BlockId.Dirt @@ -1328,30 +1214,30 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; - else if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel; + if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; + else if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel; else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills; - if (random.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5, terrainHeight-1); - + if (FastRandom.Bool()) { + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5, terrainHeight-1); + // Add animals - if (random.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1)); + if (FastRandom.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1)); bool placed=false; if (plantSeek!=0){ if (plantPrefer!=0){ - if (random.Bool()){ + if (FastRandom.Bool()){ chunk.AddPlant(plantPrefer,(byte)(terrainHeight-1)); placed=true; } @@ -1359,7 +1245,7 @@ public enum WorldSize : byte{ } plantSeek--; if (!placed){ - switch (random.Int(10)) { + switch (FastRandom.Int(10)) { case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather; break; @@ -1385,10 +1271,10 @@ public enum WorldSize : byte{ break; case 7: - if (random.Bool()){ + if (FastRandom.Bool()){ if (plantSeek<-20){ plantPrefer=(ushort)BlockId.Blueberry; - plantSeek=3+random.Int(10); + plantSeek=3+FastRandom.Int(10); } } break; @@ -1403,18 +1289,18 @@ public enum WorldSize : byte{ } if (treeChange<0) { - if (random.Bool_20Percent()) TreeSpruceLittle(pos, terrainHeight); + if (FastRandom.Bool_20Percent()) TreeSpruceLittle(pos, terrainHeight); } else treeChange--; //Add dirt for (int b=terrainHeight+1; b52) terrainHeight--; else if (terrainHeight<49) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=4+random.Int5(); + terrainChange=4+FastRandom.Int5(); } else terrainChange--; // Height (ushort)BlockId.Dirt @@ -1446,30 +1332,30 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; - else if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel; + if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; + else if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel; else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills; - if (random.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool()) { + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - if (random.Int(15)==1){ + if (FastRandom.Int(15)==1){ chunk.AddRabbit((byte)(terrainHeight-1)); } bool placed=false; if (plantSeek!=0){ if (plantPrefer!=0){ - if (random.Bool()){ + if (FastRandom.Bool()){ chunk.AddPlant(plantPrefer,(byte)(terrainHeight-1)); placed=true; } @@ -1477,7 +1363,7 @@ public enum WorldSize : byte{ } plantSeek--; if (!placed){ - switch (random.Int(10)) { + switch (FastRandom.Int(10)) { case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather; break; @@ -1497,10 +1383,10 @@ public enum WorldSize : byte{ break; case 7: - if (random.Bool()){ + if (FastRandom.Bool()){ if (plantSeek<-15){ plantPrefer=(ushort)BlockId.Blueberry; - plantSeek=3+random.Int(10); + plantSeek=3+FastRandom.Int(10); } } break; @@ -1515,18 +1401,18 @@ public enum WorldSize : byte{ } if (treeChange<0) { - if (random.Bool_20Percent()) TreeSpruceLittle(pos,terrainHeight); + if (FastRandom.Bool_20Percent()) TreeSpruceLittle(pos,terrainHeight); else TreeSpruceBig(pos, terrainHeight); }else treeChange--; for (int b=terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -1558,10 +1444,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -1570,17 +1456,17 @@ public enum WorldSize : byte{ } chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; - if (random.Bool()) { + if (FastRandom.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - if (random.Int(14)==1){ + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Int(14)==1){ chunk.AddRabbit((byte)(terrainHeight-1)); } - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: - if (random.Bool()) { - if (random.Bool()){ + if (FastRandom.Bool()) { + if (FastRandom.Bool()){ chunk.AddPlant((ushort)BlockId.Blueberry,(byte)(terrainHeight-1)); } else { chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1)); @@ -1613,8 +1499,8 @@ public enum WorldSize : byte{ break; case 8: - if (random.Bool_20Percent()) { - if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool; + if (FastRandom.Bool_20Percent()) { + if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus; } break; @@ -1622,7 +1508,7 @@ public enum WorldSize : byte{ } if (treeChange<0) { - switch (random.Int3()) { + switch (FastRandom.Int3()) { case 1: TreeSpruceLittle(pos, terrainHeight); break; @@ -1636,7 +1522,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -1668,10 +1554,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -1680,16 +1566,16 @@ public enum WorldSize : byte{ } chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; - if (random.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool()) { + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - if (random.Int(13)==1){ + if (FastRandom.Int(13)==1){ chunk.AddRabbit((byte)(terrainHeight-1)); } - switch (random.Int(7)) { + switch (FastRandom.Int(7)) { case 0: - switch (random.Int4()){ + switch (FastRandom.Int4()){ case 0: chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1)); break; @@ -1730,7 +1616,7 @@ public enum WorldSize : byte{ break; case 6: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus; break; case 2:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool; @@ -1743,7 +1629,7 @@ public enum WorldSize : byte{ } if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreeSpruceLittle(pos, terrainHeight); break; @@ -1774,7 +1660,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -1806,21 +1692,21 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - switch (random.Int(7)) { + switch (FastRandom.Int(7)) { case 0: - switch (random.Int4()){ + switch (FastRandom.Int4()){ case 0: chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1)); break; @@ -1867,7 +1753,7 @@ public enum WorldSize : byte{ } if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreeSpruceLittle(pos, terrainHeight); break; @@ -1897,8 +1783,8 @@ public enum WorldSize : byte{ if (seabedChange<0) { - if (grass) seabedChange=10+random.Int(20); - else seabedChange=3+random.Int5(); + if (grass) seabedChange=10+FastRandom.Int(20); + else seabedChange=3+FastRandom.Int5(); grass=!grass; } else seabedChange--; @@ -1908,12 +1794,12 @@ public enum WorldSize : byte{ } else { chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockCompost; for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-3) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -1945,10 +1831,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -1957,12 +1843,12 @@ public enum WorldSize : byte{ } chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; - if (random.Bool()) { - if (random.Int(13)==1) { + if (FastRandom.Bool()) { + if (FastRandom.Int(13)==1) { chunk.AddRabbit((byte)(terrainHeight-1)); } - switch (random.Int(7)) { + switch (FastRandom.Int(7)) { case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassForest; break; @@ -1984,7 +1870,7 @@ public enum WorldSize : byte{ break; case 6: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus; break; case 2:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool; @@ -1997,7 +1883,7 @@ public enum WorldSize : byte{ } if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreeSpruceLittle(pos, terrainHeight); break; @@ -2028,7 +1914,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -2060,10 +1946,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -2073,14 +1959,14 @@ public enum WorldSize : byte{ chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; - if (random.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool()) { + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - if (random.Int(13)==1) { + if (FastRandom.Int(13)==1) { chunk.AddRabbit((byte)(terrainHeight-1)); } - switch (random.Int(13)) { + switch (FastRandom.Int(13)) { case 1: chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1)); break; @@ -2126,7 +2012,7 @@ public enum WorldSize : byte{ break; case 12: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus; break; case 2:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool; @@ -2139,7 +2025,7 @@ public enum WorldSize : byte{ } if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreePlum(pos, terrainHeight); break; @@ -2172,7 +2058,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height dirt @@ -2204,10 +2090,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -2218,17 +2104,17 @@ public enum WorldSize : byte{ // Add grass chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockPlains; - if (random.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool()) { + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); // Animals - if (random.Int(13)==1) chunk.AddRabbit((byte)(terrainHeight-1)); - else if (random.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1)); + if (FastRandom.Int(13)==1) chunk.AddRabbit((byte)(terrainHeight-1)); + else if (FastRandom.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1)); // Add something on grass - switch (random.Int(10)) { + switch (FastRandom.Int(10)) { case 1: - if (random.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1)); + if (FastRandom.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1)); else chunk.AddPlantCarrot((byte)(terrainHeight-1)); break; @@ -2261,7 +2147,7 @@ public enum WorldSize : byte{ break; case 9: - if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); + if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); break; } } @@ -2270,7 +2156,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height Dirt @@ -2303,10 +2189,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -2315,15 +2201,15 @@ public enum WorldSize : byte{ } chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockDesert; - if (random.Bool_1Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool_1Percent()) ClayPlace(pos-5,terrainHeight-1); // Add something on grass - if (random.Bool()) { - double z=random.Double(); + if (FastRandom.Bool()) { + double z=FastRandom.Double(); if (z<0.5) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassDesert; - else { + else { if (z<0.66)chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.BranchFull; - else if (z<0.88)chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Dandelion; + else if (z<0.88)chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Dandelion; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; } } @@ -2332,7 +2218,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -2365,30 +2251,30 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; // Sub if (seabedChange<0) { grass=!grass; - seabedChange=5+random.Int(10); + seabedChange=5+FastRandom.Int(10); } else seabedChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; - } + } if (grass) { chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockDesert; - if (random.Bool()) { + if (FastRandom.Bool()) { // Add animals - if (random.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1)); - else if (random.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1)); + if (FastRandom.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1)); + else if (FastRandom.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1)); - switch (random.Int(10)) { + switch (FastRandom.Int(10)) { case 1: chunk.AddPlantWheat((byte)(terrainHeight-1)); break; @@ -2414,7 +2300,7 @@ public enum WorldSize : byte{ break; case 7: - if (random.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1)); + if (FastRandom.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1)); else chunk.AddPlantCarrot((byte)(terrainHeight-1)); break; @@ -2423,16 +2309,16 @@ public enum WorldSize : byte{ break; case 9: - if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); + if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); break; } } } else { chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; - if (random.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - switch (random.Int(11)) { + if (FastRandom.Bool()) { + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + switch (FastRandom.Int(11)) { case 1: chunk.AddPlant((ushort)BlockId.Strawberry,(byte)(terrainHeight-1)); break; @@ -2466,18 +2352,18 @@ public enum WorldSize : byte{ break; case 9: - if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); + if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); break; case 10: - if (random.Bool_33_333Percent()) chunk.AddPlantWheat((byte)(terrainHeight-1)); + if (FastRandom.Bool_33_333Percent()) chunk.AddPlantWheat((byte)(terrainHeight-1)); break; } } } if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreeEucalyptus(pos, terrainHeight); break; @@ -2509,7 +2395,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height Dirt @@ -2541,30 +2427,30 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; // Sub if (seabedChange<0) { grass=!grass; - seabedChange=5+random.Int(10); + seabedChange=5+FastRandom.Int(10); } else seabedChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool()) { + if (FastRandom.Bool()) { // Add animals - if (random.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1)); - else if (random.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1)); + if (FastRandom.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1)); + else if (FastRandom.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1)); // Add something on grass - switch (random.Int(10)) { + switch (FastRandom.Int(10)) { case 1: chunk.AddPlantWheat((byte)(terrainHeight-1)); break; @@ -2590,7 +2476,7 @@ public enum WorldSize : byte{ break; case 7: - if (random.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1)); + if (FastRandom.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1)); else chunk.AddPlantCarrot((byte)(terrainHeight-1)); break; @@ -2599,7 +2485,7 @@ public enum WorldSize : byte{ break; case 9: - if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); + if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1)); break; } } @@ -2607,7 +2493,7 @@ public enum WorldSize : byte{ chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreeEucalyptus(pos, terrainHeight); break; @@ -2639,7 +2525,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -2671,10 +2557,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -2682,8 +2568,8 @@ public enum WorldSize : byte{ if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } if (seabedChange<0) { - if (grass) seabedChange=20+random.Int(50); - else seabedChange=3+random.Int5(); + if (grass) seabedChange=20+FastRandom.Int(50); + else seabedChange=3+FastRandom.Int5(); grass=!grass; } else seabedChange--; @@ -2695,8 +2581,8 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height dirt @@ -2781,10 +2667,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -2792,15 +2678,15 @@ public enum WorldSize : byte{ if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } if (seabedChange<0) { - if (grass) seabedChange=20+random.Int(50); - else seabedChange=3+random.Int5(); + if (grass) seabedChange=20+FastRandom.Int(50); + else seabedChange=3+FastRandom.Int5(); grass=!grass; } else seabedChange--; if (grass) { // Add animals - if (random.Int(25)==1) chunk.AddChicken((byte)(terrainHeight-1)); + if (FastRandom.Int(25)==1) chunk.AddChicken((byte)(terrainHeight-1)); // Add grass chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockDesert; @@ -2808,7 +2694,7 @@ public enum WorldSize : byte{ // Add dirt for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-2) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=3+random.Int3(); + terrainChange=3+FastRandom.Int3(); } else terrainChange--; //Height dirt @@ -2908,10 +2794,10 @@ public enum WorldSize : byte{ if (dirtHeight>2) dirtHeight--; else if (dirtHeight<1) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -2920,8 +2806,8 @@ public enum WorldSize : byte{ } for (int b = terrainHeight; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height dirt @@ -2980,25 +2866,25 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (random.Bool()) { + if (FastRandom.Bool()) { - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); // Add animals - if (random.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1)); - - - switch (random.Int(9)) { + if (FastRandom.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1)); + + + switch (FastRandom.Int(9)) { case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Orchid; break; @@ -3038,7 +2924,7 @@ public enum WorldSize : byte{ else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; if (treeChange<0) { - switch (random.Int4()){ + switch (FastRandom.Int4()){ default: TreePineJunle(pos, terrainHeight); break; @@ -3057,7 +2943,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3105,11 +2991,11 @@ public enum WorldSize : byte{ // Add grass chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills; - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); // Add something on grass - if (random.Bool()) { - switch (random.Int(9)) { + if (FastRandom.Bool()) { + switch (FastRandom.Int(9)) { case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills; break; @@ -3145,8 +3031,8 @@ public enum WorldSize : byte{ } if (treeChange<0) { - if (random.Bool_10Percent()) { - if (random.Bool()) TreeSpruceLittle(pos, terrainHeight); + if (FastRandom.Bool_10Percent()) { + if (FastRandom.Bool()) TreeSpruceLittle(pos, terrainHeight); else TreeOakLittle(pos, terrainHeight); } } else treeChange--; @@ -3155,7 +3041,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3200,9 +3086,9 @@ public enum WorldSize : byte{ if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills; - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - if (random.Bool()) { - switch (random.Int(9)) { + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool()) { + switch (FastRandom.Int(9)) { case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills; break; @@ -3238,8 +3124,8 @@ public enum WorldSize : byte{ } if (treeChange<0) { - if (random.Bool_10Percent()) { - if (random.Bool()) TreeSpruceLittle(pos, terrainHeight); + if (FastRandom.Bool_10Percent()) { + if (FastRandom.Bool()) TreeSpruceLittle(pos, terrainHeight); else TreeOakLittle(pos, terrainHeight); } } else treeChange--; @@ -3248,7 +3134,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3295,10 +3181,10 @@ public enum WorldSize : byte{ // Add grass chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest; - if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); + if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1); - if (random.Bool()) { - switch (random.Int(9)) { + if (FastRandom.Bool()) { + switch (FastRandom.Int(9)) { case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills; break; @@ -3334,8 +3220,8 @@ public enum WorldSize : byte{ } if (treeChange<0) { - if (random.Bool_10Percent()) { - if (random.Bool()) TreeSpruceLittle(pos, terrainHeight); + if (FastRandom.Bool_10Percent()) { + if (FastRandom.Bool()) TreeSpruceLittle(pos, terrainHeight); else TreePine(pos, terrainHeight); } } else treeChange--; @@ -3343,7 +3229,7 @@ public enum WorldSize : byte{ for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height dirt @@ -3374,10 +3260,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3386,22 +3272,22 @@ public enum WorldSize : byte{ } ushort[] chunk_SolidBlocks=chunk.SolidBlocks; - if (random.Int(9)==1) { - if (random.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; + if (FastRandom.Int(9)==1) { + if (FastRandom.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; } - if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.StoneBasalt; - else if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; + if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.StoneBasalt; + else if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; else chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Regolite; for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height dirt @@ -3431,10 +3317,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3443,23 +3329,23 @@ public enum WorldSize : byte{ } ushort[] chunk_SolidBlocks=chunk.SolidBlocks; - if (random.Bool_12_5Percent()) { - if (random.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; + if (FastRandom.Bool_12_5Percent()) { + if (FastRandom.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; } - if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Anorthosite; - else if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; + if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Anorthosite; + else if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; else chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Regolite; for (int b = terrainHeight+1; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; //Height (ushort)BlockId.Dirt @@ -3489,17 +3375,17 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=(byte)(terrainHeight-2); if (!chunk.SetLightPosHalf) { if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight; } - if (Rabcr.random.Bool_12_5Percent()) chunk.TopBlocks[terrainHeight-3]=(ushort)BlockId.SnowTop; + if (FastRandom.Bool_12_5Percent()) chunk.TopBlocks[terrainHeight-3]=(ushort)BlockId.SnowTop; ushort[] chunk_SolidBlocks=chunk.SolidBlocks; @@ -3507,7 +3393,7 @@ public enum WorldSize : byte{ chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Ice; // Lithosphere - if (random.Bool()) { + if (FastRandom.Bool()) { chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone; GenerateUnderSurfaceMars(chunk, terrainHeight+1); } else GenerateUnderSurfaceMars(chunk, terrainHeight); @@ -3525,11 +3411,11 @@ public enum WorldSize : byte{ if (terrainHeight>53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height dirt @@ -3537,10 +3423,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3549,18 +3435,18 @@ public enum WorldSize : byte{ } ushort[] chunk_SolidBlocks=chunk.SolidBlocks; - if (random.Int(6)==1) { - if (random.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; + if (FastRandom.Int(6)==1) { + if (FastRandom.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; } for (int b =terrainHeight; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // Height dirt @@ -3590,10 +3476,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3602,18 +3488,18 @@ public enum WorldSize : byte{ } ushort[] chunk_SolidBlocks=chunk.SolidBlocks; - if (random.Int(6)==1) { - if (random.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; + if (FastRandom.Int(6)==1) { + if (FastRandom.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; } for (int b = terrainHeight; b53-1) terrainHeight--; else if (terrainHeight<53-6) terrainHeight++; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - terrainChange=2+random.Int3(); + terrainChange=2+FastRandom.Int3(); } else terrainChange--; // height dirt @@ -3643,10 +3529,10 @@ public enum WorldSize : byte{ if (dirtHeight>3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int3(); + dirtChange=1+FastRandom.Int3(); } else dirtChange--; chunk.LightPosFull=terrainHeight; @@ -3655,18 +3541,18 @@ public enum WorldSize : byte{ } ushort[] chunk_SolidBlocks=chunk.SolidBlocks; - if (random.Int(6)==1) { - if (random.Bool_20Percent())chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; + if (FastRandom.Int(6)==1) { + if (FastRandom.Bool_20Percent())chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone; else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks; } for (int b = terrainHeight; b70) height12--; else { - if (random.Bool()) height12++; + if (FastRandom.Bool()) height12++; else height12--; } - height12Change=random.Int2()+1; + height12Change=FastRandom.Int2()+1; } else height12Change--; if (height23Change==0) { if (height23<80)height23++; else if (height23>85)height23--; - else if (random.Bool()) height23++; + else if (FastRandom.Bool()) height23++; else height23--; - height23Change=random.Int3()+1; + height23Change=FastRandom.Int3()+1; } else height23Change--; if (height34Change==0) { if (height34<105)height34++; else if (height34>110)height34--; - else if (random.Bool()) height34++; + else if (FastRandom.Bool()) height34++; else height34--; - height34Change=random.Int4()+1; + height34Change=FastRandom.Int4()+1; } else height34Change--; //Type if (level1Lenght==0) { level1TypeLast=level1Type; level1Crossing=2; - level1Type=random.Int(10); + level1Type=FastRandom.Int(10); - level1Lenght=random.Int(12)+8+8; + level1Lenght=FastRandom.Int(12)+8+8; block1 =GetByIdHeight1(level1Type); } else { level1Lenght--; @@ -3723,9 +3609,9 @@ public enum WorldSize : byte{ if (level2Lenght==0) { level2TypeLast=level2Type; level2Crossing=2; - level2Type=random.Int(10); + level2Type=FastRandom.Int(10); - level2Lenght=random.Int16()+8+8+8; + level2Lenght=FastRandom.Int16()+8+8+8; block2 =GetByIdHeight2(level2Type); } else { level2Lenght--; @@ -3735,9 +3621,9 @@ public enum WorldSize : byte{ if (level3Lenght==0) { level3TypeLast=level3Type; level3Crossing=2; - level3Type=random.Int(10); + level3Type=FastRandom.Int(10); - level3Lenght=random.Int(20)+8+8+24; + level3Lenght=FastRandom.Int(20)+8+8+24; block3 =GetByIdHeight3(level3Type); } else { level3Lenght--; @@ -3752,13 +3638,13 @@ public enum WorldSize : byte{ if (level1Crossing==2) { ushort oldTop = GetByIdHeight1(level1TypeLast); for (int y = height; y15) { - switch (random.Int(35)) { + switch (FastRandom.Int(35)) { case 1: - OreCoal(height+3+random.Int(height34-height-10)); + OreCoal(height+3+FastRandom.Int(height34-height-10)); break; case 2: - OreCoal(height+3+random.Int(45)); + OreCoal(height+3+FastRandom.Int(45)); break; case 3: - OreCoal(height+3+random.Int(10)); + OreCoal(height+3+FastRandom.Int(10)); break; case 4: - OreCoal(height+3+random.Int(10)); + OreCoal(height+3+FastRandom.Int(10)); break; case 5: - OreCoal(height+3+30+random.Int(10)); + OreCoal(height+3+30+FastRandom.Int(10)); break; case 6: - OreCoal(height+3+30+random.Int(10)); + OreCoal(height+3+30+FastRandom.Int(10)); break; case 7: - OreCopper(height+3+random.Int(height34-height-10)); + OreCopper(height+3+FastRandom.Int(height34-height-10)); break; case 8: - OreCopper(height+3+random.Int(45)); + OreCopper(height+3+FastRandom.Int(45)); break; case 9: - OreCopper(height+3+random.Int(15)); + OreCopper(height+3+FastRandom.Int(15)); break; case 10: - OreCopper(height+3+random.Int(10)); + OreCopper(height+3+FastRandom.Int(10)); break; case 11: - OreCopper(height+10+random.Int(10)); + OreCopper(height+10+FastRandom.Int(10)); break; case 12: - OreIron(height+3+random.Int(height34-height-10)+2); + OreIron(height+3+FastRandom.Int(height34-height-10)+2); break; case 13: - OreIron(height+3+random.Int(45)+2); + OreIron(height+3+FastRandom.Int(45)+2); break; case 14: - OreIron(height+10+random.Int(20)); + OreIron(height+10+FastRandom.Int(20)); break; case 15: - OreIron(height+3+random.Int(45)+2); + OreIron(height+3+FastRandom.Int(45)+2); break; case 16: - OreOil(height+3+random.Int(height34-height-10)); + OreOil(height+3+FastRandom.Int(height34-height-10)); break; case 17: - OreOil(height+3+random.Int(45)); + OreOil(height+3+FastRandom.Int(45)); break; case 18: - OreOil(height+3+random.Int(34)); + OreOil(height+3+FastRandom.Int(34)); break; case 19: - OreOil(height+3+random.Int(35)); + OreOil(height+3+FastRandom.Int(35)); break; case 20: - OreTin(height+3+random.Int(height34-height-10)); + OreTin(height+3+FastRandom.Int(height34-height-10)); break; case 21: - OreTin(height+3+random.Int(35)); + OreTin(height+3+FastRandom.Int(35)); break; case 22: - OreTin(height+6+random.Int(25)); + OreTin(height+6+FastRandom.Int(25)); break; case 23: - OreSilver(height+3+random.Int(height34-height-5)); + OreSilver(height+3+FastRandom.Int(height34-height-5)); break; case 24: - OreGold(height+3+random.Int(height34-height-5)); + OreGold(height+3+FastRandom.Int(height34-height-5)); break; case 25: - OreAliminium(height+3+random.Int(height34-height-10)); + OreAliminium(height+3+FastRandom.Int(height34-height-10)); break; case 26: - OreAliminium(height+3+random.Int(45)); + OreAliminium(height+3+FastRandom.Int(45)); break; case 27: - OreAliminium(height+3+random.Int(35)); + OreAliminium(height+3+FastRandom.Int(35)); break; case 28: - OreSulfur(height+3+random.Int(height12-height/*-10*/)); + OreSulfur(height+3+FastRandom.Int(height12-height/*-10*/)); break; case 29: - OreSaltpeter(height+3+random.Int(height12-height/*-10*/)); + OreSaltpeter(height+3+FastRandom.Int(height12-height/*-10*/)); break; case 30: - OreSulfur(height+3+random.Int(height12-height/*-10*/)); + OreSulfur(height+3+FastRandom.Int(height12-height/*-10*/)); break; case 31: - OreSaltpeter(height+3+random.Int(height12-height/*-10*/)); + OreSaltpeter(height+3+FastRandom.Int(height12-height/*-10*/)); break; } } @@ -3931,17 +3817,17 @@ public enum WorldSize : byte{ if (height34Change==0) { if (height34<105)height34++; else if (height34>110)height34--; - else if (random.Bool()) height34++; + else if (FastRandom.Bool()) height34++; else height34--; - height34Change=random.Int4()+1; + height34Change=FastRandom.Int4()+1; } else height34Change--; if (level3Lenght==0) { level3TypeLast=level3Type; level3Crossing=2; - level3Type=random.Int(10); + level3Type=FastRandom.Int(10); - level3Lenght=random.Int(20)+8+8+24; + level3Lenght=FastRandom.Int(20)+8+8+24; } else { level3Lenght--; level3Crossing--; @@ -3953,76 +3839,76 @@ public enum WorldSize : byte{ for (int y=height; y15) { - switch (random.Int(25)) { + switch (FastRandom.Int(25)) { case 7: - OreCopper(height+3+random.Int(height34-height-10)); + OreCopper(height+3+FastRandom.Int(height34-height-10)); break; case 8: - OreCopper(height+3+random.Int(45)); + OreCopper(height+3+FastRandom.Int(45)); break; case 9: - OreIron(height+3+random.Int(15)); + OreIron(height+3+FastRandom.Int(15)); break; case 10: - OreCopper(height+3+random.Int(10)); + OreCopper(height+3+FastRandom.Int(10)); break; case 11: - OreCopper(height+10+random.Int(10)); + OreCopper(height+10+FastRandom.Int(10)); break; case 12: - OreIron(height+3+random.Int(height34-height-10)); + OreIron(height+3+FastRandom.Int(height34-height-10)); break; case 13: - OreIron(height+3+random.Int(45)); + OreIron(height+3+FastRandom.Int(45)); break; case 14: - OreIron(height+10+random.Int(20)); + OreIron(height+10+FastRandom.Int(20)); break; case 15: - OreIron(height+3+random.Int(45)); + OreIron(height+3+FastRandom.Int(45)); break; case 20: - OreTin(height+3+random.Int(height34-height-10)); + OreTin(height+3+FastRandom.Int(height34-height-10)); break; case 21: - OreTin(height+3+random.Int(35)); + OreTin(height+3+FastRandom.Int(35)); break; case 22: - OreTin(height+6+random.Int(25)); + OreTin(height+6+FastRandom.Int(25)); break; case 23: - OreSilver(height+3+random.Int(height34-height-5)); + OreSilver(height+3+FastRandom.Int(height34-height-5)); break; case 24: - OreGold(height+3+random.Int(height34-height-5)); + OreGold(height+3+FastRandom.Int(height34-height-5)); break; case 25: - OreAliminium(height+3+random.Int(height34-height-10)); + OreAliminium(height+3+FastRandom.Int(height34-height-10)); break; case 26: - OreAliminium(height+3+random.Int(45)); + OreAliminium(height+3+FastRandom.Int(45)); break; case 27: - OreAliminium(height+3+random.Int(35)); + OreAliminium(height+3+FastRandom.Int(35)); break; } } @@ -4033,18 +3919,18 @@ public enum WorldSize : byte{ if (height34Change==0) { if (height34<105)height34++; else if (height34>110)height34--; - else if (random.Bool()) height34++; + else if (FastRandom.Bool()) height34++; else height34--; - height34Change=random.Int4()+1; + height34Change=FastRandom.Int4()+1; } else height34Change--; if (level3Lenght==0) { level3TypeLast=level3Type; level3Crossing=2; - level3Type=random.Int(10); + level3Type=FastRandom.Int(10); - level3Lenght=random.Int(20)+8+8+24; + level3Lenght=FastRandom.Int(20)+8+8+24; } else { level3Lenght--; level3Crossing--; @@ -4054,45 +3940,45 @@ public enum WorldSize : byte{ for (int y=height; y15) { - switch (random.Int(25)) { + switch (FastRandom.Int(25)) { case 7: - OreCopper(height+3+random.Int(height34-height-10)); + OreCopper(height+3+FastRandom.Int(height34-height-10)); break; case 8: - OreCopper(height+3+random.Int(45)); + OreCopper(height+3+FastRandom.Int(45)); break; case 9: - OreIron(height+3+random.Int(15)); + OreIron(height+3+FastRandom.Int(15)); break; case 10: - OreCopper(height+3+random.Int(10)); + OreCopper(height+3+FastRandom.Int(10)); break; case 11: - OreCopper(height+10+random.Int(10)); + OreCopper(height+10+FastRandom.Int(10)); break; case 12: - OreIron(height+3+random.Int(height34-height-10)); + OreIron(height+3+FastRandom.Int(height34-height-10)); break; case 13: - OreIron(height+3+random.Int(45)); + OreIron(height+3+FastRandom.Int(45)); break; case 14: - OreIron(height+10+random.Int(20)); + OreIron(height+10+FastRandom.Int(20)); break; case 15: - OreIron(height+3+random.Int(45)); + OreIron(height+3+FastRandom.Int(45)); break; @@ -4100,33 +3986,33 @@ public enum WorldSize : byte{ case 20: - OreTin(height+3+random.Int(height34-height-10)); + OreTin(height+3+FastRandom.Int(height34-height-10)); break; case 21: - OreTin(height+3+random.Int(35)); + OreTin(height+3+FastRandom.Int(35)); break; case 22: - OreTin(height+6+random.Int(25)); + OreTin(height+6+FastRandom.Int(25)); break; case 23: - OreSilver(height+3+random.Int(height34-height-5)); + OreSilver(height+3+FastRandom.Int(height34-height-5)); break; case 24: - OreGold(height+3+random.Int(height34-height-5)); + OreGold(height+3+FastRandom.Int(height34-height-5)); break; case 25: - OreAliminium(height+3+random.Int(height34-height-10)); + OreAliminium(height+3+FastRandom.Int(height34-height-10)); break; case 26: - OreAliminium(height+3+random.Int(45)); + OreAliminium(height+3+FastRandom.Int(45)); break; case 27: - OreAliminium(height+3+random.Int(35)); + OreAliminium(height+3+FastRandom.Int(35)); break; } } @@ -4140,10 +4026,10 @@ public enum WorldSize : byte{ if (height12<65) height12++; else if (height12>70) height12--; else { - if (random.Bool()) height12++; + if (FastRandom.Bool()) height12++; else height12--; } - height12Change=random.Int2()+1; + height12Change=FastRandom.Int2()+1; } else height12Change--; @@ -4152,9 +4038,9 @@ public enum WorldSize : byte{ if (level1Lenght==0) { level1TypeLast=level1Type; level1Crossing=2; - level1Type=random.Int5(); + level1Type=FastRandom.Int5(); - level1Lenght=random.Int(20)+20; + level1Lenght=FastRandom.Int(20)+20; } else { level1Lenght--; level1Crossing--; @@ -4169,13 +4055,13 @@ public enum WorldSize : byte{ if (level1Crossing==2) { ushort oldTop = GetByIdHeight1(level1TypeLast); for (int y = height; y15) { - switch (random.Int(25)) { + switch (FastRandom.Int(25)) { case 1: - OreIron(height+3+random.Int(height34-height-10)); + OreIron(height+3+FastRandom.Int(height34-height-10)); break; case 2: - OreIron(height+3+random.Int(45)); + OreIron(height+3+FastRandom.Int(45)); break; case 7: - OreCopper(height+3+random.Int(height34-height-10)); + OreCopper(height+3+FastRandom.Int(height34-height-10)); break; case 8: - OreCopper(height+3+random.Int(45)); + OreCopper(height+3+FastRandom.Int(45)); break; case 9: - OreCopper(height+3+random.Int(15)); + OreCopper(height+3+FastRandom.Int(15)); break; case 10: - OreCopper(height+3+random.Int(10)); + OreCopper(height+3+FastRandom.Int(10)); break; case 11: - OreCopper(height+10+random.Int(10)); + OreCopper(height+10+FastRandom.Int(10)); break; case 12: - OreIron(height+3+random.Int(height34-height-10)); + OreIron(height+3+FastRandom.Int(height34-height-10)); break; case 13: - OreIron(height+3+random.Int(45)); + OreIron(height+3+FastRandom.Int(45)); break; case 14: - OreIron(height+10+random.Int(20)); + OreIron(height+10+FastRandom.Int(20)); break; case 15: - OreIron(height+3+random.Int(45)); + OreIron(height+3+FastRandom.Int(45)); break; case 20: - OreTin(height+3+random.Int(height34-height-10)); + OreTin(height+3+FastRandom.Int(height34-height-10)); break; case 21: - OreTin(height+3+random.Int(35)); + OreTin(height+3+FastRandom.Int(35)); break; case 22: - OreTin(height+6+random.Int(25)); + OreTin(height+6+FastRandom.Int(25)); break; case 23: - OreSilver(height+3+random.Int(height34-height-5)); + OreSilver(height+3+FastRandom.Int(height34-height-5)); break; case 24: - OreGold(height+3+random.Int(height34-height-5)); + OreGold(height+3+FastRandom.Int(height34-height-5)); break; case 25: - OreAliminium(height+3+random.Int(height34-height-10)); + OreAliminium(height+3+FastRandom.Int(height34-height-10)); break; case 26: - OreAliminium(height+3+random.Int(45)); + OreAliminium(height+3+FastRandom.Int(45)); break; case 27: - OreAliminium(height+3+random.Int(35)); + OreAliminium(height+3+FastRandom.Int(35)); break; } } @@ -4320,38 +4206,34 @@ public enum WorldSize : byte{ } ushort GetByIdHeight3(int v) { - switch (v) { - case 1: return (ushort)BlockId.StoneBasalt; - case 2: return (ushort)BlockId.StoneGabbro; - case 3: return (ushort)BlockId.StoneDiorit; - case 4: return (ushort)BlockId.StoneGneiss; - - case 5: return (ushort)BlockId.StoneBasalt; - case 11: return (ushort)BlockId.StoneGabbro; - case 12: return (ushort)BlockId.StoneDiorit; - case 13: return (ushort)BlockId.StoneGneiss; - - case 14: return (ushort)BlockId.StoneBasalt; - case 15: return (ushort)BlockId.StoneBasalt; - - case 6: return (ushort)BlockId.StoneSandstone; - case 7: return (ushort)BlockId.StoneLimestone; - case 8: return (ushort)BlockId.StoneSchist; - case 9: return (ushort)BlockId.StoneDolomite; - case 10: return (ushort)BlockId.StoneRhyolite; - - default: return (ushort)BlockId.StoneDolomite; - } + return v switch { + 1 => (ushort)BlockId.StoneBasalt, + 2 => (ushort)BlockId.StoneGabbro, + 3 => (ushort)BlockId.StoneDiorit, + 4 => (ushort)BlockId.StoneGneiss, + 5 => (ushort)BlockId.StoneBasalt, + 11 => (ushort)BlockId.StoneGabbro, + 12 => (ushort)BlockId.StoneDiorit, + 13 => (ushort)BlockId.StoneGneiss, + 14 => (ushort)BlockId.StoneBasalt, + 15 => (ushort)BlockId.StoneBasalt, + 6 => (ushort)BlockId.StoneSandstone, + 7 => (ushort)BlockId.StoneLimestone, + 8 => (ushort)BlockId.StoneSchist, + 9 => (ushort)BlockId.StoneDolomite, + 10 => (ushort)BlockId.StoneRhyolite, + _ => (ushort)BlockId.StoneDolomite, + }; } ushort GetByIdHeightMars(int v) { - switch (v) { - case 1: return (ushort)BlockId.StoneSandstone; - case 2: return (ushort)BlockId.StoneBasalt; - case 3: return (ushort)BlockId.StoneBasalt; - case 4: return (ushort)BlockId.MudStone; - default: return (ushort)BlockId.StoneSandstone; - } + return v switch { + 1 => (ushort)BlockId.StoneSandstone, + 2 => (ushort)BlockId.StoneBasalt, + 3 => (ushort)BlockId.StoneBasalt, + 4 => (ushort)BlockId.MudStone, + _ => (ushort)BlockId.StoneSandstone, + }; } unsafe void Save(string name) { @@ -5020,7 +4902,7 @@ public enum WorldSize : byte{ world++; void SaveLiveObject(GenLiveObject lo) { - switch (lo) { + switch (lo) { case GenTree tree: // Basic info bytesLiveObject.Add((byte)LiveObjectType.Tree); @@ -5033,7 +4915,7 @@ public enum WorldSize : byte{ int countWood=tree.TitlesWood.Count; bytesLiveObject.Add((byte)countWood); - for (int i=0; i1f)add=1f; + if (add+lastRnd<0f)add=0f; + + lastRnd+=add; + + float half=(float)i/len; + points[i].Item2=lastRnd*(1f-(2f*half-1f)*(2f*half-1f)); + + // Next acc + float nextLen=FastRandom.Float()+0.5f; + lastPoint.X+=((float)Math.Cos(angle))*nextLen; + lastPoint.Y+=((float)Math.Sin(angle))*nextLen; + + angle+=(FastRandom.Float()-0.5f)*0.1f; + points[i].Item3=(angle*ta)/2f; + + } + + Vector2[] fin=new Vector2[len]; + for (int i=0; i40) RemoveRound(1+FastRandom.Int(7),xx,yy); + } + + void RemoveRound(int size, int xx, int yy) { + RemoveBlock(xx,yy); + + RemoveBlock(xx, yy+1); + RemoveBlock(xx, yy-1); + if (size>2) return; + + RemoveBlock(xx-1, yy); + RemoveBlock(xx+1, yy); + if (size>3) return; + + RemoveBlock(xx+1, yy+1); + RemoveBlock(xx-1, yy-1); + if (size>4) return; + + RemoveBlock(xx+1, yy-1); + RemoveBlock(xx-1, yy+1); + if (size>5) return; + + RemoveBlock(xx+2, yy); + RemoveBlock(xx-2, yy); + if (size>6) return; + + RemoveBlock(xx, yy+2); + RemoveBlock(xx, yy-2); + if (size>7) return; + } + + void RemoveBlock(int xx, int yy) { + ushort solidId=terrain[xx].SolidBlocks[yy]; + + if (solidId!=0) { + + switch (solidId) { + case (ushort)BlockId.StoneBasalt: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackBasalt; + break; + + case (ushort)BlockId.StoneDiorit: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDiorit; + break; + + case (ushort)BlockId.StoneDolomite: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDolomite; + break; + + case (ushort)BlockId.StoneGabbro: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGabbro; + break; + + case (ushort)BlockId.StoneGneiss: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGneiss; + break; + + case (ushort)BlockId.StoneLimestone: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackLimestone; + break; + + case (ushort)BlockId.StoneRhyolite: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackRhyolite; + break; + + case (ushort)BlockId.StoneSandstone: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSandstone; + break; + + case (ushort)BlockId.StoneSchist: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSchist; + break; + + case (ushort)BlockId.OreAluminium: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackAluminium; + break; + + case (ushort)BlockId.OreCoal: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackCoal; + break; + + case (ushort)BlockId.OreCopper: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackCopper; + break; + + case (ushort)BlockId.OreGold: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGold; + break; + + case (ushort)BlockId.OreIron: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackIron; + break; + + case (ushort)BlockId.OreSaltpeter: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSaltpeter; + break; + + case (ushort)BlockId.OreSilver: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSilver; + break; + + case (ushort)BlockId.OreSulfur: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSulfur; + break; + + case (ushort)BlockId.OreTin: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackTin; + break; + + case (ushort)BlockId.Dirt: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt; + break; + + case (ushort)BlockId.Sand: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSand; + break; + + case (ushort)BlockId.Gravel: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGravel; + break; + + case (ushort)BlockId.Cobblestone: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackCobblestone; + break; + + case (ushort)BlockId.Clay: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackClay; + break; + + case (ushort)BlockId.GrassBlockClay: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackClay; + break; + + case (ushort)BlockId.GrassBlockCompost: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt; + break; + + case (ushort)BlockId.GrassBlockDesert: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt; + break; + + case (ushort)BlockId.GrassBlockForest: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt; + break; + + case (ushort)BlockId.GrassBlockHills: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt; + break; + + case (ushort)BlockId.GrassBlockJungle: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt; + break; + + case (ushort)BlockId.GrassBlockPlains: + terrain[xx].SolidBlocks[yy]=0; + terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt; + break; + } + + if (terrain[xx].SolidBlocks[yy-1]!=0) { + ushort idTop=terrain[xx].TopBlocks[yy-1]; + if (idTop!=0) { + switch (idTop) { + case (ushort)BlockId.GrassDesert: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.GrassForest: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.GrassHills: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.GrassJungle: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.GrassPlains: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.Heather: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.Dandelion: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.Violet: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.Rose: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.BranchALittle1:terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.BranchALittle2:terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.BranchFull: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.BranchWithout: terrain[xx].TopBlocks[yy-1]=0; break; + case (ushort)BlockId.Alore: terrain[xx].TopBlocks[yy-1]=0; break; + } + } + } + } + } + } class BiomeExt{ public HotBiome Temterature; @@ -6519,7 +6660,7 @@ public class GChunk { public List Plants = new List(), - Mobs = new List(); + Mobs = new(); public unsafe void AddPlant(ushort id, byte height) { #if DEBUG @@ -6530,7 +6671,7 @@ public class GChunk { Plants.Add(ids[1]); Plants.Add(ids[0]); Plants.Add(height); - Rabcr.random.Byte(Plants); + FastRandom.Byte(Plants); PlantsCount++; } @@ -6538,7 +6679,7 @@ public class GChunk { Plants.Add(byteWheat1); Plants.Add(byteWheat0); Plants.Add(height); - Rabcr.random.Byte(Plants); + FastRandom.Byte(Plants); PlantsCount++; } @@ -6546,7 +6687,7 @@ public class GChunk { Plants.Add(byteCarrot1); Plants.Add(byteCarrot0); Plants.Add(height); - Rabcr.random.Byte(Plants); + FastRandom.Byte(Plants); PlantsCount++; } @@ -6554,7 +6695,7 @@ public class GChunk { Plants.Add(byteFlax1); Plants.Add(byteFlax0); Plants.Add(height); - Rabcr.random.Byte(Plants); + FastRandom.Byte(Plants); PlantsCount++; } @@ -6574,7 +6715,7 @@ const byte byteRabbit0=(byte)(ushort)BlockId.Rabbit, byteRabbit1=(byte)(ushort)(((ushort)BlockId.Rabbit)>>8), - + byteParrot0=(byte)(ushort)BlockId.MobParrot, byteParrot1=(byte)(ushort)(((ushort)BlockId.MobParrot)>>8), @@ -6585,7 +6726,7 @@ const byte Mobs.Add(byteFish1); Mobs.Add(byteFish0); Mobs.Add(height); - Rabcr.random.Byte2(Mobs); + FastRandom.Byte2(Mobs); MobsCount++; } @@ -6593,7 +6734,7 @@ const byte Mobs.Add(byteRabbit1); Mobs.Add(byteRabbit0); Mobs.Add(height); - Rabcr.random.Byte2(Mobs); + FastRandom.Byte2(Mobs); MobsCount++; } @@ -6601,7 +6742,7 @@ const byte Mobs.Add(byteChicken1); Mobs.Add(byteChicken0); Mobs.Add(height); - Rabcr.random.Byte2(Mobs); + FastRandom.Byte2(Mobs); MobsCount++; } @@ -6613,7 +6754,7 @@ const byte Mobs.Add(0); Mobs.Add(height); - Rabcr.random.Byte2(Mobs); + FastRandom.Byte2(Mobs); MobsCount++; } @@ -6624,6 +6765,7 @@ const byte public byte LightPosHalf; public bool SetLightPosHalf; public byte Half; + } public class GPreChunk { diff --git a/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs b/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs index 44c70f9..5853aa7 100644 --- a/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs +++ b/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs @@ -10,69 +10,218 @@ public enum MChunkState:byte{ } public class MTerrain { + public int + // Total (With half) + LightPosFull, + LightPosFull16, + LightPosHalf, + LightPosHalf16, + StartSomething; + public MChunkState state=MChunkState.NotDownloaded; public DateTime sended; - public byte LightPos; - public int LightPos16; - public byte StartSomething; - public Block[] Background=new Block[125]; public Block[] SolidBlocks=new Block[125]; public Block[] TopBlocks=new Block[125]; - public MBlockState[] IsBackground=new MBlockState[125]; - public MBlockState[] IsSolidBlocks=new MBlockState[125]; - public MBlockState[] IsTopBlocks=new MBlockState[125]; + public bool[] + IsBackground=new bool[125], + IsSolidBlocks=new bool[125], + IsTopBlocks=new bool[125]; + + // public bool BackgroundExists(int h) => IsBackground[h]==MBlockState.Exist;//((int)IsBackground[h] & 1)==1; + + // public bool SolidBlocksExists(int h) => IsSolidBlocks[h]==MBlockState.Exist/* || IsSolidBlocks[h]==MBlockState.TmpAdded*/;//((int)IsSolidBlocks[h] & 1)==1; + // public bool TopBlocksExists(int h) => IsTopBlocks[h]==MBlockState.Exist;//((int)IsTopBlocks[h] & 1)==1; public List Mobs=new List(); public List Plants=new List(); - public Vector2 LightVec;//new Vector2(x*16-48+8, terrain[x].LightPos*16-48+8) + public Vector2 LightVec; + + /// After you removed New Block on Y pos terrain + public void RefreshLightingRemoveTop(int newBlockOnY, ushort id) { + if (newBlockOnY==LightPosHalf) { + if (GameMethods.IsHalfShadowBlock(id)) { + + for (int i=LightPosHalf; i<125; i++) { + if (i==LightPosFull) { + LightPosHalf=i; + LightPosHalf16=i*16; + //StartSomething=newBlockOnY; + return; + } + + if (IsTopBlocks[i]) { + if (GameMethods.IsHalfShadowBlock(TopBlocks[i].Id)) { + LightPosHalf=i; + LightPosHalf16=i*16; + // StartSomething=newBlockOnY; + return; + } + } + } + } + } + } + + /// After you Added New Block on Y pos terrain + public void RefreshLightingAddTop(int newBlockOnY, ushort id) { + if (GameMethods.IsHalfShadowBlock(id)) { + //if (newBlockOnYLooks like notexisting, but not, but server need check if player can remove + TmpRemoved=2, //10 + + ///Looks like existing, but not, but server need check if player can add + TmpAdded=3, //11 } - class ChangeTerrain { + class ChangeTerrain { public DateTime sended; - enum ChangeTerrainType:byte{ + enum ChangeTerrainType:byte{ BasicRemove, BasicAdd, + Changed, + - } } class SendedBlockToRemove:ChangeTerrain { - public Mob animal; + // public MMob animal; public DInt blockPos; public BlockType blockType; - public List items; + // public List items; public string World; + + public int SelectedInv; } - //class SendedBlockToRemove:ChangeTerrain { - // public Mob animal; - // public DInt blockPos; - // public BlockType blockType; - // public List items; - // public string World; - //} + class SendedBlockToChange : ChangeTerrain { + // public MMob animal; + public DInt blockPos; + public BlockType blockType; + // public List items; + public string World; + } class SendedBlockToAdd:ChangeTerrain { - public Mob animal; + // public MMob animal; public DInt blockPos; public BlockType blockType; - public List items; + // public List items; public string World; + + public int SelectedInv; } diff --git a/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs b/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs new file mode 100644 index 0000000..186ecac --- /dev/null +++ b/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs @@ -0,0 +1,1933 @@ +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using System.Diagnostics; +//using System.Drawing; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Sockets; + +namespace rabcrClient { + partial class Multiplayer { + int playerId=-1; + #region varibles + List terrainChanges = new List(); + List Queue = new List(); + const string toServer = "{Server}"; + const string toEveryone = "{Everyone}"; + string SomeoneWantTeleportToYouName; + + Password password; + + enum LoginType { + Null, + + Banned, + BannedWithInfo, + + FirstConnectPassword, + FirstConnect, + + NotOnWhitelistNoInfo, + NotOnWhitelist, + + LoginWithPassword, + BasicLogin, + } + int state = 0; + const int downloadingSpawnAreaMax = 53; + int downloadedSpawnArea = 0; + // bool cmdWeb; + byte[] byteData = new byte[1024]; + Current currentState; + bool Error = false; + int joinedPlayers = 0; + Socket clientSocket; + string serverName = ""; + int maxplayers = 10; + DateTime tpPlayerTime; + string tpPlayerMsgWaiting; + int safeSpawn = 0; + List players = new List(); + // bool UseBackColor; + // Color BackColor; + // bool UseGedo; + GameButtonMedium menu; + float Process { + get { return state/496f; } + } + string sn = ""; + #endregion + + void DestroyBlockTopBlock(int x, int y) { + MTerrain chunk=terrain[x]; + SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Top); + // chunk.TopBlocks[y]=null; + // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved; + } + + void DestroyBlockBackBlock(int x, int y) { + MTerrain chunk=terrain[x]; + SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Back); + //chunk.BackBlocks[y]=null; + // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved; + } + + void DestroyBlockSolidBlock(int x, int y) { + MTerrain chunk=terrain[x]; + SendRemovedBlock(x, y, chunk.SolidBlocks[y].Id,BlockType.Solid); + // chunk.TopBlocks[y]=null; + //chunk.IsTopBlocks[y]=MBlockState.TmpRemoved; + } + + void SendRemovedBlock(int x, int y, ushort id, BlockType bt) { + terrainChanges.Add(new SendedBlockToRemove { + blockPos=new DInt(x,y), + blockType=bt, + World="Earth", + SelectedInv=boxSelected, + sended=DateTime.Now, + }); + + //switch (bt) { + // case BlockType.Back: + // terrain[x].IsBackground[y]=MBlockState.TmpRemoved; + // break; + + // case BlockType.Solid: + // terrain[x].IsSolidBlocks[y]=MBlockState.TmpRemoved; + // break; + + // case BlockType.Top: + // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; + // break; + + // case BlockType.Plant: + // terrain[x].Plants.[y]=MBlockState.TmpRemoved; + // break; + + // case BlockType.Mob: + // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; + // break; + //} + + //Queue.Add(new DataToSend { + // Importance=Importance.Middle, + // Bytes=new Data { + // Cmd=Command.EditTerrain, + // From=Setting.Name, + // To=toServer, + // Message="-|"+x+"|"+y+"|"+world+"|"+(int)BlockType.Top+"|"+id+"|", + // }.ToByte(), + //}); + } + + //void SendChangedBlock(int x, int y, ushort oldId, ushort newId, BlockType bt) { + // terrainChanges.Add(new SendedBlockToAdd { + // blockPos=new DInt(x,y), + // blockType=bt, + // World="Earth", + // sended=DateTime.Now, + // }); + + // //switch (bt) { + // // case BlockType.Back: + // // // terrain[x].IsBackground[y]=false; + // // break; + + // // case BlockType.Solid: + // // // terrain[x].IsSolidBlocks[y]=MBlockState.TmpRemoved; + // // break; + + // // case BlockType.Top: + // // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; + // // break; + + // // case BlockType.Plant: + // // // terrain[x].Plants.[y]=MBlockState.TmpRemoved; + // // break; + + // // case BlockType.Mob: + // // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; + // // break; + // //} + + // Queue.Add(new DataToSend { + // Importance=Importance.Middle, + // Bytes=new Data { + // Cmd=Command.EditTerrain, + // From=Setting.Name, + // To=toServer, + // Message="*|"+x+"|"+y+"|"+world+"|"+(int)BlockType.Top+"|"+oldId+"|"+newId, + // }.ToByte(), + // }); + //} + + void SendAddedBlock(int x, int y, int id, BlockType bt) { + terrainChanges.Add(new SendedBlockToAdd { + blockPos=new DInt(x,y), + blockType=bt, + World="Earth", + SelectedInv=boxSelected, + sended=DateTime.Now, + }); + + //switch (bt) { + // case BlockType.Back: + // // terrain[x].IsBackground[y]=false; + // break; + + // case BlockType.Solid: + // // terrain[x].IsSolidBlocks[y]=MBlockState.TmpRemoved; + // break; + + // case BlockType.Top: + // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; + // break; + + // case BlockType.Plant: + // // terrain[x].Plants.[y]=MBlockState.TmpRemoved; + // break; + + // case BlockType.Mob: + // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; + // break; + //} + + //Queue.Add(new DataToSend { + // Importance=Importance.Middle, + // Bytes=new Data { + // Cmd=Command.EditTerrain, + // From=Setting.Name, + // To=toServer, + // Message="+|"+x+"|"+y+"|"+world+"|"+(int)BlockType.Top+"|"+id+"|", + // }.ToByte(), + //}); + } + + void SendEatItem() { + //Queue.Add(new DataToSend { + // Importance=Importance.Middle, + // Bytes=new Data { + // Cmd=Command.EatFood, + // From=Setting.Name, + // To=toServer, + // Message=InventoryNormal[boxSelected].Id.ToString(), + // }.ToByte(), + //}); + } + + void SendHoeAction(int x, int y) { + + } + + Color StringToColor(string str) { + string h = str.Replace("[", "").Replace("]", "").Replace(" ", ""); + return new Color(int.Parse(h.Substring(0, h.IndexOf(","))), + int.Parse(h.Substring(h.IndexOf(",")+1, h.LastIndexOf(",")-h.IndexOf(",")-1)), + int.Parse(h.Substring(h.LastIndexOf(",")+1))); + } + + public void Connect() { + clientSocket=new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { + ReceiveTimeout=10 + }; + IPAddress ipAddress = ip; + + if (ipAddress.ToString()==IPAddress.Any.ToString()) { ipAddress=IPAddress.Loopback; ip=IPAddress.Loopback; } + + IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port); + + Console.WriteLine("Připojování: "+ipAddress.ToString()+":"+port); + + clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null); + } + + public void ConnectDuringGameError() { + clientSocket=new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { + ReceiveTimeout=10 + }; + IPAddress ipAddress = ip; + + if (ipAddress.ToString()==IPAddress.Any.ToString()) ipAddress=IPAddress.Loopback; + + IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port); + + Console.WriteLine("Znovupřipojování: "+ipAddress.ToString()+":"+port); + + clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null); + } + + void OnCheck(IAsyncResult ar) { + try { + state++; + clientSocket.EndConnect(ar); + + //Data msgToSend = new Data { + // Cmd = Command.Check, + // // From=Setting.Name, + // To = toServer, + // Message = "" + //}; + + List bytesToSend=new List(); + bytesToSend.Add((byte)Command.Check); + AddStringToByteList(bytesToSend, Setting.Name); + + byteData = bytesToSend.ToArray(); + + //byteData = msgToSend.ToByte(); + + clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + + byteData = new byte[1024]; + + clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null); + + //current=Current.EndChecking; + state++; + } catch (SocketException ex) { + + //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl + if (10061 == ex.ErrorCode) { + ShowError("Nelze se připojit k serveru", "Žádný server není spuštěn na adrese " + ip + ":" + port); + } else { + //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel + if (10060 == ex.ErrorCode) { + ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho."); + } else if (10013 == ex.ErrorCode) { + ShowError("Nelze se připojit k serveru", "Pravděpodobně Váš firewall blokuje připojení (Zkuste ho vypnout)"); + } else + ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnCheck: " + ex.Message + "; Kód: " + ex.ErrorCode); + } + } + + //if (!Global.OnlineAccount){ + // string url="https://geftgames.ga/System/rabcr/ifplayerexists.php?username="+Setting.Name; + // MyWebClient wc=new MyWebClient { + // Encoding=Encoding.UTF8, + // }; + // try{ + // string get=wc.DownloadString(new Uri(url)); + // Console.WriteLine(6); + // if (string.IsNullOrEmpty(get)) { + // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); + // } else { + // string[]g=get.Split('|'); + + // if (g.Length>1){ + // switch (g[0]) { + // case "E": + + // break; + + // case "O": + // //ok + // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá"); + // break; + + // default: + // // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá"); + // break; + // } + // } else { + // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); + // } + // } + // }catch{ + // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); + // } + //} + + } + + void SendMyInventory() { + //Data data = new Data { + // Cmd=Command.Message, + // To=toServer, + // Message="*int-set ", + //}; + + //data.Message+=maxInvCount+" "; + + ////for (int i = 0; i inv = null; + int id = terrain[x].TopBlocks[y].Id; + + //if (terrain[x].TopBlocks[y] is BoxBlock) { + // inv=((BoxBlock)terrain[x].TopBlocks[y]).Inv; + //} else if (terrain[x].TopBlocks[y] is MashineBlockBasic) { + // inv=((MashineBlockBasic)terrain[x].TopBlocks[y]).Inv; + //} else if (terrain[x].TopBlocks[y] is ShelfBlock) { + // inv=((ShelfBlock)terrain[x].TopBlocks[y]).Inv; + //} else return; + + //Data data = new Data { + // Cmd=Command.Message, + // To=toServer, + // Message="*inv-machine-set "+x+" "+y+" ", + //}; + + //data.Message+=inv.Count+" "; + + //for (int i = 0; i inv=null; + + + //Data data = new Data { + // Cmd=Command.Message, + // To=toServer, + // Message="*inv-set ", + //}; + + //data.Message+=maxInvCount+" "; + + //List bytesInv=new(); + //for (int i = 0; i \"; y je číslo"); + } + } else { + if (int.TryParse(word[2], out int y)) { + DisplayText("Použití: \"*tp \"; x je číslo"); + } else { + DisplayText("Použití: \"*tp \"; x a y je číslo"); + } + } + } + } else { + DisplayText("Na tento příkaz namáte oprávnění"); + } + return; + + case "*warp-set": + if (word.Length==2) { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*warp-set "+word[1]+" "+PlayerX+" "+PlayerY, + // }.ToByte(), + // Importance=Importance.Middle + //}); + DisplayText("Nastavuji warp "+word[1]); + } + break; + + case "*warp": + if (word.Length==2) { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*warp "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + //}); + } + break; + + case "*kick": + if (word.Length==2) { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*kick "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + //}); + } + break; + + case "*ban": + if (word.Length==2) { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*ban "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + //}); + } + break; + + case "*unban": + if (word.Length==2) { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*unban "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + //}); + } + break; + + case "*warp-remove": + if (word.Length==2) { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*warp-remove "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + //}); + } + break; + + case "*group-set": + if (word.Length==3) { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*group-set "+word[1]+" "+word[2], + // }.ToByte(), + // Importance=Importance.Middle + //}); + } + break; + + case "*itemsclear": + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*itemsclear", + // }.ToByte(), + // Importance=Importance.Middle + //}); + break; + + case "*server-backup": + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*server-backup", + // }.ToByte(), + // Importance=Importance.Middle + //}); + break; + + case "*server-reset": + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*server-reset", + // }.ToByte(), + // Importance=Importance.Middle + //}); + break; + + case "*server-end": + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*server-end", + // }.ToByte(), + // Importance=Importance.Middle + //}); + break; + + case "*changepassword": + password=new Password(); + password.Show(); + break; + + case "*spawn-set": + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*spawn-set "+PlayerX+" "+PlayerY, + // }.ToByte(), + // Importance=Importance.Middle + //}); + break; + + case "*gamemode": + if (word.Length==2) { + if (word[1]=="Dobrodružná"||word[1]=="Výzkum"||word[1]=="Kreativní" + ||word[1]=="0"||word[1]=="1"||word[1]=="2" + ||word[1]=="d"||word[1]=="v"||word[1]=="k") { + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*gamemode "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + //}); + } else DisplayText("Neplatný příkaz, zkus \"*help\""); + } + break; + + default: + DisplayText("Neplatný příkaz, zkus \"*help\""); + return; + } + } + + void OnReceive(IAsyncResult ar) { + //Console.WriteLine("rec"); + try { + clientSocket.EndReceive(ar); + } catch (Exception ex) { + if (ex.HResult==10054) { + //ShowError("Spojení bylo přerušeno", ex.Message); + //clientSocket.Shutdown(new SocketShutdown()); + //clientSocket.Close(); + //clientSocket.Dispose(); + if (!exit) SolveErrorDuringGame(ex.HResult, "", ""); + return; + } else { + Console.WriteLine(ex.Message+" rec1"); + } + } + + // Data msgReceived = new Data(byteData); + // msgReceived.Talk(); + Command cmd=(Command)byteData[0]; + + Console.WriteLine("Get: "+cmd.ToString("g")); + + switch (cmd) { + case Command.SendingWorldData: + { + // if (msgReceived.terrain!=null) { + // if (msgReceived.terrain.Length>2) { + // Load(bytes: msgReceived.terrain, pos: msgReceived.pos); + + // if (currentState==Current.GettingSpawn) { + // if (downloadedSpawnArea bytes = new List(); + // if (strs.Length==5) { + // if (strs[4]!="") { + // foreach (string s in strs[4].Split(',')) { + // bytes.Add(byte.Parse(s)); + // } + // } + // } + // if (strs[0]=="+") { + // int x = int.Parse(strs[1]), + // y = int.Parse(strs[2]); + // if (terrain[x]==null) break; + // byte id = byte.Parse(strs[3]); + // bool stay = true; + + // { + // Block b = SolidBlockFromId(id, new Vector2(x, y)); + // if (b!=null) { + // // if (terrain[x].IsSolidBlocks[y]) GetItemsFromBlock(id, x, y); + // terrain[x].IsSolidBlocks[y]=true; + // terrain[x].SolidBlocks[y]=b; + // stay=false; + // } + // } + // if (stay) { + // Block b = TopBlockFromId(id, new Vector2(x, y)); + // if (b!=null) { + // // if (terrain[x].IsTopBlocks[y]) GetItemsFromBlock(id, x, y); + // terrain[x].IsTopBlocks[y]=true; + // terrain[x].TopBlocks[y]=b; + // stay=false; + // } + // } + // if (stay) { + // Block b = BackBlockFromId(id, new Vector2(x, y)); + // if (b!=null) { + // // if (terrain[x].IsBackground[y]) GetItemsFromBlock(id, x, y); + // terrain[x].IsBackground[y]=true; + // terrain[x].Background[y]=null; + // stay=false; + // } + // } + + // if (stay) { + // Plant p = GetPlantFromId(id, (byte)y,/*?*/255, (short)x); + // if (p!=null) { + // foreach (Plant px in terrain[x].Plants) { + // if (px.Height==y) { + // //GetItemsFromPlant(id, new DInt(x, y), px.Grow==255); + // terrain[x].Plants.Remove(px); + // break; + // } + // } + // stay=false; + // terrain[x].Plants.Add(p); + // } + // } + + + // //if (stay) { + // // Block b=ani(id,new Vector2(x,y)); + // // if (b!=null) { + // // foreach (Mob m in terrain[x].Mobs) { + // // if (m.Height==y) { + // // if (m.Id==id) {GetItemsFromBlock(id,new DInt(x,y)); + // // terrain[x].Mobs.Remove(m); + // // stay=false; + // // break; + // // } + // // } + // // } + // //} + // } else { + // int x = int.Parse(strs[1]), + // y = int.Parse(strs[2]); + // if (terrain[x]==null) break; + // byte id = byte.Parse(strs[3]); + // bool stay = true; + + // if (terrain[x].IsSolidBlocks[y]) { + // if (terrain[x].SolidBlocks[y].Id==id) { + // terrain[x].IsSolidBlocks[y]=false; + // terrain[x].SolidBlocks[y]=null; + // stay=false; + // } + // } + // if (stay) { + // if (terrain[x].IsTopBlocks[y]) { + // if (terrain[x].TopBlocks[y].Id==id) { + // terrain[x].IsTopBlocks[y]=false; + // terrain[x].TopBlocks[y]=null; + // stay=false; + // } + // } + // } + // if (stay) { + // if (terrain[x].IsBackground[y]) { + // if (terrain[x].Background[y].Id==id) { + // terrain[x].IsBackground[y]=false; + // terrain[x].Background[y]=null; + // stay=false; + // } + // } + // } + + // if (stay) { + // foreach (Plant p in terrain[x].Plants) { + // if (p.Height==y) { + // if (p.Id==id) { + // terrain[x].Plants.Remove(p); + // stay=false; + // break; + // } + // } + // } + // } + // if (stay) { + // foreach (MMob m in terrain[x].Mobs) { + // if (m.Height==y) { + // if (m.Id==id) { + // terrain[x].Mobs.Remove(m); + // stay=false; + // break; + // } + // } + // } + // } + // } + // } + // } + } + break; + + case Command.Login: + { + state++; + bool success = byteData[1]==1; + + if (success) { + playerId = byteData[3] | (byteData[4]>>8) | (byteData[5]>>16) | (byteData[6]>>24); + + //PlayerX = (byteData[7] | (byteData[8]>>8)); + //PlayerY = byteData[9]; + + List bytesToSend = new List(); + bytesToSend.Add((byte)Command.PlayerPosition); + // bytesToSend.Add((byte)LoginType.BasicLogin); + AddStringToByteList(bytesToSend, Setting.Name); + + Queue.Add(new DataToSend { + Bytes = bytesToSend.ToArray(), + Importance = Importance.VeryImportant + }); + + SendMsgTerrain(); + } else { + ShowError("Nelze se připjit", "Server odmítl hráče připojit"); + } + + + //if (msgReceived.Message!=null) { + + // string[] strs = msgReceived.Message.Split('|'); + // if (strs.Length>0) { + // if (strs[0]=="0") { + // // Console.WriteLine("Wrong password!"); + // System.Windows.Forms.MessageBox.Show("Špatné heslo", "Pro připojení k serveru je potřeba zadat správné heslo"); + // // System.Windows.Forms.MessageBox.Show("Zadali jste špatné heslo","Špatné heslo"); + // clientSocket.Disconnect(false); + // // Rabcr.GoTo(new MenuMultiplayer()); + // } else if (strs[0]=="1") { + // //Console.WriteLine("Setting vars"); + + // TerrainLenght=int.Parse(strs[1]); + // terrain=new MTerrain[TerrainLenght]; + // Console.WriteLine(TerrainLenght+" len"); + + // for (int c = 0; c bytesToSend = new List(); + bytesToSend.Add((byte)Command.Login); + bytesToSend.Add((byte)LoginType.BasicLogin); + AddStringToByteList(bytesToSend, Setting.Name); + + Queue.Add(new DataToSend { + Bytes = bytesToSend.ToArray(), + Importance = Importance.VeryImportant + }); + // byteData = msg.ToByte(); + + //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + } + break; + + case LoginType.FirstConnect: + { + //Data msg = new Data { + // Cmd = Command.SetPassword, + // // From=Setting.Name, + // To = toServer, + // Message = "" + //}; + List bytesToSend = new List(); + bytesToSend.Add((byte)Command.Login); + bytesToSend.Add((byte)LoginType.FirstConnect); + AddStringToByteList(bytesToSend, Setting.Name); + + Queue.Add(new DataToSend { + Bytes = bytesToSend.ToArray(), + Importance = Importance.VeryImportant + }); + // byteData = msg.ToByte(); + + // clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + } + break; + + } + // } + + + + //if (strs.Length>0) { + // switch (strs[0]) { + // case "0": + // if (strs.Length==3) { + // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]+Environment.NewLine+"zkuste tento web: "+strs[2]); + // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // break; + + // case "1": + // if (strs.Length==2) { + // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]); + // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // break; + + // case "2": + // if (strs.Length==4) { + // int x = int.Parse(strs[0]); + // int y = int.Parse(strs[1]); + // string password = strs[2]; + // int type = int.Parse(strs[3]); + + // if (password!="") { + // chp=new CheckPassword(); + // chp.Show(); + // waitingPassword=true; + // this.password=password; + // } + // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]); + // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // break; + + // case "3": + // if (strs.Length==2) { + // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství"+Environment.NewLine+strs[1]); + // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // break; + + // case "4": + // if (strs.Length==1) { + // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství"); + // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // break; + + // case "5": + + // break; + // } + //} + + //int.TryParse(strs[1], out spawnX); + //int.TryParse(strs[2], out spawnY); + //int.TryParse(strs[3], out safeSpawn); + + //PlayerX=spawnX; + //PlayerY=spawnY; + + //SendMsgTerrain(); + state++; + } + break; + + //case Command.Logout: + // clientSocket.Disconnect(false); + // break; + + case Command.PlayersTeleportMessageToSource: + { + //if (!string.IsNullOrEmpty(msgReceived.Message)) { + // string[] strs = msgReceived.Message.Split('|'); + + // if (int.TryParse(strs[0], out int num)) { + // if (num==1) { + // //DisplayText("Vaše žádost byla zamítnuta"); + // } + // if (num==2) { + // if ((DateTime.Now-tpPlayerTime.Date).TotalMinutes<=2) { + // foreach (Player p in players) { + // if (tpPlayerMsgWaiting==p.name) { + // // DisplayText("Teleportuji..."); + // text="Teleportuji..."; + // PlayerX=p.x; + // PlayerY=p.y; + // break; + // } + // } + // } + // } + // if (num==3) { + // if (strs[1]==Setting.Name) { + // //SomeoneWantTeleportToYou=true; + // SomeoneWantTeleportToYouName=msgReceived.From; + // gedo.BuildString("Hráč "+SomeoneWantTeleportToYouName+" se chce k vám teleportovat.\r\nPoužij \"*tp-allow\" pro přijení nebo \"*tp-deny\" pro zamítnutí."); + // diserpeard=255; + // } + // } + // } + //} + } + break; + + case Command.Message: + { + //if (msgReceived.Message!=null||msgReceived.Message!="") { + // if (msgReceived.Message.StartsWith("*")) { + // string[] word = msgReceived.Message.Split(' '); + // switch (word[0]) { + // case "*setplayerpos": + // if (word.Length==3) { + // PlayerX=int.Parse(word[1]); + // PlayerY=int.Parse(word[2]); + // DisplayText("Teleportuji..."); + // SetPlayerPos(PlayerX, PlayerY); + // } + // break; + + // case "*spawnwaschanged": + // spawnX=int.Parse(word[1]); + // spawnY=int.Parse(word[2]); + // break; + + // case "*int-set": { + // int count = int.Parse(word[1]); + + // List tmpInv = new List(); + + // //for (int i = 0; i tmpInv = new List(); + + // //for (int i = 0; i"+msgReceived.cmdCommand.ToString()+"<>"+msgReceived.strMessage); + ////} else Console.WriteLine("!jméno "+msgReceived.strName); + } + break; + + //case Command.Request: + // { + // Data msg = new Data { + // Cmd=Command.Request, + // // From=Setting.Name, + // To=toServer, + // Message="" + // }; + // //byteData=new byte[1024]; + // //byteData=msg.ToByte(); + + // //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + // Queue.Add(new DataToSend { + // Bytes=msg.ToByte(), + // Importance=Importance.VeryImportant + // }); + // } + // break; + + case Command.Check: + { + state++; + // Version + byte lenVersion = byteData[1]; + string version=System.Text.Encoding.UTF8.GetString(byteData, 2, lenVersion); + + if (version==Release.VersionString) { + + // Message + int pos=3+lenVersion; + int lenMessage=byteData[pos]; + string serverMessage=System.Text.Encoding.UTF8.GetString(byteData, pos, lenMessage); + + pos+=lenMessage+1; + joinedPlayers=byteData[pos]; + maxplayers=byteData[pos+1]; + + Debug.WriteLine("G|"+version+'|'+serverMessage+'|'+joinedPlayers+'|'+maxplayers); + + // Ask server what I need to join server + List bytesToSend=new List(); + bytesToSend.Add((byte)Command.GetStatus); + + Queue.Add(new DataToSend { + Bytes=bytesToSend.ToArray(), + Importance=Importance.VeryImportant + }); + //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + } else ShowError("Jiná verze serveru", "Verze serveru ("+version+") je rozdílná od verze hry."); + + // string[] get = msgReceived.Message.Split('|'); + + // if (get.Length > 0) { + // maxplayers = int.Parse(get[1]); + // joinedPlayers = int.Parse(get[2]); + // string version = get[3]; + // //smd=true; + // if (version == Release.VersionString) { + // Data msg = new Data { + // Cmd = Command.Login, + // // From=Setting.Name, + // To = toServer, + // //Message=Setting.Name + // }; + // //byteData=msg.ToByte(); + // currentState = Current.EndChecking; + // SetMultiplayerLoadingText(); + // //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + // Queue.Add(new DataToSend { + // Bytes = msg.ToByte(), + // Importance = Importance.VeryImportant + // }); + // } else { + + // } + // } else { + // ShowError("Chyba sáčku", "Hra obdržela od serveru prázdný soubor s informacemi."); + // } + // Console.WriteLine(msgReceived.strMessage); + // string _new = msgReceived.strMessage; + // string version = _new.Substring(_new.LastIndexOf("|") + 1); + // _new = _new.Substring(0, _new.LastIndexOf("|")); + // int.TryParse(_new.Substring(_new.LastIndexOf("|") + 1), out maxplayers); + // _new = _new.Substring(0, _new.LastIndexOf("|")); + // int.TryParse(_new.Substring(_new.LastIndexOf("|") + 1), out joinedPlayers); + // _new = _new.Substring(0, _new.LastIndexOf("|")); + // Console.WriteLine("sdfgdfgfdf"); + // if + // if (joinedPlayers < maxplayers) { + // // OK //////////////////////////////////////// + + + + // } + // Console.WriteLine("Logining..."); + // state++; + + // } else { + // Error = true; + // ErrorCode = "Server je plný."; + // Console.WriteLine("Moc hráčů."); + // clientSocket.Disconnect(false); + // clientSocket.Close(); + // clientSocket.Dispose(); + // } + //} else { + // Error = true; + // ErrorCode = "Server je pro jinou verzi."; + // Console.WriteLine("Jiná verze."); + // clientSocket.Disconnect(false); + // clientSocket.Close(); + // clientSocket.Dispose(); + //} + } + break; + + case Command.Exit: + //Queue.Add(new DataToSend { + // Bytes=new Data { + // // From=Setting.Name, + // To=toServer, + // Message="*beforeexitdata "+PlayerX+" "+PlayerY,//+inv... + // Cmd=Command.Message + // }.ToByte(), + // Importance=Importance.VeryImportant + //}); + //closingServer=true; + break; + + case Command.PlayersList: { + //players.Clear(); + //foreach (string h in msgReceived.Message.Split('~')) { + // if (h!="") { + // string[] splited = h.Split('|'); + + // Player player = new Player(splited[0]) { + // x=int.Parse(splited[1]), + // y=int.Parse(splited[2]) + // }; + // players.Add(player); + // } + //} + + //if (currentState==Current.GettingPlayers) { + // currentState=Current.Playing; + // SetMultiplayerLoadingText(); + // //Resize(); + //} + } + break; + } + + if (Queue.Count == 0) { + // if (cmd==Command.Blank) + // System.Threading.Thread.Sleep(10); + // else System.Threading.Thread.Sleep(5); + //Data data = new Data { + // // From=Setting.Name, + // To = toServer, + // Cmd = Command.Blank + //}; + ListbytesToSend=new List(); + bytesToSend.Add((byte)Command.Blank); + try { + byte[] bytes = bytesToSend.ToArray(); + clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + } catch (Exception ex) { Console.WriteLine(ex.Message + "1"); } + } else { + try { + byte[] bytes = Queue[0].Bytes; + Console.WriteLine("SEND: "+((Command)Queue[0].Bytes[0]).ToString()); + Queue.RemoveAt(0); + clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + } catch (Exception ex) { Console.WriteLine(ex.Message + "2"); } + } + + + + ////////if (!closingServer){ + //////// byteData=new byte[1024]; + + //////// try { + //////// clientSocket.BeginReceive(byteData, + //////// 0, + //////// byteData.Length, + //////// SocketFlags.None, + //////// new AsyncCallback(OnReceive), + //////// clientSocket); + //////// } catch (Exception ex) { + //////// if (ex.HResult==10054) { + //////// ShowError("Spojení bylo přerušeno", ex.Message); + //////// clientSocket.Shutdown(new SocketShutdown()); + //////// clientSocket.Close(); + //////// clientSocket.Dispose(); + //////// return; + //////// }else{ + //////// Console.WriteLine(ex.Message+"12"); + //////// } + //////// } + ////////} else { + //////// clientSocket.Shutdown(new SocketShutdown()); + //////// current=Current.Checking; + //////// clientSocket.Disconnect(false); + //////// clientSocket.Close(); + //////// // clientSocket.Dispose(); + //////// ShowError("Server byl ukončen","Server se vypnul ze strany serveru"); + //////// // Rabcr.GoTo(new Menu()); + ////////} + //if (msgReceived.strMessage != null && msgReceived.cmdCommand != Command.List) { + // chat += msgReceived.strMessage + "\r\n"; + // Console.WriteLine("G " + msgReceived.strMessage); + // foreach (Player p in players) {//Console.WriteLine(0); + // if (p.name == msgReceived.strName) {//Console.WriteLine(1); + // string data = msgReceived.strMessage.Replace(msgReceived.strName + ": ", ""); + // if (data.StartsWith("X")) {//Console.WriteLine(2); + + // //for (int i=0; i bytesToSend=new List(); + bytesToSend.Add((byte)Command.ConnectDuringGame); + AddStringToByteList(bytesToSend,Setting.Name); + + byteData=bytesToSend.ToArray(); + clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + + byteData=new byte[1024]; + clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null); + + //current=Current.EndChecking; + state++; + } catch (SocketException ex) { + + //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl + if (10061==ex.ErrorCode) { + ShowError("Nelze se připojit k serveru", "Pravděpodobně není spuštěn server."); + } else { + //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel + if (10060==ex.ErrorCode) { + ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho."); + } else { + ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnConnectDuringGameError: "+ex.Message); + } + } + } + } + + void OnSend(IAsyncResult ar) { + try { + // clientSocket.Connected + //Process=0.55f; + clientSocket.EndSend(ar); + //Process=1f; + //ready=true; + //Loading=false; + } catch (SocketException ex) { + //Console.WriteLine(ex.ErrorCode+" 2 "+ex.Message); + ////Process=1f; + //ready=true; + //Error=true; + //ErrorCode=ex.Message; + if (!exit) ShowError("Nelze odeslat sáček", ""+ex.Message); + } + //Console.WriteLine(byteData); + // Console.WriteLine("send"); + } + + void SendEveryone(string text) { + try { + //Fill the info for the message to be send + //Data msgToSend = new Data { + // //Console.WriteLine(text); + // // From=Setting.Name, + // To=toEveryone, + // Message=text, + // Cmd=Command.Message + //}; + + ////byte[] byteData = + //Queue.Add(new DataToSend { + // Bytes=msgToSend.ToByte(), + // Importance=Importance.High + //}); + //Send it to the server + //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSendAfter), null); + // Console.WriteLine("sending: "+System.Text.Encoding.UTF8.GetString(byteData)); + // txtMessage.Text = null; + } catch (Exception) { + //Console.WriteLine("Unable to send message to the server."); + } + } + + void ShowError(string main, string toShow) { + Error=true; + ErrorHeader=main; + ErrorText=toShow; + currentState=Current.ErrorDuringGame; + textHeader=new TextWithMeasure(ErrorHeader,0,0); + textMore=new TextWithMeasure(ErrorText,0,0); + + textHeader.ChangePosition(Global.WindowWidthHalf-textHeader.MeasureX/2, Global.WindowHeightHalf-30/2); + textMore.ChangePosition(Global.WindowWidthHalf-textMore.MeasureX/2, Global.WindowHeightHalf+30/2); + } + + void SetMultiplayerLoadingText(){ + switch (currentState) { + case Current.Checking: + textHeader=new TextWithMeasure("Připojování...",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black); + break; + + case Current.EndChecking: + textHeader=new TextWithMeasure("Přihlašování...",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black); + break; + + case Current.EndLoging: + textHeader=new TextWithMeasure("Přihlašování...",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black); + break; + + case Current.Loging: + textHeader=new TextWithMeasure("Přihlašování...",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black); + break; + + case Current.SendingBasic: + textHeader=new TextWithMeasure("Přihlašování...",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black); + break; + + case Current.GettingSpawn: + textHeader=new TextWithMeasure("Získávání terénu",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Získávání terénu", Color.Black); + break; + + case Current.GettingPlayers: + textHeader=new TextWithMeasure("Informace o hráčích",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Načítání herních komponent", Color.Black); + break; + + case Current.LoadingAssets: + textHeader=new TextWithMeasure("Herních komponent",0,0); + // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Načítání herních komponent", Color.Black); + break; + } + textHeader.ChangePosition(Global.WindowWidthHalf-textHeader.MeasureX/2, Global.WindowHeightHalf-30/2); + //} + // textHeader=new TextWithMeasure(,0,0);//.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString("Připojování...").X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black); + } + + } +} diff --git a/rabcrClient/InterLogic/Game/Terrain/Terrain.cs b/rabcrClient/InterLogic/Game/Terrain/Terrain.cs index 0741000..a0c3f82 100644 --- a/rabcrClient/InterLogic/Game/Terrain/Terrain.cs +++ b/rabcrClient/InterLogic/Game/Terrain/Terrain.cs @@ -3,14 +3,13 @@ namespace rabcrClient { public class Terrain { - public int + public int // Total (With half) LightPosFull, LightPosFull16, LightPosHalf, - LightPosHalf16; - - public int StartSomething; + LightPosHalf16, + StartSomething; public Block[] Background=new Block[125], @@ -22,26 +21,26 @@ public int IsSolidBlocks=new bool[125], IsTopBlocks=new bool[125]; - public List Mobs=new List(); - public List Plants=new List(); + public List Mobs=new(); + public List Plants=new(); public Vector2 LightVec; /// After you removed New Block on Y pos terrain public void RefreshLightingRemoveTop(int newBlockOnY, ushort id) { if (newBlockOnY==LightPosHalf) { - if (GameMethods.IsHalfShadowBlock(id)) { + if (GameMethods.IsHalfShadowBlock(id)) { - for (int i=LightPosHalf; i<125; i++) { - if (i==LightPosFull) { + for (int i=LightPosHalf; i<125; i++) { + if (i==LightPosFull) { LightPosHalf=i; LightPosHalf16=i*16; //StartSomething=newBlockOnY; - return; + return; } if (IsTopBlocks[i]) { - if (GameMethods.IsHalfShadowBlock(TopBlocks[i].Id)) { + if (GameMethods.IsHalfShadowBlock(TopBlocks[i].Id)) { LightPosHalf=i; LightPosHalf16=i*16; // StartSomething=newBlockOnY; @@ -55,9 +54,9 @@ public int /// After you Added New Block on Y pos terrain public void RefreshLightingAddTop(int newBlockOnY, ushort id) { - if (GameMethods.IsHalfShadowBlock(id)) { + if (GameMethods.IsHalfShadowBlock(id)) { //if (newBlockOnY&l;Spoiler&g;, &l;Article&g; a &l;NewLine&g;" + // "\""; - public static void RunMessage(string Text, string Header="Message"){ + public static void RunMessage(string Text, string Header="Message"){ System.Diagnostics.Process.Start(Environment.GetCommandLineArgs()[0], "/Message Language="+Setting.CurrentLanguage+" \"Header="+Header+"\" \"Text="+Text+"\""); System.Diagnostics.Debug.WriteLine("/Message Language="+Setting.CurrentLanguage+" \"Header="+Header+"\" \"Text="+Text+"\""); } - public static void ShowgeDoHelp(){ + public static void ShowgeDoHelp(){ RunMessage( ""+Lang.Texts[1559]+"" + ""+ @@ -123,13 +123,13 @@ static class Global { //"&l;Spoiler&g;, &l;Article&g; a &l;NewLine&g;"+ //"" - - - + + + ,Lang.Texts[194]); - + } - + //public static string MessageGedoInfo="Informace o GeDo tagech" + // ""+ @@ -182,7 +182,7 @@ static class Global { //static Message message; //static GameWindow otherWindow; //public static bool IsPopupShowed; - //public static void ShowPopUpWindow(string text) { + //public static void ShowPopUpWindow(string text) { // if (!IsPopupShowed){ // message=new Message(Setting.CurrentLanguage,text); // otherWindow = Microsoft.Xna.Framework.GameWindow.Create(message, 100, 100); @@ -191,9 +191,9 @@ static class Global { // } //} - //public static void ClosePopUp() { - // if (IsPopupShowed) { - + //public static void ClosePopUp() { + // if (IsPopupShowed) { + // IsPopupShowed=false; // } //} diff --git a/rabcrClient/InterLogic/Global/Setting.cs b/rabcrClient/InterLogic/Global/Setting.cs index 1e1ca17..14bba48 100644 --- a/rabcrClient/InterLogic/Global/Setting.cs +++ b/rabcrClient/InterLogic/Global/Setting.cs @@ -155,12 +155,12 @@ public enum Scale :byte{ bytes.AddRange(BitConverter.GetBytes(slideChangeTime)); bytes.AddRange(BitConverter.GetBytes(Zoom)); bytes.AddRange(BitConverter.GetBytes(NightBrightness)); - + File.WriteAllBytes(Path+@"\Setting.bin",bytes.ToArray()); //Debug.Write(" Uloženo!"); //if (Global.OnlineAccount && Global.Logged) UploadAccountSetting(); - //else + //else // if (exiting)saved=true; } diff --git a/rabcrClient/InterLogic/Graphics/Background.cs b/rabcrClient/InterLogic/Graphics/Background.cs index db7beab..c11ec9e 100644 --- a/rabcrClient/InterLogic/Graphics/Background.cs +++ b/rabcrClient/InterLogic/Graphics/Background.cs @@ -239,7 +239,7 @@ readonly Texture2D BGChunkLenght=int.Parse(File.ReadAllText(Setting.Path+"\\MenuBackgroundChunks.txt")); terrain =new BTerrain[BGChunkLenght]; - WindowX=Rabcr.random.Int(BGChunkLenght*16); + WindowX=FastRandom.Int(BGChunkLenght*16); WindowY =848-Global.WindowHeightHalf-150; WindowCenterY=WindowY+Global.WindowHeightHalf; @@ -366,7 +366,7 @@ readonly Texture2D startIndex=start+delta/16; endIndex=start+(Global.WindowWidth-delta)/16+3; if (endIndex>=terrain.Length)endIndex=0; - + lights=new Rectangle[endIndex-startIndex]; for (int x=startIndex; x(); for (byte i = 1; i<11; i++) { byte DInt; - if (random.Int(11)==1) DInt=0; + if (FastRandom.Int(11)==1) DInt=0; else DInt=i; biomes.Add(DInt); } for (byte i = 11; i>0; i--) { byte DInt; - if (random.Int(11)==1) DInt=0; + if (FastRandom.Int(11)==1) DInt=0; else DInt=i; biomes.Add(DInt); } for (byte i = 0; i<11; i++) { byte DInt; - if (random.Int(11)==1) DInt=0; + if (FastRandom.Int(11)==1) DInt=0; else DInt=i; biomes.Add(DInt); } for (byte i = 11; i>0; i--) { byte DInt; - if (random.Int(11)==1) DInt=0; + if (FastRandom.Int(11)==1) DInt=0; else DInt=i; biomes.Add(DInt); } @@ -850,16 +850,16 @@ public class BGenerateWorld { if (terrainHeight>waterHeight+3) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; @@ -961,7 +961,7 @@ public class BGenerateWorld { if (terrainChange<0) { terrainHeight--; - terrainChange=1+random.Int(3); + terrainChange=1+FastRandom.Int(3); } else terrainChange--; // Sand height @@ -969,11 +969,11 @@ public class BGenerateWorld { if (dirtHeight>waterHeight+1) terrainHeight--; else if (terrainHeight>waterHeight+4) terrainHeight--; else { - if (random.Bool()) terrainHeight++; + if (FastRandom.Bool()) terrainHeight++; else terrainHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; @@ -982,7 +982,7 @@ public class BGenerateWorld { if (seabedSand) { for (int yy = terrainHeight; yywaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; BGChunk.LightPos=terrainHeight; BGChunk.Blocks[terrainHeight]=(byte)BackBlockId.Snow; - if (random.Bool_33_333Percent()) BGChunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.SnowTop; + if (FastRandom.Bool_33_333Percent()) BGChunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.SnowTop; for (int b = terrainHeight+1; bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; - if (random.Bool()) { + if (FastRandom.Bool()) { chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockHills; - if (random.Int(5)==1) { - if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Heather; + if (FastRandom.Int(5)==1) { + if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Heather; else chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.GrassHills; } } else { - if (random.Bool()) chunk.Blocks[terrainHeight]=(byte)BackBlockId.Ice; + if (FastRandom.Bool()) chunk.Blocks[terrainHeight]=(byte)BackBlockId.Ice; else chunk.TopBlocks[terrainHeight]=(byte)BackBlockId.Snow; - if (random.Int(3)==1) chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.SnowTop; + if (FastRandom.Int(3)==1) chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.SnowTop; } for (int b = terrainHeight+1; bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockHills; - if (random.Bool()) { - switch (random.Int(9)) { + if (FastRandom.Bool()) { + switch (FastRandom.Int(9)) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Heather; break; @@ -1154,14 +1154,14 @@ public class BGenerateWorld { } if (treeChange<0) { - if (random.Bool_20Percent()) TreeSpruceLittle(pos, terrainHeight); + if (FastRandom.Bool_20Percent()) TreeSpruceLittle(pos, terrainHeight); else TreeSpruceBig(pos, terrainHeight); } else treeChange--; for (int b = terrainHeight+1; bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockForest; - if (random.Bool()) { - switch (random.Int(9)) { + if (FastRandom.Bool()) { + switch (FastRandom.Int(9)) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Blueberry; break; @@ -1232,7 +1232,7 @@ public class BGenerateWorld { break; case 9: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Toadstool; break; @@ -1242,7 +1242,7 @@ public class BGenerateWorld { } if (treeChange<0) { - switch (random.Int(3)) { + switch (FastRandom.Int(3)) { case 1: TreeSpruceLittle(pos, terrainHeight); break; @@ -1273,7 +1273,7 @@ public class BGenerateWorld { for (byte b = (byte)(terrainHeight+1); bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockForest; - if (random.Bool()) { - switch (random.Int(11)) { + if (FastRandom.Bool()) { + switch (FastRandom.Int(11)) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Rashberry; break; @@ -1348,14 +1348,14 @@ public class BGenerateWorld { break; case 9: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax1; break; case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax2; break; } break; case 10: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Boletus; break; @@ -1371,7 +1371,7 @@ public class BGenerateWorld { } if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreeSpruceLittle(pos, terrainHeight); break; @@ -1402,7 +1402,7 @@ public class BGenerateWorld { for (byte b = (byte)(terrainHeight+1); bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockForest; - if (random.Bool()) { - //if (random.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; - switch (random.Int(11)) { + if (FastRandom.Bool()) { + //if (FastRandom.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; + switch (FastRandom.Int(11)) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Rashberry; break; @@ -1478,7 +1478,7 @@ public class BGenerateWorld { break; case 10: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax1; break; case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax2; break; //case 3: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax3; break; @@ -1486,7 +1486,7 @@ public class BGenerateWorld { break; case 9: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Boletus; break; @@ -1502,7 +1502,7 @@ public class BGenerateWorld { } if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreePlum(pos, terrainHeight); break; @@ -1535,7 +1535,7 @@ public class BGenerateWorld { for (byte b = (byte)(terrainHeight+1); bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockPlains; - if (random.Bool()) { - //if (random.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; - switch (random.Int(10)) { + if (FastRandom.Bool()) { + //if (FastRandom.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; + switch (FastRandom.Int(10)) { case 1: // chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Onion; break; @@ -1611,7 +1611,7 @@ public class BGenerateWorld { break; case 9: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax1; break; case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax2; break; //case 3: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax3; break; @@ -1623,7 +1623,7 @@ public class BGenerateWorld { for (byte b = (byte)(terrainHeight+1); bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; //Sub if (seabedChange<0) { grass=!grass; - seabedChange=5+random.Int(10); + seabedChange=5+FastRandom.Int(10); } else seabedChange--; chunk.LightPos=terrainHeight; @@ -1670,13 +1670,13 @@ public class BGenerateWorld { if (grass) { chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockDesert; - //if (random.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; - //else if (random.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Chicken; + //if (FastRandom.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; + //else if (FastRandom.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Chicken; - if (random.Bool()) { - switch (random.Int(10)) { + if (FastRandom.Bool()) { + switch (FastRandom.Int(10)) { case 1: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Wheat1; break; case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Wheat2; break; //case 3: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Wheat3; break; @@ -1712,7 +1712,7 @@ public class BGenerateWorld { break; case 9: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax1; break; case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax2; break; //case 3: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax3; break; @@ -1722,10 +1722,10 @@ public class BGenerateWorld { } } else { chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockForest; - //if (random.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; - //else if (random.Int(12)==1) chunk.Blocks[ terrainHeight-1]=(byte)BackBlockId.Chicken; - if (random.Bool()) { - switch (random.Int(11)) { + //if (FastRandom.Int(12)==1) chunk.Blocks[terrainHeight-1]=(byte)BackBlockId.Rabbit; + //else if (FastRandom.Int(12)==1) chunk.Blocks[ terrainHeight-1]=(byte)BackBlockId.Chicken; + if (FastRandom.Bool()) { + switch (FastRandom.Int(11)) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Strawberry; break; @@ -1759,7 +1759,7 @@ public class BGenerateWorld { break; case 9: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax1; break; case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax2; break; //case 3: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Flax3; break; @@ -1767,7 +1767,7 @@ public class BGenerateWorld { break; case 10: - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Wheat1; break; case 2: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Wheat2; break; //case 3: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Wheat3; break; @@ -1780,7 +1780,7 @@ public class BGenerateWorld { if (treeChange<0) { - switch (random.Int(9)) { + switch (FastRandom.Int(9)) { case 1: TreeSpruceLittle(pos, terrainHeight); break; @@ -1812,7 +1812,7 @@ public class BGenerateWorld { for (byte b = (byte)(terrainHeight+1); bwaterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; if (seabedChange<0) { - if (grass) seabedChange=20+random.Int(50); - else seabedChange=3+random.Int(5); + if (grass) seabedChange=20+FastRandom.Int(50); + else seabedChange=3+FastRandom.Int(5); grass=!grass; } else seabedChange--; @@ -1860,8 +1860,8 @@ public class BGenerateWorld { chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockDesert; for (byte b = (byte)(terrainHeight+1); bterrainHeight+random.Int(6); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusBig; + for (int x = terrainHeight-1; x>terrainHeight+FastRandom.Int(6); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusBig; break; case 6: - for (int x = terrainHeight-1; x>terrainHeight+random.Int(5); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusSmall; + for (int x = terrainHeight-1; x>terrainHeight+FastRandom.Int(5); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusSmall; break; case 8: @@ -1911,7 +1911,7 @@ public class BGenerateWorld { } // Lithosphere - if (random.Bool()) { + if (FastRandom.Bool()) { chunk.Blocks[terrainHeight+dirtHeight]=(byte)BackBlockId.Cobblestone; GenerateUnderSurface(chunk, terrainHeight+dirtHeight+1); } else GenerateUnderSurface(chunk, terrainHeight+dirtHeight); @@ -1929,11 +1929,11 @@ public class BGenerateWorld { if (terrainHeight>waterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; if (seabedChange<0) { - if (grass) seabedChange=20+random.Int(50); - else seabedChange=3+random.Int(5); + if (grass) seabedChange=20+FastRandom.Int(50); + else seabedChange=3+FastRandom.Int(5); grass=!grass; } else seabedChange--; @@ -1959,8 +1959,8 @@ public class BGenerateWorld { chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockDesert; for (byte b = (byte)(terrainHeight+1); bterrainHeight+random.Int(6); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusBig; + for (int x = terrainHeight-1; x>terrainHeight+FastRandom.Int(6); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusBig; break; case 6: - for (int x = terrainHeight-1; x>terrainHeight+random.Int(5); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusSmall; + for (int x = terrainHeight-1; x>terrainHeight+FastRandom.Int(5); x--) chunk.TopBlocks[x]=(byte)BackBlockId.CactusSmall; break; case 8: @@ -2020,7 +2020,7 @@ public class BGenerateWorld { } // Lithosphere - if (random.Bool()) { + if (FastRandom.Bool()) { chunk.Blocks[terrainHeight+dirtHeight]=(byte)BackBlockId.Cobblestone; GenerateUnderSurface(chunk, terrainHeight+dirtHeight+1); } else GenerateUnderSurface(chunk, terrainHeight+dirtHeight); @@ -2038,11 +2038,11 @@ public class BGenerateWorld { if (terrainHeight>waterHeight-1) terrainHeight--; else if (terrainHeight3) dirtHeight--; else if (dirtHeight<2) dirtHeight++; else { - if (random.Bool()) dirtHeight++; + if (FastRandom.Bool()) dirtHeight++; else dirtHeight--; } - dirtChange=1+random.Int(3); + dirtChange=1+FastRandom.Int(3); } else dirtChange--; chunk.LightPos=terrainHeight; chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockForest; - if (random.Bool()) { - switch (random.Int(9)) { + if (FastRandom.Bool()) { + switch (FastRandom.Int(9)) { case 1: chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.Orchid; break; @@ -2097,13 +2097,13 @@ public class BGenerateWorld { } if (treeChange<0) { - if (random.Bool()) TreePineJunle(pos, terrainHeight); + if (FastRandom.Bool()) TreePineJunle(pos, terrainHeight); } else treeChange--; for (byte b = (byte)(terrainHeight+1); b3) dirtHeight--; // else if (dirtHeight<2) dirtHeight++; // else { - // if (random.Bool()) dirtHeight++; + // if (FastRandom.Bool()) dirtHeight++; // else dirtHeight--; // } - // dirtChange=1+random.Int(3); + // dirtChange=1+FastRandom.Int(3); // } else dirtChange--; // chunk.LightPos=terrainHeight; // chunk.Blocks[terrainHeight]=(byte)BackBlockId.GrassBlockHills; - // if (random.Bool()) { - // switch (random.Int(9)) { + // if (FastRandom.Bool()) { + // switch (FastRandom.Int(9)) { // case 1: // chunk.TopBlocks[terrainHeight-1]=(byte)BackBlockId.GrassHills; // break; @@ -2184,8 +2184,8 @@ public class BGenerateWorld { // } // if (treeChange<0) { - // if (random.Int(10)==1) { - // if (random.Bool()) TreeSpruceLittle(pos, terrainHeight); + // if (FastRandom.Int(10)==1) { + // if (FastRandom.Bool()) TreeSpruceLittle(pos, terrainHeight); // else TreeOakLittle(pos, terrainHeight); // } // } else treeChange--; @@ -2193,7 +2193,7 @@ public class BGenerateWorld { // for (byte b = (byte)(terrainHeight+1); b new Color(20, 64, 224), + GeDoType.Green => new Color(32, 128, 0), + GeDoType.Red => new Color(255, 0, 0), + GeDoType.DarkBlue => new Color(0, 0, 128), + GeDoType.DarkGreen => new Color(0, 64, 0), + GeDoType.DarkRed => new Color(128, 0, 0), + GeDoType.Orange => new Color(255, 92, 0), + GeDoType.LightGreen => new Color(0, 255, 0), + GeDoType.LightBlue => new Color(128, 192, 255), + GeDoType.DarkGray => new Color(64, 64, 64), + GeDoType.Gold => new Color(120, 120, 0), + GeDoType.Yellow => new Color(220, 220, 0), + GeDoType.Gray => new Color(128, 128, 128), + GeDoType.Teal => new Color(0, 128, 128), + GeDoType.Purple => new Color(255, 0, 255), + GeDoType.Pink => new Color(255, 128, 172), + GeDoType.Brown => new Color(128, 30, 0), + GeDoType.Black => new Color(0, 0, 0), + GeDoType.White => new Color(255, 255, 255), + /* ShowError("Unknown tag");*/ + _ => Color.Black, + }; } string Symbols(string s) { @@ -1188,7 +1165,7 @@ public class GeDoStringRandom : GeDoString{ public TextWithMeasure text; public override void Draw(SpriteBatch sb) { - text.Draw(sb, Rabcr.random.ColorMonogame());/* new Color(Rabcr.random.Int255(),Rabcr.random.Int255(),Rabcr.random.Int255()));;*/ + text.Draw(sb, FastRandom.ColorMonogame()); } public override int Height() => text.NewLines*30; @@ -1263,10 +1240,10 @@ public enum Action:byte{ if (click) { click=false; - if (Rabcr.ActiveWindow /*&& !selected*/) { + if (Rabcr.ActiveWindow /*&& !selected*/) { //Console.WriteLine(action); - if (Menu.newKeyboardState.IsKeyDown(Keys.LeftControl)){ - System.Windows.Forms.MessageBox.Show(info,"Link info"); + if (Menu.newKeyboardState.IsKeyDown(Keys.LeftControl)){ + System.Windows.Forms.MessageBox.Show(info,"Link info"); } else{ switch (action){ case Action.Event: @@ -1338,8 +1315,8 @@ public enum Action:byte{ color=new Color(0, colorChanger, 255); text.Draw(sb, color/**Constants.alpha*/); - sb.Draw(Rabcr.Pixel, new Rectangle(X, Y+underlinecount/*+y2*/, text.X+2, 1), color/**Constants.alpha*/); - sb.Draw(Rabcr.Pixel, new Rectangle(X, Y+1+underlinecount/*+y2*/, text.X+2, 1), color/**(Constants.alpha/2)*/); + sb.Draw(Rabcr.Pixel, new Rectangle(X, Y+underlinecount/*+y2*/, text.MeasureX+2, 1), color/**Constants.alpha*/); + sb.Draw(Rabcr.Pixel, new Rectangle(X, Y+1+underlinecount/*+y2*/, text.MeasureX+2, 1), color/**(Constants.alpha/2)*/); // oldMouseState=Rabcr.newMouseState; } @@ -1348,7 +1325,7 @@ public enum Action:byte{ // Console.WriteLine("X: "+X+", Y: "+Y+", M.X: "+Rabcr.newMouseState.X+", M.Y: "+(Rabcr.newMouseState.Y-mouseAdd2)+", t.X:"+text.X+", ma: "+mouseAdd2); if (Rabcr.newMouseState.X < X) return false; if (Rabcr.newMouseState.Y+mouseAdd2< Y) return false; - if (Rabcr.newMouseState.X > X+text.X) return false; + if (Rabcr.newMouseState.X > X+text.MeasureX) return false; if (Rabcr.newMouseState.Y+mouseAdd2> Y+30) return false; return true; } @@ -1441,8 +1418,8 @@ public class GeDoStringSpoiler : GeDoString{ color=new Color(0, colorChanger, 255); text.Draw(sb, color/**Constants.alpha*/); - sb.Draw(Rabcr.Pixel, new Rectangle(X2, Y+underlinecount/*+y2*/, text.X+2, 1), color/**Constants.alpha*/); - sb.Draw(Rabcr.Pixel, new Rectangle(X2, Y+1+underlinecount/*+y2*/, text.X+2, 1), color*0.5f/**(Constants.alpha)*/); + sb.Draw(Rabcr.Pixel, new Rectangle(X2, Y+underlinecount/*+y2*/, text.MeasureX+2, 1), color/**Constants.alpha*/); + sb.Draw(Rabcr.Pixel, new Rectangle(X2, Y+1+underlinecount/*+y2*/, text.MeasureX+2, 1), color*0.5f/**(Constants.alpha)*/); if (Show) innerGedo.DrawGedo(Constants.alpha, sb); } @@ -1451,7 +1428,7 @@ public class GeDoStringSpoiler : GeDoString{ // Console.WriteLine("X: "+X+", Y: "+Y+", M.X: "+Rabcr.newMouseState.X+", M.Y: "+(Rabcr.newMouseState.Y-mouseAdd2)+", t.X:"+text.X+", ma: "+mouseAdd2); if (Rabcr.newMouseState.X < X2) return false; if (Rabcr.newMouseState.Y+mouseAdd2< Y) return false; - if (Rabcr.newMouseState.X > X2+text.X) return false; + if (Rabcr.newMouseState.X > X2+text.MeasureX) return false; if (Rabcr.newMouseState.Y+mouseAdd2> Y+30) return false; return true; } @@ -1530,7 +1507,7 @@ public class GeDoStringMark: GeDoString{ public Color color; public override void Draw(SpriteBatch sb) { - sb.Draw(Rabcr.Pixel,new Rectangle(X, Y, text.X+2,30), color/*new Color(173,216,255)*//**Constants.alpha*/); + sb.Draw(Rabcr.Pixel,new Rectangle(X, Y, text.MeasureX+2,30), color/*new Color(173,216,255)*//**Constants.alpha*/); text.Draw(sb, Color.Black/**Constants.alpha*/); } public override int Height() => text.NewLines*30; @@ -1543,7 +1520,7 @@ public class GeDoStringUnderline: GeDoString{ public TextWithMeasure text; public override void Draw(SpriteBatch sb) { //DrawSelection(sb); - sb.Draw(Rabcr.Pixel,new Rectangle(X, Y+27, text.X+2,1), new Color(0,0,0)/**Constants.alpha*/); + sb.Draw(Rabcr.Pixel,new Rectangle(X, Y+27, text.MeasureX+2,1), new Color(0,0,0)/**Constants.alpha*/); text.Draw(sb, Color.Black/**Constants.alpha*/); } public override int Height() => text.NewLines*30; @@ -1568,7 +1545,7 @@ public class GeDoStringArticle : GeDoString{ int w; public GeDoStringArticle(string txt, int x, int y, int ww, int mouseAdd2, bool wr) { this.mouseAdd2=mouseAdd2; - wrap=wr; + wrap=wr; w=ww; innerGedo=new GeDo(x, y) { mouseAdd=mouseAdd2-Y @@ -1634,7 +1611,7 @@ public class GeDoStringArticle : GeDoString{ innerGedo.BuildString(Wrap()); - // return ; + // return; } string Wrap(){ @@ -1646,7 +1623,7 @@ public class GeDoStringArticle : GeDoString{ foreach (string line in lines) { string[] words = line.Replace('\r', ' ').Split(' '); - + float lineWidth = 0f; int ii=0; foreach (string word in words) { diff --git a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs index 87c211e..71b4ed2 100644 --- a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs +++ b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs @@ -21,7 +21,7 @@ public class Rabcr : Game { public static GraphicsDeviceManager GraphicsManager; public static Game Game; public static Texture2D Pixel; - public static FastRandom random; + // public static FastRandom random; public static SpriteBatch spriteBatch; static bool exiting=false; static bool saved=false; @@ -101,7 +101,7 @@ public class Rabcr : Game { // Global.OnlineAccount=false; Setting.Path=GetPathIfNotArgs(); - + //if (File.Exists(Path.GetTempPath()+"\\rabcrLastPassword.txt")) File.Delete(Path.GetTempPath()+"\\rabcrLastPassword.txt"); } @@ -113,7 +113,7 @@ public class Rabcr : Game { //Log.Init(); if (!Directory.Exists(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData")) { - switch (System.Globalization.CultureInfo.CurrentCulture.EnglishName){ + switch (System.Globalization.CultureInfo.CurrentCulture.EnglishName){ default: MessageBox.Show("Game data not found, game was probably runned from archive" #if DEBUG @@ -130,7 +130,7 @@ public class Rabcr : Game { ,"Chyba - Nenalezeny data hry"); break; } - + Environment.Exit(-1); return; @@ -152,8 +152,8 @@ public class Rabcr : Game { GraphicsManager.PreferredBackBufferHeight =(int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height*0.6667f); GraphicsManager.PreferredBackBufferWidth = (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width*0.6667f); - - + + try { GraphicsManager.ApplyChanges(); } catch{ } @@ -162,10 +162,10 @@ public class Rabcr : Game { SetLangUp(); Content = new ContentManager(Services, "RabcrData"); content=Content; - + (Pixel = new Texture2D(GraphicsDevice, 1, 1)).SetData(new[] { Color.White }); - random=new FastRandom(); + // random=new FastRandom(); Window.Position=new Microsoft.Xna.Framework.Point((int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width/6f),(int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/7f)); { @@ -175,7 +175,7 @@ public class Rabcr : Game { MyGameForm.MinimumSize=new Size(320, 200); MyGameForm.SizeChanged+=Window_ClientSizeChanged; MyGameForm.StartPosition=FormStartPosition.CenterScreen; - } + } } public static void SetLangUp(){ @@ -217,7 +217,7 @@ public class Rabcr : Game { GC.WaitForPendingFinalizers(); BitmapFont.bitmapFont18=new BitmapFont(18,Properties.Resources.FontInfo_traditionalChinese_18); break; - + case "korean": BitmapFont.bitmapFont34=new BitmapFont(34,Properties.Resources.FontInfo_korean_34); GC.Collect(); @@ -306,7 +306,7 @@ public class Rabcr : Game { spriteBatch=new SpriteBatch(GraphicsDevice); IsMouseVisible = true; Window.AllowUserResizing = true; - + GoTo(new Start()); base.LoadContent(); } @@ -325,7 +325,7 @@ public class Rabcr : Game { public static void GoTo(Screen name) { if (screen!=null) { - if (!screen.isDisposed) screen.Shutdown(); + if (!screen.isDisposed) screen.Shutdown(); } name.Init(); screen=name; @@ -400,14 +400,14 @@ public class Rabcr : Game { // bytes.AddRange(BitConverter.GetBytes(Setting.slideChangeTime)); // bytes.AddRange(BitConverter.GetBytes(Setting.Zoom)); // bytes.AddRange(BitConverter.GetBytes(Setting.NightBrightness)); - - + + // File.WriteAllBytes(Setting.Path+@"\Setting.bin",bytes.ToArray()); // //Debug.Write(" Uloženo!"); // //if (Global.OnlineAccount && Global.Logged) UploadAccountSetting(); - // //else + // //else // if (exiting)saved=true; //} diff --git a/rabcrClient/InterLogic/ItemInv.cs b/rabcrClient/InterLogic/ItemInv.cs index 5e7c37c..ae6e428 100644 --- a/rabcrClient/InterLogic/ItemInv.cs +++ b/rabcrClient/InterLogic/ItemInv.cs @@ -582,7 +582,7 @@ class ItemInvTool16: ItemInv { posTex=new Rectangle(0, 0, 32, 32); Id=id; GetCount=Maximum=GameMethods.ToolMax(id); - + Texture=tex; bar2.Width=-1; diff --git a/rabcrClient/InterLogic/Lang.cs b/rabcrClient/InterLogic/Lang.cs index 7461eac..1a0723f 100644 --- a/rabcrClient/InterLogic/Lang.cs +++ b/rabcrClient/InterLogic/Lang.cs @@ -64,7 +64,7 @@ static class Lang { public static void SetUp(bool sameLanguageAsSystem) { XmlDocument file = new XmlDocument(); XmlNode data=null; - + try { file.Load(new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData\\"+Setting.StyleName+"\\Lang\\lang.xml"); } catch (Exception ex) { @@ -86,16 +86,16 @@ static class Lang { EnglishName=n.Attributes["EnglishName"].Value, NativeName=n.Attributes["NativeName"].Value, Name=n.Attributes["Name"].Value, - + FontFile=n.Attributes["FontFile"]?.Value, _Base=n.Attributes["Base"]?.Value, // TwoLetterISOLanguageName=n.Attributes["TwoLetterISOLanguageName"]?.Value, // ThreeLetterISOLanguageName=n.Attributes["ThreeLetterISOLanguageName"]?.Value, // TranslationQuality=int.Parse(n.Attributes["TranslationQuality"]?.Value), // UseBase=n.Attributes["UseBase"]?.Value=="true", - }; + }; if (n.Attributes["Quality"]!=null) int.TryParse(n.Attributes["Quality"].Value, out ll.Quality); - + { // Solve category XmlAttribute cat=n.Attributes["Flag"]; @@ -181,7 +181,7 @@ static class Lang { for (int i=0; i bytesToSend=new List(); + bytesToSend.Add((byte)Command.CheckInMenu); - byte[] bytes = msgToSend.ToByte(); + byte[] bytes = bytesToSend.ToArray(); clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null); } catch (SocketException ex) { @@ -114,30 +118,47 @@ class CheckServer :IDisposable{ } void OnReceive(IAsyncResult ar) { - Data msgReceived=null; + //Data msgReceived=null; try { clientSocket.EndReceive(ar); - msgReceived = new Data(byteData); + // msgReceived = new Data(byteData); + //bytesToSend.Add((byte)Command.Check); + if (byteData[0]==(byte)Command.Check) { + // Version + byte lenVersion = byteData[1]; + string version=System.Text.Encoding.UTF8.GetString(byteData, 2, lenVersion); + + // Message + int pos=2+lenVersion/*-1*/; + int lenMessage=byteData[pos]; + string serverMessage=System.Text.Encoding.UTF8.GetString(byteData, pos+1, lenMessage/*-1*/); + + pos+=lenMessage+1; + int online=byteData[pos]; + int max=byteData[pos+1]; + Console.WriteLine("G|"+version+'|'+serverMessage+'|'+online+'|'+max); + Exit(); + } } catch (SocketException ex) { if (ex.ErrorCode==10054) SetServerError(1,"1524",ex.ErrorCode,ex.Message,"OnReceive");//Server byl neočekávaně vypnut. else SetServerError(2,ex.Message,ex.ErrorCode,ex.Message,"OnReceive"); } catch (Exception ex) { SetServerError(2,"1525",0,ex.Message,"OnReceive");//Nelze získat data } finally { - if (msgReceived.Cmd==Command.Check) { - string[]get=msgReceived.Message.Split('|'); - if (get.Length>0) { - Console.WriteLine("G|"+msgReceived.Message); - Exit(); - } else { - SetServerError(3,"1526",0,"","OnReceive");//Připojení existuje, ale získané data nemají správný typ. - } - } else { - string str=""; - foreach (byte b in byteData)str+=b+" "; - SetServerError(3,"1527",0,""+str,"OnReceive");//Obdrženy vadné data - } + //if (msgReceived.Cmd==Command.Check) { + // string[]get=msgReceived.Message.Split('|'); + // if (get.Length>0) { + // Console.WriteLine("G|"+msgReceived.Message); + // Exit(); + // } else { + // SetServerError(3,"1526",0,"","OnReceive");//Připojení existuje, ale získané data nemají správný typ. + // } + //} else { + // string str=""; + // foreach (byte b in byteData)str+=b+" "; + // SetServerError(3,"1527",0,""+str,"OnReceive");//Obdrženy vadné data + //} } } diff --git a/rabcrClient/InterLogic/Multiplayer/MultiplayerSystem.cs b/rabcrClient/InterLogic/Multiplayer/MultiplayerSystem.cs index df36787..340c0e9 100644 --- a/rabcrClient/InterLogic/Multiplayer/MultiplayerSystem.cs +++ b/rabcrClient/InterLogic/Multiplayer/MultiplayerSystem.cs @@ -2,30 +2,37 @@ using System.Collections.Generic; namespace rabcrClient { - public enum Command { - Null, - Check, //Status of server - Blank, - Login, //Login into the server - PostLogin, //Check password enter - Logout, //Logout of the server - Exit, //End - Message, //Send a text message to all the chat clients - PlayersList, //Get a list of users in the chat room from the server - - SendingWorldData, //Get chunk of blocks - GetWorldData, - // GetSpawn, - PlayersTeleportMessageToTarget, - PlayersTeleportMessageToSource, - MyPlayerData, //get pos of player - Request, //Check if player exists - EditTerrain, - - SomeoneLogout, - //SomeoneLogin, - ConnectDuringGame - } + //public enum Command : byte{ + // Null, + // Check, //Status of server + // Blank, + // Login, // Login into the server + // EnterPassword, // Check password enter + // Logout, // Logout of the server + // Exit, // End + // Message, // Send a text message to all the chat clients + // PlayersList, //Get a list of users in the chat room from the server + + // SendingWorldData, //Get chunk of blocks + // GetWorldData, + // // GetSpawn, + // PlayersTeleportMessageToTarget, + // PlayersTeleportMessageToSource, + // MyPlayerData, //get pos of player + // Request, //Check if player exists + // EditTerrain, + + // SomeoneLogout, + // //SomeoneLogin, + // ConnectDuringGame, + + // EatFood, + // SetInventory, + // SetInventoryMachine, + // SpawnChanged, + // SetPlayerPosition, + + //} public class DataToSend { public DataToSend(){ @@ -89,7 +96,171 @@ enum LoginType{ BasicLogin, } - class Data { + //class Data { + // // + // // 1 Command + // // 1 len to + // // 1 len from + // // 2 message len + // // lenTo name to + // // lenFrom name from + // //messageLen message + // // zeros + + // public string From; + // public string To; + // public string Message; + // public Command Cmd; + + // public byte[] terrain; + // public int pos; + + // public Data(){ From=Setting.Name; } + + // public Data(byte[] data) { + // // Command + // Cmd=(Command)data[0]; + + // //len to + // byte lenTo = data[1]; + + // //len from + // byte lenFrom = data[2]; + + // // message length + // short msgLen = BitConverter.ToInt16(data, 3); + + // // name to + // if (lenTo>0) To=System.Text.Encoding.UTF8.GetString(data, 5, lenTo); + // else To=""; + + // // name from + // if (lenFrom>0) From=System.Text.Encoding.UTF8.GetString(data, 5+lenTo, lenFrom); + // else From=""; + + // //message + // if (msgLen==0) { + // Message=""; + // return; + // } + + // if (Cmd==Command.SendingWorldData) { + // if (msgLen<1024-lenTo-lenFrom-5) { + // terrain=new byte[msgLen]; + // pos = BitConverter.ToInt16(data, 5+lenFrom+lenTo); + // Array.Copy(data, 5+lenFrom+lenTo+2, terrain, 0, msgLen-2); + // } //else Console.WriteLine("Velká zpráva"); + // } else { + // Message=System.Text.Encoding.UTF8.GetString(data, 5+lenFrom+lenTo, msgLen); + // } + // } + + // public byte[] ToByte() { + // if (Message==null) Message=""; + + // byte[] bytesTo =System.Text.Encoding.UTF8.GetBytes(To); + // byte[] bytesFrom = System.Text.Encoding.UTF8.GetBytes(From); + // byte[] bytesMessage = System.Text.Encoding.UTF8.GetBytes(Message); + + // List bytes=new List(){ + // // Command + // (byte)Cmd, + + // // len to + // (byte)bytesTo.Length, + + // // len from + // (byte)bytesFrom.Length, + // }; + + // //len message + // bytes.AddRange(BitConverter.GetBytes((short)bytesMessage.Length)); + + // // to + // bytes.AddRange(bytesTo); + + // // from + // bytes.AddRange(bytesFrom); + + // // message + // bytes.AddRange(bytesMessage); + + // return bytes.ToArray(); + // } + + // public byte[] ToByte(byte[] terrain, short myPos) { + // byte[] bytesTo =System.Text.Encoding.UTF8.GetBytes(To); + // byte[] bytesFrom = System.Text.Encoding.UTF8.GetBytes(From); + + // List bytes=new List(){ + // // Command + // (byte)Cmd, + + // // len to + // (byte)bytesTo.Length, + + // // len from + // (byte)bytesFrom.Length, + // }; + + // //len message + // bytes.AddRange(BitConverter.GetBytes((short)(terrain.Length+2))); + + // // to + // bytes.AddRange(bytesTo); + + // // from + // bytes.AddRange(bytesFrom); + + // // message + // bytes.AddRange(BitConverter.GetBytes(myPos)); + // bytes.AddRange(terrain); + + // return bytes.ToArray(); + // } + + // public string Talk() { + // if (Cmd==Command.SendingWorldData) { + + // string h=""; + // foreach (byte c in terrain){ + // string k=c.ToString(); + + // if (k.Length==1) h+=" "+k+Environment.NewLine; + // else if (k.Length==2) h+=" "+k+Environment.NewLine; + // else h+=" "+k+Environment.NewLine; + // } + + // return "Cmd: "+Command.SendingWorldData+", From: "+From+", To: "+To+" Pos: "+pos+", Terrain: "+Environment.NewLine+h; + + // } else if (Cmd!=Command.Blank){ + // return "Cmd: "+Cmd+", From: "+From+", To: "+To+", Message: "+Message; + // } + // return ""; + // } + //} + + //static class BasicDataOut { + // public static void GetBasicData(byte[] data, out Command cmd, out ushort toPlayerId, out ushort fromPlayerId, out byte[] byteData) { + // // Command + // cmd = (Command)data[0]; + + // // len to player + // toPlayerId = (ushort)(data[2] << 8 | data[1]); + + // // len from player (server) + // fromPlayerId = (ushort)(data[4] << 8 | data[3]); + + // // lenght data + // int len = data[6] << 8 | data[5]; + + // // message length + // byteData = data.SubBytes(7, len - 7); + // } + //} + + + class TerrainData { // // 1 Command // 1 len to @@ -109,9 +280,9 @@ class Data { public int pos; - public Data(){ From=Setting.Name; } + public TerrainData(){ From=Setting.Name; } - public Data(byte[] data) { + public TerrainData(byte[] data) { // Command Cmd=(Command)data[0]; diff --git a/rabcrClient/InterLogic/TextDrawer.cs b/rabcrClient/InterLogic/TextDrawer.cs index 1616a1e..4268036 100644 --- a/rabcrClient/InterLogic/TextDrawer.cs +++ b/rabcrClient/InterLogic/TextDrawer.cs @@ -24,11 +24,11 @@ public class Text { font=f; X=x; Y=y; - if (IsDevanagari(txt)){ + if (IsDevanagari(txt)){ BuildTextDevanagari(txt); return; } - if (IsArabic(txt)){ + if (IsArabic(txt)){ BuildTextArabic(txt); return; } @@ -37,15 +37,15 @@ public class Text { } #region Devanagari - static bool IsDevanagari(string input) { - foreach (char i in input) { + static bool IsDevanagari(string input) { + foreach (char i in input) { if (IsDevanagariChar(i)) return true; } return false; - } + } - static bool IsDevanagariChar(char input) { - switch (input) { + static bool IsDevanagariChar(char input) { + switch (input) { case 'क': return true; case 'ख': return true; case 'ग': return true; @@ -83,11 +83,11 @@ public class Text { return false; } - void BuildTextDevanagari(string txt){ + void BuildTextDevanagari(string txt){ List tmpChs=new List(); char[] chs=new RenderEnngineDevanagari(txt).Output.ToCharArray(); int posx=X; - + Glyph g; for (int ch = 0; ch tmpChs=new List(); char[] chs=BuildArabicText(txt); int posx=X; - + Glyph g; for (int ch = 0; ch "+chs[ch]+" s:"+s+" e:"+e); - } + } ch=chs.Length-1; // end if (IsArabicChar(chs[chs.Length-1-1])) { @@ -596,11 +596,11 @@ public class Text { #endregion #region Normal - void BuildTextNormal(string txt){ + void BuildTextNormal(string txt){ List tmpChs=new List(); char[] chs=txt.ToArray(); int posx=X, posY=Y; - + Glyph g; for (int ch = 0; ch tmpChs=new List(); - // txt= + char[] chs=Text.BuildArabicText(txt);//txt.ToCharArray(); int posx=x; Glyph g; @@ -863,37 +866,37 @@ public class TextWithMeasure{ } Chars=tmpChs.ToArray(); - X=posx-x; + MeasureX=posx-x; len=Chars.Length; } public void Draw(SpriteBatch sb) { for (int i=0; i2){ - // if (Environment.GetCommandLineArgs()[1]=="/Message"){ + // if (Environment.GetCommandLineArgs().Length>2){ + // if (Environment.GetCommandLineArgs()[1]=="/Message"){ // using (FileStream fileStream = new FileStream(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"/RabcrData/Default/Fonts/Font latin 18.png", FileMode.Open)){ //// Bitmap=Rabcr.Game.Content.Load("Default/Fonts/font"+size); // /*BitmapFont.bitmapFont16.*/Bitmap=Texture2D.FromStream(Rabcr.Game.GraphicsDevice, fileStream); @@ -1462,7 +1479,7 @@ class RenderEnngineDevanagari { }; public string Output; - readonly (char[],char)[] Replacements=new (char[],char)[]{ + readonly (char[],char)[] Replacements=new (char[],char)[]{ // Nukta... (new char[]{ 'क', '़'}, 'क़'), (new char[]{ 'फ', '़'}, 'फ़'), @@ -1485,9 +1502,9 @@ class RenderEnngineDevanagari { (new char[]{ 'ए', 'े'}, 'ऐ'), }; - bool IdDevanagariChar(char ch){ - foreach (char i in Consonants) { if (ch==i) return true;} - foreach (char i in DevandariPreCh) { if (ch==i) return true;} + bool IdDevanagariChar(char ch) { + foreach (char i in Consonants) { if (ch==i) return true; } + foreach (char i in DevandariPreCh) { if (ch==i) return true; } return false; } @@ -1496,47 +1513,47 @@ class RenderEnngineDevanagari { List<(bool,string)> DevanagariWords=new List<(bool, string)>(); bool WasLastDevanagari=false; int lastpos=-1; - - for (int i=0; i Syllables=null; string LastSyllable=""; for (int i = 0; i1){ foreach ((char[], char) r in Replacements) { bool make=true; - foreach (char x in r.Item1) { - if (s.Contains(x)){ - } else { + foreach (char x in r.Item1) { + if (s.Contains(x)){ + } else { make=false; break; } } - if (make) { + if (make) { string g=s.Replace(r.Item1[0],r.Item2); g=g.Replace(r.Item1[1].ToString(),""); return r.Item2.ToString(); @@ -1574,7 +1591,7 @@ class RenderEnngineDevanagari { } if (s.Contains('ा')){ //f return s.Replace('ा'.ToString(),"发"); - } + } if (s.Contains('ो')){ //T´ return s.Replace('ो'.ToString(),"飞"); } @@ -1622,11 +1639,11 @@ class RenderEnngineDevanagari { return s.Replace('ौ'.ToString(),"头"); } // f+o - if (s.Contains('ि')){ + if (s.Contains('ि')){ string o=s.Replace('ि'.ToString(),""); return '媪'+o; - } - // 'ि' + } + // 'ि' } return s; @@ -1635,8 +1652,8 @@ class RenderEnngineDevanagari { - - //class Replace{ + + //class Replace{ // public char[] From; // public char To; //} diff --git a/rabcrClient/LiveObject.cs b/rabcrClient/LiveObject.cs index 6d8abb3..0f2d32a 100644 --- a/rabcrClient/LiveObject.cs +++ b/rabcrClient/LiveObject.cs @@ -3,15 +3,15 @@ namespace rabcrClient { // waving leaves are living! - public abstract class LiveObject { + public abstract class LiveObject { public UShortAndByte Root; public float angle; } - public class Cactus : LiveObject{ + public class Cactus : LiveObject{ public List Titles; - public Cactus(int x, int y) { + public Cactus(int x, int y) { Root=new UShortAndByte((ushort)x, (byte)y); Titles=new List(); } @@ -19,10 +19,10 @@ public class Cactus : LiveObject{ public void Add(int x, int y) => Titles.Add(new UShortAndByte((ushort)x, (byte)y)); } - public class Tree : LiveObject { + public class Tree : LiveObject { public List TitlesLeaves, TitlesWood; - public Tree(int x, int y) { + public Tree(int x, int y) { Root=new UShortAndByte((ushort)x, (byte)y); TitlesLeaves=new List(); TitlesWood=new List(); diff --git a/rabcrClient/Particles.cs b/rabcrClient/Particles.cs index 7f02c53..079de67 100644 --- a/rabcrClient/Particles.cs +++ b/rabcrClient/Particles.cs @@ -1,137 +1,129 @@ -//using System; -//using Microsoft.Xna.Framework; -//using Microsoft.Xna.Framework.Graphics; - -//namespace rabcrClient { -// partial class SinglePlayer : Screen { -// //class ParticleMess { -// // public Vector2 Position; -// // public Rectangle Source; -// // public Texture2D Texture; -// // public int Disepeard; - -// // public float LimitY; -// // public float HSpeed; -// // public float VSpeed; -// // public Color Color; - -// // public void Update() { -// // HSpeed+=gravity*0.5f; -// // Position.Y+=HSpeed; - -// // Position.X+=VSpeed; - -// // if (Position.Y>=LimitY) Position.Y=LimitY; -// // } - -// // public void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, Source, Color*(Disepeard/50f)); -// //} - -// //class ParticleRain { -// // public Vector2 Position; - -// // public float HSpeed; -// // public float VSpeed; -// // public Color Color; -// // // public float Angle; - -// // public float Size; - -// // public ParticleRain(float size, float vSpeed) { -// // Color=Color.Blue*(Size=size); -// // VSpeed=vSpeed*(size*0.5f+0.5f); -// // } - -// // public void Update() { -// // Position.X+=HSpeed*Size; -// // Position.Y+=VSpeed; -// // } - -// // public void Draw(float x, float y) => Rabcr.spriteBatch.Draw( -// // texture: Rabcr.Pixel, -// // destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), 1, Size<0.5f ? 2 : 3), -// // //sourceRectangle: null, -// // //effects:SpriteEffects.None, -// // color: Color/*,*/ -// // //rotation: Angle, -// // //origin: Vector2.Zero, -// // //layerDepth: 1f -// // ); -// //} - -// //class ParticleSnow { -// // public Vector2 Position; - -// // public float HSpeed; -// // public float VSpeed; -// // public Color Color; -// // // public float Angle; -// // int time; -// // public float Size; - -// // public ParticleSnow(float size, float vSpeed) { -// // Color=Color.White*(Size=size); -// // VSpeed=vSpeed*size; -// // } - -// // public void Update() { -// // time++; -// // Position.X+=HSpeed+((float)Math.Cos(time/10f))*0.25f; -// // Position.Y+=VSpeed+((float)Math.Sin(time/10f))*HSpeed*0.5f/*+0.2f*/; -// // } - -// // public void Draw(float x, float y) => Rabcr.spriteBatch.Draw( -// // texture: Rabcr.Pixel, -// // destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), Size>0.5f ? 2 : 1, Size>0.5f ? 2 : 1), -// // //sourceRectangle: null, -// // //effects:SpriteEffects.None, -// // color: Color//, -// // //rotation: Angle, -// // //origin: Vector2.Zero, -// // //layerDepth: 1f -// // ); - -// //} - -// //class FallingLeave { -// // public Texture2D texture; -// // public Vector2 Position; -// // public float angle; -// // public float time; -// // // public float size; -// // Vector2 vecOrigin; -// // public float VSpeed; -// // public Rectangle srcrec; -// // public Color Color = Color.White; -// // public FallingLeave(int x, int y, float size, bool leftWind, bool rain, Rectangle src) { -// // Position=new Vector2(x, y); -// // vecOrigin=new Vector2(size, size); -// // if (rain) { -// // if (leftWind) VSpeed=-0.01f; else VSpeed=0.01f; -// // } else { -// // if (leftWind) VSpeed=-0.09f; else VSpeed=0.09f; -// // } -// // srcrec=src; -// // } - -// // public void Update() { -// // time+=0.07f; -// // Position.X+=VSpeed; -// // Position.Y+=(float)Math.Cos(time)*0.1f+0.2f; -// // angle=(float)Math.Cos(time)*0.3f+FastMath.PI/2f; -// // } - -// // public void Draw() { -// // Rabcr.spriteBatch.Draw( -// // texture: texture, -// // destinationRectangle: new Rectangle((int)Position.X, (int)Position.Y, srcrec.Width, srcrec.Height), -// // sourceRectangle: srcrec/*new Rectangle(0,0,2,3)*/, -// // effects: SpriteEffects.None, -// // color: Color, -// // rotation: angle, -// // origin: vecOrigin, -// // layerDepth: 1f); -// // } -// //} -// } -//} +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace rabcrClient { + class ParticleMess { + public static float gravity=1f; + public Vector2 Position; + public Rectangle Source; + public Texture2D Texture; + public int Disepeard; + + public float LimitY; + public float HSpeed; + public float VSpeed; + public Color Color; + + public void Update() { + HSpeed+=gravity*0.5f; + Position.Y+=HSpeed; + + Position.X+=VSpeed; + + if (Position.Y>=LimitY) Position.Y=LimitY; + } + + public void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, Source, Color*(Disepeard/50f)); + } + + class ParticleRain { + public Vector2 Position; + + public float HSpeed; + public float VSpeed; + public Color Color; + // public float Angle; + + public float Size; + + public ParticleRain(float size, float vSpeed) { + Color=Color.Blue*(Size=size); + VSpeed=vSpeed*(size*0.5f+0.5f); + } + + public void Update() { + Position.X+=HSpeed*Size; + Position.Y+=VSpeed; + } + + public void Draw(float x, float y,float a) => Rabcr.spriteBatch.Draw( + texture: Rabcr.Pixel, + destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), 1, Size<0.5f ? 2 : 3), + color: Color*a + ); + } + + class ParticleSnow { + public Vector2 Position; + + public float HSpeed; + public float VSpeed; + public Color Color; + // public float Angle; + int time; + public float Size; + float amplitude=1; + public ParticleSnow(float size, float vSpeed) { + Color=Color.White*(Size=size); + VSpeed=vSpeed*size; + } + + public void Update() { + time++; + if (time%10==0) amplitude=FastRandom.Float()*2-1; + + Position.X+=HSpeed+amplitude*((float)Math.Cos(time/10f))*0.25f; + Position.Y+=VSpeed+((float)Math.Sin(time/10f))*HSpeed*0.5f/*+0.2f*/; + } + + public void Draw(float x, float y,float A) => Rabcr.spriteBatch.Draw( + texture: Rabcr.Pixel, + destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), Size>0.5f ? 2 : 1, Size>0.5f ? 2 : 1), + color: Color*A + ); + + } + + class FallingLeave { + public Texture2D texture; + public Vector2 Position; + public float angle; + public float time; + // public float size; + Vector2 vecOrigin; + public float VSpeed; + public Rectangle srcrec; + public Color Color = Color.White; + public FallingLeave(int x, int y, float size, bool leftWind, bool rain, Rectangle src) { + Position=new Vector2(x, y); + vecOrigin=new Vector2(size, size); + if (rain) { + if (leftWind) VSpeed=-0.01f; else VSpeed=0.01f; + } else { + if (leftWind) VSpeed=-0.09f; else VSpeed=0.09f; + } + srcrec=src; + } + + public void Update() { + time+=0.07f; + Position.X+=VSpeed; + Position.Y+=(float)Math.Cos(time)*0.125f+0.35f; + angle=(float)Math.Cos(time)*0.3f+FastMath.PI/2f; + } + + public void Draw() { + Rabcr.spriteBatch.Draw( + texture: texture, + position: new Vector2(Position.X, Position.Y), + sourceRectangle: srcrec, + effects: SpriteEffects.None, + color: Color, + scale: 1f, + rotation: angle, + origin: vecOrigin, + layerDepth: 1f); + } + } +} \ No newline at end of file diff --git a/rabcrClient/Program.cs b/rabcrClient/Program.cs index 74160f7..5dda2e3 100644 --- a/rabcrClient/Program.cs +++ b/rabcrClient/Program.cs @@ -12,7 +12,7 @@ public static class Program { [STAThread] static void Main(string[] args) { - + #if !DEBUG @@ -25,10 +25,10 @@ public static class Program { /* Args Use: "...\rabcrClient.exe" Path="C:\Users\..." Type="Message" Name="Player" Text="" - - + + */ - + if (args.Length>0) { switch (args[0]) { @@ -54,9 +54,9 @@ public static class Program { int language=-1; /*langFilePath="",*/string Text="Error no text found", Header="Message"; - foreach (string arg in args) { + foreach (string arg in args) { string[] a=arg.Split('='); - switch (a[0]) { + switch (a[0]) { case "Language": int.TryParse(a[1], out language); break; @@ -69,12 +69,12 @@ public static class Program { Text=arg.Substring(5); break; } - } - + } + using (Message message = new Message(language: language, Header: Header, text: Text)) message.Run(); } - + break; case "/CheckServer": @@ -158,7 +158,7 @@ public static class Program { #if !DEBUG } catch (Exception ex) { - + CultureInfo ci = CultureInfo.InstalledUICulture; string cap, text, details; @@ -236,7 +236,7 @@ public static class Program { // StackTrace System.Diagnostics.StackTrace st=new System.Diagnostics.StackTrace(ex, true); int count = st.FrameCount; - + if (count>1) { System.Diagnostics.StackFrame sf2=st.GetFrame(1); @@ -254,8 +254,8 @@ public static class Program { trace=trace.Replace(" ", "%20"); send+=trace; } else send+="&h="; - - + + Clipboard.SetText(Release.stringRRE+send); // Antispawn System.Threading.Thread.Sleep(200); @@ -264,10 +264,10 @@ public static class Program { WebClient wc=new WebClient(); string result=wc.DownloadString(Release.stringRRE+send); //System.Diagnostics.Process.Start(); - if (result.StartsWith("O|")){ + if (result.StartsWith("O|")){ Console.WriteLine("send"); }else Console.WriteLine("not send"); - + // Antispawn System.Threading.Thread.Sleep(200); diff --git a/rabcrClient/Properties/Resources.resx b/rabcrClient/Properties/Resources.resx index 3d27dd7..495fe1b 100644 --- a/rabcrClient/Properties/Resources.resx +++ b/rabcrClient/Properties/Resources.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/Relase.cs b/rabcrClient/Relase.cs index ea2ff39..4315c7b 100644 --- a/rabcrClient/Relase.cs +++ b/rabcrClient/Relase.cs @@ -2,10 +2,10 @@ namespace rabcrClient{ static class Release { // Name of version - public const int - VersionMajor = 0, - VersionMinor = 1, - VersionBuild = 25, + public const int + VersionMajor = 0, + VersionMinor = 1, + VersionBuild = 25, VersionRevision = 0; public const string VersionString = "0.1.25.0"; @@ -134,7 +134,7 @@ public const int #region Links - public const string + public const string // Report error stringRRE="https://***.php", diff --git a/rabcrClient/Resources/Fonts licence OFL.txt b/rabcrClient/Resources/Fonts licence OFL.txt index 1456c18..33f3666 100644 --- a/rabcrClient/Resources/Fonts licence OFL.txt +++ b/rabcrClient/Resources/Fonts licence OFL.txt @@ -22,7 +22,7 @@ with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, +fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/GeneratePlanetSystem.cs b/rabcrClient/WindowsAndStates/GameStates/Game/GeneratePlanetSystem.cs index d69be57..b62162a 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/GeneratePlanetSystem.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/GeneratePlanetSystem.cs @@ -162,7 +162,7 @@ public class AstronomicalObject { //////// double h=(CurrentTime/OrbitalPeriod)*Math.PI*2; ////////if (CurrentTime>OrbitalPeriod)CurrentTime-=OrbitalPeriod; ////////// double p=SemiMajorAxis-(Eccentricity*SemiMajorAxis/2)+(Eccentricity*SemiMajorAxis); - //////// //double v=Speed;//;; + //////// //double v=Speed;//; //////// //double TrueAnomaly=h;//(Math.Sqrt(1-Eccentricity*Eccentricity)*Math.Sin(v))/(1+Eccentricity*Math.Cos(v)); //////// // v=TrueAnomaly; //////// // TrueAnomaly=p; diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs index 944e415..759090c 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs @@ -1,20219 +1,27081 @@ -//using System; -//using System.Collections.Generic; -//using System.Diagnostics; -//using System.IO; -//using System.Net; -//using System.Net.Sockets; -//using Microsoft.Xna.Framework; -//using Microsoft.Xna.Framework.Graphics; -//using Microsoft.Xna.Framework.Input; -//using Microsoft.Xna.Framework.Media; - -//namespace rabcrClient { -// class MultiPlayer : Screen { -// bool easter; -// Texture2D[] TextureEggDropE; -// Texture2D[] TextureRocks; -// #region Varibles - -// #region Clothes -// ClothesTypeUnderwearDown -// ClothesUnderwearDown, - -// ClothesUnderpants, -// ClothesBoxerShorts, -// ClothesPanties, -// ClothesSwimsuit, -// ClothesBikiniDown; - -// ClothesTypeUnderwearUp -// ClothesUnderwearUp, - -// ClothesBra, -// ClothesBikiniTop; - -// ClothesTypeBoots -// ClothesFeet, - -// ClothesFormalShoes, -// ClothesPumps, -// ClothesSneakers, -// ClothesSpaceBoots; - -// ClothesTypeTrousers -// ClothesLegs, - -// ClothesJeans, -// ClothesShorts, -// ClothesSkirt, -// ClothesArmyTrousers, -// ClothesSpaceTrousers; - -// ClothesTypeTShirt -// ClothesChest, - -// ClothesTShirt, -// ClothesShirt, -// ClothesDress, -// ClothesTop; - -// ClothesTypeCoat -// ClothesChestTop, - -// ClothesCoatArmy, -// ClothesCoat, -// ClothesJacketDenim, -// ClothesJacketFormal, -// ClothesJacketShort, -// ClothesSpaceSuit; - -// ClothesTypeHelmet -// ClothesHead, - -// ClothesCap, -// ClothesHad, -// ClothesCrown, -// ClothesSpaceHelmet; -// #endregion -// Color -// ColorWhite, -// ColorSmokeWhite=new Color(240,240,240); -// // Texture2D TextureBarBarrel, pixel; - -// bool radioplaying = false; -// int PopUpWindowSelectedItem; -// int PopUpWindowChoosingPotencialdItem; -// CraftingRecipe[] CurrentDeskCrafting; -// int SelectedCraftingRecipe = -1; -// bool displayPopUpWindow; -// GameScrollbar inventoryScrollbar, creativeScrollbar, craftingScrollbar; -// bool exit = false; -// bool inventoryChanged; -// DInt wantedBlocksInv = new DInt(); -// bool getFromServerInv = false; -// readonly DInt[] InventoryClothes = new DInt[] { new DInt(), new DInt(), new DInt(), new DInt(), new DInt(), new DInt(), new DInt(), new DInt() }; - - -// #region Items -// List DroppedItems; -// float itemAnimationPos, itemAnimationPos2 = 3.1f; -// #endregion - -// #region Blocks in lists -// List FurnaceStone, Chargers, windable, Miners, Composters, bucketRubber; -// List chunksWithPlants; -// List lightsLamp; -// List movingAnimals; -// #endregion - -// #region Player -// bool died = false; -// int timerStayDied; -// string diedInfo; - -// bool rocket; -// bool swimming, waterDown; -// bool rocketDown; -// float gravity; - -// bool notNeedScafander; - -// int PlayerX, PlayerY; - -// int playerImg; -// int playerState; -// int distanceToGround = 0; -// float gravitySpeed = 0; -// bool playerLight = false; -// #endregion - -// #region Textures - -// #region Dye -// Texture2D -// TextureBin, -// TextureEggDrop,TextureOxygenMachine, TextureAirTank, TextureAirTank2, TextureBarrel, TextureIngotSteel, -// TextureItemEgg, TextureItemBoiledEgg, TextureWaterGraystyle, TextureChristmasStar, -// TextureBarBarrel, pixel, -// TextureClouds, -// TextureSunGradient, - -// TextureChristmasBall, -// TextureChristmasBallYellow, -// TextureChristmasBallOrange, -// TextureChristmasBallRed, -// TextureChristmasBallPurple, -// TextureChristmasBallPink, -// TextureChristmasBallLightGreen, -// TextureChristmasBallBlue, -// TextureChristmasBallTeal, -// TextureAngelHair, -// TextureAngelHairWithSpruceLeaves, - -// TextureChristmasBallGrayWithLeaves, -// TextureChristmasBallYellowWithLeaves, -// TextureChristmasBallOrangeWithLeaves, -// TextureChristmasBallRedWithLeaves, -// TextureChristmasBallPurpleWithLeaves, -// TextureChristmasBallPinkWithLeaves, -// TextureChristmasBallLightGreenWithLeaves, -// TextureChristmasBallBlueWithLeaves, -// TextureChristmasBallTealWithLeaves, - -// TextureDyeWhite, -// TextureDyeYellow, -// TextureDyeGold, -// TextureDyeOrange, -// TextureDyeRed, -// TextureDyeDarkRed, -// TextureDyePink, -// TextureDyePurple, -// TextureDyeLightBlue, -// TextureDyeBlue, -// TextureDyeDarkBlue, -// TextureDyeTeal, -// TextureDyeLightGreen, -// TextureDyeGreen, -// TextureDyeDarkGreen, -// TextureDyeBrown, -// TextureDyeLightGray, -// TextureDyeGray, -// TextureDyeDarkGray, -// TextureDyeBlack, -// TextureDyeArmy, -// TextureDyeMagenta, -// TextureDyeRoseQuartz, -// TextureDyeSpringGreen, -// TextureDyeViolet, -// TextureDyeOlive, -// #endregion - -// TextureTestTube, - -// #region Ore -// TextureOreCoal, -// TextureOreCopper, -// TextureOreTin, -// TextureOreGold, -// TextureOreIron, -// TextureOreSilver, -// TextureOreAluminium, -// TextureOreSulfur, -// TextureOreSaltpeter, -// #endregion - -// #region Back blocks -// TextureBackSulfurOre, -// TextureBackSaltpeterOre, - -// backgroundDirtTexture, -// backgroundGravelTexture, -// backgroundSandTexture, -// backgroundCobblestoneTexture, -// backgroundRegoliteTexture, -// backgroundRedSandTexture, -// backgroundClayTexture, - -// backgroundAnorthositeTexture, -// backgroundBasaltTexture, -// backgroundDioritTexture, -// backgroundDolomiteTexture, -// backgroundFlintTexture, -// backgroundGabbroTexture, -// backgroundGneissTexture, -// backgroundLimestoneTexture, -// backgroundMudstoneTexture, -// backgroundRhyoliteTexture, -// backgroundSandstoneTexture, -// backgroundSchistTexture, - -// backgroundCoalTexture, -// backgroundCopperTexture, -// backgroundTinTexture, -// backgroundIronTexture, -// backgroundAluminiumTexture, -// backgroundSilverTexture, -// backgroundGoldTexture, -// #endregion - -// #region Tools -// // Axe -// TextureAxeStone, -// TextureAxeCopper, -// TextureAxeBronze, -// TextureAxeGold, -// TextureAxeIron, -// TextureAxeSteel, -// TextureAxeAluminium, - -// // Pickaxe -// TexturePickaxeStone, -// TexturePickaxeCopper, -// TexturePickaxeBronze, -// TexturePickaxeGold, -// TexturePickaxeIron, -// TexturePickaxeSteel, -// TexturePickaxeAluminium, - -// // Shovel -// TextureShovelStone, -// TextureShovelCopper, -// TextureShovelBronze, -// TextureShovelGold, -// TextureShovelIron, -// TextureShovelSteel, -// TextureShovelAluminium, - -// // Hoe -// TextureHoeStone, -// TextureHoeCopper, -// TextureHoeBronze, -// TextureHoeGold, -// TextureHoeIron, -// TextureHoeSteel, -// TextureHoeAluminium, - -// // Saw -// TextureSawCopper, -// TextureSawBronze, -// TextureSawIron, -// TextureSawSteel, -// TextureSawAluminium, -// TextureSawGold, - -// // Hammer -// TextureHammerCopper, -// TextureHammerBronze, -// TextureHammerGold, -// TextureHammerIron, -// TextureHammerSteel, -// TextureHammerAluminium, - -// // Shears -// TextureShearsCopper, -// TextureShearsBronze, -// TextureShearsGold, -// TextureShearsIron, -// TextureShearsSteel, -// TextureShearsAluminium, - -// // Knife -// // TextureKnifeStone, -// TextureKnifeCopper, -// TextureKnifeBronze, -// TextureKnifeGold, -// TextureKnifeIron, -// TextureKnifeSteel, -// TextureKnifeAluminium, - -// // Electric -// TextureDrillElectric, -// TextureGun, -// TextureTorchOff, -// electricSawTexture, -// #endregion - -// #region Tools head -// // Pickaxe -// TexturePickaxeHeadCopper, -// TexturePickaxeHeadBronze, -// TexturePickaxeHeadGold, -// TexturePickaxeHeadIron, -// TexturePickaxeHeadSteel, -// TexturePickaxeHeadAluminium, - -// // Shovel -// TextureShovelHeadCopper, -// TextureShovelHeadBronze, -// TextureShovelHeadGold, -// TextureShovelHeadIron, -// TextureShovelHeadSteel, -// TextureShovelHeadAluminium, - -// // Axe -// TextureAxeHeadCopper, -// TextureAxeHeadBronze, -// TextureAxeHeadGold, -// TextureAxeHeadIron, -// TextureAxeHeadSteel, -// TextureAxeHeadAluminium, - -// // Hoe -// TextureHoeHeadCopper, -// TextureHoeHeadBronze, -// TextureHoeHeadGold, -// TextureHoeHeadIron, -// TextureHoeHeadSteel, -// TextureHoeHeadAluminium, - -// // Shears -// TextureShearsHeadCopper, -// TextureShearsHeadBronze, -// TextureShearsHeadGold, -// TextureShearsHeadIron, -// TextureShearsHeadSteel, -// TextureShearsHeadAluminium, - -// // Knife -// TextureKnifeHeadCopper, -// TextureKnifeHeadBronze, -// TextureKnifeHeadGold, -// TextureKnifeHeadIron, -// TextureKnifeHeadSteel, -// TextureKnifeHeadAluminium, - - - -// #endregion - -// #region player -// TextureHand, -// // TextureHandDown, - -// // Static -// TexturePlayerStaticFeet, -// TexturePlayerStaticLegs, -// TexturePlayerStaticChest, -// // TexturePlayerStaticHead, -// TexturePlayerStaticHair, -// TexturePlayerStaticFace, -// TexturePlayerStaticMoustage, -// TexturePlayerStaticMouth, -// TexturePlayerStaticEyes, - -// // Walking -// TexturePlayerWalkingFeet, -// TexturePlayerWalkingFeetForShoes, -// TexturePlayerWalkingLegs, -// TexturePlayerWalkingChest, -// TexturePlayerWalkingFace, -// TexturePlayerWalkingHair, -// TexturePlayerWalkingMoustage, -// TexturePlayerWalkingMouth, -// TexturePlayerWalkingEyes, -// // TexturePlayerWalkingLegsWoman, - -// // Swimming -// TexturePlayerSwimmingFeet, -// TexturePlayerSwimmingLegs, -// // TexturePlayerSwimmingChest, -// // TexturePlayerSwimmingLegsWoman, - - -// TextureInventoryClothes, -// //TextureWalkingClothesHead, -// //TextureWalkingClothesFeet, -// //TextureWalkingClothesChest, -// //TextureWalkingClothesChestTop, -// //TextureWalkingClothesLegs, -// //TextureWalkingClothesUnderwearUp, -// //TextureWalkingClothesUnderwearDown, -// //ClothesHead, -// //ClothesFeet, -// //ClothesChest, -// //ClothesChestTop, -// //ClothesLegs, -// //ClothesUnderwearUp, -// //ClothesUnderwearDown, -// //TextureSwimmingClothesFeet, -// //TextureSwimmingClothesChest, -// //TextureSwimmingClothesChestTop, -// //TextureSwimmingClothesLegs, -// //TextureSwimmingClothesUnderwearUp, -// //TextureSwimmingClothesUnderwearDown, - - -// TextureWalkingUpCensored, -// TextureWalkingDownCensored, - -// TextureStaticUpCensored, -// TextureStaticDownCensored, - -// TextureSwimmingUpCensored, -// TextureSwimmingDownCensored, - - -// //TextureWalkingFormalShoes, -// //TextureWalkingPumps, -// //TextureWalkingSneakers, -// //TextureWalkingSpaceBoots, - -// //TextureWalkingJeans, -// //TextureWalkingShorts, -// //TextureWalkingSkirt, -// //TextureWalkingArmyTrousers, -// //TextureWalkingSpaceTrousers, - -// //TextureWalkingTShirt, -// //TextureWalkingSpaceSuit, -// //TextureWalkingShirt, -// //TextureWalkingDress, - -// //TextureWalkingCap, -// //TextureWalkingHad, -// //TextureWalkingCrown, -// //TextureWalkingSpaceHelmet, - -// //TextureWalkingUnderpants, -// //TextureWalkingBoxerShorts, -// //TextureWalkingPanties, -// //TextureWalkingSwimsuit, -// //TextureWalkingBikiniDown, - -// //TextureWalkingCoatArmy, -// //TextureWalkingCoat, -// //TextureWalkingJacketDenim, -// //TextureWalkingJacketFormal, -// //TextureWalkingJacketShort, - -// //TextureWalkingBra, -// //TextureWalkingBikiniTop, - -// // TextureStaticFormalShoes, -// // TextureStaticPumps, -// // TextureStaticSneakers, -// // TextureStaticSpaceBoots, - -// // TextureStaticJeans, -// // TextureStaticShorts, -// // TextureStaticSkirt, -// // TextureStaticArmyTrousers, -// // TextureStaticSpaceTrousers, - -// // TextureStaticTShirt, -// // TextureStaticSpaceSuit, -// // TextureStaticShirt, -// // TextureStaticDress, - -// // TextureStaticCap, -// // TextureStaticHad, -// // TextureStaticCrown, -// // TextureStaticSpaceHelmet, - -// // TextureStaticUnderpants, -// // TextureStaticBoxerShorts, -// // TextureStaticPanties, -// // TextureStaticSwimsuit, -// // TextureStaticBikiniDown, - -// // TextureStaticCoatArmy, -// // TextureStaticCoat, -// // TextureStaticJacketDenim, -// // TextureStaticJacketFormal, -// //// TextureStaticJacket, -// // TextureStaticJacketShort, - -// // TextureStaticBra, -// // TextureStaticBikiniTop, - -// // TextureSwimmingFormalShoes, -// // TextureSwimmingPumps, -// // TextureSwimmingSneakers, -// // TextureSwimmingSpaceBoots, - -// // TextureSwimmingJeans, -// // TextureSwimmingShorts, -// // TextureSwimmingSkirt, -// // TextureSwimmingArmyTrousers, -// // TextureSwimmingSpaceTrousers, - -// // TextureSwimmingTShirt, -// // TextureSwimmingSpaceSuit, -// // TextureSwimmingShirt, -// // TextureSwimmingDress, - -// // TextureSwimmingUnderpants, -// // TextureSwimmingBoxerShorts, -// // TextureSwimmingPanties, -// // TextureSwimmingSwimsuit, -// // TextureSwimmingBikiniDown, - -// // TextureSwimmingCoatArmy, -// // TextureSwimmingCoat, -// // TextureSwimmingJacketDenim, -// // TextureSwimmingJacketFormal, -// //// TextureSwimmingJacket, -// // TextureSwimmingJacketShort, - -// // TextureSwimmingBra, -// // TextureSwimmingBikiniTop, -// #endregion - -// #region Trees -// TextureBranches, - -// // Oak -// TextureOakWood, -// TextureOakLeaves, -// oakSaplingTexture, - -// // Pine -// pineWoodTexture, -// pineLeavesTexture, -// pineSaplingTexture, - -// //Spruce -// spruceWoodTexture, -// spruceLeavesTexture, -// spruceSaplingTexture, - -// // Linden -// TextureLindenWood, -// TextureLindenLeaves, -// TextureLindenSapling, - -// // Apple -// TextureAppleWood, -// TextureAppleLeaves, -// TextureAppleBlossom, -// TextureAppleSapling, -// TextureAppleLeavesWithApples, - -// // Plum -// TexturePlumWood, -// TexturePlumLeaves, -// TexturePlumBlossom, -// plumSaplingTexture, -// TexturePlumLeavesWithPlums, - -// // Cherry -// cherryWoodTexture, -// TextureCherryBlossom, -// TextureCherryLeaves, -// cherrySaplingTexture, -// TextureCherryLeavesWithCherries, - -// // Orange -// TextureOrangeWood, -// TextureOrangeLeaves, -// TextureOrangeLeavesWithOranges, -// orangeSaplingTexture, - -// // Lemon -// TextureLemonWood, -// TextureLemonLeaves, -// lemonLeavesWithLemonsTexture, -// lemonSaplingTexture, - -// // Willow -// TextureWillowLeaves, -// TextureWillowWood, -// TextureWillowSapling, - -// // Mangrove -// TextureMangroveLeaves, -// TextureMangroveWood, -// TextureMangroveSapling, - -// // Eucalyptus -// TextureEucalyptusLeaves, -// TextureEucalyptusWood, -// TextureEucalyptusSapling, - -// // Olive -// TextureOliveLeavesWithOlives, -// TextureOliveLeaves, -// TextureOliveWood, -// TextureOliveSapling, - -// // Rubber -// TextureRubberTreeLeaves, -// TextureRubberTreeWood, -// TextureRubberTreeSapling, - -// // Accacia -// TextureAcaciaLeaves, -// TextureAcaciaWood, -// TextureAcaciaSapling, - -// // Kapok -// TextureKapokBlossom, -// TextureKapokLeavesFibre, -// TextureKapokLeaves, -// TextureKapokSapling, -// TextureKapokWood, -// #endregion - -// #region Clothes -// // Shoes -// TextureItemFormalShoes, -// TextureItemPumps, -// TextureItemSneakers, -// TextureItemSpaceBoots, - -// // Trousers + skirt -// TextureItemJeans, -// TextureItemShorts, -// TextureItemSpaceTrousers, -// TextureItemArmyTrousers, -// TextureItemSkirt, - -// // T-shirts + dress -// TextureItemTShirt, -// TextureItemSpaceSuit, -// TextureItemDress, -// TextureItemShirt, - -// // head -// TextureItemCap, -// TextureItemHat, -// TextureItemCrown, -// TextureItemSpaceHelmet, - -// // bottom -// TextureItemUnderpants, -// TextureItemBoxerShorts, -// TextureItemPanties, -// TextureItemSwimsuit, -// TextureItemBikiniDown, - -// // Top -// TextureItemBra, -// TextureItemBikiniTop, - -// // Coat -// TextureItemCoatArmy, -// TextureItemCoat, -// ItemJacketDenimTexture, -// ItemJacketFormalTexture, -// // ItemJacketTexture, -// TextureItemJacketShort, -// #endregion - -// #region Foods - -// // Fruit -// ItemOrangeTexture, -// ItemLemonTexture, -// ItemAppleTexture, -// ItemBananaTexture, -// ItemCherryTexture, -// ItemPlumTexture, - -// rashberryTexture, -// strawberryTexture, -// blueberryTexture, - -// // Wegetable -// ItemOnionTexture, - -// // Meat -// ItemRabbtCookedMeatTexture, -// ItemRabbitMeatTexture, - - -// #endregion - -// TextureSulfur, -// TextureSaltpeter, -// TextureGunpowder, -// TextureAmmo, - - -// TextureBucketForRubber, -// TextureBucketWithLatex, -// TextureResin, -// TextureSelectCrafting, -// RadioButtonPause, -// RadioButtonPlay, -// sewingMachineTexture, - -// ItemOliveTexture, -// ItemKapokFibreTexture, - -// CompostTexture, -// ComposterTexture, -// ComposterFullTexture, -// LightElectricTexture, -// lightMaskLineTexture, -// lightMaskRoundTexture, -// rabbitStillTexture, -// chickenStillTexture, -// lightMaskTexture, -// RodTexture, -// chargerTexture, -// TextureRedSand, -// mudstoneTexture, -// flintTexture, -// stoneHeadTexture, - -// rocketTexture, -// anorthositeTexture, -// regoliteTexture, -// solidFuelSmokeTexture, -// mobileTexture, -// bucketOilTexture, -// bottleOilTexture, -// bowlEmptyTexture, -// bowlMushroomsTexture, -// bowlVegetablesTexture, -// messageLeft, -// bottleEmptyTexture, -// bottleWaterTexture, -// boxWoodenTexture, -// messageCenter, -// messageRight, -// flaxSeedsTexture, -// fishCookedTexture, -// flaxInvTexture, -// invStrawberryTexture, -// invRashberryTexture, -// invBlueberryTexture, -// shelfTexture, -// boxAdvTexture, -// nailTexture, -// siliciumTexture, - -// //Items -// condenserTexture, -// diodeTexture, -// tranzistorTexture, -// resistanceTexture, -// motorTexture, -// bareLabelTexture, - -// //Blocks -// roof1Texture, -// roof2Texture, -// scrollbarUpTexture, -// scrollbarBetweenTexture, -// scrollbarDownTexture, -// inventoryNeedTexture, -// inventorySlotTexture, -// inventorySlotInTexture, -// inventorySlotOutTexture, - -// clothTexture, -// yarnTexture, -// chickenEatTexture, -// chickenWalkTexture, -// rabbitEatTexture, -// rabbitJumpTexture, -// rabbitWalkTexture, -// sunTexture, - -// barEnergyTexture, - -// plateCopperTexture, -// plateIronTexture, -// plateBronzeTexture, -// plateAluminiumTexture, -// plateGoldTexture, - -// oneBrickTexture, -// oneMudBrickTexture, - -// boletusTexture, - -// coralTexture, -// flaxTexture, -// toadstoolTexture, -// champignonTexture, -// sugarCaneTexture, -// seaweedTexture, -// heatherTexture, - -// dolomiteTexture, -// basaltTexture, -// limestoneTexture, -// rhyoliteTexture, -// gneissTexture, -// sandstoneTexture, -// schistTexture, -// gabbroTexture, -// dioritTexture, - -// lavaTexture, - -// radioInvTexture, -// advancedSpaceBackTexture, -// advancedSpaceWindowTexture, -// advancedSpaceBlockTexture, -// advancedSpacePart1Texture, -// advancedSpacePart2Texture, -// advancedSpacePart3Texture, -// advancedSpacePart4Texture, -// advancedSpaceFloorTexture, -// doorInvTexture, - -// oilTexture, -// lianaTexture, - -// branchWithoutTexture, -// branchALittle1Texture, -// branchALittle2Texture, -// branchFullTexture, - -// // Still Items -// furnaceStoneOneTexture, -// maceratorOneTexture, -// furnaceElectricOneTexture, -// labelOneTexture, -// ashTexture, -// coalWoodTexture, -// snowTopTexture, - -// // Bars -// barEatTexture, -// barWaterTexture, -// barOxygenTexture, -// barHeartTexture, - -// // Textures blocks -// //rocks0Texture, -// //rocks1Texture, -// //rocks2Texture, -// //rocks3Texture, -// TextureDirt, -// gravelTexture, -// sandTexture, -// waterTexture, -// snowTexture, -// iceTexture, -// cobblestoneTexture, - -// //GrassBlock -// TextureGrassBlockPlains, -// TextureGrassBlockHills, -// TextureGrassBlockForest, -// TextureGrassBlockDesert, -// TextureGrassBlockJungle, -// TextureGrassBlockClay, -// TextureGrassBlockCompost, -// TextureGrassBlockSnow, - -// //CraftingBlocks -// bricksTexture, -// deskTexture, -// doorOpenTexture, -// doorCloseTexture, -// furnaceElectricTexture, -// furnaceStoneTexture, -// glassTexture, -// hayBlockTexture, -// labelTexture, -// ladderTexture, -// lampTexture, - -// maceratorTexture, -// minerTexture, -// TextureMoon, -// radioTexture, - -// solarPanelTexture, -// planksTexture, - -// torchTexture, -// flagTexture, -// waterMillTexture, -// windMillTexture, - -// // Plants -// plantAloreTexture, -// plantCarrotTexture, -// plantOnionTexture, -// plantPeasTexture, - -// ItemPeasTexture, -// ItemCarrotTexture, - -// blueberryPlantTexture, -// strawberryPlantTexture, -// rashberryPlantTexture, - -// wheatTexture, - -// cactusBigTexture, -// cactusLittleTexture, - -// grassJungleTexture, -// grassDesertTexture, -// grassForestTexture, -// grassHillsTexture, -// grassPlainsTexture, - -// plantVioletTexture, -// plantRoseTexture, -// plantOrchidTexture, -// plantDandelionTexture, - -// torchInvTexture, -// clayTexture, - - - -// // Animals -// fishTexture0, -// fishTexture1, - -// // Animations -// destructionTexture, - -// //Dusts -// ItemAluminiumDustTexture, -// ItemBronzeDustTexture, -// ItemCoalDustTexture, -// ItemCopperDustTexture, -// ItemGoldDustTexture, -// ItemIronDustTexture, -// ItemSilverDustTexture, -// ItemStoneDustTexture, -// ItemTinDustTexture, -// ItemWoodDustTexture, - -// //Electronic -// ItemBatteryTexture, -// ItemBigCircuitTexture, -// ItemBulbTexture, -// ItemCircuitTexture, -// ItemRubberTexture, - - - -// #region Ingots -// ItemAluminiumIngotTexture, -// ItemBronzeIngotTexture, -// ItemCopperIngotTexture, -// ItemGoldIngotTexture, -// ItemIronIngotTexture, -// ItemSilverIngotTexture, -// ItemTinIngotTexture, -// #endregion - -// // MashinesBlocks -// ItemDoorTexture, -// ItemFlagTexture, -// ItemRocketTexture, -// ItemWaterMillTexture, -// ItemWindMillTexture, - -// //Nature -// ItemHayTexture, -// ItemLeaveTexture, -// ItemSeedsTexture, -// ItemStickTexture, -// ItemSticksTexture, -// ItemWheatSeedsTexture, -// ItemWheatStrawTexture, - -// #region Rocks -// ItemCoalTexture, -// ItemCopperTexture, -// ItemDiamondTexture, -// ItemAluminiumTexture, -// ItemGoldTexture, -// ItemIronTexture, -// ItemPlasticTexture, -// ItemRubyTexture, -// ItemSaphiriteTexture, -// ItemSilverTexture, -// ItemSmaragdTexture, -// ItemBigStoneTexture, -// ItemMediumStoneTexture, -// ItemSmallStoneTexture, -// ItemTinTexture, -// #endregion - -// ItemBackpackTexture, -// ItemBucketTexture, -// ItemBucketWaterTexture, -// ItemRopeTexture; -// #endregion - -// #region Weather & time (day/night) -// float windForce; -// int dayLenght = 4800; -// const int hour = 200; - - -// List lights = new List(); - -// // Rain -// int rainDuration; -// int changeRain = 1250; -// List rainDots; -// bool wind, rain; - -// //Time -// int day, timeToChageWind, timer5 = 10; -// int time; -// int _secondTimer = 60; -// int timerDraw60 = 60; - -// // Day / night -// float dayAlpha; -// float moonSpeed; -// #endregion - -// #region Inventory -// InventoryType lastMashineType; -// InventoryType inventory = InventoryType.Normal; -// Mobile.System mobileOS; -// string[] radioSongs; -// int inventoryScrollbarValue = 0; -// int selectedCraftingItem; -// int inventoryScrollbarValueCrafting = 0; -// int inventoryScrollbarValueCraftingMax = 0; -// int boxSelected; - -// bool mouseDraw = false; -// bool invMove; -// int invStart; -// DInt invStartDInt; -// bool leftMove; -// int maxInvCount; - -// DInt selectedMashine; - -// GeDo gedo; -// List Inventory; -// List Crafting; -// List Need; - -// int diserpeard = 255; -// string text = ""; - -// // int craftingType; - -// bool hold; -// int timeHold; -// string lastKey; -// #endregion - -// #region Buttons -// GameButtonSmall -// buttonNext, -// buttonRocket, -// buttonRadio, -// buttonPrev, -// buttonCraft1x, -// buttonCraft10x, -// buttonCraft100x; - -// ImgButton -// buttonClose, -// buttonClosePopUp, -// buttonInvTabBlocks, -// buttonInvTabPlants, -// buttonInvTabTools, -// buttonInvTabMashines, -// buttonInvTabItems, -// buttonInvTabCeramics, -// buttonInvTabFood, -// buttonInvTabGlass, -// buttonInvTabMaterials, -// buttonInvAnimals, - - -// buttonInvHead, -// buttonInvChest, -// buttonInvLegs, -// buttonInvShoes, -// buttonInvUnderwear; -// #endregion - -// #region Window -// Matrix camera, ZoomMatrix, Translation; - -// int WindowXWithout, WindowYWithout, -// WindowCenterX, WindowCenterY, -// WindowX, WindowY; - -// float WindowXPlayer, WindowYPlayer; - -// RenderTarget2D sunLightTarget, modificatedLightTarget; - -// readonly BlendState Multiply = new BlendState() { -// AlphaSourceBlend=Blend.Zero, -// AlphaDestinationBlend=Blend.SourceColor, -// ColorSourceBlend=Blend.Zero, -// ColorDestinationBlend=Blend.SourceColor -// }; - -// // readonly int Zoom16=(int)(16*Setting.Zoom); - -// int terrainStartIndexX, terrainStartIndexY, terrainStartIndexW, terrainStartIndexH; -// #endregion - -// #region Mouse & keyboard -// bool mouseLeftPress, -// mouseLeftRelease, -// mouseLeftDown, - -// mouseRightPress, -// mouseRightRelease, -// mouseRightDown; - -// MouseState newMouseState, oldMouseState; -// KeyboardState oldKeyboardState, newKeyboardState; - -// int previousScrollValue; - -// Vector2 mousePos; -// DInt mousePosDiv16 = new DInt(), -// mouseRealPos = new DInt(), -// mousePosRound = new DInt(); -// #endregion - -// #region Bars -// float barWater = 16; -// float barEat = 16; -// float barOxygen = 0; -// float barHeart = 16; -// float barEnergy = 0; -// #endregion - -// #region Debug -// bool debug; -// float fps; -// float fpss = 0; -// PerformanceCounter cpu; -// PerformanceCounter ram; -// PerformanceCounter cpuUsage; -// PerformanceCounter freeRam; - -// float usageCpuProcess; -// float usageCpu; -// float usageRamProcess; -// float usageRam; - -// bool showInventory = true; -// bool showPlayer = true; -// #endregion - -// #region World -// int TerrainLenght; - -// public string pathToWorld; -// readonly string world = "Earth"; -// int autoSave = 300; -// List energy; -// #endregion - -// #region Block destruction -// DInt destroyBlock; - -// float destroingIndex; -// float destringMaxIndex; - -// bool destroing; - -// BlockType destroingBlockDepth; -// byte destroingBlockType; - -// const int DistanceBlockEdit = 200; -// #endregion - -// #region Fonts -// SpriteFont -// spriteFont_small, -// spriteFont_small_italic, -// spriteFont_medium, -// spriteFont_big, -// spriteFont_biggest; -// #endregion - -// #region Colors -// readonly Color -// color_r200_g200_b200_a100 = new Color(200, 200, 200, 100), -// color_r0_g0_b0_a200 = new Color(0, 0, 0, 200), -// color_r10_g140_b255 = new Color(10, 140, 255), -// color_r128_g128_b128 = new Color(128, 128, 128), -// color_r128_g128_b128_a128 = new Color(128, 128, 128, 128), -// color_r150_g150_b150 = new Color(150, 150, 150), -// color_r0_g0_b0_a100 = new Color(0, 0, 0, 100), -// color_r255_g0_b0_a100 = new Color(255, 0, 0, 100), -// color_r200_g200_b200 = new Color(200, 200, 200), -// lampColorLight = new Color(255, 255, 220, 255); -// #endregion - -// #region Other -// int walkingSoundDuration; -// #endregion - -// #endregion - -// #region Multiplayer -// List sendedBlockToRemove = new List(); - -// List Queue = new List(); -// const string toServer = "{Server}"; -// const string toEveryone = "{Everyone}"; -// string SomeoneWantTeleportToYouName; - -// Password password; - -// enum LoginType { -// Null, - -// Banned, -// BannedWithInfo, - -// FirstConnectPassword, -// FirstConnect, - -// NotOnWhitelistNoInfo, -// NotOnWhitelist, - -// LoginWithPassword, -// BasicLogin, -// } -// int state = 0; -// volatile MTerrain[] terrain; -// // string web; - -// const int downloadingSpawnAreaMax = 53; -// int downloadedSpawnArea = 0; -// // bool cmdWeb; -// byte[] byteData = new byte[1024]; -// Current current; -// bool Error = false; -// int joinedPlayers = 0; -// Socket clientSocket; -// string serverName = ""; -// int maxplayers = 10; -// DateTime tpPlayerTime; -// string tpPlayerMsgWaiting; -// int safeSpawn = 0; -// List players = new List(); -// // bool UseBackColor; -// // Color BackColor; -// // bool UseGedo; -// GameButtonMedium menu; -// float Process { -// get { return state/496f; } -// } -// string sn = ""; - -// // public string playedWorld = ""; - - -// // const int hour=3000; -// //const int dayLenght=72000; -// // List DroppedItems=new List(); -// //#region Mouse & keyboard -// //bool mouseLeftPress; -// //bool mouseLeftRelease; -// //bool mouseLeftDown; - -// //bool mouseRightPress; -// //bool mouseRightRelease; -// //bool mouseRightDown; - -// //Vector2 mousePos; - -// //MouseState newMouseState; -// //MouseState oldMouseState; -// //int previousScrollValue; -// //KeyboardState oldKeyboardState; -// //KeyboardState newKeyboardState; -// //#endregion -// // #region Weather & time (day/night) -// // Rain -// //int rainDuration; -// //int changeRain = 1250; -// //List rainDots; -// //bool wind, rain; - -// ////Time -// //int day, timeToChageWind, timer5; -// //int time; -// //int _secondTimer=60; - -// //// Day / night -// //float dayAlpha; -// //float moonSpeed; -// //#endregion -// // #region Debug -// //bool debug; -// // List energy; -// //PerformanceCounter cpu; -// //PerformanceCounter ram; -// //PerformanceCounter cpuUsage; -// //PerformanceCounter freeRam; - -// //float usageCpuProcess; -// //float usageCpu; -// //float usageRamProcess; -// //float usageRam; - -// //bool show; -// //bool showBlocks; -// //#endregion -// // #region -// // int inventory =0;// 0==not 1==normal 2==desk 3==furnace stone;4==furnace electric;5 ==macerator 6==shelf - -// // int inventoryScrollbarValue=0; -// // int selectedCraftingItem; -// // int inventoryScrollbarValueCrafting=0; -// // int inventoryScrollbarValueCraftingMax=0; -// // int boxSelected; - -// // bool mouseDraw =false; -// // bool invMove; -// // int invStart; -// // DInt invStartDInt; -// // bool leftMove; -// // int maxInvCount; - -// // DInt selectedMashine; - -// // GeDo gedo; -// // List Inventory; -// // List Crafting; -// // List Need; - -// // int diserpeard=255; -// // string text=""; - -// // int craftingType; - -// //// string newKey; -// // bool hold; -// // int timeHold; -// // string lastKey; -// // string olderKey; -// // #endregion -// // #region Bars -// //float barWater = 16; -// //float barEat = 16; -// //readonly float barOxygen=0; -// //float barHeart=16; -// //float barEnergy=0; -// //#endregion -// // #region Player -// // int PlayerX, PlayerY; - -// // int playerImg; -// // int playerState; -// // int distanceToGround=0; -// // float gravitySpeed=0; -// // #endregion - -// // #region Block destruction -// //DInt destroyBlock; - -// //float destroingIndex; -// //float destringMaxIndex; - -// //bool destroing; - -// //int destroingBlockDepth; -// //byte destroingBlockType; -// //#endregion - -// // #region Varibles -// // RenderTarget2D fogTarget; -// // #region Inventory - -// // int terrainStartIndexX, terrainStartIndexY, terrainStartIndexW, terrainStartIndexH; - -// // #endregion -// // // float itemAnimationPos; -// // #region Buttons -// // Button -// // buttonNext, -// // buttonPrev, -// // buttonCraft1x, -// // buttonCraft10x, -// // buttonCraft100x; - -// //ImgButton - -// // buttonClose, -// // buttonInvTabBlocks, -// // buttonInvTabPlants, -// // buttonInvTabTools, -// // buttonInvTabMashines, -// // buttonInvTabItems, -// // buttonInvTabCeramics, -// // buttonInvTabFood, -// // buttonInvTabGlass, -// // buttonInvTabMaterials; -// // #endregion - -// // int WindowXWithout; -// // int WindowYWithout; - -// // int WindowCenterX; -// // int WindowCenterY; - -// // float WindowXPlayer; -// // float WindowYPlayer; - -// // int WindowX; -// // int WindowY; - -// // readonly BlendState Multiply = new BlendState() { -// // AlphaSourceBlend = Blend.Zero, -// // AlphaDestinationBlend = Blend.SourceColor, -// // ColorSourceBlend = Blend.Zero, -// // ColorDestinationBlend = Blend.SourceColor -// // }; - -// // readonly int Zoom16=(int)(16*Setting.Zoom); - - -// //List lightsLamp; -// // #region Inventory -// //int inventory =0;// 0==not 1==normal 2==desk 3==furnace stone;4==furnace electric;5 ==macerator 6==shelf - -// //int inventoryScrollbarValue=0; -// //int selectedCraftingItem; -// //int inventoryScrollbarValueCrafting=0; -// //int inventoryScrollbarValueCraftingMax=0; -// //int boxSelected; - -// //bool mouseDraw =false; -// //bool invMove; -// //int invStart; -// //DInt invStartDInt; -// //bool leftMove; -// //int maxInvCount; - -// //DInt selectedMashine; - -// //GeDo gedo; -// //List Inventory; -// //List Crafting; -// //List Need; - -// //int diserpeard=255; -// //string text=""; - -// //int craftingType; - -// //string newKey; -// //bool hold; -// //int timeHold; -// //string lastKey; -// //string olderKey; -// // #endregion -// // #region Textures -// // Texture2D -// //messageLeft, -// // bottleFullTexture, -// // boxWoodenTexture, -// // messageCenter, -// // messageRight, -// // // pixel, -// // lightmap, -// // jugTexture, -// // jugWithWaterTexture, -// // //backDolomiteTexture, -// // //backBasaltTexture, -// // //backLimestoneTexture, -// // //backRhyoliteTexture, -// // //backGneissTexture, -// // //backSandstoneTexture, -// // //backSchistTexture, -// // //backGabbroTexture, -// // //backDioritTexture, -// // // boxTexture, -// // flaxSeedsTexture, -// // fishCookedTexture, -// // flaxInvTexture, -// // invStrawberryTexture, -// // invRashberryTexture, -// // invBlueberryTexture, -// // //ItemPlantBlueberryTexture, -// // shelfTexture, -// // boxAdvTexture, -// // nailTexture, -// // siliciumTexture, -// // //Player -// // playerTexture, -// // playerLeftTexture, -// // playerRightTexture, - -// // //Items -// // condenserTexture, -// // diodeTexture, -// // tranzistorTexture, -// // resistanceTexture, -// // motorTexture, -// // bareLabelTexture, - -// // //Blocks -// // roof1Texture, -// // roof2Texture, -// // scrollbarUpTexture, -// // scrollbarBetweenTexture, -// // scrollbarDownTexture, -// // // Inventories -// // inventoryNeedTexture, -// // //inventoryChooseTexture, -// // //inventoryCreativeTexture, -// // inventorySlotTexture, -// // inventoryBasicTexture, -// // // inventoryClothesTexture, - -// // //deskInventoryTexture, -// // //maceratorInventoryTexture, -// // //furnaceInventoryStoneTexture, -// // //furnaceInventoryElectricTexture, -// // clothTexture, -// // yarnTexture, -// // chickenEatTexture, -// // chickenWalkTexture, -// // rabbitEatTexture, -// // rabbitJumpTexture, -// // rabbitWalkTexture, sunTexture, - -// // sawCopperTexture, -// // sawBronzeTexture, -// // sawIronTexture, - - -// // electricDrillTexture, - -// // electricSawTexture, - -// // //Fonts -// // //hammerBronzeTexture, -// // hammerBronzeTexture, -// // hammerIronTexture, -// // barEnergyTexture, -// // shearsCopperTexture, -// // shearsBronzeTexture, -// // shearsIronTexture, - -// // plateCopperTexture, -// // plateIronTexture, -// // plateBronzeTexture, -// // plateAluminiumTexture, -// // plateGoldTexture, - -// // oneBrickTexture, -// // oneMudBrickTexture, - -// // //buttonCraftTexture, - - -// // boletusTexture, -// // // onionTexture, -// // coralTexture, -// // flaxTexture, -// // toadstoolTexture, -// // champignonTexture, -// // sugarCaneTexture, -// // seaweedTexture, -// // heatherTexture, -// // clayTexture, - -// // dolomiteTexture, -// // basaltTexture, -// // limestoneTexture, -// // rhyoliteTexture, -// // gneissTexture, -// // sandstoneTexture, -// // schistTexture, -// // gabbroTexture, -// // dioritTexture, - -// // lavaTexture, - -// // // dolomiteBrickTexture, -// // // basaltBrickTexture, -// // // limestoneBrickTexture, -// // // rhyoliteBrickTexture, -// // // gneissBrickTexture, -// // // sandstoneBrickTexture, -// // // schistBrickTexture, -// // // gabbroBrickTexture, -// // //dioritBrickTexture, - -// // radioInvTexture, -// // advancedSpaceBackTexture, -// // advancedSpaceWindowTexture, -// // advancedSpaceBlockTexture, -// // advancedSpacePart1Texture, -// // advancedSpacePart2Texture, -// // advancedSpacePart3Texture, -// // advancedSpacePart4Texture, -// // advancedSpaceFloorTexture, -// // doorInvTexture, - - -// // orangeWoodTexture, -// // lemonWoodTexture, -// // ItemOrangeWoodTexture, -// // ItemLemonWoodTexture, -// // orangeLeavesTexture, -// // orangeLeavesWithOrangesTexture, -// // lemonLeavesTexture, -// // lemonLeavesWithLemonsTexture, -// // orangeSaplingTexture, -// // lemonSaplingTexture, -// // ItemOrangeTexture, -// // ItemLemonTexture, - -// // ItemIronAxeTexture, -// // ItemIronShovelTexture, -// // ItemIronPickaxeTexture, -// // Snow, -// // branchesTexture, -// // oilTexture, -// // lianaTexture, -// // ItemStoneAxeTexture, -// // ItemStoneShovelTexture, -// // ItemStonePickaxeTexture, - -// // //ItemStoneHeadAxeTexture, -// // //ItemStoneHeadShovelTexture, -// // //ItemStoneHeadPickaxeTexture, - -// // ItemIronHeadAxeTexture, -// // ItemIronHeadShovelTexture, -// // ItemIronHeadPickaxeTexture, - -// // //ItemFrameworkAxeTexture, -// // //ItemFrameworkShovelTexture, -// // //ItemFrameworkPickaxeTexture, - - -// // //shelfInventoryTexture, - -// // //logo, - -// // branchWithoutTexture, -// // branchALittle1Texture, -// // branchALittle2Texture, -// // branchFullTexture, - -// // // Still Items -// // furnaceStoneOneTexture, -// // maceratorOneTexture, -// // furnaceElectricOneTexture, -// // labelOneTexture, -// // ashTexture, -// // coalWoodTexture, -// // snowTopTexture, - -// // // Bars -// // barEatTexture, -// // barWaterTexture, -// // barOxygenTexture, -// // barHeartTexture, - -// // // Textures blocks -// // //stoneTexture, -// // rocks0Texture, -// // rocks1Texture, -// // rocks2Texture, -// // rocks3Texture, -// // dirtTexture, -// // gravelTexture, -// // //lavaTexture, -// // sandTexture, -// // waterTexture, -// // snowTexture, -// // iceTexture, -// // cobblestoneTexture, - -// // //Oak -// // oakWoodTexture, -// // oakLeavesTexture, -// // oakSaplingTexture, - -// // //Pine -// // pineWoodTexture, -// // pineLeavesTexture, -// // pineSaplingTexture, - -// // //Spruce -// // spruceWoodTexture, -// // spruceLeavesTexture, -// // spruceSaplingTexture, - -// // //Linden -// // lindenWoodTexture, -// // lindenLeavesTexture, -// // lindenSaplingTexture, - -// // //Apple -// // appleWoodTexture, -// // appleLeavesTexture, -// // appleSaplingTexture, -// // appleLeavesWithApplesTexture, - -// // //Plum -// // plumWoodTexture, -// // plumLeavesTexture, -// // plumSaplingTexture, -// // plumLeavesWithPlumsTexture, - -// // //Cherry -// // cherryWoodTexture, -// // cherryLeavesTexture, -// // cherrySaplingTexture, -// // cherryLeavesWithCherriesTexture, - -// // //Ores -// // ironOreTexture, -// // coalOreTexture, -// // goldOreTexture, -// // silverOreTexture, -// // aluminiumOreTexture, -// // copperOreTexture, -// // tinOreTexture, - -// // //GrassBlock -// // grassBlockPlainsTexture, -// // grassBlockHillsTexture, -// // grassBlockForestTexture, -// // grassBlockDesertTexture, -// // grassBlockJungleTexture, - -// // //CraftingBlocks -// // bricksTexture, -// // deskTexture, -// // doorOpenTexture, -// // doorCloseTexture, -// // furnaceElectricTexture, -// // furnaceStoneTexture, -// // glassTexture, -// // hayBlockTexture, -// // labelTexture, -// // ladderTexture, -// // lampTexture, -// // //lindenPlanksTexture, -// // maceratorTexture, -// // minerTexture, -// // //oakPlanksTexture, -// // moonTexture, -// // //pinePlanksTexture, -// // //potatoesTexture, -// // radioTexture, - -// // solarPanelTexture, -// // planksTexture, - -// // torchTexture, -// // flagTexture, -// // fenceTexture, -// // //rocketTexture, -// // waterMillTexture, -// // windMillTexture, -// // //bonfireTexture, - -// // // Plants -// // plantAloreTexture, -// // plantCarrotTexture, -// // plantOnionTexture, -// // plantPeasTexture, - -// // ItemPeasTexture, -// // ItemCarrotTexture, - -// // blueberryPlantTexture, -// // strawberryPlantTexture, -// // rashberryPlantTexture, - -// // wheatTexture, - -// // cactusBigTexture, -// // cactusLittleTexture, - -// // grassJungleTexture, -// // grassDesertTexture, -// // grassForestTexture, -// // grassHillsTexture, -// // grassPlainsTexture, - -// // plantVioletTexture, -// // plantRoseTexture, -// // plantOrchidTexture, -// // plantDandelionTexture, - -// // // Inventory -// // //boxInventoryTexture, -// // //boxBackpackTexture, -// // //boxCraftingTexture, -// // //boxSelectedTexture, - -// // torchInvTexture, - -// // // Background -// // backgroundDirtTexture, -// // backgroundGravelTexture, -// // //backgroundStoneTexture, -// // backgroundSandTexture, - -// // // Animals -// // fishTexture0, -// // fishTexture1, - -// // // Animations -// // BoublesTexture, -// // WaterSquirtTexture, -// // destructionTexture, - -// // // Textures Other - -// // //scrollbarTexture, -// // //buttonPlayTexture, -// // //buttonSettingTexture, -// // //buttonNewWorldTexture, -// // //ButtonOkTexture, - -// // //// BackGround -// // //backgroundTexture0, -// // //backgroundTexture1, -// // //backgroundTexture2, -// // //backgroundTexture3, -// // //backgroundTexture4, -// // //backgroundTexture5, -// // //backgroundTexture6, -// // //backgroundTexture7, -// // //backgroundTexture8, -// // //backgroundTexture9, - -// // // Blocks - Items -// // //ItemBlockLeavesTexture, -// // //ItemBricksTexture, -// // //ItemDirtTexture, -// // //ItemGlassTexture, -// // //ItemGravelTexture, -// // //ItemHayBlockTexture, -// // //ItemSandTexture, - -// // //Dusts -// // ItemAluminiumDustTexture, -// // ItemBronzeDustTexture, -// // ItemCoalDustTexture, -// // ItemCopperDustTexture, -// // ItemGoldDustTexture, -// // ItemIronDustTexture, -// // ItemSilverDustTexture, -// // ItemStoneDustTexture, -// // //ItemDustSulfidTexture, -// // ItemTinDustTexture, -// // //ItemUranDustTexture, -// // ItemWoodDustTexture, - -// // //Electronic -// // ItemBatteryTexture, -// // ItemBigCircuitTexture, -// // ItemBulbTexture, -// // ItemCircuitTexture, -// // ItemRubberTexture, - -// // //Food -// // ItemAppleTexture, -// // ItemBananaTexture, -// // ItemCherryTexture, -// // ItemOnionTexture, -// // ItemPlumTexture, -// // ItemRabbtCookedMeatTexture, -// // ItemRabbitMeatTexture, -// // rashberryTexture, -// // strawberryTexture, -// // blueberryTexture, - -// // //Ingots -// // ItemAluminiumIngotTexture, -// // ItemBronzeIngotTexture, -// // ItemCopperIngotTexture, -// // ItemGoldIngotTexture, -// // ItemIronIngotTexture, -// // ItemSilverIngotTexture, -// // ItemTinIngotTexture, -// // // ItemUranIngotTexture, - -// // //MashinesBlocks -// // //ItemDeskTexture, -// // ItemDoorTexture, -// // ItemFlagTexture, -// // //ItemFurnaceElectricTexture, -// // //ItemFurnaceStoneTexture, -// // //ItemLabelTexture, -// // //ItemLadderTexture, -// // //ItemLampTexture, -// // //ItemMaceratorTexture, -// // //ItemMinerTexture, -// // //ItemRadioTexture, -// // ItemRocketTexture, -// // //ItemSolarPanelTexture, -// // //ItemTorchTexture, -// // ItemWaterMillTexture, -// // ItemWindMillTexture, - -// // //Nature -// // //ItemCactusTexture, -// // //ItemDandelionTexture, -// // ItemHayTexture, -// // ItemLeatherTexture, -// // ItemLeaveTexture, -// // //ItemOrchidTexture, -// // //ItemRoseTexture, -// // ItemSeedsTexture, -// // ItemStickTexture, -// // ItemSticksTexture, -// // //ItemVioletTexture, -// // ItemWheatSeedsTexture, -// // ItemWheatStrawTexture, - -// // ItemOakSaplingTexture, -// // ItemPineSaplingTexture, -// // ItemLindenSaplingTexture, -// // ItemPlumSaplingTexture, -// // ItemCherrySaplingTexture, -// // ItemAppleSaplingTexture, -// // ItemSpruceSaplingTexture, - - -// // //Rocks -// // ItemCoalTexture, -// // ItemCopperTexture, -// // ItemDiamondTexture, -// // ItemAluminiumTexture, -// // ItemGoldTexture, -// // ItemIronTexture, -// // ItemPlasticTexture, -// // ItemRubyTexture, -// // ItemSaphiriteTexture, -// // ItemSilverTexture, -// // ItemSmaragdTexture, -// // ItemBigStoneTexture, -// // ItemMediumStoneTexture, -// // ItemSmallStoneTexture, -// // ItemTinTexture, -// // // ItemUranTexture, - -// // //Tools -// // ItemBackpackTexture, -// // ItemBucketTexture, -// // ItemBucketWaterTexture, -// // ItemRopeTexture, - -// // //Wood -// // //ItemLindenPlanksTexture, -// // ItemLindenWoodTexture, -// // //ItemSprucePlanksTexture, -// // ItemSpruceWoodTexture, -// // //ItemOakPlanksTexture, -// // ItemOakWoodTexture, -// // //ItemPinePlanksTexture, -// // ItemPineWoodTexture, -// // //ItemCherryPlanksTexture, -// // ItemCherryWoodTexture, -// // //ItemPlumPlanksTexture, -// // ItemPlumWoodTexture, -// // //ItemApplePlanksTexture, -// // buttleTexture, -// // ItemAppleWoodTexture; -// // #endregion - -// //Chunk[] terrain; -// //bool geft = false; - -// //List energy; - -// //List rainDots; - - -// //Vector2 mousePos; -// // readonly List waterSquirt; -// //Texture2D playerTexture, playerLeftTexture, playerRightTexture; -// //int timer = 10; -// //List world = new List(); - - - -// #region Keyboard and Mouse -// //bool mouseLeftPress; -// // bool mouseLeftRelease; -// // bool mouseLeftDown; - - -// #endregion - -// // bool invMove =false; - - -// // GeDo gedo; - -// //float barOxygen=16; -// // int invStart=0; -// // bool leftMove=true; -// // string newKey; -// //bool hold; -// //int timeHold; -// //string lastKey; -// //string olderKey; -// // int walkingSoundDuration; -// // SoundEffect walking,rainEffect,eating; -// // Song songHappend, songMedium, songRoot, songStorm; - -// // CheckPassword chp; -// // #region Interworking -// //MouseState oldMouseState, newMouseState; -// //KeyboardState oldKeyboardState, newKeyboardState; - -// //Texture2D Pixel; -// //enum Step { -// // Checking, -// // Logining, -// // Terrain, -// // Assets, -// //} -// //MouseState ms=new MouseState(); -// // int PlayerX = 200; -// // float PlayerY = 200; - -// // public Matrix Translation; - - - - -// //List lightPos; - - - -// //bool first=true; public ContentManager cm; -// //KeyboardState ks=new KeyboardState(); -// //KeyboardState oks=new KeyboardState(); -// // SoundEffect walking, eating, rainEffect; -// //Step step=Step.Checking; -// // SpriteFont spriteFont_small, spriteFont_small_italic, spriteFont_medium, spriteFont_big, spritefontBiggest; -// //SpriteBatch spriteBatch; /*List LightPos=new List();*/ -// // #endregion - - -// // #region Blocks type - -// //#region Block -// //List -// // roof1, -// // roof2, -// //rocket, -// // heather, -// // boletus, -// // //onion, -// // coral, -// // //blueberriesFlowers, -// // //blueberriesNone, -// // //blueberriesFoodtable, -// // seaweed, -// // sugarCane, -// // champignon, -// // toadstool, - - -// // dolomite, -// // basalt, -// // limestone, -// // rhyolite, -// // gneiss, -// // sandstone, -// // schist, -// // gabbro, -// // diorit, - -// // lava, - -// // dolomiteBrick, -// // basaltBrick, -// // limestoneBrick, -// // rhyoliteBrick, -// // gneissBrick, -// // sandstoneBrick, -// // schistBrick, -// // gabbroBrick, -// // dioritBrick, - - -// // doorOpen, -// //doorClose, -// // //Blocks -// // advancedSpaceFloor, -// // advancedSpaceBack, -// // advancedSpaceWindow, -// // advancedSpaceBlok, -// // advancedSpacePart1, -// // advancedSpacePart2, -// // advancedSpacePart3, -// // advancedSpacePart4, - -// // orangeWood, -// // orangeSapling, -// // lemonSapling, -// // lemonWood, -// // orangeLeaves, -// // orangeLeavesWithOranges, -// // lemonLeaves, -// // lemonLeavesWithLemons, -// // sand, -// // liana, -// // dirt, -// // ice, -// // snow, -// // //strawberryNone, -// // //rashberryNone, -// // // strawberryFoodtable, -// // //rashberryFoodtable, -// // // strawberryWithFlowers, -// // //rashberryWithFlowers, -// // cobblestone, -// // gravel, -// // //stone, -// // oil, -// // snowTop, -// // branches, -// // branchWithout, -// // branchALittle1, -// // branchALittle2, -// // branchFull, - -// // grassPlainsBlock, -// // grassHillsBlock, -// // grassJungleBlock, -// // grassDesertBlock, -// // grassForestBlock, - -// // //Plants -// // plantViolet, -// // plantRose, -// // plantOrchid, -// // plantDandelion, - -// // grassPlains, -// // grassDesert, -// // grassJungle, -// // grassHills, -// // grassForest, - -// // cactusBig, -// // cactusLittle, -// // plantAlore, - -// // //plantCarrot, -// // //plantChives, - -// // //plantOnion, -// // //plantPeas, - -// // //Ores -// // ironOre, -// // coalOre, -// // goldOre, -// // aluminiumOre, -// // // stoneOre, -// // copperOre, -// // silverOre, -// // tinOre, - -// // //Apple -// // appleWood, -// // appleLeaves, -// // appleSapling, -// // appleLeavesWithApples, - -// // //Plum -// // plumWood, -// // plumLeaves, -// // plumSapling, -// // plumLeavesWithPlums, - -// // //Cherry -// // cherryWood, -// // cherryLeaves, -// // cherrySapling, -// // cherryLeavesWithCherries, - -// // //Oak -// // oakWood, -// // oakLeaves, -// // oakSapling, - -// // //Spruce -// // spruceWood, -// // spruceLeaves, -// // spruceSapling, - -// // //Pine -// // pineWood, -// // pineLeaves, -// // pineSapling, - -// // //Linden -// // lindenWood, -// // lindenLeaves, -// // lindenSapling, - -// // //Crafted -// // bricks, -// // glass, -// // hayBlock, -// // desk, -// // ladder, - -// // oakPlanks, -// // lindenPlanks, -// // sprucePlanks, -// // pinePlanks, - -// // solarPanel, - -// // //BackBlocks -// // backgroundDirt, -// // backgroundGravel, -// // backgroundStone, -// // backgroundSand; -// //#endregion - -// //#region Animated Blocks -// //List -// // torch, -// // flag, -// // windmill, -// // watermill; -// //#endregion - -// //#region Plants -// //List -// //wheat, -// //strawberry, -// //rashberry, -// //blueberry, -// //onion, -// //flax, -// //carrot, -// //chives, -// //peas; -// //#endregion - -// //#region ScreenBlocks -// //List fence, rocks, label; -// //#endregion - -// //#region MashinesBlocks -// //List -// // macerator, -// // furnaceElectric, -// // radio, -// // furnaceStone, -// // lamp, -// // miner; -// //#endregion - -// //#region BoxBlocks -// //List -// // shelf, -// // box; -// //#endregion - -// //#region Water -// //List waterBlock; -// //#endregion - -// //#region Animals -// //List chicken, rabbit; -// //#endregion - -// //#region Fishs -// //List fish; -// //#endregion - -// //#endregion - -// //Random random; -// //bool existsWDown; -// //bool existsWRight; -// //bool existsWLeft; -// //int playerImg; -// //int playerState; -// //float playerGravity; -// // private bool geft; -// //private int playerJump; -// //private float barEat; -// //private float barWater; -// //private int walkingSoundDuration; -// //private bool wind; -// //private bool debug; -// // private bool destruction; -// //private bool notAnimated; -// //private AnimatedBlock destructionBlockIndexA; -// // private Block destructionBlockIndex; -// //private float destructionIndex; -// //private float destructionTime; -// //private bool show=true; -// //private float time; -// // private int day; -// //int inventory = 0;// 0==not 1==normal 2==desk 3==furnace stone;4==furnace electric;5 ==macerator 6==shelf -// //List Inventory; -// //private int moonSpeed; -// //bool smd = false; -// public int port; -// public IPAddress ip; -// string ErrorHeader = ""; -// string ErrorText = ""; -// //string password = ""; -// //bool waitingPassword = false; -// //DateTime start; - - -// //string name; -// //bool active; -// // bool backColor; -// //Color color; -// // public bool gedo; - -// //bool autoJoinGroup; -// //string newGroup; -// //DateTime daysGoTo; - -// //bool editMoreGroups; -// //string[] moreGroups; - -// bool tpSpawn; -// bool tpEverywhere; -// bool tpPlayer; -// bool tpPlayerMessage; - -// bool changeSpawn; -// bool changeTerrainSpawn; -// bool changeWarps; -// //bool otherWarpsDoNotChange; - -// //public bool freeItems; -// // bool cmdRemoveItems; - -// // bool allowFly; -// bool allowChangeGametype; - -// //bool paswords; -// // bool doNotConnect; -// //bool kickOtherPlayerIfFull; -// //bool cannotBeKickedIfFull; - -// bool cmdPing; -// bool cmdMsg; -// bool cmdMsgAll; -// bool cmdLog; -// bool cmdKick; - -// bool cmdServerEnd; -// bool cmdServerReset; -// bool cmdServerBackup; - -// // bool kit; - -// int spawnX; -// int spawnY; -// #endregion - -// public override void Init() { -// buttonRadio=new GameButtonSmall(Textures.ButtonCenter/*,spriteFont_small,spriteFont_medium*/) { -// Text="Otevřít", -// }; - -// current=Current.Checking; - -// Connect(); - -// CountGravity(new GeneratePlanetSystem().SunSystem()); - -// #region Load textures -// TextureTestTube=GetDataTexture(@"Items\Dye\TestTube"); - -// TextureChristmasBall=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBall"); -// TextureChristmasBallYellow=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallYellow"); -// TextureChristmasBallOrange=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallOrange"); -// TextureChristmasBallRed=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallRed"); -// TextureChristmasBallPurple=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallPurple"); -// TextureChristmasBallPink=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallPink"); -// TextureChristmasBallLightGreen=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallLightGreen"); -// TextureChristmasBallBlue=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallBlue"); -// TextureChristmasBallTeal=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallTeal"); - -// TextureAngelHair=GetDataTexture(@"Items/Decorations/AngelHair"); -// TextureAngelHairWithSpruceLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/AngelHair"); - -// TextureChristmasBallGrayWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Gray"); -// TextureChristmasBallYellowWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Yellow"); -// TextureChristmasBallOrangeWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Orange"); -// TextureChristmasBallRedWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Red"); -// TextureChristmasBallPurpleWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Purple"); -// TextureChristmasBallPinkWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Pink"); -// TextureChristmasBallLightGreenWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/LightGreen"); -// TextureChristmasBallBlueWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Blue"); -// TextureChristmasBallTealWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Teal"); - -// CreateGradientTexture(); - -// #region Imventory -// TextureBin=GetDataTexture("Inventories/bin"); -// TextureSelectCrafting=GetDataTexture("Buttons/Other/SelectyCrafting"); - -// inventoryNeedTexture=GetDataTexture("Inventories/InventoryNeed"); -// inventorySlotTexture=GetDataTexture("Inventories/Slot"); -// inventorySlotInTexture=GetDataTexture("Inventories/SlotIn"); -// inventorySlotOutTexture=GetDataTexture("Inventories/SlotOut"); - -// TextureInventoryClothes=GetDataTexture("Inventories/InventoryClothes"); -// TextureBarBarrel=GetDataTexture("Inventories/BarBarrel"); -// #endregion -// TextureClouds=GetDataTexture("Animations\\Clouds"); -// #region Items -// #region Tools -// // Axe -// TextureAxeStone = GetDataTexture("Items/Tools/Axe/AxeStone"); -// TextureAxeCopper = GetDataTexture("Items/Tools/Axe/AxeCopper"); -// TextureAxeBronze = GetDataTexture("Items/Tools/Axe/AxeBronze"); -// TextureAxeGold = GetDataTexture("Items/Tools/Axe/AxeGold"); -// TextureAxeIron = GetDataTexture("Items/Tools/Axe/AxeIron"); -// TextureAxeSteel = GetDataTexture("Items/Tools/Axe/AxeSteel"); -// TextureAxeAluminium = GetDataTexture("Items/Tools/Axe/AxeAluminium"); - -// // Pickaxe -// TexturePickaxeStone = GetDataTexture("Items/Tools/Pickaxe/PickaxeStone"); -// TexturePickaxeCopper = GetDataTexture("Items/Tools/Pickaxe/PickaxeCopper"); -// TexturePickaxeBronze = GetDataTexture("Items/Tools/Pickaxe/PickaxeBronze"); -// TexturePickaxeGold = GetDataTexture("Items/Tools/Pickaxe/PickaxeGold"); -// TexturePickaxeIron = GetDataTexture("Items/Tools/Pickaxe/PickaxeIron"); -// TexturePickaxeSteel = GetDataTexture("Items/Tools/Pickaxe/PickaxeSteel"); -// TexturePickaxeAluminium = GetDataTexture("Items/Tools/Pickaxe/PickaxeAluminium"); - -// // Shovel -// TextureShovelStone = GetDataTexture("Items/Tools/Shovel/ShovelStone"); -// TextureShovelBronze = GetDataTexture("Items/Tools/Shovel/ShovelBronze"); -// TextureShovelCopper = GetDataTexture("Items/Tools/Shovel/ShovelCopper"); -// TextureShovelGold = GetDataTexture("Items/Tools/Shovel/ShovelGold"); -// TextureShovelIron = GetDataTexture("Items/Tools/Shovel/ShovelIron"); -// TextureShovelSteel = GetDataTexture("Items/Tools/Shovel/ShovelSteel"); -// TextureShovelAluminium = GetDataTexture("Items/Tools/Shovel/ShovelAluminium"); - -// //Hoe -// TextureHoeStone=GetDataTexture("Items/Tools/Hoe/StoneHoe"); -// TextureHoeCopper=GetDataTexture("Items/Tools/Hoe/CopperHoe"); -// TextureHoeBronze=GetDataTexture("Items/Tools/Hoe/BronzeHoe"); -// TextureHoeGold=GetDataTexture("Items/Tools/Hoe/GoldHoe"); -// TextureHoeIron=GetDataTexture("Items/Tools/Hoe/IronHoe"); -// TextureHoeSteel=GetDataTexture("Items/Tools/Hoe/SteelHoe"); -// TextureHoeAluminium=GetDataTexture("Items/Tools/Hoe/AluminiumHoe"); - -// // Saw -// TextureSawCopper=GetDataTexture("Items/Tools/Saw/SawCopper"); -// TextureSawBronze=GetDataTexture("Items/Tools/Saw/SawBronze"); -// TextureSawGold=GetDataTexture("Items/Tools/Saw/SawGold"); -// TextureSawIron=GetDataTexture("Items/Tools/Saw/SawIron"); -// TextureSawSteel=GetDataTexture("Items/Tools/Saw/SawSteel"); -// TextureSawAluminium=GetDataTexture("Items/Tools/Saw/SawAluminium"); - -// // Shears -// TextureShearsCopper=GetDataTexture("Items/Tools/Shears/ShearsCopper"); -// TextureShearsBronze=GetDataTexture("Items/Tools/Shears/ShearsBronze"); -// TextureShearsGold=GetDataTexture("Items/Tools/Shears/ShearsGold"); -// TextureShearsIron=GetDataTexture("Items/Tools/Shears/ShearsIron"); -// TextureShearsSteel=GetDataTexture("Items/Tools/Shears/ShearsSteel"); -// TextureShearsAluminium=GetDataTexture("Items/Tools/Shears/ShearsAluminium"); - -// // Hammer -// TextureHammerCopper=GetDataTexture("Items/Tools/Hammer/HammerCopper"); -// TextureHammerBronze=GetDataTexture("Items/Tools/Hammer/HammerBronze"); -// TextureHammerGold=GetDataTexture("Items/Tools/Hammer/HammerGold"); -// TextureHammerIron=GetDataTexture("Items/Tools/Hammer/HammerIron"); -// TextureHammerSteel=GetDataTexture("Items/Tools/Hammer/HammerSteel"); -// TextureHammerAluminium=GetDataTexture("Items/Tools/Hammer/HammerAluminium"); - -// // Knife -// //TextureKnifeStone = GetDataTexture("Items/Tools/Knife/KnifeStone"); -// TextureKnifeCopper = GetDataTexture("Items/Tools/Knife/KnifeCopper"); -// TextureKnifeBronze = GetDataTexture("Items/Tools/Knife/KnifeBronze"); -// TextureKnifeGold = GetDataTexture("Items/Tools/Knife/KnifeGold"); -// TextureKnifeIron = GetDataTexture("Items/Tools/Knife/KnifeIron"); -// TextureKnifeSteel = GetDataTexture("Items/Tools/Knife/KnifeSteel"); -// TextureKnifeAluminium = GetDataTexture("Items/Tools/Knife/KnifeAluminium"); - -// // Electronics -// TextureTorchOff=GetDataTexture("Blocks/ForInventory/TorchOFF"); -// LightElectricTexture=GetDataTexture("Items/Tools/Electric/Light"); -// TextureDrillElectric=GetDataTexture("Items/Tools/Electric/Drill"); -// electricSawTexture=GetDataTexture("Items/Tools/Electric/Saw"); -// mobileTexture=GetDataTexture("Items/NonTools/mobile"); - -// // Air tank -// TextureAirTank=GetDataTexture("Items/NonTools/OxygenTank"); -// TextureAirTank2=GetDataTexture("Items/NonTools/OxygenTank2"); - -// // Gun -// TextureAmmo = GetDataTexture("Items/NonTools/Ammo"); -// TextureGun = GetDataTexture("Items/NonTools/Gun"); - -// // Other -// stoneHeadTexture = GetDataTexture("Items/Tools/StoneAxe"); -// #endregion - -// #region Tool heads -// // Axe -// TextureAxeHeadCopper = GetDataTexture("Items/ToolsHeads/Axe/Copper"); -// TextureAxeHeadBronze = GetDataTexture("Items/ToolsHeads/Axe/Bronze"); -// TextureAxeHeadGold = GetDataTexture("Items/ToolsHeads/Axe/Gold"); -// TextureAxeHeadIron = GetDataTexture("Items/ToolsHeads/Axe/Iron"); -// TextureAxeHeadSteel = GetDataTexture("Items/ToolsHeads/Axe/Steel"); -// TextureAxeHeadAluminium = GetDataTexture("Items/ToolsHeads/Axe/Aluminium"); - -// // Shovel -// TextureShovelHeadCopper = GetDataTexture("Items/ToolsHeads/Shovel/Copper"); -// TextureShovelHeadBronze = GetDataTexture("Items/ToolsHeads/Shovel/Bronze"); -// TextureShovelHeadGold = GetDataTexture("Items/ToolsHeads/Shovel/Gold"); -// TextureShovelHeadIron = GetDataTexture("Items/ToolsHeads/Shovel/Iron"); -// TextureShovelHeadSteel = GetDataTexture("Items/ToolsHeads/Shovel/Steel"); -// TextureShovelHeadAluminium = GetDataTexture("Items/ToolsHeads/Shovel/Aluminium"); - -// // Pickaxe -// TexturePickaxeHeadCopper= GetDataTexture("Items/ToolsHeads/Pickaxe/Copper"); -// TexturePickaxeHeadBronze= GetDataTexture("Items/ToolsHeads/Pickaxe/Bronze"); -// TexturePickaxeHeadGold= GetDataTexture("Items/ToolsHeads/Pickaxe/Gold"); -// TexturePickaxeHeadIron= GetDataTexture("Items/ToolsHeads/Pickaxe/Iron"); -// TexturePickaxeHeadSteel= GetDataTexture("Items/ToolsHeads/Pickaxe/Steel"); -// TexturePickaxeHeadAluminium= GetDataTexture("Items/ToolsHeads/Pickaxe/Aluminium"); - -// // Shears -// TextureShearsHeadCopper= GetDataTexture("Items/ToolsHeads/Shears/Copper"); -// TextureShearsHeadBronze= GetDataTexture("Items/ToolsHeads/Shears/Bronze"); -// TextureShearsHeadGold= GetDataTexture("Items/ToolsHeads/Shears/Gold"); -// TextureShearsHeadIron= GetDataTexture("Items/ToolsHeads/Shears/Iron"); -// TextureShearsHeadSteel= GetDataTexture("Items/ToolsHeads/Shears/Steel"); -// TextureShearsHeadAluminium= GetDataTexture("Items/ToolsHeads/Shears/Aluminium"); - -// // Knife -// TextureKnifeHeadCopper= GetDataTexture("Items/ToolsHeads/Knife/Copper"); -// TextureKnifeHeadBronze= GetDataTexture("Items/ToolsHeads/Knife/Bronze"); -// TextureKnifeHeadGold= GetDataTexture("Items/ToolsHeads/Knife/Gold"); -// TextureKnifeHeadIron= GetDataTexture("Items/ToolsHeads/Knife/Iron"); -// TextureKnifeHeadSteel= GetDataTexture("Items/ToolsHeads/Knife/Steel"); -// TextureKnifeHeadAluminium= GetDataTexture("Items/ToolsHeads/Knife/Aluminium"); - -// // Hoe -// TextureHoeHeadCopper=GetDataTexture("Items/ToolsHeads/Hoe/Copper"); -// TextureHoeHeadBronze=GetDataTexture("Items/ToolsHeads/Hoe/Bronze"); -// TextureHoeHeadGold=GetDataTexture("Items/ToolsHeads/Hoe/Gold"); -// TextureHoeHeadIron=GetDataTexture("Items/ToolsHeads/Hoe/Iron"); -// TextureHoeHeadSteel=GetDataTexture("Items/ToolsHeads/Hoe/Steel"); -// TextureHoeHeadAluminium=GetDataTexture("Items/ToolsHeads/Hoe/Aluminium"); -// #endregion - -// #region Clothes -// // Head -// TextureItemCap=GetDataTexture("Items/Clothes/Head/Cap"); -// TextureItemHat=GetDataTexture("Items/Clothes/Head/Hat"); -// TextureItemCrown=GetDataTexture("Items/Clothes/Head/Crown"); -// TextureItemSpaceHelmet=GetDataTexture("Items/Clothes/Head/SpaceHelmet"); - -// // Feet -// TextureItemFormalShoes=GetDataTexture("Items/Clothes/Feet/FormalShoes"); -// TextureItemPumps=GetDataTexture("Items/Clothes/Feet/Pumps"); -// TextureItemSneakers=GetDataTexture("Items/Clothes/Feet/Sneakers"); -// TextureItemSpaceBoots=GetDataTexture("Items/Clothes/Feet/SpaceBoots"); - -// // Chest top -// TextureItemCoatArmy=GetDataTexture("Items/Clothes/ChestTop/CoatArmy"); -// TextureItemCoat=GetDataTexture("Items/Clothes/ChestTop/Coat"); -// ItemJacketDenimTexture=GetDataTexture("Items/Clothes/ChestTop/JacketDenim"); -// ItemJacketFormalTexture=GetDataTexture("Items/Clothes/ChestTop/JacketFormal"); -// TextureItemJacketShort=GetDataTexture("Items/Clothes/ChestTop/JacketShort"); - -// // Legs -// TextureItemJeans=GetDataTexture("Items/Clothes/Legs/Jeans"); -// TextureItemShorts=GetDataTexture("Items/Clothes/Legs/Shorts"); -// TextureItemSpaceTrousers=GetDataTexture("Items/Clothes/Legs/SpaceTrousers"); -// TextureItemArmyTrousers=GetDataTexture("Items/Clothes/Legs/ArmyTrousers"); -// TextureItemSkirt=GetDataTexture("Items/Clothes/Legs/Skirt"); -// TextureItemTShirt=GetDataTexture("Items/Clothes/Chest/TShirt"); -// TextureItemSpaceSuit=GetDataTexture("Items/Clothes/ChestTop/SpaceSuit"); -// TextureItemDress=GetDataTexture("Items/Clothes/Chest/Dress"); -// TextureItemShirt=GetDataTexture("Items/Clothes/Chest/Shirt"); - -// // Underwear Down -// TextureItemUnderpants=GetDataTexture("Items/Clothes/DownUnderwear/Underpants"); -// TextureItemBoxerShorts=GetDataTexture("Items/Clothes/DownUnderwear/BoxerShorts"); -// TextureItemPanties=GetDataTexture("Items/Clothes/DownUnderwear/Panties"); -// TextureItemSwimsuit=GetDataTexture("Items/Clothes/DownUnderwear/Swimsuit"); -// TextureItemBikiniDown=GetDataTexture("Items/Clothes/DownUnderwear/Bikini"); - -// // Underwear Up -// TextureItemBra=GetDataTexture("Items/Clothes/UpUnderwear/Bra"); -// TextureItemBikiniTop=GetDataTexture("Items/Clothes/UpUnderwear/TopBikini"); - -// #endregion - -// #region Electronics -// condenserTexture=GetDataTexture("Items/Electronic/Condenser"); -// diodeTexture=GetDataTexture("Items/Electronic/Diode"); -// tranzistorTexture=GetDataTexture("Items/Electronic/Transistor"); -// resistanceTexture=GetDataTexture("Items/Electronic/Resistance"); -// motorTexture=GetDataTexture("Items/Electronic/Motor"); -// ItemBatteryTexture = GetDataTexture("Items/Electronic/Battery"); -// ItemBigCircuitTexture = GetDataTexture("Items/Electronic/BigCircuit"); -// ItemBulbTexture = GetDataTexture("Items/Electronic/Bulb"); -// ItemCircuitTexture = GetDataTexture("Items/Electronic/Circuit"); -// bareLabelTexture=GetDataTexture("Items/Electronic/label"); -// #endregion - -// #region Nature -// // From plants -// flaxSeedsTexture=GetDataTexture("Items/Nature/FlaxSeeds"); -// ItemHayTexture = GetDataTexture("Items/Nature/Hay"); -// ItemLeaveTexture = GetDataTexture("Items/Nature/Leave"); -// ItemSeedsTexture = GetDataTexture("Items/Nature/Seeds"); -// ItemStickTexture = GetDataTexture("Items/Nature/Stick"); -// ItemSticksTexture = GetDataTexture("Items/Nature/Sticks"); -// ItemWheatSeedsTexture = GetDataTexture("Items/Nature/WheatSeeds"); -// ItemWheatStrawTexture = GetDataTexture("Items/Nature/WheatStraw"); -// ItemKapokFibreTexture=GetDataTexture("Items/Nature/KapokFibre"); - -// // Crafted -// clothTexture=GetDataTexture("Items/Nature/Cloth"); -// yarnTexture=GetDataTexture("Items/Nature/Yarn"); -// TextureResin=GetDataTexture("Items/Nature/Resin"); -// #endregion - -// #region Rocks -// ItemAluminiumTexture = GetDataTexture("Items/Rocks/Aluminium"); -// ItemCoalTexture = GetDataTexture("Items/Rocks/Coal"); -// ItemCopperTexture = GetDataTexture("Items/Rocks/Copper"); -// ItemDiamondTexture = GetDataTexture("Items/Rocks/Diamond"); -// ItemGoldTexture = GetDataTexture("Items/Rocks/Gold"); -// ItemIronTexture = GetDataTexture("Items/Rocks/Iron"); -// ItemPlasticTexture= GetDataTexture("Items/Rocks/Plastic"); -// ItemRubyTexture = GetDataTexture("Items/Rocks/Ruby"); -// ItemSaphiriteTexture = GetDataTexture("Items/Rocks/Saphirite"); -// ItemSilverTexture = GetDataTexture("Items/Rocks/Silver"); -// ItemSmaragdTexture = GetDataTexture("Items/Rocks/Smaragd"); -// ItemBigStoneTexture = GetDataTexture("Items/Rocks/StoneBig"); -// ItemMediumStoneTexture = GetDataTexture("Items/Rocks/StoneMedium"); -// ItemSmallStoneTexture = GetDataTexture("Items/Rocks/StoneSmall"); -// ItemTinTexture = GetDataTexture("Items/Rocks/Tin"); -// #endregion - -// #region Dye -// TextureDyeWhite= GetDataTexture("Items/Dye/White"); -// TextureDyeYellow = GetDataTexture("Items/Dye/Yellow"); -// TextureDyeGold = GetDataTexture("Items/Dye/Gold"); -// TextureDyeOrange = GetDataTexture("Items/Dye/Orange"); -// TextureDyeRed = GetDataTexture("Items/Dye/Red"); -// TextureDyeDarkRed = GetDataTexture("Items/Dye/DarkRed"); -// TextureDyePink = GetDataTexture("Items/Dye/Pink"); -// TextureDyePurple = GetDataTexture("Items/Dye/Purple"); -// TextureDyeLightBlue = GetDataTexture("Items/Dye/LightBlue"); -// TextureDyeBlue = GetDataTexture("Items/Dye/Blue"); -// TextureDyeDarkBlue = GetDataTexture("Items/Dye/DarkBlue"); -// TextureDyeTeal = GetDataTexture("Items/Dye/Teal"); -// TextureDyeLightGreen = GetDataTexture("Items/Dye/LightGreen"); -// TextureDyeGreen = GetDataTexture("Items/Dye/Green"); -// TextureDyeDarkGreen = GetDataTexture("Items/Dye/DarkGreen"); -// TextureDyeBrown = GetDataTexture("Items/Dye/Brown"); -// TextureDyeLightGray = GetDataTexture("Items/Dye/LightGray"); -// TextureDyeGray = GetDataTexture("Items/Dye/Gray"); -// TextureDyeDarkGray = GetDataTexture("Items/Dye/DarkGray"); -// TextureDyeBlack = GetDataTexture("Items/Dye/Black"); -// TextureDyeArmy = GetDataTexture("Items/Dye/Army"); -// TextureDyeMagenta = GetDataTexture("Items/Dye/Magenta"); -// TextureDyeRoseQuartz = GetDataTexture("Items/Dye/RoseQuartz"); -// TextureDyeSpringGreen = GetDataTexture("Items/Dye/SpringGreen"); -// TextureDyeViolet = GetDataTexture("Items/Dye/Violet"); -// TextureDyeOlive = GetDataTexture("Items/Dye/Olive"); -// #endregion - -// #region Food -// // Raw vegetable -// ItemPeasTexture=GetDataTexture("Items/Food/Peas"); -// ItemCarrotTexture=GetDataTexture("Items/Food/Carrot"); - -// // Raw fruit -// ItemOrangeTexture=GetDataTexture("Items/Food/Orange"); -// ItemLemonTexture=GetDataTexture("Items/Food/Lemon"); -// ItemOliveTexture=GetDataTexture("Items/Food/Olive"); -// ItemAppleTexture = GetDataTexture("Items/Food/Apple"); -// ItemBananaTexture = GetDataTexture("Items/Food/Banana"); -// ItemCherryTexture = GetDataTexture("Items/Food/Cherry"); -// ItemOnionTexture = GetDataTexture("Items/Food/Onion"); -// ItemPlumTexture = GetDataTexture("Items/Food/Plum"); -// rashberryTexture = GetDataTexture("Items/Food/Rashberry"); -// blueberryTexture=GetDataTexture("Items/Food/Blueberry"); -// strawberryTexture = GetDataTexture("Items/Food/Strawberry"); - -// // Raw other -// TextureItemEgg=GetDataTexture("Items/Food/egg"); -// ItemRabbitMeatTexture = GetDataTexture("Items/Food/RabbitMeat"); - -// // Boiled -// TextureItemBoiledEgg=GetDataTexture("Items/Food/eggboiled"); -// fishCookedTexture=GetDataTexture("Items/Food/FishCooked"); -// ItemRabbtCookedMeatTexture = GetDataTexture("Items/Food/RabbitCookedMeat"); - -// // Combined -// bowlMushroomsTexture=GetDataTexture("Items/Food/BowlWithMushrooms"); -// bowlVegetablesTexture=GetDataTexture("Items/Food/BowlWithVegetable"); -// #endregion - -// #region Other -// RodTexture=GetDataTexture("Items/NonTools/Rod"); -// nailTexture=GetDataTexture("Items/NonTools/Nail"); -// plateCopperTexture=GetDataTexture("Items/Plates/PlateCopper"); -// plateIronTexture=GetDataTexture("Items/Plates/PlateIron"); -// plateBronzeTexture=GetDataTexture("Items/Plates/PlateBronze"); -// plateAluminiumTexture=GetDataTexture("Items/Plates/PlateAluminium"); -// plateGoldTexture=GetDataTexture("Items/Plates/PlateGold"); -// #endregion - - - -// bottleWaterTexture=GetDataTexture("Items/NonTools/BottleWater"); -// bottleEmptyTexture=GetDataTexture("Items/NonTools/BottleEmpty"); -// bottleOilTexture=GetDataTexture("Items/NonTools/BottleOil"); -// bucketOilTexture=GetDataTexture("Items/NonTools/BucketOil"); - -// coalWoodTexture = GetDataTexture("Items/Rocks/CoalWood"); -// ItemBackpackTexture = GetDataTexture("Items/Clothes/Backpack"); -// ItemBucketTexture = GetDataTexture("Items/NonTools/Bucket"); -// ItemBucketWaterTexture = GetDataTexture("Items/NonTools/BucketWater"); -// ItemRopeTexture = GetDataTexture("Items/NonTools/Rope"); - -// #region Ingots -// ItemAluminiumIngotTexture= GetDataTexture("Items/Ingots/Aluminium"); -// ItemBronzeIngotTexture = GetDataTexture("Items/Ingots/Bronze"); -// ItemCopperIngotTexture = GetDataTexture("Items/Ingots/Copper"); -// ItemGoldIngotTexture = GetDataTexture("Items/Ingots/Gold"); -// ItemIronIngotTexture = GetDataTexture("Items/Ingots/Iron"); -// ItemSilverIngotTexture = GetDataTexture("Items/Ingots/Silver"); -// ItemTinIngotTexture = GetDataTexture("Items/Ingots/Tin"); -// TextureIngotSteel=GetDataTexture("Items/Ingots/Steel"); - -// siliciumTexture=GetDataTexture("Items/Ingots/Silicium"); - -// oneBrickTexture=GetDataTexture("Items/Ingots/Brick"); -// oneMudBrickTexture=GetDataTexture("Items/Ingots/Mud"); -// #endregion - -// #region Dusts -// // Metal -// ItemCopperDustTexture = GetDataTexture("Items/Dusts/Copper"); -// ItemTinDustTexture = GetDataTexture("Items/Dusts/Tin"); -// ItemBronzeDustTexture = GetDataTexture("Items/Dusts/Bronze"); -// ItemGoldDustTexture = GetDataTexture("Items/Dusts/Gold"); -// ItemSilverDustTexture = GetDataTexture("Items/Dusts/Silver"); -// ItemIronDustTexture = GetDataTexture("Items/Dusts/Iron"); -// ItemAluminiumDustTexture= GetDataTexture("Items/Dusts/Aluminium"); - -// // Other -// ItemCoalDustTexture = GetDataTexture("Items/Dusts/Coal"); -// ItemStoneDustTexture = GetDataTexture("Items/Dusts/Stone"); -// ItemWoodDustTexture = GetDataTexture("Items/Dusts/Wood"); -// ashTexture= GetDataTexture("Items/Dusts/Ash"); -// TextureSulfur = GetDataTexture("Items/Dusts/Sulfur"); -// TextureSaltpeter = GetDataTexture("Items/Dusts/Saltpeter"); -// TextureGunpowder = GetDataTexture("Items/Dusts/Gunpowder"); -// #endregion - -// ItemRubberTexture = GetDataTexture("Items/Electronic/Rubber"); -// bowlEmptyTexture=GetDataTexture("Items/NonTools/Bowl"); -// #endregion - -// #region Blocks -// #region Mashines -// // Mechanical -// ComposterTexture=GetDataTexture("Blocks/Mashines/Composter"); -// TextureBucketForRubber=GetDataTexture("Blocks/Mashines/BucketForRubber"); -// TextureBucketWithLatex=GetDataTexture("Blocks/Mashines/BucketWithLatex"); -// ComposterFullTexture=GetDataTexture("Blocks/Mashines/ComposterFull"); -// shelfTexture=GetDataTexture("Blocks/Mashines/shelf"); -// boxAdvTexture=GetDataTexture("Blocks/Mashines/box"); -// boxWoodenTexture=GetDataTexture("Blocks/Mashines/boxWooden"); -// deskTexture = GetDataTexture("Blocks/Mashines/Desk"); -// doorOpenTexture = GetDataTexture("Blocks/Mashines/DoorOpen"); -// doorCloseTexture = GetDataTexture("Blocks/Mashines/DoorClose"); -// furnaceStoneTexture = GetDataTexture("Blocks/Mashines/FurnaceStone"); -// torchTexture = GetDataTexture("Blocks/Mashines/Torch"); -// TextureBarrel = GetDataTexture("Blocks/Mashines/Barrel"); - -// // Electrinics -// TextureOxygenMachine=GetDataTexture("Blocks/Mashines/OxygenMachine"); -// chargerTexture=GetDataTexture("Blocks/Mashines/Charger"); -// rocketTexture=GetDataTexture("Space/Rocket"); -// radioTexture = GetDataTexture("Blocks/Mashines/Radio"); -// maceratorTexture = GetDataTexture("Blocks/Mashines/Macerator"); -// minerTexture = GetDataTexture("Blocks/Mashines/Miner"); -// lampTexture = GetDataTexture("Blocks/Mashines/Lamp"); -// solarPanelTexture = GetDataTexture("Blocks/Mashines/SolarPanel"); -// labelTexture = GetDataTexture("Blocks/Mashines/Label"); -// furnaceElectricTexture = GetDataTexture("Blocks/Mashines/FurnaceElectric"); -// waterMillTexture = GetDataTexture("Blocks/Mashines/Watermill"); -// windMillTexture = GetDataTexture("Blocks/Mashines/Windmill"); -// sewingMachineTexture=GetDataTexture("Blocks/Mashines/SewingMachine"); -// #endregion - -// #region Trees -// TextureBranches = GetDataTexture("Blocks/TreeBlocks/Branches"); -// // Oak -// TextureOakWood = GetDataTexture("Blocks/TreeBlocks/Oak/Wood"); -// TextureOakLeaves = GetDataTexture("Blocks/TreeBlocks/Oak/Leaves"); - -// // Spruce -// spruceWoodTexture = GetDataTexture("Blocks/TreeBlocks/Spruce/Wood"); -// spruceLeavesTexture = GetDataTexture("Blocks/TreeBlocks/Spruce/Leaves"); - -// // Linden -// TextureLindenWood = GetDataTexture("Blocks/TreeBlocks/Linden/Wood"); -// TextureLindenLeaves = GetDataTexture("Blocks/TreeBlocks/Linden/Leaves"); - -// // Pine -// pineLeavesTexture = GetDataTexture("Blocks/TreeBlocks/Pine/Leaves"); -// pineWoodTexture = GetDataTexture("Blocks/TreeBlocks/Pine/Wood"); - -// // Apple -// TextureAppleWood = GetDataTexture("Blocks/TreeBlocks/Apple/Wood"); -// TextureAppleLeaves = GetDataTexture("Blocks/TreeBlocks/Apple/Leaves"); -// TextureAppleBlossom = GetDataTexture("Blocks/TreeBlocks/Apple/Blossom"); -// TextureAppleLeavesWithApples = GetDataTexture("Blocks/TreeBlocks/Apple/LeavesWithApples"); - -// // Cherry -// cherryWoodTexture = GetDataTexture("Blocks/TreeBlocks/Cherry/Wood"); -// TextureCherryLeaves = GetDataTexture("Blocks/TreeBlocks/Cherry/Leaves"); -// TextureCherryBlossom = GetDataTexture("Blocks/TreeBlocks/Cherry/Blossom"); -// TextureCherryLeavesWithCherries = GetDataTexture("Blocks/TreeBlocks/Cherry/LeavesWithCherries"); - -// // Plum -// TexturePlumWood = GetDataTexture("Blocks/TreeBlocks/Plum/Wood"); -// TexturePlumLeaves = GetDataTexture("Blocks/TreeBlocks/Plum/Leaves"); -// TexturePlumBlossom = GetDataTexture("Blocks/TreeBlocks/Plum/Blossom"); -// TexturePlumLeavesWithPlums = GetDataTexture("Blocks/TreeBlocks/Plum/LeavesWithPlums"); - -// // Orange -// TextureOrangeLeaves=GetDataTexture("Blocks/TreeBlocks/Orange/Leaves"); -// TextureOrangeLeavesWithOranges=GetDataTexture("Blocks/TreeBlocks/Orange/LeavesWithOranges"); -// TextureOrangeWood=GetDataTexture("Blocks/TreeBlocks/Orange/Wood"); - -// // Lemon -// TextureLemonWood=GetDataTexture("Blocks/TreeBlocks/Lemon/Wood"); -// TextureLemonLeaves=GetDataTexture("Blocks/TreeBlocks/Lemon/Leaves"); -// lemonLeavesWithLemonsTexture=GetDataTexture("Blocks/TreeBlocks/Lemon/LeavesWithLemons"); - -// // Olive -// TextureOliveLeavesWithOlives=GetDataTexture("Blocks/TreeBlocks/Olive/LeavesWithOlives"); -// TextureOliveLeaves=GetDataTexture("Blocks/TreeBlocks/Olive/Leaves"); -// TextureOliveWood=GetDataTexture("Blocks/TreeBlocks/Olive/Wood"); - -// // Mangrove -// TextureMangroveLeaves=GetDataTexture("Blocks/TreeBlocks/Mangrove/Leaves"); -// TextureMangroveWood=GetDataTexture("Blocks/TreeBlocks/Mangrove/Wood"); - -// // Willow -// TextureWillowLeaves=GetDataTexture("Blocks/TreeBlocks/Willow/Leaves"); -// TextureWillowWood=GetDataTexture("Blocks/TreeBlocks/Willow/Wood"); - -// // Eucaliptus -// TextureEucalyptusLeaves=GetDataTexture("Blocks/TreeBlocks/Eucalyptus/Leaves"); -// TextureEucalyptusWood=GetDataTexture("Blocks/TreeBlocks/Eucalyptus/Wood"); - -// // Rubber -// TextureRubberTreeLeaves=GetDataTexture("Blocks/TreeBlocks/RubberTree/Leaves"); -// TextureRubberTreeWood=GetDataTexture("Blocks/TreeBlocks/RubberTree/Wood"); - -// // Accacia -// TextureAcaciaLeaves=GetDataTexture("Blocks/TreeBlocks/Acacia/Leaves"); -// TextureAcaciaWood=GetDataTexture("Blocks/TreeBlocks/Acacia/Wood"); - -// // Kapok -// TextureKapokBlossom=GetDataTexture("Blocks/TreeBlocks/Kapok/Blossom"); -// TextureKapokLeavesFibre=GetDataTexture("Blocks/TreeBlocks/Kapok/LeavesWithFibre"); -// TextureKapokLeaves=GetDataTexture("Blocks/TreeBlocks/Kapok/Leaves"); -// TextureKapokWood=GetDataTexture("Blocks/TreeBlocks/Kapok/Wood"); -// #endregion - -// #region Saplings -// cherrySaplingTexture = GetDataTexture("Plants/Saplings/Cherry"); -// oakSaplingTexture = GetDataTexture("Plants/Saplings/Oak"); -// spruceSaplingTexture = GetDataTexture("Plants/Saplings/Spruce"); -// TextureLindenSapling = GetDataTexture("Plants/Saplings/Linden"); -// TextureAppleSapling = GetDataTexture("Plants/Saplings/Apple"); -// plumSaplingTexture = GetDataTexture("Plants/Saplings/Plum"); -// TextureMangroveSapling=GetDataTexture("Plants/Saplings/Mangrove"); -// lemonSaplingTexture=GetDataTexture("Plants/Saplings/Lemon"); -// orangeSaplingTexture=GetDataTexture("Plants/Saplings/Orange"); -// pineSaplingTexture = GetDataTexture("Plants/Saplings/Pine"); -// TextureWillowSapling=GetDataTexture("Plants/Saplings/Willow"); -// TextureEucalyptusSapling=GetDataTexture("Plants/Saplings/Eucalyptus"); -// TextureOliveSapling=GetDataTexture("Plants/Saplings/Olive"); -// TextureRubberTreeSapling=GetDataTexture("Plants/Saplings/RubberTree"); -// TextureAcaciaSapling=GetDataTexture("Plants/Saplings/Acacia"); -// TextureKapokSapling=GetDataTexture("Plants/Saplings/Kapok"); -// #endregion - -// #region Plants -// branchWithoutTexture=GetDataTexture("Plants/Branch/Without"); -// branchALittle1Texture=GetDataTexture("Plants/Branch/Little1"); -// branchALittle2Texture=GetDataTexture("Plants/Branch/Little2"); -// branchFullTexture=GetDataTexture("Plants/Branch/Full"); - -// plantAloreTexture = GetDataTexture("Plants/Flowers/Alore"); -// plantCarrotTexture = GetDataTexture("Plants/ForInventory/Carrot"); -// plantOnionTexture = GetDataTexture("Plants/ForInventory/Onion"); -// plantPeasTexture = GetDataTexture("Plants/ForInventory/Peas"); -// grassForestTexture = GetDataTexture("Plants/Grass/Forest"); -// grassPlainsTexture = GetDataTexture("Plants/Grass/Plains"); -// grassJungleTexture = GetDataTexture("Plants/Grass/Jungle"); -// grassDesertTexture = GetDataTexture("Plants/Grass/Desert"); -// grassHillsTexture = GetDataTexture("Plants/Grass/Hills"); -// strawberryPlantTexture = GetDataTexture("Plants/Grow/Strawberry"); -// rashberryPlantTexture = GetDataTexture("Plants/Grow/Rashberry"); -// wheatTexture = GetDataTexture("Plants/Grow/WheatGrow"); -// plantDandelionTexture = GetDataTexture("Plants/Flowers/Dandelion"); -// plantOrchidTexture = GetDataTexture("Plants/Flowers/Orchid"); -// plantRoseTexture = GetDataTexture("Plants/Flowers/Rose"); -// plantVioletTexture = GetDataTexture("Plants/Flowers/Violet"); -// cactusLittleTexture = GetDataTexture("Plants/Cactus/Small"); -// cactusBigTexture = GetDataTexture("Plants/Cactus/Big"); -// blueberryPlantTexture=GetDataTexture("Plants/Grow/Blueberry"); - -// coralTexture=GetDataTexture("Plants/Flowers/Coral"); -// flaxTexture=GetDataTexture("Plants/Grow/Flax"); -// toadstoolTexture=GetDataTexture("Plants/Mushrooms/Toadstoll"); -// champignonTexture=GetDataTexture("Plants/Mushrooms/Champignon"); -// sugarCaneTexture=GetDataTexture("Plants/Flowers/Sugarcane"); -// seaweedTexture=GetDataTexture("Plants/Flowers/Seaweed"); -// heatherTexture=GetDataTexture("Plants/Flowers/Heather"); -// boletusTexture=GetDataTexture("Plants/Mushrooms/Boletus"); -// lianaTexture = GetDataTexture("Plants/Flowers/Liana"); -// #endregion - -// #region Stone -// mudstoneTexture=GetDataTexture("Blocks/BasicBlocks/Mudstone"); -// dolomiteTexture=GetDataTexture("Blocks/BasicBlocks/Dolomite"); -// basaltTexture=GetDataTexture("Blocks/BasicBlocks/Basalt"); -// limestoneTexture=GetDataTexture("Blocks/BasicBlocks/Limestone"); -// rhyoliteTexture=GetDataTexture("Blocks/BasicBlocks/Rhyolite"); -// gneissTexture=GetDataTexture("Blocks/BasicBlocks/Gneiss"); -// sandstoneTexture=GetDataTexture("Blocks/BasicBlocks/SandStone"); -// schistTexture=GetDataTexture("Blocks/BasicBlocks/Schist"); -// gabbroTexture=GetDataTexture("Blocks/BasicBlocks/Gabbro"); -// dioritTexture=GetDataTexture("Blocks/BasicBlocks/Diorit"); -// anorthositeTexture=GetDataTexture("Blocks/BasicBlocks/Anorthosite"); -// regoliteTexture=GetDataTexture("Blocks/BasicBlocks/Regolite"); -// flintTexture=GetDataTexture("Blocks/BasicBlocks/Flint"); -// #endregion - -// #region Ore -// TextureOreCoal = GetDataTexture("Blocks/OreBlocks/Coal"); -// TextureOreCopper = GetDataTexture("Blocks/OreBlocks/Copper"); -// TextureOreTin = GetDataTexture("Blocks/OreBlocks/Tin"); -// TextureOreGold = GetDataTexture("Blocks/OreBlocks/Gold"); -// TextureOreSilver = GetDataTexture("Blocks/OreBlocks/Silver"); -// TextureOreIron = GetDataTexture("Blocks/OreBlocks/Iron"); -// TextureOreAluminium = GetDataTexture("Blocks/OreBlocks/Aluminium"); -// TextureOreSulfur = GetDataTexture("Blocks/OreBlocks/Sulfur"); -// TextureOreSaltpeter = GetDataTexture("Blocks/OreBlocks/Saltpeter"); - - -// #endregion - -// #region Basic -// // Grass block -// TextureGrassBlockPlains= GetDataTexture("Blocks/GrassBlocks/Plains"); -// TextureGrassBlockHills = GetDataTexture("Blocks/GrassBlocks/Hills"); -// TextureGrassBlockJungle = GetDataTexture("Blocks/GrassBlocks/Jungle"); -// TextureGrassBlockForest = GetDataTexture("Blocks/GrassBlocks/Forest"); -// TextureGrassBlockDesert = GetDataTexture("Blocks/GrassBlocks/Desert"); -// TextureGrassBlockClay= GetDataTexture("Blocks/GrassBlocks/Clay"); -// TextureGrassBlockCompost= GetDataTexture("Blocks/GrassBlocks/Compost"); -// TextureGrassBlockSnow= GetDataTexture("Blocks/GrassBlocks/Snow"); - -// // Sand -// sandTexture = GetDataTexture("Blocks/BasicBlocks/Sand"); -// TextureRedSand=GetDataTexture("Blocks/BasicBlocks/Redsand"); - -// // Liquid -// waterTexture = GetDataTexture("Blocks/BasicBlocks/Water"); -// oilTexture = GetDataTexture("Blocks/OreBlocks/Oil"); - -// TextureDirt = GetDataTexture("Blocks/BasicBlocks/Dirt"); -// gravelTexture = GetDataTexture("Blocks/BasicBlocks/Gravel"); -// clayTexture= GetDataTexture("Blocks/BasicBlocks/Clay"); -// iceTexture = GetDataTexture("Blocks/BasicBlocks/Ice"); -// snowTexture = GetDataTexture("Blocks/BasicBlocks/snow"); -// snowTopTexture = GetDataTexture("Blocks/BasicBlocks/SnowTop"); -// cobblestoneTexture = GetDataTexture("Blocks/BasicBlocks/Cobblestone"); - -// #endregion - -// #region Backgrounds -// // Basic -// backgroundDirtTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Dirt"); -// backgroundGravelTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Gravel"); -// backgroundSandTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Sand"); -// backgroundCobblestoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Cobblestone"); -// backgroundRegoliteTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Regolite"); -// backgroundRedSandTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/RedSand"); -// backgroundClayTexture=GetDataTexture("Blocks/BlockBackgrounds/Other/Clay"); - -// // Stone -// backgroundAnorthositeTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Anorthosite"); -// backgroundBasaltTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Basalt"); -// backgroundDioritTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Diorit"); -// backgroundDolomiteTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Dolomite"); -// backgroundFlintTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Flint"); -// backgroundGabbroTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Gabbro"); -// backgroundGneissTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Gneiss"); -// backgroundLimestoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Limestone"); -// backgroundMudstoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Mudstone"); -// backgroundRhyoliteTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Rhyolite"); -// backgroundSandstoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Sandstone"); -// backgroundSchistTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Schist"); - -// // Ore -// TextureBackSulfurOre= GetDataTexture("Blocks/BlockBackgrounds/Ore/Sulfur"); -// TextureBackSaltpeterOre= GetDataTexture("Blocks/BlockBackgrounds/Ore/Saltpeter"); -// backgroundCoalTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Coal"); -// backgroundCopperTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Copper"); -// backgroundTinTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Tin"); -// backgroundIronTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Iron"); -// backgroundAluminiumTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Aluminium"); -// backgroundSilverTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Silver"); -// backgroundGoldTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Gold"); -// #endregion - -// if (easter) { -// TextureEggDropE=new Texture2D[4]{ -// GetDataTexture("Blocks/BasicBlocks/eggdrop2"), -// GetDataTexture("Blocks/BasicBlocks/eggdrop3"), -// GetDataTexture("Blocks/BasicBlocks/eggdrop4"), -// GetDataTexture("Blocks/BasicBlocks/eggdrop5"), -// }; -// } - -// TextureChristmasStar=GetDataTexture("Blocks/CraftedBlocks/Star"); - -// TextureWaterGraystyle=GetDataTexture("Blocks/BasicBlocks/WaterGraystyle"); -// TextureEggDrop=GetDataTexture("Blocks/BasicBlocks/eggdrop"); -// CompostTexture=GetDataTexture("Blocks/BasicBlocks/Compost"); - -// roof1Texture=GetDataTexture("Blocks/CraftedBlocks/Roof1"); -// roof2Texture=GetDataTexture("Blocks/CraftedBlocks/Roof2"); -// flagTexture = GetDataTexture("Blocks/CraftedBlocks/Flag"); -// ladderTexture = GetDataTexture("Blocks/CraftedBlocks/Ladder"); -// TextureRocks = new Texture2D[] { -// GetDataTexture("Blocks/BasicBlocks/Rocks0"), -// GetDataTexture("Blocks/BasicBlocks/Rocks1"), -// GetDataTexture("Blocks/BasicBlocks/Rocks2"), -// GetDataTexture("Blocks/BasicBlocks/Rocks3") -// }; -// bricksTexture = GetDataTexture("Blocks/CraftedBlocks/Bricks"); -// glassTexture = GetDataTexture("Blocks/CraftedBlocks/Glass"); -// hayBlockTexture = GetDataTexture("Blocks/CraftedBlocks/HayBlock"); -// planksTexture = GetDataTexture("Blocks/CraftedBlocks/Planks"); -// ItemRocketTexture = GetDataTexture("Blocks/ForInventory/Rocket"); -// ItemWaterMillTexture = GetDataTexture("Blocks/ForInventory/WaterMill"); -// ItemWindMillTexture = GetDataTexture("Blocks/ForInventory/WindMill"); -// ItemDoorTexture = GetDataTexture("Blocks/ForInventory/Door"); -// ItemFlagTexture = GetDataTexture("Blocks/ForInventory/Flag"); -// labelOneTexture = GetDataTexture("Blocks/ForInventory/Label"); -// maceratorOneTexture = GetDataTexture("Blocks/ForInventory/Macerator"); -// furnaceStoneOneTexture = GetDataTexture("Blocks/ForInventory/FurnaceStone"); -// furnaceElectricOneTexture = GetDataTexture("Blocks/ForInventory/FurnaceElectric"); -// torchInvTexture = GetDataTexture("Blocks/ForInventory/Torch"); -// advancedSpaceBackTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceBack"); -// advancedSpaceWindowTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceWindow"); -// advancedSpaceBlockTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceBlok"); -// advancedSpacePart1Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart"); -// advancedSpacePart2Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart2"); -// advancedSpacePart3Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart3"); -// advancedSpacePart4Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart4"); -// advancedSpaceFloorTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceFloor"); -// doorInvTexture=GetDataTexture("Blocks/ForInventory/Door"); -// lavaTexture=GetDataTexture("Blocks/BasicBlocks/Lava"); -// #endregion - -// #region Other -// lightMaskLineTexture=GetDataTexture("Particles/lightMaskLine"); -// lightMaskTexture=GetDataTexture("Particles/lightMask"); -// lightMaskRoundTexture=GetDataTexture("Particles/lightMaskRound"); - -// solidFuelSmokeTexture=GetDataTexture("Particles/AnimationsRocket/Solid"); - -// messageLeft= GetDataTexture("Particles/MessageBox/Left"); -// messageCenter = GetDataTexture("Particles/MessageBox/Center"); -// messageRight = GetDataTexture("Particles/MessageBox/Right"); - -// invStrawberryTexture=GetDataTexture("Plants/ForInventory/Strawberry"); -// invRashberryTexture=GetDataTexture("Plants/ForInventory/Rashberry"); -// invBlueberryTexture=GetDataTexture("Plants/ForInventory/Blueberry"); -// flaxInvTexture=GetDataTexture("Plants/ForInventory/Flax"); -// barEnergyTexture=GetDataTexture("Bars/Lightning"); -// scrollbarUpTexture=GetDataTexture("Buttons/Scrollbar/Top"); -// scrollbarBetweenTexture=GetDataTexture("Buttons/Scrollbar/Center"); -// scrollbarDownTexture=GetDataTexture("Buttons/Scrollbar/Bottom"); -// radioInvTexture=GetDataTexture("Blocks/ForInventory/Radio"); -// sunTexture = GetDataTexture("Particles/Sun"); - -// fishTexture0 = GetDataTexture("Animals/Fish/Fish0"); -// fishTexture1 = GetDataTexture("Animals/Fish/Fish1"); - -// RadioButtonPause=GetDataTexture("Buttons/Radio/Pause"); -// RadioButtonPlay=GetDataTexture("Buttons/Radio/Play"); -// chickenEatTexture = GetDataTexture("Animals/Chicken/Eating"); -// chickenWalkTexture = GetDataTexture("Animals/Chicken/Walking"); -// rabbitStillTexture = GetDataTexture("Animals/Rabbit/Still"); -// chickenStillTexture = GetDataTexture("Animals/Chicken/Still"); - -// rabbitEatTexture = GetDataTexture("Animals/Rabbit/Eating"); -// rabbitWalkTexture = GetDataTexture("Animals/Rabbit/Walking"); -// rabbitJumpTexture = GetDataTexture("Animals/Rabbit/Jumping"); - -//destructionTexture = GetDataTexture("Animations/destruction"); -// TextureMoon = GetDataTexture("Animations/Moon"); -// barEatTexture= GetDataTexture("Bars/Eat"); -// barWaterTexture = GetDataTexture("Bars/Water"); -// barOxygenTexture = GetDataTexture("Bars/Oxygen"); -// barHeartTexture = GetDataTexture("Bars/Heart"); - -// #endregion - -// #region Player -// string dirLegs=(Setting.MaturePlayer==0 ? "Young" : "")+(Setting.sex==Sex.Girl ? "Girl" : "Men"); -// string dirChest=Setting.sex==Sex.Men ? "0": Setting.MaturePlayer.ToString(); - -// if (Setting.sex==Sex.Girl) { -// TextureWalkingUpCensored=GetDataTexture("ClothesAnimations/Walking/UpUnderwear/Censored"); -// TextureStaticUpCensored=GetDataTexture("ClothesAnimations/Static/UpUnderwear/Censored"); -// TextureSwimmingUpCensored=GetDataTexture("ClothesAnimations/Swimming/UpUnderwear/Censored"); -// } - -// // Hair -// if (Setting.hairType!=0) { -// TexturePlayerStaticHair=GetDataTexture("ClothesAnimations/Static/Body/Hair/"+Setting.hairType); -// TexturePlayerWalkingHair=GetDataTexture("ClothesAnimations/Walking/Body/Hair/"+Setting.hairType); -// } - -// // Moustage -// if (Setting.moustageType!=0) { -// TexturePlayerWalkingMoustage=GetDataTexture("ClothesAnimations/Walking/Body/Moustage/"+Setting.moustageType); -// TexturePlayerStaticMoustage=GetDataTexture("ClothesAnimations/Static/Body/Moustage/"+Setting.moustageType); -// } - -// // Face -// TexturePlayerWalkingFace=GetDataTexture("ClothesAnimations/Walking/Body/Face"); -// TexturePlayerStaticFace=GetDataTexture("ClothesAnimations/Static/Body/Face"); - -// // Mouth -// TexturePlayerStaticMouth=GetDataTexture("ClothesAnimations/Static/Body/Mouth/Normal"); -// TexturePlayerWalkingMouth=GetDataTexture("ClothesAnimations/Walking/Body/Mouth/Normal"); - -// // Eyes -// TexturePlayerStaticEyes=GetDataTexture("ClothesAnimations/Static/Body/Eyes/"+Setting.eyesType); -// TexturePlayerWalkingEyes=GetDataTexture("ClothesAnimations/Walking/Body/Eyes/"+Setting.eyesType); - -// // Feet -// TexturePlayerStaticFeet=GetDataTexture("ClothesAnimations/Static/Body/Feet"); -// TexturePlayerWalkingFeet=GetDataTexture("ClothesAnimations/Walking/Body/Feet"); -// TexturePlayerSwimmingFeet=GetDataTexture("ClothesAnimations/Swimming/Body/Feet"); - -// TexturePlayerWalkingFeetForShoes=GetDataTexture("ClothesAnimations/Walking/Body/FeetForShoes"); - -// // Legs -// TexturePlayerStaticLegs=GetDataTexture("ClothesAnimations/Static/Body/Legs/"+dirLegs); -// TexturePlayerWalkingLegs=GetDataTexture("ClothesAnimations/Walking/Body/Legs/"+dirLegs); -// TexturePlayerSwimmingLegs=GetDataTexture("ClothesAnimations/Swimming/Body/Legs/"+dirLegs); - -// // Chest -// TexturePlayerStaticChest=GetDataTexture("ClothesAnimations/Static/Body/Chest/"+dirChest); -// TexturePlayerWalkingChest=GetDataTexture("ClothesAnimations/Walking/Body/Chest/"+dirChest); -// //TexturePlayerSwimmingChest=GetDataTexture("ClothesAnimations/Swimming/Body/Chest/"+dirChest); - - -// // Censored -// TextureWalkingDownCensored=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Censored"); -// TextureStaticDownCensored=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Censored"); -// TextureSwimmingDownCensored=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Censored"); - -// //TexturePlayerSwimmingLegsWoman=Rabcr.ColorizeTexture(GetDataTexture("ClothesAnimations/Swimming/Legs/YoungGirl"),Setting.ColorSkin); - -// TextureHand=GetDataTexture(@"ClothesAnimations\Hand"); -// //TextureHandDown=GetDataTexture(@"ClothesAnimations\Static\Hand\Down"); - -// #region Boots -// ClothesFormalShoes=new ClothesTypeBoots{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/FormalShoes"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/FormalShoes"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/FormalShoes"), -// Color=ColorWhite, -// }; - -// ClothesPumps=new ClothesTypeBoots{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/Pumps"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/Pumps"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/Pumps"), -// Colorize=true, -// }; - -// ClothesSneakers=new ClothesTypeBoots{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/Sneakers"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/Sneakers"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/Sneakers"), -// Colorize=true, -// }; - -// ClothesSpaceBoots=new ClothesTypeBoots{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/SpaceBoots"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/SpaceBoots"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/SpaceBoots"), -// Color=ColorWhite, -// }; -// #endregion - -// #region Trousers -// ClothesJeans = new ClothesTypeTrousers { -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/Jeans"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/Jeans"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/Jeans"), -// Colorize=true, -// }; - -// ClothesShorts=new ClothesTypeTrousers{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/Shorts"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/Shorts"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/Shorts"), -// ShowBodyLegs=true, -// Colorize=true, -// }; -// ClothesSkirt=new ClothesTypeTrousers{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/Skirt"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/Skirt"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/Skirt"), -// ShowBodyLegs=true, -// Colorize=true, -// }; -// ClothesArmyTrousers=new ClothesTypeTrousers{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/ArmyTrousers"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/ArmyTrousers"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/ArmyTrousers"), -// Colorize=true, -// }; -// ClothesSpaceTrousers=new ClothesTypeTrousers{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/SpaceTrousers"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/SpaceTrousers"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/SpaceTrousers"), -// Color=ColorWhite, -// }; -// #endregion - -// #region TShirt -// ClothesTShirt=new ClothesTypeTShirt{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/TShirt"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/TShirt"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/Chest/TShirt"), -// //Texture2DClothHandDown=GetDataTexture("ClothesAnimations/Hand/Chest/Down/TShirt"), -// Colorize=true, -// handSize=HandClothSize.NearlyFull, -// }; -// ClothesShirt=new ClothesTypeTShirt{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/Shirt"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/Shirt"), -// // Texture2DClothHandUp=GetDataTexture("ClothesAnimations/Hand/Chest/Up/Shirt"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/Chest/Shirt"), -// Colorize=true, -// handSize=HandClothSize.NearlyFull, -// }; -// ClothesDress=new ClothesTypeTShirt{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/Dress"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/Dress"), -// // Texture2DClothHandUp=GetDataTexture("ClothesAnimations/Hand/Chest/Up/Dress"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/Chest/Dress"), -// Colorize=true, -// handSize=HandClothSize.NearlyFull, -// }; -// ClothesTop=new ClothesTypeTShirt{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/Top"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/Top"), -// // Texture2DClothHandUp=GetDataTexture("ClothesAnimations/Hand/ChestTop/Up/Top"), -// // Texture2DClothHandDown=GetDataTexture("ClothesAnimations/Hand/ChestTop/Down/Top"), -// Colorize=true, -// handSize=HandClothSize.None, -// ShowBodyChest=true, -// }; -// #endregion - -// #region Helmet -// ClothesCap=new ClothesTypeHelmet{ -// TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Cap"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Cap"), -// Colorize=true, -// }; -// ClothesHad=new ClothesTypeHelmet{ -// TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Had"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Had"), -// Color=ColorWhite, -// }; -// ClothesCrown=new ClothesTypeHelmet{ -// TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Crown"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Crown"), -// Color=ColorWhite, -// }; -// ClothesSpaceHelmet=new ClothesTypeHelmet{ -// TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/SpaceHelmet"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/SpaceHelmet"), -// Color=ColorWhite, -// }; -// #endregion - -// #region UnderwearDown -// ClothesUnderpants=new ClothesTypeUnderwearDown{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Underpants"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Underpants"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Underpants"), -// Colorize=true, -// }; -// ClothesBoxerShorts=new ClothesTypeUnderwearDown{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/BoxerShorts"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/BoxerShorts"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/BoxerShorts"), -// Colorize=true, -// }; -// ClothesPanties=new ClothesTypeUnderwearDown{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Panties"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Panties"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Panties"), -// Colorize=true, -// }; -// ClothesSwimsuit=new ClothesTypeUnderwearDown{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Swimsuit"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Swimsuit"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Swimsuit"), -// Colorize=true, -// }; -// ClothesBikiniDown=new ClothesTypeUnderwearDown{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Bikini"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Bikini"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Bikini"), -// Colorize=true, -// }; -// #endregion - -// #region UnderwearUp -// ClothesBra=new ClothesTypeUnderwearUp{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/UpUnderwear/Bra"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/UpUnderwear/Bra"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/UpUnderwear/Bra"), -// Colorize=true, -// }; -// ClothesBikiniTop=new ClothesTypeUnderwearUp{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/UpUnderwear/Bikini"), -// TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/UpUnderwear/Bikini"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/UpUnderwear/Bikini"), -// Colorize=true, -// }; -// #endregion - -// #region Coat -// ClothesCoatArmy=new ClothesTypeCoat{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/CoatArmy"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/CoatArmy"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/CoatArmy"), -// Colorize=true, -// handSize=HandClothSize.NearlyFull, -// }; -// ClothesCoat=new ClothesTypeCoat{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/Coat"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/Coat"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/Coat"), -// Colorize=true, -// handSize=HandClothSize.NearlyFull, -// }; -// ClothesJacketDenim=new ClothesTypeCoat{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/JacketDenim"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/JacketDenim"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/JacketDenim"), -// Colorize=true, -// handSize=HandClothSize.NearlyFull, -// }; -// ClothesJacketFormal=new ClothesTypeCoat{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/JacketFormal"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/JacketFormal"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/JacketFormal"), -// Colorize=true, -// handSize=HandClothSize.NearlyFull, -// }; -// ClothesJacketShort=new ClothesTypeCoat{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/JacketShort"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/JacketShort"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/JacketShort"), -// Colorize=true, -// handSize=HandClothSize.Half, -// }; -// ClothesSpaceSuit=new ClothesTypeCoat{ -// TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/SpaceSuit"), -// TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/SpaceSuit"), -// Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/SpaceSuit"), -// Color=ColorWhite, -// handSize=HandClothSize.Full, -// }; -// #endregion - - -// #endregion -// #endregion - -// inventoryScrollbar=new GameScrollbar(scrollbarUpTexture,scrollbarBetweenTexture,scrollbarDownTexture); -// creativeScrollbar=new GameScrollbar(scrollbarUpTexture,scrollbarBetweenTexture,scrollbarDownTexture); -// craftingScrollbar=new GameScrollbar(scrollbarUpTexture, scrollbarBetweenTexture, scrollbarDownTexture) { -// maxheight=4*40 -// }; - -// #region Set lists other -// energy=new List(); -// rainDots=new List(); -// lightsLamp=new List(); - -// Inventory=new List(); -// Crafting=new List(); -// Need=new List(); -// #endregion - -// #region Load buttons -// buttonClose=new ImgButton(GetDataTexture("Buttons/Square/Close")); -// buttonClosePopUp=new ImgButton(GetDataTexture("Buttons/Square/Close")); -// buttonInvTabBlocks=new ImgButton(GetDataTexture("Buttons/Square/Blocks")); -// buttonInvTabPlants=new ImgButton(GetDataTexture("Buttons/Square/Plants")); -// buttonInvTabTools=new ImgButton(GetDataTexture("Buttons/Square/Tools")); -// buttonInvTabMashines=new ImgButton(GetDataTexture("Buttons/Square/Mashines")); -// buttonInvTabItems=new ImgButton(GetDataTexture("Buttons/Square/Items")); -// buttonInvTabCeramics=new ImgButton(GetDataTexture("Buttons/Square/Ceramics")); -// buttonInvTabFood=new ImgButton(GetDataTexture("Buttons/Square/Food")); -// buttonInvTabGlass=new ImgButton(GetDataTexture("Buttons/Square/Glass")); -// buttonInvTabMaterials=new ImgButton(GetDataTexture("Buttons/Square/Materials")); -// buttonInvAnimals=new ImgButton(GetDataTexture("Buttons/Square/Animals")); - -// buttonRocket=new GameButtonSmall(Textures.ButtonCenter/*,spriteFont_small,spriteFont_medium*/) { -// Text="Odletět", -// //center=true -// }; - -// buttonRadio=new GameButtonSmall(Textures.ButtonCenter/*,spriteFont_small,spriteFont_medium*/) { -// Text="Otevřít", -// // center=true -// }; - -// { -// Texture2D button=GetDataTexture("Buttons/Other/Craft"); -// buttonNext=new GameButtonSmall(button) { Text="->" }; -// buttonPrev=new GameButtonSmall(button) { Text="<-" }; - -// buttonCraft1x=new GameButtonSmall(button) { Text="1×" }; -// buttonCraft10x=new GameButtonSmall(button) { Text="10×" }; -// buttonCraft100x=new GameButtonSmall(button) { Text="100×" }; -// } -// #endregion - -// #region Set lists other -// DroppedItems=new List(); -// windable=new List(); -// FurnaceStone=new List(); -// chunksWithPlants=new List(); -// Chargers=new List(); -// Miners=new List(); -// movingAnimals=new List(); -// Composters=new List(); - - -// energy=new List(); -// rainDots=new List(); -// lightsLamp=new List(); - -// // Inventory = new List(); -// Crafting=new List(); -// Need=new List(); -// #endregion - -// #region Set basic -// //fogTarget= new RenderTarget2D(Graphics, Graphics.Viewport.Width, Graphics.Viewport.Height); -// ZoomMatrix=Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); -// newKeyboardState=Keyboard.GetState(); -// newMouseState=Mouse.GetState(); -// oldKeyboardState=newKeyboardState; -// oldMouseState=newMouseState; -// previousScrollValue=oldMouseState.ScrollWheelValue; - -// for (int i = 0; i<50; i++) Crafting.Add(new DInt()); -// for (int i = 0; i<12; i++) Need.Add(new DInt()); - -// // if (Global.WorldDifficulty==2) { -// for (int i = 0; i<600; i++) Inventory.Add(new DInt(0, 0)); -// // } else for (int i = 0; i<200; i++) Inventory.Add(new DInt()); - -// maxInvCount=32+8; -// #endregion - -// //dayAlpha -// if (time>hour*6&&timehour*18&&time=hour*7&&time<=hour*18) { -// dayAlpha=1f; -// } else { -// dayAlpha=0.5f; -// } - - -// menu=new GameButtonMedium(Textures.ButtonCenter/*, spriteFont_medium, spriteFont_big*/) { -// Text="Zpět do menu", -// // center=true -// }; - -// state++; -// Resize(); -// } - -// public override void Shutdown() { -// exit=true; -// #region Send logout -// if (current==Current.Playing) { -// Queue.Add( -// new DataToSend { -// Bytes=new Data { -// To="{Server}", -// Cmd=Command.Logout -// }.ToByte(), -// Importance=Importance.VeryImportant -// } -// ); -// } - -// // if (cancelExit) { -// try { -// clientSocket.Disconnect(false); -// } catch { } -// try { -// clientSocket.Close(); -// clientSocket.Dispose(); -// } catch { } -// //} - -// #endregion - -// // return cancelExit; -// } - -// public override void Update(GameTime gameTime) { -// if (Queue.Count!=0) { -// try { -// if (Queue[0]!=null) { -// byte[] bytes = Queue[0].Bytes; -// clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null); -// } // } catch (Exception ex){ -// // Console.WriteLine(ex.Message+"2"); -// } finally { //Console.WriteLine("sending..."); -// Queue.RemoveAt(0); -// } -// } - -// if (Current.Playing!=current) { -// #region Mouse -// oldMouseState=newMouseState; -// previousScrollValue=oldMouseState.ScrollWheelValue; -// newMouseState=Mouse.GetState(); -// mouseLeftPress=false; -// mouseLeftRelease=false; -// mouseRightPress=false; -// mouseRightRelease=false; - -// if (newMouseState.LeftButton==ButtonState.Pressed) { -// mouseLeftDown=true; -// if (oldMouseState.LeftButton==ButtonState.Released) mouseLeftPress=true; -// } else { -// mouseLeftDown=false; -// if (oldMouseState.LeftButton==ButtonState.Pressed) mouseLeftRelease=true; -// } - -// if (newMouseState.RightButton==ButtonState.Pressed) { -// mouseRightDown=true; -// if (oldMouseState.RightButton==ButtonState.Released) mouseRightPress=true; -// } else { -// mouseRightDown=false; -// if (oldMouseState.RightButton==ButtonState.Pressed) mouseRightRelease=true; -// } -// SetMousePos(); -// //mousePosDiv16.X=(int)mousePos.X/16; -// //mousePosDiv16.Y=(int)mousePos.Y/16; - -// //mousePosRound.X=mousePosDiv16.X*16; -// //mousePosRound.Y=mousePosDiv16.Y*16; -// #endregion - -// //#region Set Mouse State and Keyboard -// //oldMouseState=newMouseState; -// //oldKeyboardState=newKeyboardState; - -// //newKeyboardState=Keyboard.GetState(); -// //newMouseState=Mouse.GetState(); - -// //mouseLeftPress=false; -// //mouseLeftRelease=false; - -// //if (newMouseState.LeftButton==ButtonState.Pressed) { -// // mouseLeftDown=true; -// // if (oldMouseState.LeftButton==ButtonState.Released) mouseLeftPress=true; -// //} else { -// // mouseLeftDown=false; -// // if (oldMouseState.LeftButton==ButtonState.Pressed) mouseLeftRelease=true; -// //} -// //#endregion - -// if (sn!="") { -// System.Windows.Forms.Form MyGameForm = (System.Windows.Forms.Form)System.Windows.Forms.Control.FromHandle(Rabcr.Game.Window.Handle); -// MyGameForm.Text=sn; - -// sn=""; -// } - -// if (menu.Update()) { -// Rabcr.GoTo(new Menu(new MenuMultiplayer())); -// } -// } else { - -// Rabcr.Game.Window.Title=serverName+" - "+Global.GameName; - -// #region Mouse -// oldMouseState=newMouseState; -// previousScrollValue=oldMouseState.ScrollWheelValue; -// newMouseState=Mouse.GetState(); -// mouseLeftPress=false; -// mouseLeftRelease=false; -// mouseRightPress=false; -// mouseRightRelease=false; - -// if (newMouseState.LeftButton==ButtonState.Pressed) { -// mouseLeftDown=true; -// if (oldMouseState.LeftButton==ButtonState.Released) mouseLeftPress=true; -// } else { -// mouseLeftDown=false; -// if (oldMouseState.LeftButton==ButtonState.Pressed) mouseLeftRelease=true; -// } - -// if (newMouseState.RightButton==ButtonState.Pressed) { -// mouseRightDown=true; -// if (oldMouseState.RightButton==ButtonState.Released) mouseRightPress=true; -// } else { -// mouseRightDown=false; -// if (oldMouseState.RightButton==ButtonState.Pressed) mouseRightRelease=true; -// } -// SetMousePos(); - -// mousePosDiv16.X=(int)mousePos.X/16; -// mousePosDiv16.Y=(int)mousePos.Y/16; - -// mousePosRound.X=mousePosDiv16.X*16; -// mousePosRound.Y=mousePosDiv16.Y*16; - -// mouseRealPos.X=newMouseState.X; -// mouseRealPos.Y=newMouseState.Y; -// #endregion - -// #region Keyboard -// oldKeyboardState=newKeyboardState; -// newKeyboardState=Keyboard.GetState(); - -// if (oldKeyboardState.IsKeyDown(Keys.F12)) { -// if (newKeyboardState.IsKeyUp(Keys.F12)) { -// GC.Collect(); -// GC.WaitForPendingFinalizers(); -// } -// } - -// if (oldKeyboardState.IsKeyDown(Keys.F1)) { -// if (newKeyboardState.IsKeyUp(Keys.F1)) { -// if (debug) { -// debug=false; - -// cpu.Close(); -// cpu.Dispose(); -// cpu=null; - -// ram.Close(); -// ram.Dispose(); -// ram=null; - -// cpuUsage.Close(); -// cpuUsage.Dispose(); -// cpuUsage=null; - -// freeRam.Close(); -// freeRam.Dispose(); -// freeRam=null; -// } else { -// // timer60=-1; -// string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; -// //cpu=new PerformanceCounter("Process", "Working Set - Private", processName); -// //ram =new PerformanceCounter("Process", "% Processor Time", processName); - -// //cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total"); -// //freeRam = new PerformanceCounter("Memory", "Available MBytes"); -// try { -// cpu=new PerformanceCounter() { -// CategoryName="Process", -// CounterName="% Processor Time", -// InstanceName=processName, -// }; -// ram=new PerformanceCounter() { -// CategoryName="Process", -// CounterName="Working Set - Private", -// InstanceName=processName, -// }; -// cpuUsage=new PerformanceCounter() { -// CategoryName="Processor", -// CounterName="% Processor Time", -// InstanceName="_Total", -// }; -// freeRam=new PerformanceCounter() { -// CategoryName="Memory", -// CounterName="Available MBytes" -// }; - -// // cpu=new PerformanceCounter("Process", "% Processor Time", processName); -// // ram =new PerformanceCounter("Process", "Working Set - Private", processName); - -// // cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total"); -// // freeRam = new PerformanceCounter("Memory", "Available MBytes"); - -// debug=true; -// } catch { -// System.Windows.Forms.MessageBox.Show("Chyba při inicializaci PerformanceCounter, Informace pro vývojáře budou skryty", "ERROR"); -// debug=false; -// } - -// } -// } -// } - -// if (oldKeyboardState.IsKeyDown(Keys.F2)) { -// if (newKeyboardState.IsKeyUp(Keys.F2)) { -// if (showInventory) showInventory=false; else showInventory=true; -// } -// } - -// if (oldKeyboardState.IsKeyDown(Keys.F3)) { -// if (newKeyboardState.IsKeyUp(Keys.F3)) { -// if (showPlayer) showPlayer=false; else showPlayer=true; -// } -// } - -// if (newKeyboardState.IsKeyDown(Setting.KeyExit)) { -// if (oldKeyboardState.IsKeyUp(Setting.KeyExit)) { -// ////////////////exit3, -// //Shutdown(); -// // Shutdown(); -// // Log.WriteLine("Odhlašování ze serveru"); -// Rabcr.GoTo(new Menu(new MenuMultiplayer())); - -// } -// } - -// if (newKeyboardState.IsKeyDown(Setting.KeyInventory)) { -// if (oldKeyboardState.IsKeyUp(Setting.KeyInventory)) { -// ChangeInventoryState(); - -// }// Console.WriteLine("!!!!!!!!!!!!!!!!!"); -// } - -// if (newKeyboardState.IsKeyDown(Setting.KeyMessage)) { -// if (oldKeyboardState.IsKeyUp(Setting.KeyMessage)) { -// if (inventory==0) inventory=InventoryType.Typing; -// } -// } -// #endregion - -// #region Player pos in Window -// if (PlayerX>TerrainLenght*16-Global.WindowWidth) SetPlayerPos(Global.WindowWidth, PlayerY); - -// if (PlayerX4||PlayerY-WindowCenterY>4||PlayerX-WindowCenterX<-4||PlayerY-WindowCenterY<-4) { -// WindowXPlayer=WindowXPlayer+(PlayerX-WindowCenterX)/16f; -// WindowYPlayer=WindowYPlayer+(PlayerY-WindowCenterY)/16f; - -// WindowXWithout=(int)WindowXPlayer; -// WindowYWithout=(int)WindowYPlayer; -// } - -// WindowCenterX=WindowXWithout+Global.WindowWidthHalf; -// WindowCenterY=WindowYWithout+Global.WindowHeightHalf; - -// WindowX=WindowCenterX-(int)(Global.WindowWidthHalf/Setting.Zoom); -// WindowY=WindowCenterY-(int)(Global.WindowHeightHalf/Setting.Zoom); - -// terrainStartIndexX=(WindowX-1)/16; -// terrainStartIndexY=WindowY/16; - -// if (terrainStartIndexX<0) terrainStartIndexX=0; -// if (terrainStartIndexY<0) terrainStartIndexY=0; - -// terrainStartIndexW=(int)((WindowX+Global.WindowWidth/Setting.Zoom)/16)+1; -// terrainStartIndexH=(int)((WindowY+Global.WindowHeight/Setting.Zoom)/16)+1; - -// if (terrainStartIndexW>TerrainLenght) terrainStartIndexW=TerrainLenght; -// if (terrainStartIndexH>124) terrainStartIndexH=124; -// if (terrainStartIndexH<0) terrainStartIndexH=0; - -// if (terrainStartIndexY>terrainStartIndexH) terrainStartIndexY=terrainStartIndexH; -// #endregion - -// #region Movement -// if (inventory==InventoryType.Normal) { -// if (newMouseState.ScrollWheelValue!=previousScrollValue) { -// if (newMouseState.ScrollWheelValuepreviousScrollValue) { -// if (boxSelected!=0) boxSelected--; -// } -// } - -// if (rocket) { -// if (rocketDown) PlayerY+=8; -// else PlayerY-=10; -// } else if (Global.WorldDifficulty==2) { - -// if (newKeyboardState.IsKeyDown(Keys.Up)) { -// if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY-=10; -// else PlayerY-=3; -// } - -// if (newKeyboardState.IsKeyDown(Keys.Down)) { -// if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY+=10; -// else PlayerY+=3; -// } - -// if (newKeyboardState.IsKeyDown(Keys.Left)) { -// if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX-=10; -// else PlayerX-=3; -// } - -// if (newKeyboardState.IsKeyDown(Keys.Right)) { -// if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX+=10; -// else PlayerX+=3; -// } - -// if (newKeyboardState.IsKeyDown(Keys.Left)) { -// if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX-=10; -// else PlayerX-=3; -// } -// } else { -// swimming=CheckWater(); -// bool canbreatheDuringSwimming = !CheckWaterUp(); -// waterDown=CheckWaterDown(); - -// //if (waterDown || swimming){ -// // barWater--; -// // if (barWater<0)barWater=0; -// //} - -// if (canbreatheDuringSwimming) { -// barOxygen--; -// if (barOxygen<0) barOxygen=0; -// } else { -// barOxygen+=0.05f; -// if (barOxygen>32) { -// barHeart+=.08f; -// if (barHeart>32) Die(Lang.Texts[161] /*"Nemůžeš dýchat vodu","You can't breathe water"*/); -// } -// } - -// if (newKeyboardState.IsKeyDown(Setting.KeyJump)) { -// if (CheckLadder()) { -// PlayerY--; - -// barEnergy+=0.01f; -// barWater+=0.01f; -// gravitySpeed=-2f; -// } else if (swimming) { -// PlayerY--; -// barEnergy+=0.01f; -// barWater+=0.01f; -// gravitySpeed=-1f; -// } else { -// if (distanceToGround==0) { -// if (gravitySpeed==0) { -// gravitySpeed=-7; -// PlayerY--; - -// barEnergy+=0.05f; -// } -// } -// } -// } - - -// // //playerImg+=20; -// // //if (playerImg==420)playerImg=0; -// // if (newKeyboardState.IsKeyDown(Setting.KeyJump)) { -// // if (distanceToGround==0 && gravitySpeed==0){ -// // gravitySpeed=-7; -// // PlayerY--; - -// // barEnergy+=0.05f; -// // } -// //} -// if (!swimming&&!waterDown) playerState=0; - -// // playerState=0; - -// if (newKeyboardState.IsKeyDown(Setting.KeyLeft)) { -// int dis = 1000; -// for (int y = (PlayerY-20-1)/16; y<(PlayerY+20)/16; y++) { -// int x = (PlayerX-11-16)/16; -// if (terrain[x]!=null) { -// if (y>=0&&y<125) { -// if (terrain[x].IsSolidBlocks[y]==MBlockState.Exists) { -// if (PlayerX-11-x*1618) { -// if (newKeyboardState.IsKeyDown(Setting.KeyRun)) { -// if (barEnergy<31) { -// if (dis<4) PlayerX-=dis; -// else PlayerX-=4; - -// barEnergy+=0.08f; - -// playerImg+=40; - -// if (walkingSoundDuration<0) { -// if (Global.HasSoundGraphics) { -// SoundEffects.Steps.Play(); -// walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; -// } -// } else walkingSoundDuration--; - -// } else { -// if (dis==1) PlayerX-=dis; -// else PlayerX-=2; - -// barEnergy+=0.045f; - -// playerImg+=20; - -// if (walkingSoundDuration<0) { -// if (Global.HasSoundGraphics) { -// SoundEffects.Steps.Play(); -// walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; -// } -// } else walkingSoundDuration--; -// } -// if (playerImg>=420) playerImg=0; - -// } else { -// if (dis==1) PlayerX-=dis; -// else PlayerX-=2; - -// barEnergy+=0.045f; - -// playerImg+=20; -// if (playerImg>=420) playerImg=0; - -// if (walkingSoundDuration<0) { -// if (Global.HasSoundGraphics) { -// SoundEffects.Steps.Play(); -// walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; -// } -// } else walkingSoundDuration--; -// } -// playerState=1; -// } -// } - -// if (newKeyboardState.IsKeyDown(Setting.KeyRight)) { -// int dis = 1000; -// for (int y = (PlayerY-20/*-16*/-1)/16; y<(PlayerY+20)/16; y++) { -// int x = (PlayerX+11+16)/16; -// if (terrain[x]!=null) { -// if (y>=0&&y<125) { -// if (terrain[x].IsSolidBlocks[y]==MBlockState.Exists) { -// if (x*16-PlayerX-112) { -// if (newKeyboardState.IsKeyDown(Setting.KeyRun)) { -// if (barEnergy<31) { -// if (dis<4) PlayerX+=dis; -// else PlayerX+=4; - -// barEnergy+=0.08f; - -// playerImg+=40; - -// if (walkingSoundDuration<0) { -// if (Global.HasSoundGraphics) { -// SoundEffects.Steps.Play(); -// walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; -// } -// } else walkingSoundDuration--; -// } else { -// if (dis==1) PlayerX+=dis; -// else PlayerX+=2; - -// barEnergy+=0.045f; - -// playerImg+=20; - -// if (walkingSoundDuration<0) { -// if (Global.HasSoundGraphics) { -// SoundEffects.Steps.Play(); -// walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; -// } -// } else walkingSoundDuration--; -// } - -// if (playerImg>=420) playerImg=0; -// } else { -// if (dis==1) PlayerX+=dis; -// else PlayerX+=2; - -// barEnergy+=0.045f; - -// playerImg+=20; -// if (playerImg>=420) playerImg=0; - -// if (walkingSoundDuration<0) { -// if (Global.HasSoundGraphics) { -// SoundEffects.Steps.Play(); -// walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; -// } -// } else walkingSoundDuration--; -// } -// playerState=2; -// } - -// } - -// if (barEnergy>32) barEnergy=32; - -// PlayerGravity(); -// // } -// } -// #endregion - -// // #region Mouse scroll -// // if (newMouseState.ScrollWheelValue != previousScrollValue) { -// // if (inventory==0) { -// //if (newMouseState.ScrollWheelValue < previousScrollValue) { -// // if (boxSelected<4) boxSelected++; -// //} else if (newMouseState.ScrollWheelValue > previousScrollValue) { -// // if (boxSelected!=0) boxSelected--; -// //} -// // } else if (inventory==InventoryType.BasicInv) { -// // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4 && newMouseState.XGlobal.WindowHeightHalf-200+2 && newMouseState.YmaxInvCount) inventoryScrollbarValue=maxInvCount; - -// // } else if (newMouseState.ScrollWheelValue > previousScrollValue) { -// // inventoryScrollbarValue-=9; -// // if (inventoryScrollbarValue<0) inventoryScrollbarValue=0; -// // } -// // if (maxInvCount<45) inventoryScrollbarValue=0; -// // } else if (newMouseState.X>Global.WindowWidthHalf-300+4+40 && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8 && newMouseState.YinventoryScrollbarValueCraftingMax) inventoryScrollbarValueCrafting=inventoryScrollbarValueCraftingMax; - -// // } else if (newMouseState.ScrollWheelValue > previousScrollValue) { -// // inventoryScrollbarValueCrafting-=6; -// // if (inventoryScrollbarValueCrafting<0) inventoryScrollbarValueCrafting=0; -// // } -// // if (inventoryScrollbarValueCraftingMax<6*4) inventoryScrollbarValueCrafting=0; -// // } -// // } -// // } -// // #endregion - -// // #region Player pos in Window -// // if (PlayerX> TerrainLenght * 16-Global.WindowWidth) { -// // SetPlayerPos(Global.WindowWidth, PlayerY); -// // // PlayerX=(int)(Global.WindowWidthHalf*Setting.Zoom); -// // } -// // if (PlayerX4 || PlayerY-WindowCenterY>4 || PlayerX-WindowCenterX<-4 || PlayerY-WindowCenterY<-4){ -// // WindowXPlayer=WindowXPlayer+(PlayerX-WindowCenterX)/16f; -// // WindowYPlayer=WindowYPlayer+(PlayerY-WindowCenterY)/16f; - -// // WindowXWithout=(int)WindowXPlayer; -// // WindowYWithout=(int)WindowYPlayer; -// // } - -// // WindowCenterX=WindowXWithout+Global.WindowWidthHalf; -// // WindowCenterY=WindowYWithout+Global.WindowHeightHalf; - -// // WindowX=WindowCenterX-(int)(Global.WindowWidthHalf/Setting.Zoom); -// // WindowY=WindowCenterY-(int)(Global.WindowHeightHalf/Setting.Zoom); - -// //// Console.WriteLine(WindowX); -// // //int deltaX = (int)((Global.WindowWidth-Global.WindowWidth/Setting.Zoom)/2); -// // //int deltaY = (int)((Global.WindowHeight-Global.WindowHeight/Setting.Zoom)/2); -// // terrainStartIndexX=(WindowX-1)/16; -// // terrainStartIndexY=WindowY/16; - -// // if (terrainStartIndexX<0)terrainStartIndexX=0; -// // if (terrainStartIndexY<0)terrainStartIndexY=0; - -// // terrainStartIndexW=(int)((WindowX+Global.WindowWidth/Setting.Zoom)/16)+1; -// // terrainStartIndexH=(int)((WindowY+Global.WindowHeight/Setting.Zoom)/16)+1; - -// // if (terrainStartIndexW>TerrainLenght)terrainStartIndexW=TerrainLenght; -// // if (terrainStartIndexH>125) terrainStartIndexH=125; - -// // #endregion -// if (diserpeard==250) { DoCommand(); } -// if (diserpeard>0) diserpeard--; - -// #region Game - destruction + place blocks + drop item -// if (mouseRightDown) MouseRightAction(); -// if (mouseRightPress) ItemEat(); - -// if (mouseLeftDown) { -// if (destroing) { -// if (destroyBlock.X==mousePosDiv16.X&&destroyBlock.Y==mousePosDiv16.Y) { -// destroingIndex++; - -// if (destroingIndex>destringMaxIndex) { -// if (destroyBlock.X>spawnX/16+safeSpawn||destroyBlock.X0&&mousePosDiv16.Y<125) { -// if (terrain[mousePosDiv16.X]!=null) { -// Destroy(mousePosDiv16.X, mousePosDiv16.Y); -// } -// } -// } -// } else destroing=false; - -// if (newKeyboardState.IsKeyDown(Setting.KeyDropItem)) { -// if (oldKeyboardState.IsKeyUp(Setting.KeyDropItem)) { -// if (Inventory[boxSelected].Y>0) { -// if (PlayerX-mousePos.X>0) { -// DroppedItems.Add(new Item { -// X=PlayerX-11-16-1, -// Y=PlayerY-22, -// Count=1, -// Texture=ItemIdToTexture(Inventory[boxSelected].X), -// Id=(Items)Inventory[boxSelected].X, -// }); -// } else { -// DroppedItems.Add(new Item { -// X=PlayerX+11+1, -// Y=PlayerY-22, -// Count=1, -// Texture=ItemIdToTexture(Inventory[boxSelected].X), -// Id=(Items)Inventory[boxSelected].X, -// }); -// } -// InventoryRemoveDInt(); - -// // float angle=(float)Math.Tanh((mousePos.Y-PlayerY)/ (mousePos.X-PlayerX)); - -// // DInt dropPos=new DInt((int)(PlayerX+96*Math.Cos(angle)), (int)(PlayerY+96*Math.Sin(angle))); - - -// //if (newKeyboardState.IsKeyDown(Setting.KeyRun)) { -// // ItemDrop(Inventory[boxSelected].X,1, dropPos); -// // InventoryRemoveDInt(boxSelected); -// //} else { -// // ItemDrop(Inventory[boxSelected].X, Inventory[boxSelected].Y, dropPos); -// // Inventory[boxSelected].Y=0; -// // Inventory[boxSelected].X=0; -// //} -// } -// } -// } -// #endregion -// // do not write here -// #region Inventory -// } else { -// switch (inventory) { -// #region 1 Typing -// case InventoryType.Typing: -// text=TextEdit(text); -// while (text.Length*13>750) text=text.Substring(0, text.Length-1); -// text=text.Replace("€", "#"); - -// if (newKeyboardState.IsKeyDown(Keys.Enter)) { -// if (oldKeyboardState.IsKeyUp(Keys.Enter)) { -// inventory=0; -// diserpeard=255; - -// gedo=new GeDo(/*spriteFont_small,*/ /*spriteFont_small_italic,*/ text/*, false*/); -// } -// } -// break; -// #endregion - -// #region 2 Basic inventory -// case InventoryType.BasicInv: -// if (displayPopUpWindow) { -// if (buttonClosePopUp.Click) { -// displayPopUpWindow=false; -// } -// } else { - -// //if (newMouseState.ScrollWheelValue != previousScrollValue) { -// if (In(Global.WindowWidthHalf-300+4+200+4, Global.WindowHeightHalf-200+2, Global.WindowWidthHalf+300, Global.WindowHeightHalf)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4 -// //&& newMouseState.XGlobal.WindowHeightHalf-200+2 -// //&& newMouseState.YmaxInvCount) inventoryScrollbarValue=maxInvCount-9*5; -// // inventoryScrollbarValue++; -// // } else if (newMouseState.ScrollWheelValue>previousScrollValue) { -// // inventoryScrollbarValue--; -// // if (inventoryScrollbarValue<0) inventoryScrollbarValue=0; -// // } -// // if (maxInvCount<45) inventoryScrollbarValue=0; - -// } - -// //else if (newMouseState.X>Global.WindowWidthHalf-300+4+40 -// // &&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8 -// // &&newMouseState.YinventoryScrollbarValueCraftingMax) inventoryScrollbarValueCrafting=inventoryScrollbarValueCraftingMax; -// // } else if (newMouseState.ScrollWheelValue>previousScrollValue) { -// // inventoryScrollbarValueCrafting-=6; -// // if (inventoryScrollbarValueCrafting<0) inventoryScrollbarValueCrafting=0; -// // } -// // if (inventoryScrollbarValueCraftingMax<6*4) inventoryScrollbarValueCrafting=0; -// // } -// // } -// ChangeInventoryClothes(); - -// SelectItemCraft(); -// CraftingEvents(); -// CraftingEventsCraft(); - -// if (buttonClose.Click) { -// inventory=0; -// SetPlayerClothes(); -// } - - -// //if (selectedCraftingItem!=-1){ -// // if (CurrentDeskCrafting.Length!=1) { -// // if (buttonNext.Click) { -// // craftingType++; -// // DListInt[] l=GameMethods.Craft(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType>l.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// // } - -// // if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l=GameMethods.Craft(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// // } -// // } -// //} - - -// if (buttonInvTabBlocks.Click) SetInvCraftingBlocks(); -// if (buttonInvTabMashines.Click) SetInvCraftingMashines(); -// if (buttonInvTabTools.Click) SetInvCraftingTools(); -// if (buttonInvTabPlants.Click) SetInvCraftingNature(); -// if (buttonInvTabItems.Click) SetInvCraftingItems(); -// } -// break; -// #endregion - -// #region 3 Crafting -// case InventoryType.Desk: -// ChangeInventoryBasic(); - -// SelectItemCraft(); - -// //if (buttonNext.Click) { -// // craftingType++; -// // DListInt[] l = GameMethods.Craft(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType>l.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// //} - -// //if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l = GameMethods.Craft(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// //} - -// //if (buttonClose.Click) inventory=0; -// break; -// #endregion - -// #region 4 Furnace stone -// case InventoryType.FurnaceStone: -// ChangeInventoryFurnaceStone(); - -// SelectItemBake(); - -// if (buttonInvTabMaterials.Click) SetInvBakeIngots(); -// if (buttonInvTabGlass.Click) SetInvBakeItems(); -// if (buttonInvTabCeramics.Click) SetInvBakeCeramics(); -// if (buttonInvTabFood.Click) SetInvBakeFood(); -// if (buttonInvTabTools.Click) SetInvBakeTools(); - -// if (buttonClose.Click) inventory=0; - -// //if (buttonNext.Click) { -// // craftingType++; -// // DListInt[] l = GameMethods.Bake(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType>l.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// //} - -// //if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l = GameMethods.Bake(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// //} -// break; -// #endregion - -// #region 5 Furnace electric -// case InventoryType.FurnaceElectric: -// ChangeInventoryBasic(); - -// SelectItemBake(); - -// if (buttonInvTabMaterials.Click) SetInvBakeIngots(); -// if (buttonInvTabGlass.Click) SetInvBakeItems(); -// if (buttonInvTabCeramics.Click) SetInvBakeCeramics(); -// if (buttonInvTabFood.Click) SetInvBakeFood(); -// if (buttonInvTabTools.Click) SetInvBakeTools(); - -// if (buttonClose.Click) inventory=0; - -// if (((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy>0) { -// //if (buttonNext.Click) { -// // craftingType++; -// // DListInt[] l = GameMethods.Bake(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType>l.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// //} - -// //if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l = GameMethods.Bake(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// //} -// } -// break; -// #endregion - -// #region 6 Macerator -// case InventoryType.Macerator: -// ChangeInventoryBasic(); - -// SelectItemToDust(); - -// if (buttonInvTabMaterials.Click) SetInvToDustDusts(); -// if (buttonInvTabPlants.Click) SetInvToDustNature(); -// if (buttonInvTabTools.Click) SetInvToDustTools(); -// if (buttonInvTabItems.Click) SetInvToDustStone(); -// if (buttonInvTabCeramics.Click) SetInvToDustOther(); - -// if (buttonClose.Click) inventory=0; - -// if (((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy>0) { -// //if (buttonNext.Click) { -// // craftingType++; -// // DListInt[] l = GameMethods.ToDust(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType>l.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// //} - -// //if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l = GameMethods.ToDust(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// //} -// } -// break; -// #endregion - - -// #region Creative -// case InventoryType.Creative: -// ChangeInventoryCreative(); -// //if (buttonInvTabBlocks.Click) SetInvCreativeBlocks(); -// //if (buttonInvTabGlass.Click) SetInvCreativeBack(); -// //if (buttonInvTabMashines.Click) SetInvCreativeMashines(); -// //if (buttonInvTabTools.Click) SetInvCreativeTools(); -// //if (buttonInvTabPlants.Click) SetInvCreativePlants(); -// //if (buttonInvTabItems.Click) SetInvCreativeItems(); -// //if (buttonInvAnimals.Click) SetInvCreativeOther(); -// // if (buttonClose.Click) inventory=0; -// break; -// #endregion - -// #region 8 Shelf -// case InventoryType.Shelf: -// ChangeInventoryShelf(); - -// if (buttonClose.Click) { -// inventory=0; -// ShelfBlock block = (ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]; -// if (block.Inv[4].X==0) block.IsSmallItem=false; -// else { -// Texture2D tex = ItemIdToTexture(block.Inv[4].X); -// if (tex!=null) { -// block.SmalItemTexture=tex; -// block.IsSmallItem=true; -// } else block.IsSmallItem=false; -// } -// } -// break; -// #endregion - -// #region 9 Wooden box -// case InventoryType.BoxWooden: -// ChangeInventoryWoodenBox(); - -// if (buttonClose.Click) inventory=0; -// break; -// #endregion - -// #region 10 Adv box -// case InventoryType.BoxAdv: -// ChangeInventoryAdvBox(); - -// if (buttonClose.Click) inventory=0; -// break; -// #endregion - - -// #region Mobile -// case InventoryType.Mobile: -// if (buttonClose.Click) inventory=0; -// mobileOS.mouse=new DInt(newMouseState.X, newMouseState.Y); -// mobileOS.mouseDown=newMouseState.LeftButton==ButtonState.Pressed; -// mobileOS.Update(); -// break; -// #endregion - -// #region Rocket -// case InventoryType.Rocket: -// if (buttonClose.Click) inventory=0; -// if (buttonRocket.Click) { -// // Save(); -// rocket=true; -// rocketDown=false; -// PlayerX=selectedMashine.X; -// PlayerY=selectedMashine.Y; -// inventory=0; -// File.WriteAllText(pathToWorld+"UseRocket.txt", ""); -// terrain[selectedMashine.X].IsTopBlocks[selectedMashine.Y]=false; -// terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]=null; -// } -// break; -// #endregion - -// #region Charger -// case InventoryType.Charger: -// ChangeInventoryCharger(); - -// if (buttonClose.Click) { -// inventory=0; -// } -// break; -// #endregion - -// #region Miner -// case InventoryType.Miner: -// ChangeInventoryMiner(); - -// if (buttonClose.Click) inventory=0; -// break; -// #endregion - -// #region Radio -// case InventoryType.Radio: -// if (buttonRocket.Click) { } -// if (buttonClose.Click) inventory=0; - -// if (radioplaying) { -// if (MediaPlayer.PlayPosition==TimeSpan.MinValue) radioplaying=false; -// } - -// if (radioSongs!=null) { -// for (int i = 0; iGlobal.WindowWidthHalf-300-2+10+240&&newMouseState.Y>Global.WindowHeightHalf-234+10+40+i*40 -// &&newMouseState.XGlobal.WindowWidthHalf-24&&newMouseState.Y>Global.WindowHeightHalf-200+2+400-50 -// &&newMouseState.X6.283185307f) itemAnimationPos=0f; -// Global.ItemAnimation=(float)Math.Cos(itemAnimationPos); - -// itemAnimationPos2+=0.1047197551f; -// if (itemAnimationPos2>6.283185307f) itemAnimationPos2=0f; -// Global.ItemAnimation2=(float)Math.Cos(itemAnimationPos2); -// UpdateItem(DroppedItems); -// } -// #endregion - -// #region bars -// if (barEnergy<=32) { -// if (barEnergy>0) { -// if (barEat>=0) { -// if (barWater>=0) { -// barEat+=0.0006f; -// barWater+=0.0008f; -// barEnergy-=0.04f; - -// if (barEat<0) barEat=0; -// if (barWater<0) barWater=0; -// if (barEnergy<0) barEnergy=0; -// } -// } -// } -// } -// #endregion - -// #region Wheather -// if (rain) { -// rainDots.Add(new DInt(random.Next(848), -10)); -// if (Global.HasSoundGraphics) { -// if (rainDuration==0) { -// SoundEffects.Rain.Play(); -// rainDuration=(int)(SoundEffects.Rain.Duration.TotalMilliseconds/16.3333334d); -// } else rainDuration--; -// } -// } -// #endregion - -// #region Chunks -// for (int x = terrainStartIndexX; x10) { -// SendRequestChunk(x); -// } -// } - -// } -// #endregion - -// EnergySystem(); - -// lights.Clear(); -// for (int x = terrainStartIndexX; x0) { -// rocket=false; -// PlayerY=0; -// InventoryAdd((int)Items.Rocket); -// File.Delete(pathToWorld+"UseRocket.txt"); -// } -// } else { -// if (PlayerY<=-10000) { -// //Save(); - -// File.WriteAllText(pathToWorld+@"\Settings.txt", -// debug+"\r\n"+ -// time+"\r\n"+ -// dayAlpha+"\r\n"+ - -// barWater+"\r\n"+ -// barEat+"\r\n"+ -// barHeart+"\r\n"+ -// barOxygen+"\r\n"+ - -// PlayerX+"\r\n"+ -// PlayerY+"\r\n"+ -// moonSpeed); - -// using (StreamWriter sr = new StreamWriter(pathToWorld+@"\Inventory.txt")) { -// foreach (DInt x in Inventory) { -// sr.WriteLine(x.X); -// sr.WriteLine(x.Y); -// } -// } -// Rabcr.GoTo(new PlanetSystem(pathToWorld)); -// } -// } -// } - -// // UpdateWater(); - -// // int x = WindowX<0 ? 0 : WindowX/16; -// // int w= (WindowX+Global.WindowWidth)/16 >TerrainLenght ? TerrainLenght : (WindowX + Global.WindowWidth) / 16; -// for (int x = terrainStartIndexX; xy) NewEnergySolarPanel(x, y); -// break; - -// case BlockId.Watermill: -// NewEnergyWatermill(x, y); -// break; - -// case BlockId.Windmill: -// NewEnergySolarPanel(x, y); -// break; -// } -// } -// } -// } -// } - - -// if (Global.HasSoundGraphics) { -// if (MediaPlayer.State==MediaState.Stopped) { -// Song play = null; - -// if (notNeedScafander) { -// switch (random.Next(4)) { -// case 0: play=Songs.Happend; break; -// case 1: play=Songs.Medium; break; -// case 2: play=Songs.Root; break; -// default: play=Songs.Storm; break; -// } -// } else play=Songs.Spacelandia; - -// MediaPlayer.Play(play); -// } -// } - -// #region Time -// time++;//1hod=3000x zvýšení -// if (time==dayLenght) { -// day++; -// if (day>365) day=0; -// time=0; -// } - -// //Východ -// if (time>hour*6&&timehour*18&&time=hour*7&&time<=hour*18) dayAlpha=1f; -// else dayAlpha=.5f; - - -// moonSpeed+=368f/(7f*dayLenght); -// if (moonSpeed>=368) moonSpeed=0; -// #endregion - -// #region Furnace Stone burning -// foreach (ShortAndByte d in FurnaceStone) { -// MashineBlockBasic block = (MashineBlockBasic)terrain[d.X].TopBlocks[d.Y]; -// if (block==null) { -// FurnaceStone.Remove(d); -// break; -// } - -// if (block.Inv[0].X!=0||block.Inv[1].X!=0||block.Inv[2].X!=0) { -// if (block.Inv[3].Y<99&&(block.Inv[3].X==0||block.Inv[3].X==(int)Items.Ash)) { -// //0 -// Items id = (Items)block.Inv[0].X; -// int add = GameMethods.BurnWoodInFurnace(id); -// if (add!=0) { -// if (add+block.Energy<100) { -// block.Energy+=add; - -// block.Inv[0].Y--; -// if (block.Inv[0].Y==0) -// block.Inv[0].X=0; - -// //ash -// if (random.Next(3)==1) { -// block.Inv[3].Y++; -// block.Inv[3].X=(int)Items.Ash; -// } -// } -// } -// } -// } - -// if (block.Energy>0) block.Energy-=0.03f; -// } -// #endregion - -// //Animatable -// if (wind) { -// if (windForce<1) { -// windForce+=.05f; -// SetWintableSources(); -// } -// } else { -// if (windForce>0) { -// windForce-=.05f; -// SetWintableSources(); -// } -// } - -// #region Auto-destroy leaves -// if (terrainStartIndexW-terrainStartIndexX>0) { -// AutoDestroyLeaves((byte)BlockId.OakWood, (byte)BlockId.OakLeaves); -// AutoDestroyLeaves((byte)BlockId.SpruceWood, (byte)BlockId.SpruceLeaves); -// AutoDestroyLeaves((byte)BlockId.PineWood, (byte)BlockId.PineLeaves); -// AutoDestroyLeaves((byte)BlockId.LindenWood, (byte)BlockId.LindenLeaves); - -// AutoDestroyLeaves((byte)BlockId.AppleWood, (byte)BlockId.AppleLeaves, (byte)BlockId.AppleLeavesWithApples); -// AutoDestroyLeaves((byte)BlockId.PlumWood, (byte)BlockId.PlumLeaves, (byte)BlockId.PlumLeavesWithPlums); -// AutoDestroyLeaves((byte)BlockId.CherryWood, (byte)BlockId.CherryLeaves, (byte)BlockId.CherryLeavesWithCherries); -// AutoDestroyLeaves((byte)BlockId.OrangeWood, (byte)BlockId.OrangeLeaves, (byte)BlockId.OrangeLeavesWithOranges); -// AutoDestroyLeaves((byte)BlockId.LemonWood, (byte)BlockId.LemonLeaves, (byte)BlockId.LemonLeavesWithLemons); -// } -// #endregion - -// // Start mooving -// if (terrainStartIndexW-terrainStartIndexX>0) { -// MoveChicken(); -// MoveRabbit(); -// } - -// // Finish mooving -// FinishMooving(); - -// timer5=5; -// } else timer5--; - -// if (_secondTimer<0) { -// for (int i = 0; i25&&barWater>25) { -// barHeart+=.06f; -// if (barHeart>32) Die(Lang.Texts[162] /*"Měl bys jíst a pít","You shoud eat and drink"*/); -// } - -// if (CheckLava()) { -// barHeart+=.06f; -// if (barHeart>32) Die(Lang.Texts[163] /*"Dávej pozor! Láva..","Pay attention! Lava..."*/); -// } - -// if (barEnergy>31) { -// if (random.Next(3)==1) { -// barHeart+=.01f; -// if (barHeart>32) Die(Lang.Texts[164] /*"Bez energie + spatné srdíčko = srmt","Without energy + wrong heart = die"*/); -// } -// } -// #endregion - -// if (debug) { -// if (cpu!=null) { -// usageCpuProcess=cpu.NextValue(); -// usageCpu=cpuUsage.NextValue(); -// usageRamProcess=ram.NextValue(); -// usageRam=freeRam.NextValue(); -// } -// } - -// #region Weather -// if (changeRain<0) { -// changeRain=100+random.Next(50); -// if (rain) rain=false; else rain=true; -// } else changeRain--; - -// if (timeToChageWind<0) { -// timeToChageWind=2000+random.Next(1000); -// wind=!wind; -// } else timeToChageWind--; - -// foreach (DInt r in rainDots) { -// if (Global.WindowHeight5000) energy.RemoveRange(5000, energy.Count-5000); -// #endregion - -// if (random.Next(2)==1) { -// switch (Inventory[boxSelected].X) { -// case (int)Items.TorchON: -// if (Inventory[boxSelected].Y>2) InventoryRemoveDInt(); -// else Inventory[boxSelected].X=(int)Items.Stick; -// playerLight=true; -// break; - -// case (int)Items.TorchElectricON: -// if (random.Next(2)==1) { -// if (Inventory[boxSelected].Y>2) InventoryRemoveDInt(); -// else Inventory[boxSelected].X=(int)Items.TorchElectricOFF; -// break; -// } -// playerLight=true; -// break; - -// default: -// playerLight=false; -// break; -// } -// } - -// foreach (ShortAndByte d in Miners) MinerJob(d); - -// autoSave--; -// if (autoSave==0) { -// //Save(); - -// File.WriteAllText(pathToWorld+@"\Settings.txt", -// debug+"\r\n"+ -// time+"\r\n"+ -// dayAlpha+"\r\n"+ - -// barWater+"\r\n"+ -// barEat+"\r\n"+ -// barHeart+"\r\n"+ -// barOxygen+"\r\n"+ - -// PlayerX+"\r\n"+ -// PlayerY+"\r\n"+ -// moonSpeed); - -// using (StreamWriter sr = new StreamWriter(pathToWorld+@"\Inventory.txt")) { -// foreach (DInt x in Inventory) { -// sr.WriteLine(x.X); -// sr.WriteLine(x.Y); -// } -// } -// autoSave=300; -// } - -// if (inventory==InventoryType.Radio) { -// try { -// if (Directory.Exists(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData\\Default\\Songs\\Radio")) { -// radioSongs=Directory.GetFiles(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData\\Default\\Songs\\Radio"); -// List songs = new List(); -// foreach (string s in radioSongs) { -// if (s.EndsWith(".wma")) songs.Add(s); -// } -// radioSongs=songs.ToArray(); -// } -// } catch { } -// } - - -// #region Multiplayer -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.MyPlayerData, -// Message=PlayerX+"|"+PlayerY, -// To=toServer, -// }.ToByte(), -// Importance=Importance.Low -// }); -// #endregion - -// if (Inventory[boxSelected].X==(int)Items.TorchON) { -// if (Inventory[boxSelected].Y>2) { -// if (random.Next(2)==1) InventoryRemoveDInt(); -// } else { -// Inventory[boxSelected].X=(int)Items.Stick; -// } - -// playerLight=true; -// } else playerLight=false; - -// _secondTimer=60; -// } else _secondTimer--; - -// CameraMatrix(); -// } - - -// base.Update(gameTime); -// } - -// public override void Draw(GameTime gameTime) { -// Rabcr.spriteBatch=spriteBatch; -// oldMouseState=newMouseState; -// newMouseState=Mouse.GetState(); - -// if (current==Current.Playing) { -// #region Died -// if (died) { -// Graphics.SetRenderTarget(null); -// Graphics.Clear(Color.DarkRed); -// spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp); -// Vector2 text = spriteFont_small.MeasureString(diedInfo); -// float a; -// if (timerStayDied>200) a=1-(timerStayDied-200)/110f; -// else if (timerStayDied<100) a=timerStayDied/100f; -// else a=1; -// string m = Lang.Texts[28];// Setting.czechLanguage? "Právě jsi zemřel(a)": "You died"; -// string respawntext = Lang.Texts[28]+" "+(timerStayDied/60+1);//(Setting.czechLanguage? "Znovuzrodíš se za ": "Respawn in ")+(timerStayDied/60+1); - -// spriteBatch.DrawString(spriteFont_medium, m, new Vector2(Global.WindowWidthHalf-(int)spriteFont_medium.MeasureString(m).X/2, Global.WindowHeightHalf-60), Color.White*a); -// GameDraw.DrawTextShadowMin(Global.WindowWidthHalf-(int)text.X/2, Global.WindowHeightHalf, diedInfo, Color.White*a); -// GameDraw.DrawTextShadowMin(Global.WindowWidthHalf-(int)spriteFont_small.MeasureString(respawntext).X/2, Global.WindowHeightHalf+30, respawntext, Color.White*a); - -// spriteBatch.End(); -// } else { -// #endregion - -// #region Draw lighting -// Graphics.SetRenderTarget(sunLightTarget); -// Graphics.Clear(Color.Black); -// spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, camera); -// for (int x = terrainStartIndexX; x=terrainStartIndexX*16) { -// if (m.Position.X<=terrainStartIndexW*16) { -// if (m.Position.Y>=terrainStartIndexY*16) { -// if (m.Position.Y<=terrainStartIndexH*16) { -// if (m.Energy>0) { -// m.Energy-=0.01f; -// if (m.Energy<0) m.Energy=0; -// spriteBatch.Draw(lightMaskRoundTexture, new Rectangle((int)m.Position.X-48*2*2+8, (int)m.Position.Y-48*2*2+8, 96*2*2, 96*2*2), lampColorLight); -// } -// } -// } -// } -// } -// } -// // playerLight=true; -// if (playerLight) spriteBatch.Draw(lightMaskRoundTexture, new Rectangle(PlayerX-48*2+8, PlayerY-48*2+8, 96*2, 96*2), lampColorLight); -// spriteBatch.End(); -// #endregion - -// //#region Draw lighting -// //Graphics.SetRenderTarget(fogTarget); -// //Graphics.Clear(/*Color.Black*/Color.White*0.1f); -// //spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp ,null, null, null, camera); -// ////for (int x= startIndex-2>0 ? startIndex-2:0; x=terrainStartIndexX*16){ -// // if (m.Position.X<=terrainStartIndexW*16){ -// // if (m.Position.Y>=terrainStartIndexY*16){ -// // if (m.Position.Y<=terrainStartIndexH*16){ -// // if (m.Energy>0){ -// // m.Energy-=0.01f; -// // if (m.Energy<0)m.Energy=0; -// // spriteBatch.Draw(lightmap, new Rectangle((int)m.Position.X-48*2+8, (int)m.Position.Y-48*2+8,96*2,96*2), Color.White); -// // } -// // } -// // } -// // } -// // } -// //} -// //spriteBatch.End(); -// //#endregion - -// #region Draw game -// Graphics.SetRenderTarget(null); -// Graphics.Clear(Color.LightSkyBlue); -// spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera); - -// #region Weather -// if (rain) { -// if (WindowY<0) { -// foreach (DInt r in rainDots) { - -// r.Y++; - -// if (wind) { -// if (random.Next(4)==1) r.X--; else if (random.Next(2)==1) r.X++; -// } else { -// if (random.Next(3)==1) r.X++; else if (random.Next(2)==1) r.X--; -// } -// spriteBatch.Draw(Rabcr.Pixel, new Rectangle(WindowX+r.X, WindowY+r.Y, 1, 1), Color.White); -// } -// } else { -// foreach (DInt r in rainDots) { - -// r.Y+=3; - -// if (wind) { -// if (random.Next(2)==1) r.X++; -// } -// spriteBatch.Draw(Rabcr.Pixel, new Rectangle(WindowX+r.X, WindowY+r.Y, 1, 2), Color.Blue); -// } -// } -// } -// #endregion - -// for (int x = terrainStartIndexX; xterrainStartIndexY ? chunk.StartSomething : terrainStartIndexY; y -// // spriteBatch.Draw(playerRightSwimmingTexture, new Vector2(PlayerX-11, PlayerY+8), new Rectangle(playerImg/22*39, 0, 39, 20), Color.White,0,Vector2.Zero,1,SpriteEffects.None,1f); -// { -// // spriteBatch.Draw(playerRightSwimmingTexture, new Vector2(PlayerX-11, PlayerY+8), new Rectangle(playerImg/22*39, 0, 39, 20), Color.White,0,Vector2.Zero,1,SpriteEffects.None,1f); - -// Rectangle curImg = new Rectangle(playerImg/22*39, 0, 39, 20); -// Vector2 vector = new Vector2(PlayerX-11, PlayerY+8); - -// if (TextureSwimmingClothesFeet!=null) spriteBatch.Draw(TextureSwimmingClothesFeet, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 1f); -// else spriteBatch.Draw(TexturePlayerSwimmingFeet, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); - -// if (TextureSwimmingClothesLegs!=null) { -// if (TextureSwimmingClothesLegs==TextureSwimmingShorts||TextureSwimmingClothesLegs==TextureSwimmingBlackSkirt||TextureSwimmingClothesLegs==TextureSwimmingPinkSkirt) spriteBatch.Draw(TexturePlayerSwimmingLegsWoman, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// spriteBatch.Draw(TextureSwimmingClothesLegs, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } else { -// spriteBatch.Draw(TexturePlayerSwimmingLegs, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// if (TextureSwimmingClothesDownUnderwear!=null) { -// if (TextureSwimmingClothesChest!=TextureSwimmingBlueDress&&TextureSwimmingClothesChest!=TextureSwimmingWhiteDress) spriteBatch.Draw(TextureSwimmingClothesDownUnderwear, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } else { -// if (Global.YoungPlayer) spriteBatch.Draw(TextureSwimmingDownCensored, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } -// } - -// spriteBatch.Draw(TexturePlayerWalkingHead, new Vector2(PlayerX-11/*+5-2+1+4-3+5+20*/+30+6+2+2, PlayerY-39/2/*-1+40-5-1*/+30+3), null, Color.White, 3.14f/2f, Vector2.Zero, 1, SpriteEffects.None, 0); -// if (TextureStaticClothesHead!=null) spriteBatch.Draw(TextureStaticClothesHead, new Vector2(PlayerX-11/*+2*/+1+4-3+20+10+5+2+2, PlayerY-39/2-2+20+5+2+2), null, Color.White, 3.14f/2f, Vector2.Zero, 1, SpriteEffects.None, 0); - -// if (TextureSwimmingClothesChestTop==null||TextureSwimmingClothesChestTop==TextureSwimmingJacketShort) { -// if (TextureSwimmingClothesChest!=null) spriteBatch.Draw(TextureSwimmingClothesChest, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); - -// else { -// spriteBatch.Draw(TexturePlayerSwimmingChest, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// if (TextureSwimmingClothesUpUnderwear!=null) spriteBatch.Draw(TextureSwimmingClothesUpUnderwear, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// else { -// if (Setting.sex==Sex.Girl) { -// if (Global.YoungPlayer) { -// if (Setting.MaturePlayer) spriteBatch.Draw(TextureSwimmingUpCensored, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } -// } -// } -// } -// } -// if (TextureSwimmingClothesChestTop!=null) spriteBatch.Draw(TextureSwimmingClothesChestTop, vector, curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } -// break; -// } -// } else { -// switch (playerState) { -// default: -// if (TextureStaticClothesLegs!=null) { -// if (TextureStaticClothesLegs==TextureStaticShorts||TextureStaticClothesLegs==TextureStaticBlackSkirt||TextureStaticClothesLegs==TextureStaticPinkSkirt) spriteBatch.Draw(TexturePlayerStaticLegs, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// spriteBatch.Draw(TextureStaticClothesLegs, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// } else { -// spriteBatch.Draw(TexturePlayerStaticLegs, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// if (TextureStaticClothesDownUnderwear!=null) { -// if (TextureStaticClothesChest!=TextureStaticBlueDress&&TextureStaticClothesChest!=TextureStaticWhiteDress) spriteBatch.Draw(TextureStaticClothesDownUnderwear, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// } else { -// if (Global.YoungPlayer) spriteBatch.Draw(TextureStaticDownCensored, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// } -// } -// if (TextureStaticClothesChestTop==null||TextureStaticClothesChestTop==TextureStaticJacketShort) { -// if (TextureStaticClothesChest!=null) spriteBatch.Draw(TextureStaticClothesChest, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// else { -// spriteBatch.Draw(TexturePlayerStaticChest, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// if (TextureStaticClothesUpUnderwear!=null) spriteBatch.Draw(TextureStaticClothesUpUnderwear, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// else { -// if (Setting.sex==Sex.Girl) { -// if (Global.YoungPlayer) { -// if (Setting.MaturePlayer) spriteBatch.Draw(TextureStaticUpCensored, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// } -// } -// } -// } -// } - -// if (TextureStaticClothesChestTop!=null) spriteBatch.Draw(TextureStaticClothesChestTop, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); - -// if (TextureStaticClothesFeet!=null) spriteBatch.Draw(TextureStaticClothesFeet, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); -// else spriteBatch.Draw(TexturePlayerStaticFeet, new Vector2(PlayerX-11, PlayerY-39/2), Color.White); - -// spriteBatch.Draw(TexturePlayerStaticHead, new Vector2(PlayerX-11, PlayerY-39/2-1), Color.White); -// if (TextureStaticClothesHead!=null) spriteBatch.Draw(TextureStaticClothesHead, new Vector2(PlayerX-11, PlayerY-39/2-2), Color.White); -// break; - -// case 2: { -// Rectangle curImg = new Rectangle((playerImg/20)*20, 0, 20, 39); - -// if (TextureWalkingClothesFeet!=null) spriteBatch.Draw(TextureWalkingClothesFeet, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// else spriteBatch.Draw(TexturePlayerWalkingFeet, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); - -// if (TextureWalkingClothesLegs!=null) { -// if (TextureWalkingClothesLegs==TextureWalkingShorts||TextureWalkingClothesLegs==TextureWalkingBlackSkirt||TextureWalkingClothesLegs==TextureWalkingPinkSkirt) spriteBatch.Draw(TexturePlayerWalkingLegsWoman, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// spriteBatch.Draw(TextureWalkingClothesLegs, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// } else { -// spriteBatch.Draw(TexturePlayerWalkingLegs, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// if (TextureWalkingClothesDownUnderwear!=null) { -// if (TextureWalkingClothesChest!=TextureWalkingBlueDress&&TextureWalkingClothesChest!=TextureWalkingWhiteDress) spriteBatch.Draw(TextureWalkingClothesDownUnderwear, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// } else { -// if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// } -// } -// if (TextureWalkingClothesChestTop==null||TextureWalkingClothesChestTop==TextureWalkingJacketShort) { -// if (TextureWalkingClothesChest!=null) spriteBatch.Draw(TextureWalkingClothesChest, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// else { -// spriteBatch.Draw(TexturePlayerWalkingChest, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// if (TextureWalkingClothesUpUnderwear!=null) spriteBatch.Draw(TextureWalkingClothesUpUnderwear, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// else { -// if (Setting.sex==Sex.Girl) { -// if (Global.YoungPlayer) { -// if (Setting.MaturePlayer) spriteBatch.Draw(TextureWalkingUpCensored, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// } -// } -// } -// } -// } - -// if (TextureWalkingClothesChestTop!=null) spriteBatch.Draw(TextureWalkingClothesChestTop, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); - - -// spriteBatch.Draw(TexturePlayerWalkingHead, new Vector2(PlayerX-11+5-2+1, PlayerY-39/2-1), Color.White); -// if (TextureWalkingClothesHead!=null) spriteBatch.Draw(TextureWalkingClothesHead, new Vector2(PlayerX-11+5-1-2+1, PlayerY-39/2-2), Color.White); -// } -// break; - -// case 1: { -// Rectangle curImg = new Rectangle((playerImg/20)*20, 0, 20, 39); - -// if (TextureWalkingClothesFeet!=null) spriteBatch.Draw(TextureWalkingClothesFeet, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// else spriteBatch.Draw(TexturePlayerWalkingFeet, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); - -// if (TextureWalkingClothesLegs!=null) { -// if (TextureWalkingClothesLegs==TextureWalkingShorts||TextureWalkingClothesLegs==TextureWalkingBlackSkirt||TextureWalkingClothesLegs==TextureWalkingPinkSkirt) spriteBatch.Draw(TexturePlayerWalkingLegsWoman, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White); -// spriteBatch.Draw(TextureWalkingClothesLegs, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } else { -// spriteBatch.Draw(TexturePlayerWalkingLegs, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// if (TextureWalkingClothesDownUnderwear!=null) { -// if (TextureWalkingClothesChest!=TextureWalkingBlueDress&&TextureWalkingClothesChest!=TextureWalkingWhiteDress) spriteBatch.Draw(TextureWalkingClothesDownUnderwear, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } else { -// if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } -// } -// if (TextureWalkingClothesChestTop==null||TextureWalkingClothesChestTop==TextureWalkingJacketShort) { -// if (TextureWalkingClothesChest!=null) spriteBatch.Draw(TextureWalkingClothesChest, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// else { -// spriteBatch.Draw(TexturePlayerWalkingChest, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// if (TextureWalkingClothesUpUnderwear!=null) spriteBatch.Draw(TextureWalkingClothesUpUnderwear, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// else { -// if (Setting.sex==Sex.Girl) { -// if (Global.YoungPlayer) { -// if (Setting.MaturePlayer) spriteBatch.Draw(TextureWalkingUpCensored, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } -// } -// } -// } -// } -// if (TextureWalkingClothesChestTop!=null) spriteBatch.Draw(TextureWalkingClothesChestTop, new Vector2(PlayerX-11, PlayerY-39/2), curImg, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); - - -// spriteBatch.Draw(TexturePlayerWalkingHead, new Vector2(PlayerX-11+5-2+1+4-3, PlayerY-39/2-1), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// if (TextureWalkingClothesHead!=null) spriteBatch.Draw(TextureWalkingClothesHead, new Vector2(PlayerX-11/*+2*/+1+4-3, PlayerY-39/2-2), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); -// } -// break; -// } -// } -// } -// #endregion - -// for (int i = 0; i100) { -// spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), ColorWhite); -// spriteBatch.Draw(messageCenter,new Rectangle(x-texts+19-10,Global.WindowHeightHalf-55-50,texts*2,57), ColorWhite); -// spriteBatch.Draw(messageRight,new Vector2(x+texts+19-10,Global.WindowHeightHalf-55-50), ColorWhite); - -// gedo.DrawGedo(1f,spriteBatch); -// } else { -// float alphaC =diserpeard/100f; -// Color alphaCC=new Color(alphaC,alphaC,alphaC,alphaC); - -// spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), alphaCC); -// spriteBatch.Draw(messageCenter,new Rectangle(x-texts+19-10,Global.WindowHeightHalf-55-50,texts*2,57), alphaCC); -// spriteBatch.Draw(messageRight,new Vector2(x+texts+19-10,Global.WindowHeightHalf-55-50), alphaCC); - -// gedo.DrawGedo(alphaC,spriteBatch); -// } -// } -// } - -// #region Basic right inventory -// { -// int w=Global.WindowWidth-40, h=Global.WindowHeightHalf-80; -// for (int i = 0; i<5; i++) { -// if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), ColorLightBlue); -// else spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), ColorWhite); -// } -// } - -// for (int i = 0; i<5; i++) InventoryNormal[i].Draw(); -// #endregion - -// break; -// #endregion - -// #region Writing message -// case InventoryType.Typing: -// { -// int xx=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); - -// int half=textWriting.X/2; -// spriteBatch.Draw(messageLeft,new Vector2(xx-half-10,Global.WindowHeightHalf-55-50), ColorWhite); -// spriteBatch.Draw(messageCenter,new Rectangle(xx-half+19-10,Global.WindowHeightHalf-55-50,textWriting.X,57), ColorWhite); -// spriteBatch.Draw(messageRight,new Vector2(xx+half+19-10,Global.WindowHeightHalf-55-50), ColorWhite); - -// textWriting.Draw(spriteBatch); - -// spriteBatch.Draw(pixel,new Rectangle(xx+half+20-10,Global.WindowHeightHalf-40-50+3,1,15),black); - -// DrawSideInventory(); -// } -// break; -// #endregion - -// #region Basic inventory - clothes, inventory and basic crafting -// case InventoryType.BasicInv: -// spriteBatch.Draw(pixel, new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight), new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(TextureInventoryClothes,new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), ColorWhite); -// textOpenInventory.Draw(spriteBatch); - -// DrawInventoryWithDIntMoving(); -// InventoryDrawClothes(); - -// #region Crafting -// { -// if (inventoryScrollbarValueCraftingMax>6*4) { -// int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); - -// int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / (inventoryScrollbarValueCraftingMax-6*3)*(160-size2) )*8; -// if (size2>20) { -// spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); -// } else { -// spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); -// } -// } - -// int xx =0; -// int yh=0; - -// for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { - -// if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r128_g128_b128); -// else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); -// } else { -// if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); -// else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); -// } - -// InventoryCrafting[i].DrawCreative(); -// //Texture2D tex=ItemIdToTexture(InventoryCrafting[i].X); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex,1,Global.WindowWidthHalf-300+4+40+xx+4+4,Global.WindowHeightHalf-200+2+4+200+8+yh+4+8); -// xx+=40; - -// if (xx==6*40) { -// xx=0; -// yh+=40; -// } -// } -// } -// #endregion - -// DrawNeedNew(); - -// buttonInvTabBlocks.ButtonDraw(); -// buttonInvTabMashines.ButtonDraw(); -// buttonInvTabTools.ButtonDraw(); -// buttonInvTabPlants.ButtonDraw(); -// buttonInvTabItems.ButtonDraw(); - -// DrawSideInventory(); - -// if (displayPopUpWindow)DrawChooseItemWindow(); -// else if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// break; -// #endregion - -// #region Desk -// case InventoryType.Desk: -// spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(deskTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); -// textOpenInventory.Draw(spriteBatch); - -// DrawInventoryNormal(); - -// #region Crafting -// { -// if (inventoryScrollbarValueCraftingMax>6*4) { -// int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); - -// int pos2 = (int)(((float)(inventoryScrollbarValueCrafting*5/40f)/(inventoryScrollbarValueCraftingMax-3*6))*(160-size2)); -// if (size2>20) { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); -// } else { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); -// } -// } - -// int xx =0; -// int yh=0; - -// for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.Y0 ?0 :16,0,16,16), ColorWhite); - -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-2, Global.WindowHeightHalf-200+2+4-6,202+2,5),black); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1, Global.WindowHeightHalf-200+2+4-5,(int)(energy*2.02),3),Color.Green); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1+(int)(energy*2.02),Global.WindowHeightHalf-200+2+4-5,202-(int)(energy*2.02),3),Color.Red); -// textOpenInventory.Draw(spriteBatch); - -// DrawInventoryWithDIntMoving(); - -// #region Bake -// { -// if (inventoryScrollbarValueCraftingMax>6*4) { -// int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); -// int pos2 = (int)(((inventoryScrollbarValueCrafting*5/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; -// if (size2>20) { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); -// } else { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); -// } -// } - -// int xx = 0; -// int yh = 0; - -// for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Y6*4) { -// int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); -// int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; -// if (size2>20) { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); -// } else { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); -// } -// } - -// int xx = 0; -// int yh = 0; - -// for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Y6*4) { -// int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); -// int pos2 = (int)(((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax*(160-size2))*8; -// if (size2>20) { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); -// } else { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); -// } -// } - -// int xx = 0; -// int yh = 0; - -// for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { - -// if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r128_g128_b128); -// else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); -// } else { -// if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); -// else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); -// } -// InventoryCrafting[i].Draw(); -// //Texture2D tex = ItemIdToTexture(InventoryCrafting[i].X); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex, 1, Global.WindowWidthHalf-300+4+40+xx+4+4, Global.WindowHeightHalf-200+2+4+200+8+yh+4+8); -// xx+=40; - -// if (xx==6*40) { -// xx=0; -// yh+=40; -// } -// } -// } -// #endregion - -// DrawNeedNew(); - -// buttonInvTabMaterials.ButtonDraw(); -// buttonInvTabPlants.ButtonDraw(); -// buttonInvTabTools.ButtonDraw(); -// buttonInvTabItems.ButtonDraw(); -// buttonInvTabCeramics.ButtonDraw(); - -// DrawSideInventory(); -// if (displayPopUpWindow)DrawChooseItemWindow(); -// else if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// break; -// #endregion - -// #region Creative -// case InventoryType.Creative: -// spriteBatch.Draw(pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0, 0, 0, animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2+30,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434+30,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2+30), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(TextureInventoryClothes, new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), ColorWhite); - -// textOpenInventory.Draw(spriteBatch); - -// int AddH=35; -// DrawInventoryWithDIntMoving(); -// InventoryDrawClothes(); - -// if (creativeTabCrafting) { -// #region Crafting -// { -// if (inventoryScrollbarValueCraftingMax>6*4) { -// int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); -// int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / (inventoryScrollbarValueCraftingMax-6*3)*(160-size2) )*8+50-15; -// if (size2>20) { -// spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); -// } else { -// spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); -// } -// } - -// int xx =0; -// int yh=0; - -// for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; - -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH)) { -// if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r128_g128_b128); -// else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r200_g200_b200); -// } else { -// if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r150_g150_b150); -// else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), ColorWhite); -// } -// // InventoryCrafting[i].SetPos(xx,yh); -// InventoryCrafting[i].DrawCreative(); -// //Texture2D tex=ItemIdToTexture(InventoryInventoryCrafting[i].X); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex,1,Global.WindowWidthHalf-300+4+40+xx+4+4,Global.WindowHeightHalf-200+2+4+200+8+yh+4+8+AddH); -// xx+=40; - -// if (xx==6*40) { -// xx=0; -// yh+=40; -// } -// } -// } -// #endregion - -// DrawNeedNewPlus(); -// } - -// buttonInvTabBlocks.ButtonDraw(); -// buttonInvTabMashines.ButtonDraw(); -// buttonInvTabTools.ButtonDraw(); -// buttonInvTabPlants.ButtonDraw(); -// buttonInvTabItems.ButtonDraw(); - -// DrawSideInventory(); - -// if (creativeTabCrafting) { -// ButtonCrafting.ButtonDrawSelected(); -// ButtonItems.ButtonDraw(); -// } else { -// DrawCreative(); -// ButtonCrafting.ButtonDraw(); -// ButtonItems.ButtonDrawSelected(); -// } - -// if (displayPopUpWindow)DrawChooseItemWindow(); -// else if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// break; -// #endregion - -// #region Shelf -// case InventoryType.Shelf: -// { -// spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(shelfTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); -// textOpenInventory.Draw(spriteBatch); -// ItemInv[] invShelf=((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; - -// DrawInventoryWithDIntMoving(); - -// DrawSideInventory(); - -// #region Shelf inventory -// { -// // int i=0; -// for (int y = 0; y<3*40; y+=40) { -// for (int x = 0; x<3*40; x+=40) { -// spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+x+20+5+1+2, Global.WindowHeightHalf+20-2+y+20+3+2), ColorWhite); - -// // if (!invMove||(invMove && invStartInventory[invStartId]!=invShelf[i])) { - -// //Texture2D tex = ItemIdToTexture(invShelf[i].X); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex, invShelf[i], Global.WindowWidthHalf-300+10+x+20+5+1+2+4, Global.WindowHeightHalf+20-2+y+20+3+2+4); -// //} -// // i++; -// } -// } - -// invShelf[0].Draw(); -// invShelf[1].Draw(); -// invShelf[2].Draw(); - -// invShelf[3].Draw(); -// invShelf[4].Draw(); -// invShelf[5].Draw(); - -// invShelf[6].Draw(); -// invShelf[7].Draw(); -// invShelf[8].Draw(); -// } -// #endregion - -// if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// } -// break; -// #endregion - -// #region Wooden box -// case InventoryType.BoxWooden: -// { -// spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(boxWoodenTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); -// textOpenInventory.Draw(spriteBatch); -// ItemInv[] invBoxWooden=((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; - -// DrawInventoryWithDIntMoving(); - -// DrawSideInventory(); - -// #region Box -// { -// int i=0; -// for (int y = 0; y<2*40; y+=40) { -// for (int x = 0; x<12*40; x+=40) { -// spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+x+59, Global.WindowHeightHalf+59+y), ColorWhite); - -// // if (!invMove||(invMove&&invStartInventory[invStartId]!=invBoxWooden[i])) { -// invBoxWooden[i].Draw(); -// //Texture2D tex = ItemIdToTexture(invBoxWooden[i].X); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex, invBoxWooden[i], Global.WindowWidthHalf-300+x+63, Global.WindowHeightHalf+y+63); -// //} -// i++; -// } -// } -// } -// #endregion - -// if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// } -// break; -// #endregion - -// #region Adv box -// case InventoryType.BoxAdv: -// { -// spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(boxAdvTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); - -// textOpenInventory.Draw(spriteBatch); -// ItemInv[] invAdvBox=((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; - -// DrawInventoryWithDIntMoving(); - -// DrawSideInventory(); - -// #region Box -// { -// int i=0; -// for (int y = 0; y<4*40; y+=40) { -// for (int x = 0; x<12*40; x+=40) { -// spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+20+x, Global.WindowHeightHalf+23+y), ColorWhite); - -// // if (!invMove||(invMove&&invStartInventory[invStartId]!=invAdvBox[i])) { -// invAdvBox[i].Draw(); -// //Texture2D tex = ItemIdToTexture(invAdvBox[i].X); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex, invAdvBox[i], Global.WindowWidthHalf-300+24+x, Global.WindowHeightHalf+23+4+y); -// //} -// i++; -// } -// } -// } -// #endregion - -// if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// } -// break; -// #endregion - -// #region Phone -// case InventoryType.Mobile: -// spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-150-2, Global.WindowHeightHalf-234,304,464+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-150-1, Global.WindowHeightHalf-233,302,464,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-232,300,34), color_r10_g140_b255); - -// buttonClose.ButtonDraw(); -// textOpenInventory.Draw(spriteBatch); - -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430), black); -// mobileOS.Draw(spriteBatch,Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430); -// break; -// #endregion - -// #region Rocket -// case InventoryType.Rocket: -// spriteBatch.Draw(pixel, new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight), new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-150-2, Global.WindowHeightHalf-234,304,464+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-150-1, Global.WindowHeightHalf-233,302,464,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-232,300,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// textOpenInventory.Draw(spriteBatch); -// spriteBatch.Draw(rocketTexture,new Rectangle(Global.WindowWidthHalf-62, Global.WindowHeightHalf-190,123,380), ColorWhite); - -// buttonRocket.ButtonDraw(); -// break; -// #endregion - -// #region Charger -// case InventoryType.Charger: -// { -// spriteBatch.Draw(pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255); -// spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(chargerTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); -// textOpenInventory.Draw(spriteBatch); - -// ItemInv[] invCharger=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; - -// DrawInventoryWithDIntMoving(); - -// #region Place for charging -// spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+40+20+5+1+2, Global.WindowHeightHalf+20-2+40+20+3+2), ColorWhite); - -// // if (!invMove||(invMove&&invStartInventory[invStartId]!=invCharger[0])) { -// invCharger[0].Draw(); -// //Texture2D tex = ItemIdToTexture(invCharger[0].X); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex, invCharger[0], Global.WindowWidthHalf-300+10+40+20+5+1+2+4, Global.WindowHeightHalf+20-2+40+20+3+2+4); -// // } -// #endregion +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Net.Sockets; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + +namespace rabcrClient { + partial class Multiplayer : Screen { + int animationInvBack=0; + #region Multiplayer + //List sendedBlockToRemove = new List(); + //List sendedBlockToRemove = new List(); + + //List Queue = new List(); + //const string toServer = "{Server}"; + //const string toEveryone = "{Everyone}"; + //string SomeoneWantTeleportToYouName; + + //Password password; + + //enum LoginType { + // Null, + + // Banned, + // BannedWithInfo, + + // FirstConnectPassword, + // FirstConnect, + + // NotOnWhitelistNoInfo, + // NotOnWhitelist, + + // LoginWithPassword, + // BasicLogin, + //} + //int state = 0; + volatile MTerrain[] terrain; + // string web; + + //const int downloadingSpawnAreaMax = 53; + //int downloadedSpawnArea = 0; + //// bool cmdWeb; + //byte[] byteData = new byte[1024]; + //Current current; + //bool Error = false; + //int joinedPlayers = 0; + //Socket clientSocket; + //string serverName = ""; + //int maxplayers = 10; + //DateTime tpPlayerTime; + //string tpPlayerMsgWaiting; + //int safeSpawn = 0; + //List players = new List(); + //// bool UseBackColor; + //// Color BackColor; + //// bool UseGedo; + //GameButtonMedium menu; + //float Process { + // get { return state/496f; } + //} + //string sn = ""; + + // public string playedWorld = ""; + + + // const int hour=3000; + //const int dayLenght=72000; + // List DroppedItems=new List(); + //#region Mouse & keyboard + //bool mouseLeftPress; + //bool mouseLeftRelease; + //bool mouseLeftDown; + + //bool mouseRightPress; + //bool mouseRightRelease; + //bool mouseRightDown; + + //Vector2 mousePos; + + //MouseState newMouseState; + //MouseState oldMouseState; + //int previousScrollValue; + //KeyboardState oldKeyboardState; + //KeyboardState newKeyboardState; + //#endregion + // #region Weather & time (day/night) + // Rain + //int rainDuration; + //int changeRain = 1250; + //List rainDots; + //bool wind, rain; + + ////Time + //int day, timeToChageWind, timer5; + //int time; + //int _secondTimer=60; + + //// Day / night + //float dayAlpha; + //float moonSpeed; + //#endregion + // #region Debug + //bool debug; + // List energy; + //PerformanceCounter cpu; + //PerformanceCounter ram; + //PerformanceCounter cpuUsage; + //PerformanceCounter freeRam; + + //float usageCpuProcess; + //float usageCpu; + //float usageRamProcess; + //float usageRam; + + //bool show; + //bool showBlocks; + //#endregion + // #region + // int inventory =0;// 0==not 1==normal 2==desk 3==furnace stone;4==furnace electric;5 ==macerator 6==shelf + + // int inventoryScrollbarValue=0; + // int selectedCraftingItem; + // int inventoryScrollbarValueCrafting=0; + // int inventoryScrollbarValueCraftingMax=0; + // int boxSelected; + + // bool mouseDraw =false; + // bool invMove; + // int invStart; + // DInt invStartDInt; + // bool leftMove; + // int maxInvCount; + + // DInt selectedMashine; + + // GeDo gedo; + // List Inventory; + // List Crafting; + // List Need; + + // int diserpeard=255; + // string text=""; + + // int craftingType; + + //// string newKey; + // bool hold; + // int timeHold; + // string lastKey; + // string olderKey; + // #endregion + // #region Bars + //float barWater = 16; + //float barEat = 16; + //readonly float barOxygen=0; + //float barHeart=16; + //float barEnergy=0; + //#endregion + // #region Player + // int PlayerX, PlayerY; + + // int playerImg; + // int playerState; + // int distanceToGround=0; + // float gravitySpeed=0; + // #endregion + + // #region Block destruction + //DInt destroyBlock; + + //float destroingIndex; + //float destringMaxIndex; + + //bool destroing; + + //int destroingBlockDepth; + //byte destroingBlockType; + //#endregion + + // #region Varibles + // RenderTarget2D fogTarget; + // #region Inventory + + // int terrainStartIndexX, terrainStartIndexY, terrainStartIndexW, terrainStartIndexH; + + // #endregion + // // float itemAnimationPos; + // #region Buttons + // Button + // buttonNext, + // buttonPrev, + // buttonCraft1x, + // buttonCraft10x, + // buttonCraft100x; + + //ImgButton + + // buttonClose, + // buttonInvTabBlocks, + // buttonInvTabPlants, + // buttonInvTabTools, + // buttonInvTabMashines, + // buttonInvTabItems, + // buttonInvTabCeramics, + // buttonInvTabFood, + // buttonInvTabGlass, + // buttonInvTabMaterials; + // #endregion + + // int WindowXWithout; + // int WindowYWithout; + + // int WindowCenterX; + // int WindowCenterY; + + // float WindowXPlayer; + // float WindowYPlayer; + + // int WindowX; + // int WindowY; + + // readonly BlendState Multiply = new BlendState() { + // AlphaSourceBlend = Blend.Zero, + // AlphaDestinationBlend = Blend.SourceColor, + // ColorSourceBlend = Blend.Zero, + // ColorDestinationBlend = Blend.SourceColor + // }; + + // readonly int Zoom16=(int)(16*Setting.Zoom); + + + //List lightsLamp; + // #region Inventory + //int inventory =0;// 0==not 1==normal 2==desk 3==furnace stone;4==furnace electric;5 ==macerator 6==shelf + + //int inventoryScrollbarValue=0; + //int selectedCraftingItem; + //int inventoryScrollbarValueCrafting=0; + //int inventoryScrollbarValueCraftingMax=0; + //int boxSelected; + + //bool mouseDraw =false; + //bool invMove; + //int invStart; + //DInt invStartDInt; + //bool leftMove; + //int maxInvCount; + + //DInt selectedMashine; + + //GeDo gedo; + //List Inventory; + //List Crafting; + //List Need; + + //int diserpeard=255; + //string text=""; + + //int craftingType; + + //string newKey; + //bool hold; + //int timeHold; + //string lastKey; + //string olderKey; + // #endregion + // #region Textures + // Texture2D + //messageLeft, + // bottleFullTexture, + // boxWoodenTexture, + // messageCenter, + // messageRight, + // // pixel, + // lightmap, + // jugTexture, + // jugWithWaterTexture, + // //backDolomiteTexture, + // //backBasaltTexture, + // //backLimestoneTexture, + // //backRhyoliteTexture, + // //backGneissTexture, + // //backSandstoneTexture, + // //backSchistTexture, + // //backGabbroTexture, + // //backDioritTexture, + // // boxTexture, + // flaxSeedsTexture, + // fishCookedTexture, + // flaxInvTexture, + // invStrawberryTexture, + // invRashberryTexture, + // invBlueberryTexture, + // //ItemPlantBlueberryTexture, + // shelfTexture, + // boxAdvTexture, + // nailTexture, + // siliciumTexture, + // //Player + // playerTexture, + // playerLeftTexture, + // playerRightTexture, + + // //Items + // condenserTexture, + // diodeTexture, + // tranzistorTexture, + // resistanceTexture, + // motorTexture, + // bareLabelTexture, + + // //Blocks + // roof1Texture, + // roof2Texture, + // scrollbarUpTexture, + // scrollbarBetweenTexture, + // scrollbarDownTexture, + // // Inventories + // inventoryNeedTexture, + // //inventoryChooseTexture, + // //inventoryCreativeTexture, + // inventorySlotTexture, + // inventoryBasicTexture, + // // inventoryClothesTexture, + + // //deskInventoryTexture, + // //maceratorInventoryTexture, + // //furnaceInventoryStoneTexture, + // //furnaceInventoryElectricTexture, + // clothTexture, + // yarnTexture, + // chickenEatTexture, + // chickenWalkTexture, + // rabbitEatTexture, + // rabbitJumpTexture, + // rabbitWalkTexture, sunTexture, + + // sawCopperTexture, + // sawBronzeTexture, + // sawIronTexture, + + + // electricDrillTexture, + + // electricSawTexture, + + // //Fonts + // //hammerBronzeTexture, + // hammerBronzeTexture, + // hammerIronTexture, + // barEnergyTexture, + // shearsCopperTexture, + // shearsBronzeTexture, + // shearsIronTexture, + + // plateCopperTexture, + // plateIronTexture, + // plateBronzeTexture, + // plateAluminiumTexture, + // plateGoldTexture, + + // oneBrickTexture, + // oneMudBrickTexture, + + // //buttonCraftTexture, + + + // boletusTexture, + // // onionTexture, + // coralTexture, + // flaxTexture, + // toadstoolTexture, + // champignonTexture, + // sugarCaneTexture, + // seaweedTexture, + // heatherTexture, + // clayTexture, + + // dolomiteTexture, + // basaltTexture, + // limestoneTexture, + // rhyoliteTexture, + // gneissTexture, + // sandstoneTexture, + // schistTexture, + // gabbroTexture, + // dioritTexture, + + // lavaTexture, + + // // dolomiteBrickTexture, + // // basaltBrickTexture, + // // limestoneBrickTexture, + // // rhyoliteBrickTexture, + // // gneissBrickTexture, + // // sandstoneBrickTexture, + // // schistBrickTexture, + // // gabbroBrickTexture, + // //dioritBrickTexture, + + // radioInvTexture, + // advancedSpaceBackTexture, + // advancedSpaceWindowTexture, + // advancedSpaceBlockTexture, + // advancedSpacePart1Texture, + // advancedSpacePart2Texture, + // advancedSpacePart3Texture, + // advancedSpacePart4Texture, + // advancedSpaceFloorTexture, + // doorInvTexture, + + + // orangeWoodTexture, + // lemonWoodTexture, + // ItemOrangeWoodTexture, + // ItemLemonWoodTexture, + // orangeLeavesTexture, + // orangeLeavesWithOrangesTexture, + // lemonLeavesTexture, + // lemonLeavesWithLemonsTexture, + // orangeSaplingTexture, + // lemonSaplingTexture, + // ItemOrangeTexture, + // ItemLemonTexture, + + // ItemIronAxeTexture, + // ItemIronShovelTexture, + // ItemIronPickaxeTexture, + // Snow, + // branchesTexture, + // oilTexture, + // lianaTexture, + // ItemStoneAxeTexture, + // ItemStoneShovelTexture, + // ItemStonePickaxeTexture, + + // //ItemStoneHeadAxeTexture, + // //ItemStoneHeadShovelTexture, + // //ItemStoneHeadPickaxeTexture, + + // ItemIronHeadAxeTexture, + // ItemIronHeadShovelTexture, + // ItemIronHeadPickaxeTexture, + + // //ItemFrameworkAxeTexture, + // //ItemFrameworkShovelTexture, + // //ItemFrameworkPickaxeTexture, + + + // //shelfInventoryTexture, + + // //logo, + + // branchWithoutTexture, + // branchALittle1Texture, + // branchALittle2Texture, + // branchFullTexture, + + // // Still Items + // furnaceStoneOneTexture, + // maceratorOneTexture, + // furnaceElectricOneTexture, + // labelOneTexture, + // ashTexture, + // coalWoodTexture, + // snowTopTexture, + + // // Bars + // barEatTexture, + // barWaterTexture, + // barOxygenTexture, + // barHeartTexture, + + // // Textures blocks + // //stoneTexture, + // rocks0Texture, + // rocks1Texture, + // rocks2Texture, + // rocks3Texture, + // dirtTexture, + // gravelTexture, + // //lavaTexture, + // sandTexture, + // waterTexture, + // snowTexture, + // iceTexture, + // cobblestoneTexture, + + // //Oak + // oakWoodTexture, + // oakLeavesTexture, + // oakSaplingTexture, + + // //Pine + // pineWoodTexture, + // pineLeavesTexture, + // pineSaplingTexture, + + // //Spruce + // spruceWoodTexture, + // spruceLeavesTexture, + // spruceSaplingTexture, + + // //Linden + // lindenWoodTexture, + // lindenLeavesTexture, + // lindenSaplingTexture, + + // //Apple + // appleWoodTexture, + // appleLeavesTexture, + // appleSaplingTexture, + // appleLeavesWithApplesTexture, + + // //Plum + // plumWoodTexture, + // plumLeavesTexture, + // plumSaplingTexture, + // plumLeavesWithPlumsTexture, + + // //Cherry + // cherryWoodTexture, + // cherryLeavesTexture, + // cherrySaplingTexture, + // cherryLeavesWithCherriesTexture, + + // //Ores + // ironOreTexture, + // coalOreTexture, + // goldOreTexture, + // silverOreTexture, + // aluminiumOreTexture, + // copperOreTexture, + // tinOreTexture, + + // //GrassBlock + // grassBlockPlainsTexture, + // grassBlockHillsTexture, + // grassBlockForestTexture, + // grassBlockDesertTexture, + // grassBlockJungleTexture, + + // //CraftingBlocks + // bricksTexture, + // deskTexture, + // doorOpenTexture, + // doorCloseTexture, + // furnaceElectricTexture, + // furnaceStoneTexture, + // glassTexture, + // hayBlockTexture, + // labelTexture, + // ladderTexture, + // lampTexture, + // //lindenPlanksTexture, + // maceratorTexture, + // minerTexture, + // //oakPlanksTexture, + // moonTexture, + // //pinePlanksTexture, + // //potatoesTexture, + // radioTexture, + + // solarPanelTexture, + // planksTexture, + + // torchTexture, + // flagTexture, + // fenceTexture, + // //rocketTexture, + // waterMillTexture, + // windMillTexture, + // //bonfireTexture, + + // // Plants + // plantAloreTexture, + // plantCarrotTexture, + // plantOnionTexture, + // plantPeasTexture, + + // ItemPeasTexture, + // ItemCarrotTexture, + + // blueberryPlantTexture, + // strawberryPlantTexture, + // rashberryPlantTexture, + + // wheatTexture, + + // cactusBigTexture, + // cactusLittleTexture, + + // grassJungleTexture, + // grassDesertTexture, + // grassForestTexture, + // grassHillsTexture, + // grassPlainsTexture, + + // plantVioletTexture, + // plantRoseTexture, + // plantOrchidTexture, + // plantDandelionTexture, + + // // Inventory + // //boxInventoryTexture, + // //boxBackpackTexture, + // //boxCraftingTexture, + // //boxSelectedTexture, + + // torchInvTexture, + + // // Background + // backgroundDirtTexture, + // backgroundGravelTexture, + // //backgroundStoneTexture, + // backgroundSandTexture, + + // // Animals + // fishTexture0, + // fishTexture1, + + // // Animations + // BoublesTexture, + // WaterSquirtTexture, + // destructionTexture, + + // // Textures Other + + // //scrollbarTexture, + // //buttonPlayTexture, + // //buttonSettingTexture, + // //buttonNewWorldTexture, + // //ButtonOkTexture, + + // //// BackGround + // //backgroundTexture0, + // //backgroundTexture1, + // //backgroundTexture2, + // //backgroundTexture3, + // //backgroundTexture4, + // //backgroundTexture5, + // //backgroundTexture6, + // //backgroundTexture7, + // //backgroundTexture8, + // //backgroundTexture9, + + // // Blocks - Items + // //ItemBlockLeavesTexture, + // //ItemBricksTexture, + // //ItemDirtTexture, + // //ItemGlassTexture, + // //ItemGravelTexture, + // //ItemHayBlockTexture, + // //ItemSandTexture, + + // //Dusts + // ItemAluminiumDustTexture, + // ItemBronzeDustTexture, + // ItemCoalDustTexture, + // ItemCopperDustTexture, + // ItemGoldDustTexture, + // ItemIronDustTexture, + // ItemSilverDustTexture, + // ItemStoneDustTexture, + // //ItemDustSulfidTexture, + // ItemTinDustTexture, + // //ItemUranDustTexture, + // ItemWoodDustTexture, + + // //Electronic + // ItemBatteryTexture, + // ItemBigCircuitTexture, + // ItemBulbTexture, + // ItemCircuitTexture, + // ItemRubberTexture, + + // //Food + // ItemAppleTexture, + // ItemBananaTexture, + // ItemCherryTexture, + // ItemOnionTexture, + // ItemPlumTexture, + // ItemRabbtCookedMeatTexture, + // ItemRabbitMeatTexture, + // rashberryTexture, + // strawberryTexture, + // blueberryTexture, + + // //Ingots + // ItemAluminiumIngotTexture, + // ItemBronzeIngotTexture, + // ItemCopperIngotTexture, + // ItemGoldIngotTexture, + // ItemIronIngotTexture, + // ItemSilverIngotTexture, + // ItemTinIngotTexture, + // // ItemUranIngotTexture, + + // //MashinesBlocks + // //ItemDeskTexture, + // ItemDoorTexture, + // ItemFlagTexture, + // //ItemFurnaceElectricTexture, + // //ItemFurnaceStoneTexture, + // //ItemLabelTexture, + // //ItemLadderTexture, + // //ItemLampTexture, + // //ItemMaceratorTexture, + // //ItemMinerTexture, + // //ItemRadioTexture, + // ItemRocketTexture, + // //ItemSolarPanelTexture, + // //ItemTorchTexture, + // ItemWaterMillTexture, + // ItemWindMillTexture, + + // //Nature + // //ItemCactusTexture, + // //ItemDandelionTexture, + // ItemHayTexture, + // ItemLeatherTexture, + // ItemLeaveTexture, + // //ItemOrchidTexture, + // //ItemRoseTexture, + // ItemSeedsTexture, + // ItemStickTexture, + // ItemSticksTexture, + // //ItemVioletTexture, + // ItemWheatSeedsTexture, + // ItemWheatStrawTexture, + + // ItemOakSaplingTexture, + // ItemPineSaplingTexture, + // ItemLindenSaplingTexture, + // ItemPlumSaplingTexture, + // ItemCherrySaplingTexture, + // ItemAppleSaplingTexture, + // ItemSpruceSaplingTexture, + + + // //Rocks + // ItemCoalTexture, + // ItemCopperTexture, + // ItemDiamondTexture, + // ItemAluminiumTexture, + // ItemGoldTexture, + // ItemIronTexture, + // ItemPlasticTexture, + // ItemRubyTexture, + // ItemSaphiriteTexture, + // ItemSilverTexture, + // ItemSmaragdTexture, + // ItemBigStoneTexture, + // ItemMediumStoneTexture, + // ItemSmallStoneTexture, + // ItemTinTexture, + // // ItemUranTexture, + + // //Tools + // ItemBackpackTexture, + // ItemBucketTexture, + // ItemBucketWaterTexture, + // ItemRopeTexture, + + // //Wood + // //ItemLindenPlanksTexture, + // ItemLindenWoodTexture, + // //ItemSprucePlanksTexture, + // ItemSpruceWoodTexture, + // //ItemOakPlanksTexture, + // ItemOakWoodTexture, + // //ItemPinePlanksTexture, + // ItemPineWoodTexture, + // //ItemCherryPlanksTexture, + // ItemCherryWoodTexture, + // //ItemPlumPlanksTexture, + // ItemPlumWoodTexture, + // //ItemApplePlanksTexture, + // buttleTexture, + // ItemAppleWoodTexture; + // #endregion + + //Chunk[] terrain; + //bool geft = false; + + //List energy; + + //List rainDots; + + + //Vector2 mousePos; + // readonly List waterSquirt; + //Texture2D playerTexture, playerLeftTexture, playerRightTexture; + //int timer = 10; + //List world = new List(); + + + + #region Keyboard and Mouse + //bool mouseLeftPress; + // bool mouseLeftRelease; + // bool mouseLeftDown; + + + #endregion + + // bool invMove =false; + + + // GeDo gedo; + + //float barOxygen=16; + // int invStart=0; + // bool leftMove=true; + // string newKey; + //bool hold; + //int timeHold; + //string lastKey; + //string olderKey; + // int walkingSoundDuration; + // SoundEffect walking,rainEffect,eating; + // Song songHappend, songMedium, songRoot, songStorm; + + // CheckPassword chp; + // #region Interworking + //MouseState oldMouseState, newMouseState; + //KeyboardState oldKeyboardState, newKeyboardState; + + //Texture2D Pixel; + //enum Step { + // Checking, + // Logining, + // Terrain, + // Assets, + //} + //MouseState ms=new MouseState(); + // int PlayerX = 200; + // float PlayerY = 200; + + // public Matrix Translation; + + + + + //List lightPos; + + + + //bool first=true; public ContentManager cm; + //KeyboardState ks=new KeyboardState(); + //KeyboardState oks=new KeyboardState(); + // SoundEffect walking, eating, rainEffect; + //Step step=Step.Checking; + // SpriteFont spriteFont_small, spriteFont_small_italic, spriteFont_medium, spriteFont_big, spritefontBiggest; + //SpriteBatch spriteBatch; /*List LightPos=new List();*/ + // #endregion + + + // #region Blocks type + + //#region Block + //List + // roof1, + // roof2, + //rocket, + // heather, + // boletus, + // //onion, + // coral, + // //blueberriesFlowers, + // //blueberriesNone, + // //blueberriesFoodtable, + // seaweed, + // sugarCane, + // champignon, + // toadstool, + + + // dolomite, + // basalt, + // limestone, + // rhyolite, + // gneiss, + // sandstone, + // schist, + // gabbro, + // diorit, + + // lava, + + // dolomiteBrick, + // basaltBrick, + // limestoneBrick, + // rhyoliteBrick, + // gneissBrick, + // sandstoneBrick, + // schistBrick, + // gabbroBrick, + // dioritBrick, + + + // doorOpen, + //doorClose, + // //Blocks + // advancedSpaceFloor, + // advancedSpaceBack, + // advancedSpaceWindow, + // advancedSpaceBlok, + // advancedSpacePart1, + // advancedSpacePart2, + // advancedSpacePart3, + // advancedSpacePart4, + + // orangeWood, + // orangeSapling, + // lemonSapling, + // lemonWood, + // orangeLeaves, + // orangeLeavesWithOranges, + // lemonLeaves, + // lemonLeavesWithLemons, + // sand, + // liana, + // dirt, + // ice, + // snow, + // //strawberryNone, + // //rashberryNone, + // // strawberryFoodtable, + // //rashberryFoodtable, + // // strawberryWithFlowers, + // //rashberryWithFlowers, + // cobblestone, + // gravel, + // //stone, + // oil, + // snowTop, + // branches, + // branchWithout, + // branchALittle1, + // branchALittle2, + // branchFull, + + // grassPlainsBlock, + // grassHillsBlock, + // grassJungleBlock, + // grassDesertBlock, + // grassForestBlock, + + // //Plants + // plantViolet, + // plantRose, + // plantOrchid, + // plantDandelion, + + // grassPlains, + // grassDesert, + // grassJungle, + // grassHills, + // grassForest, + + // cactusBig, + // cactusLittle, + // plantAlore, + + // //plantCarrot, + // //plantChives, + + // //plantOnion, + // //plantPeas, + + // //Ores + // ironOre, + // coalOre, + // goldOre, + // aluminiumOre, + // // stoneOre, + // copperOre, + // silverOre, + // tinOre, + + // //Apple + // appleWood, + // appleLeaves, + // appleSapling, + // appleLeavesWithApples, + + // //Plum + // plumWood, + // plumLeaves, + // plumSapling, + // plumLeavesWithPlums, + + // //Cherry + // cherryWood, + // cherryLeaves, + // cherrySapling, + // cherryLeavesWithCherries, + + // //Oak + // oakWood, + // oakLeaves, + // oakSapling, + + // //Spruce + // spruceWood, + // spruceLeaves, + // spruceSapling, + + // //Pine + // pineWood, + // pineLeaves, + // pineSapling, + + // //Linden + // lindenWood, + // lindenLeaves, + // lindenSapling, + + // //Crafted + // bricks, + // glass, + // hayBlock, + // desk, + // ladder, + + // oakPlanks, + // lindenPlanks, + // sprucePlanks, + // pinePlanks, + + // solarPanel, + + // //BackBlocks + // backgroundDirt, + // backgroundGravel, + // backgroundStone, + // backgroundSand; + //#endregion + + //#region Animated Blocks + //List + // torch, + // flag, + // windmill, + // watermill; + //#endregion + + //#region Plants + //List + //wheat, + //strawberry, + //rashberry, + //blueberry, + //onion, + //flax, + //carrot, + //chives, + //peas; + //#endregion + + //#region ScreenBlocks + //List fence, rocks, label; + //#endregion + + //#region MashinesBlocks + //List + // macerator, + // furnaceElectric, + // radio, + // furnaceStone, + // lamp, + // miner; + //#endregion + + //#region BoxBlocks + //List + // shelf, + // box; + //#endregion + + //#region Water + //List waterBlock; + //#endregion + + //#region Animals + //List chicken, rabbit; + //#endregion + + //#region Fishs + //List fish; + //#endregion + + //#endregion + + //FastRandom FastRandom; + //bool existsWDown; + //bool existsWRight; + //bool existsWLeft; + //int playerImg; + //int playerState; + //float playerGravity; + // private bool geft; + //private int playerJump; + //private float barEat; + //private float barWater; + //private int walkingSoundDuration; + //private bool wind; + //private bool debug; + // private bool destruction; + //private bool notAnimated; + //private AnimatedBlock destructionBlockIndexA; + // private Block destructionBlockIndex; + //private float destructionIndex; + //private float destructionTime; + //private bool show=true; + //private float time; + // private int day; + //int inventory = 0;// 0==not 1==normal 2==desk 3==furnace stone;4==furnace electric;5 ==macerator 6==shelf + //List Inventory; + //private int moonSpeed; + //bool smd = false; + public int port; + public IPAddress ip; + string ErrorHeader = ""; + string ErrorText = ""; + //string password = ""; + //bool waitingPassword = false; + //DateTime start; + + + //string name; + //bool active; + // bool backColor; + //Color color; + // public bool gedo; + + //bool autoJoinGroup; + //string newGroup; + //DateTime daysGoTo; + + //bool editMoreGroups; + //string[] moreGroups; + + bool tpSpawn; + bool tpEverywhere; + bool tpPlayer; + bool tpPlayerMessage; + + bool changeSpawn; + bool changeTerrainSpawn; + bool changeWarps; + //bool otherWarpsDoNotChange; + + //public bool freeItems; + // bool cmdRemoveItems; + + // bool allowFly; + bool allowChangeGametype; + + //bool paswords; + // bool doNotConnect; + //bool kickOtherPlayerIfFull; + //bool cannotBeKickedIfFull; + + bool cmdPing; + bool cmdMsg; + bool cmdMsgAll; + bool cmdLog; + bool cmdKick; + + bool cmdServerEnd; + bool cmdServerReset; + bool cmdServerBackup; + + // bool kit; + + int spawnX; + int spawnY; + #endregion + + //void DestroyBlockTopBlock(int x, int y) { + // MTerrain chunk=terrain[x]; + // SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Top); + // chunk.TopBlocks[y]=null; + // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved; + //} + //void DestroyBlockBackBlock(int x, int y) { + // MTerrain chunk=terrain[x]; + // SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Back); + // chunk.BackBlocks[y]=null; + // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved; + //} + + //void DestroyBlockSolidBlock(int x, int y) { + // MTerrain chunk=terrain[x]; + // SendRemovedBlock(x, y, chunk.SolidBlocks[y].Id,BlockType.Solid); + // chunk.TopBlocks[y]=null; + // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved; + //} + + //void DestroyBlockPlant(int x, int y) { + // MTerrain chunk=terrain[x]; + // chunk.TopBlocks[y]=null; + // SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Plant); + // chunk.Plants[y]=MBlockState.TmpRemoved; + //} + + //void DestroyBlockTopBlock(int x, int y) { + // MTerrain chunk=terrain[x]; + // chunk.TopBlocks[y]=null; + // SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Top); + // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved; + //} + + #region Varibles + TextWithMeasure textWriting;bool mousePosChanged;DInt startMovePos; LiveObject[] LiveObjects;TextWithMeasure textHeader,textMore; List FallingLeaves; + List Particles; + List WavingPlants; + Color ColorNightColorBack; + Color ColorNightColorBackRain; + Rectangle Fullscreen;float ConstNightAlpha; + Texture2D + TextureParrotStill, + TextureParrotFly; + int invStartId; + List FurnaceStone, Chargers, windable, Miners, Composters, bucketRubber, OxygenMachines/*, Barrels*/; + Text itemText; + const float divider_16=1f/16f; Text textDie, textDieInfo, textRespawnIn, textOpenInventory, textChooseItemWindow; + GameButtonSmall ButtonCrafting, ButtonItems, ButtonSeal; + ItemInv mouseItem;ushort mouseItemId; + string mouseItemName; + ItemInv[] invStartInventory; + int destroyBlockX, destroyBlockY; + readonly List<(Color, float)> Gradient=new() { + (Color.CornflowerBlue, 0), + // (new Color(40, 120, 229), 152/542f), + (new Color((byte)103, (byte)160, (byte)209), 268/542f), + (new Color((byte)197, (byte)203, (byte)209), 333/542f), + (new Color((byte)235, (byte)197, (byte)156), 375/542f), + (new Color((byte)255, (byte)186, (byte)64), 455/542f), + (new Color((byte)255, (byte)75, (byte)37), 1f), + }; + const int + InventoryClothesSlotCap=0, + InventoryClothesSlotTShirt=1, + InventoryClothesSlotTrousers=2, + InventoryClothesSlotShoes=3, + InventoryClothesSlotCoat=4, + InventoryClothesSlotBra=5, + InventoryClothesSlotUnderwear=6, + InventoryClothesSlotBackpack=7; + + GameButtonSmall + //buttonRocket, + //buttonRadio, + //buttonNext, + //buttonPrev, + //buttonCraft1x, + //buttonCraft10x, + //buttonCraft100x, + + buttonContinue, + buttonExit, + buttonUseGiftCode, + buttonAcheavements; + + const int + InvMaxComposter=9, + InvMaxBarrel=2, + InvMaxShelf=9, + InvMaxBoxWooden=24, + InvMaxBoxAdv=4*12, + InvMaxFurnaceStone=4, + InvMaxMiner=12*2; + bool creativeTabCrafting=true;List GunShots; + bool easter;float scrollBarCreative; + readonly List lightsFull=new List(); + readonly List lightsHalf=new List(); + bool showMouseItemWhileMooving; + const float WalkingHandMaxAngle=0.4f; + const int HandSize=18; + int speedDir; + int TerrainLength; + int mouseItemNameWidth; + Texture2D[] TextureEggDropE; + Vector2 Vector2_2; + Texture2D[] TextureRocks;bool mouseDrawItemTextInfo =false; + bool AchievementStoneAge, + AchievementBronzeAge, + AchievementIronAge, + AchievementFutureAge; + ItemInvBlank itemBlank; + + float swimmingTicks; + Vector2 Vector2Zero; + ItemInv[] InventoryClothes, InventoryCreative, InventoryCrafting, InventoryNormal; + + float handAngle; + + int mousePosRoundX, mousePosRoundY; + #region Clothes + ClothesTypeUnderwearDown + ClothesUnderwearDown, + + ClothesUnderpants, + ClothesBoxerShorts, + ClothesPanties, + ClothesSwimsuit, + ClothesBikiniDown; + + ClothesTypeUnderwearUp + ClothesUnderwearUp, + + ClothesBra, + ClothesBikiniTop; + + ClothesTypeBoots + ClothesFeet, + + ClothesFormalShoes, + ClothesPumps, + ClothesSneakers, + ClothesSpaceBoots; + + ClothesTypeTrousers + ClothesLegs, + + ClothesJeans, + ClothesShorts, + ClothesSkirt, + ClothesArmyTrousers, + ClothesSpaceTrousers; + + ClothesTypeTShirt + ClothesChest, + + ClothesTShirt, + ClothesShirt, + ClothesDress, + ClothesTop; + + ClothesTypeCoat + ClothesChestTop, + + ClothesCoatArmy, + ClothesCoat, + ClothesJacketDenim, + ClothesJacketFormal, + ClothesJacketShort, + ClothesSpaceSuit; + + ClothesTypeHelmet + ClothesHead, + + ClothesCap, + ClothesHad, + ClothesCrown, + ClothesSpaceHelmet; + #endregion + Color + ColorWhite, + ColorSmokeWhite=new Color(240,240,240); + // Texture2D TextureBarBarrel, pixel; + + bool radioplaying = false; + int PopUpWindowSelectedItem; + int PopUpWindowChoosingPotencialdItem; + CraftingRecipe[] CurrentDeskCrafting; + int SelectedCraftingRecipe = -1; + bool displayPopUpWindow; + GameScrollbar inventoryScrollbar, creativeScrollbar, craftingScrollbar; + bool exit = false; + bool inventoryChanged; + DInt wantedBlocksInv = new DInt(); + bool getFromServerInv = false; + // readonly DInt[] InventoryClothes = new DInt[] { new DInt(), new DInt(), new DInt(), new DInt(), new DInt(), new DInt(), new DInt(), new DInt() }; + + + #region Items + List DroppedItems; + float itemAnimationPos, itemAnimationPos2 = 3.1f; + #endregion + + #region Blocks in lists + //List FurnaceStone, Chargers, windable, Miners, Composters, bucketRubber; + List chunksWithPlants; + List lightsLamp; + List movingAnimals; + #endregion + + #region Player + bool died = false; + int timerStayDied; + string diedInfo; + + bool rocket; + bool swimming, waterDown; + bool rocketDown; + float gravity; + + bool notNeedScafander; + + int PlayerX, PlayerY; + + int playerImg; + int playerState; + int distanceToGround = 0; + float gravitySpeed = 0; + bool playerLight = false; + #endregion + + #region Textures + + #region Dye + Texture2D + TextureBin, + TextureEggDrop,TextureOxygenMachine, TextureAirTank, TextureAirTank2, TextureBarrel, TextureIngotSteel, + TextureItemEgg, TextureItemBoiledEgg, TextureWaterGraystyle, TextureChristmasStar, + TextureBarBarrel, pixel, + TextureClouds, + TextureSunGradient, + + TextureChristmasBall, + TextureChristmasBallYellow, + TextureChristmasBallOrange, + TextureChristmasBallRed, + TextureChristmasBallPurple, + TextureChristmasBallPink, + TextureChristmasBallLightGreen, + TextureChristmasBallBlue, + TextureChristmasBallTeal, + TextureAngelHair, + TextureAngelHairWithSpruceLeaves, + + TextureChristmasBallGrayWithLeaves, + TextureChristmasBallYellowWithLeaves, + TextureChristmasBallOrangeWithLeaves, + TextureChristmasBallRedWithLeaves, + TextureChristmasBallPurpleWithLeaves, + TextureChristmasBallPinkWithLeaves, + TextureChristmasBallLightGreenWithLeaves, + TextureChristmasBallBlueWithLeaves, + TextureChristmasBallTealWithLeaves, + + TextureDyeWhite, + TextureDyeYellow, + TextureDyeGold, + TextureDyeOrange, + TextureDyeRed, + TextureDyeDarkRed, + TextureDyePink, + TextureDyePurple, + TextureDyeLightBlue, + TextureDyeBlue, + TextureDyeDarkBlue, + TextureDyeTeal, + TextureDyeLightGreen, + TextureDyeGreen, + TextureDyeDarkGreen, + TextureDyeBrown, + TextureDyeLightGray, + TextureDyeGray, + TextureDyeDarkGray, + TextureDyeBlack, + TextureDyeArmy, + TextureDyeMagenta, + TextureDyeRoseQuartz, + TextureDyeSpringGreen, + TextureDyeViolet, + TextureDyeOlive, + #endregion + + TextureTestTube, + + #region Ore + TextureOreCoal, + TextureOreCopper, + TextureOreTin, + TextureOreGold, + TextureOreIron, + TextureOreSilver, + TextureOreAluminium, + TextureOreSulfur, + TextureOreSaltpeter, + #endregion + + #region Back blocks + TextureBackSulfurOre, + TextureBackSaltpeterOre, + + backgroundDirtTexture, + backgroundGravelTexture, + backgroundSandTexture, + backgroundCobblestoneTexture, + backgroundRegoliteTexture, + backgroundRedSandTexture, + backgroundClayTexture, + + backgroundAnorthositeTexture, + backgroundBasaltTexture, + backgroundDioritTexture, + backgroundDolomiteTexture, + backgroundFlintTexture, + backgroundGabbroTexture, + backgroundGneissTexture, + backgroundLimestoneTexture, + backgroundMudstoneTexture, + backgroundRhyoliteTexture, + backgroundSandstoneTexture, + backgroundSchistTexture, + + backgroundCoalTexture, + backgroundCopperTexture, + backgroundTinTexture, + backgroundIronTexture, + backgroundAluminiumTexture, + backgroundSilverTexture, + backgroundGoldTexture, + #endregion + + #region Tools + // Axe + TextureAxeStone, + TextureAxeCopper, + TextureAxeBronze, + TextureAxeGold, + TextureAxeIron, + TextureAxeSteel, + TextureAxeAluminium, + + // Pickaxe + TexturePickaxeStone, + TexturePickaxeCopper, + TexturePickaxeBronze, + TexturePickaxeGold, + TexturePickaxeIron, + TexturePickaxeSteel, + TexturePickaxeAluminium, + + // Shovel + TextureShovelStone, + TextureShovelCopper, + TextureShovelBronze, + TextureShovelGold, + TextureShovelIron, + TextureShovelSteel, + TextureShovelAluminium, + + // Hoe + TextureHoeStone, + TextureHoeCopper, + TextureHoeBronze, + TextureHoeGold, + TextureHoeIron, + TextureHoeSteel, + TextureHoeAluminium, + + // Saw + TextureSawCopper, + TextureSawBronze, + TextureSawIron, + TextureSawSteel, + TextureSawAluminium, + TextureSawGold, + + // Hammer + TextureHammerCopper, + TextureHammerBronze, + TextureHammerGold, + TextureHammerIron, + TextureHammerSteel, + TextureHammerAluminium, + + // Shears + TextureShearsCopper, + TextureShearsBronze, + TextureShearsGold, + TextureShearsIron, + TextureShearsSteel, + TextureShearsAluminium, + + // Knife + // TextureKnifeStone, + TextureKnifeCopper, + TextureKnifeBronze, + TextureKnifeGold, + TextureKnifeIron, + TextureKnifeSteel, + TextureKnifeAluminium, + + // Electric + TextureDrillElectric, + TextureGun, + TextureTorchOff, + electricSawTexture, + #endregion + + #region Tools head + // Pickaxe + TexturePickaxeHeadCopper, + TexturePickaxeHeadBronze, + TexturePickaxeHeadGold, + TexturePickaxeHeadIron, + TexturePickaxeHeadSteel, + TexturePickaxeHeadAluminium, + + // Shovel + TextureShovelHeadCopper, + TextureShovelHeadBronze, + TextureShovelHeadGold, + TextureShovelHeadIron, + TextureShovelHeadSteel, + TextureShovelHeadAluminium, + + // Axe + TextureAxeHeadCopper, + TextureAxeHeadBronze, + TextureAxeHeadGold, + TextureAxeHeadIron, + TextureAxeHeadSteel, + TextureAxeHeadAluminium, + + // Hoe + TextureHoeHeadCopper, + TextureHoeHeadBronze, + TextureHoeHeadGold, + TextureHoeHeadIron, + TextureHoeHeadSteel, + TextureHoeHeadAluminium, + + // Shears + TextureShearsHeadCopper, + TextureShearsHeadBronze, + TextureShearsHeadGold, + TextureShearsHeadIron, + TextureShearsHeadSteel, + TextureShearsHeadAluminium, + + // Knife + TextureKnifeHeadCopper, + TextureKnifeHeadBronze, + TextureKnifeHeadGold, + TextureKnifeHeadIron, + TextureKnifeHeadSteel, + TextureKnifeHeadAluminium, + + + + #endregion + + #region player + TextureHand, + // TextureHandDown, + + // Static + TexturePlayerStaticFeet, + TexturePlayerStaticLegs, + TexturePlayerStaticChest, + // TexturePlayerStaticHead, + TexturePlayerStaticHair, + TexturePlayerStaticFace, + TexturePlayerStaticMoustage, + TexturePlayerStaticMouth, + TexturePlayerStaticEyes, + + // Walking + TexturePlayerWalkingFeet, + TexturePlayerWalkingFeetForShoes, + TexturePlayerWalkingLegs, + TexturePlayerWalkingChest, + TexturePlayerWalkingFace, + TexturePlayerWalkingHair, + TexturePlayerWalkingMoustage, + TexturePlayerWalkingMouth, + TexturePlayerWalkingEyes, + // TexturePlayerWalkingLegsWoman, + + // Swimming + TexturePlayerSwimmingFeet, + TexturePlayerSwimmingLegs, + // TexturePlayerSwimmingChest, + // TexturePlayerSwimmingLegsWoman, + + + TextureInventoryClothes, + //TextureWalkingClothesHead, + //TextureWalkingClothesFeet, + //TextureWalkingClothesChest, + //TextureWalkingClothesChestTop, + //TextureWalkingClothesLegs, + //TextureWalkingClothesUnderwearUp, + //TextureWalkingClothesUnderwearDown, + //ClothesHead, + //ClothesFeet, + //ClothesChest, + //ClothesChestTop, + //ClothesLegs, + //ClothesUnderwearUp, + //ClothesUnderwearDown, + //TextureSwimmingClothesFeet, + //TextureSwimmingClothesChest, + //TextureSwimmingClothesChestTop, + //TextureSwimmingClothesLegs, + //TextureSwimmingClothesUnderwearUp, + //TextureSwimmingClothesUnderwearDown, + + + TextureWalkingUpCensored, + TextureWalkingDownCensored, + + TextureStaticUpCensored, + TextureStaticDownCensored, + + TextureSwimmingUpCensored, + TextureSwimmingDownCensored, + + + //TextureWalkingFormalShoes, + //TextureWalkingPumps, + //TextureWalkingSneakers, + //TextureWalkingSpaceBoots, + + //TextureWalkingJeans, + //TextureWalkingShorts, + //TextureWalkingSkirt, + //TextureWalkingArmyTrousers, + //TextureWalkingSpaceTrousers, + + //TextureWalkingTShirt, + //TextureWalkingSpaceSuit, + //TextureWalkingShirt, + //TextureWalkingDress, + + //TextureWalkingCap, + //TextureWalkingHad, + //TextureWalkingCrown, + //TextureWalkingSpaceHelmet, + + //TextureWalkingUnderpants, + //TextureWalkingBoxerShorts, + //TextureWalkingPanties, + //TextureWalkingSwimsuit, + //TextureWalkingBikiniDown, + + //TextureWalkingCoatArmy, + //TextureWalkingCoat, + //TextureWalkingJacketDenim, + //TextureWalkingJacketFormal, + //TextureWalkingJacketShort, + + //TextureWalkingBra, + //TextureWalkingBikiniTop, + + // TextureStaticFormalShoes, + // TextureStaticPumps, + // TextureStaticSneakers, + // TextureStaticSpaceBoots, + + // TextureStaticJeans, + // TextureStaticShorts, + // TextureStaticSkirt, + // TextureStaticArmyTrousers, + // TextureStaticSpaceTrousers, + + // TextureStaticTShirt, + // TextureStaticSpaceSuit, + // TextureStaticShirt, + // TextureStaticDress, + + // TextureStaticCap, + // TextureStaticHad, + // TextureStaticCrown, + // TextureStaticSpaceHelmet, + + // TextureStaticUnderpants, + // TextureStaticBoxerShorts, + // TextureStaticPanties, + // TextureStaticSwimsuit, + // TextureStaticBikiniDown, + + // TextureStaticCoatArmy, + // TextureStaticCoat, + // TextureStaticJacketDenim, + // TextureStaticJacketFormal, + //// TextureStaticJacket, + // TextureStaticJacketShort, + + // TextureStaticBra, + // TextureStaticBikiniTop, + + // TextureSwimmingFormalShoes, + // TextureSwimmingPumps, + // TextureSwimmingSneakers, + // TextureSwimmingSpaceBoots, + + // TextureSwimmingJeans, + // TextureSwimmingShorts, + // TextureSwimmingSkirt, + // TextureSwimmingArmyTrousers, + // TextureSwimmingSpaceTrousers, + + // TextureSwimmingTShirt, + // TextureSwimmingSpaceSuit, + // TextureSwimmingShirt, + // TextureSwimmingDress, + + // TextureSwimmingUnderpants, + // TextureSwimmingBoxerShorts, + // TextureSwimmingPanties, + // TextureSwimmingSwimsuit, + // TextureSwimmingBikiniDown, + + // TextureSwimmingCoatArmy, + // TextureSwimmingCoat, + // TextureSwimmingJacketDenim, + // TextureSwimmingJacketFormal, + //// TextureSwimmingJacket, + // TextureSwimmingJacketShort, + + // TextureSwimmingBra, + // TextureSwimmingBikiniTop, + #endregion + + #region Trees + TextureBranches, + + // Oak + TextureOakWood, + TextureOakLeaves, + oakSaplingTexture, + + // Pine + pineWoodTexture, + pineLeavesTexture, + pineSaplingTexture, + + //Spruce + spruceWoodTexture, + spruceLeavesTexture, + spruceSaplingTexture, + + // Linden + TextureLindenWood, + TextureLindenLeaves, + TextureLindenSapling, + + // Apple + TextureAppleWood, + TextureAppleLeaves, + TextureAppleBlossom, + TextureAppleSapling, + TextureAppleLeavesWithApples, + + // Plum + TexturePlumWood, + TexturePlumLeaves, + TexturePlumBlossom, + plumSaplingTexture, + TexturePlumLeavesWithPlums, + + // Cherry + cherryWoodTexture, + TextureCherryBlossom, + TextureCherryLeaves, + cherrySaplingTexture, + TextureCherryLeavesWithCherries, + + // Orange + TextureOrangeWood, + TextureOrangeLeaves, + TextureOrangeLeavesWithOranges, + orangeSaplingTexture, + + // Lemon + TextureLemonWood, + TextureLemonLeaves, + lemonLeavesWithLemonsTexture, + lemonSaplingTexture, + + // Willow + TextureWillowLeaves, + TextureWillowWood, + TextureWillowSapling, + + // Mangrove + TextureMangroveLeaves, + TextureMangroveWood, + TextureMangroveSapling, + + // Eucalyptus + TextureEucalyptusLeaves, + TextureEucalyptusWood, + TextureEucalyptusSapling, + + // Olive + TextureOliveLeavesWithOlives, + TextureOliveLeaves, + TextureOliveWood, + TextureOliveSapling, + + // Rubber + TextureRubberTreeLeaves, + TextureRubberTreeWood, + TextureRubberTreeSapling, + + // Accacia + TextureAcaciaLeaves, + TextureAcaciaWood, + TextureAcaciaSapling, + + // Kapok + TextureKapokBlossom, + TextureKapokLeavesFibre, + TextureKapokLeaves, + TextureKapokSapling, + TextureKapokWood, + #endregion + + #region Clothes + // Shoes + TextureItemFormalShoes, + TextureItemPumps, + TextureItemSneakers, + TextureItemSpaceBoots, + + // Trousers + skirt + TextureItemJeans, + TextureItemShorts, + TextureItemSpaceTrousers, + TextureItemArmyTrousers, + TextureItemSkirt, + + // T-shirts + dress + TextureItemTShirt, + TextureItemSpaceSuit, + TextureItemDress, + TextureItemShirt, + + // head + TextureItemCap, + TextureItemHat, + TextureItemCrown, + TextureItemSpaceHelmet, + + // bottom + TextureItemUnderpants, + TextureItemBoxerShorts, + TextureItemPanties, + TextureItemSwimsuit, + TextureItemBikiniDown, + + // Top + TextureItemBra, + TextureItemBikiniTop, + + // Coat + TextureItemCoatArmy, + TextureItemCoat, + ItemJacketDenimTexture, + ItemJacketFormalTexture, + // ItemJacketTexture, + TextureItemJacketShort, + #endregion + + #region Foods + + // Fruit + ItemOrangeTexture, + ItemLemonTexture, + ItemAppleTexture, + ItemBananaTexture, + ItemCherryTexture, + ItemPlumTexture, + + rashberryTexture, + strawberryTexture, + blueberryTexture, + + // Wegetable + ItemOnionTexture, + + // Meat + ItemRabbtCookedMeatTexture, + ItemRabbitMeatTexture, + + + #endregion + + TextureSulfur, + TextureSaltpeter, + TextureGunpowder, + TextureAmmo, + + + TextureBucketForRubber, + TextureBucketWithLatex, + TextureResin, + TextureSelectCrafting, + RadioButtonPause, + RadioButtonPlay, + sewingMachineTexture, + + ItemOliveTexture, + ItemKapokFibreTexture, + + CompostTexture, + ComposterTexture, + ComposterFullTexture, + LightElectricTexture, + lightMaskLineTexture, + lightMaskRoundTexture, + rabbitStillTexture, + chickenStillTexture, + lightMaskTexture, + RodTexture, + chargerTexture, + TextureRedSand, + mudstoneTexture, + flintTexture, + stoneHeadTexture, + + rocketTexture, + anorthositeTexture, + regoliteTexture, + solidFuelSmokeTexture, + mobileTexture, + bucketOilTexture, + bottleOilTexture, + bowlEmptyTexture, + bowlMushroomsTexture, + bowlVegetablesTexture, + messageLeft, + bottleEmptyTexture, + bottleWaterTexture, + boxWoodenTexture, + messageCenter, + messageRight, + flaxSeedsTexture, + fishCookedTexture, + flaxInvTexture, + invStrawberryTexture, + invRashberryTexture, + invBlueberryTexture, + shelfTexture, + boxAdvTexture, + nailTexture, + siliciumTexture, + + //Items + condenserTexture, + diodeTexture, + tranzistorTexture, + resistanceTexture, + motorTexture, + bareLabelTexture, + + //Blocks + roof1Texture, + roof2Texture, + scrollbarUpTexture, + scrollbarBetweenTexture, + scrollbarDownTexture, + inventoryNeedTexture, + inventorySlotTexture, + inventorySlotInTexture, + inventorySlotOutTexture, + + clothTexture, + yarnTexture, + chickenEatTexture, + chickenWalkTexture, + rabbitEatTexture, + rabbitJumpTexture, + rabbitWalkTexture, + sunTexture, + + barEnergyTexture, + + plateCopperTexture, + plateIronTexture, + plateBronzeTexture, + plateAluminiumTexture, + plateGoldTexture, + + oneBrickTexture, + oneMudBrickTexture, + + boletusTexture, + + coralTexture, + flaxTexture, + toadstoolTexture, + champignonTexture, + sugarCaneTexture, + seaweedTexture, + heatherTexture, + + dolomiteTexture, + basaltTexture, + limestoneTexture, + rhyoliteTexture, + gneissTexture, + sandstoneTexture, + schistTexture, + gabbroTexture, + dioritTexture, + + lavaTexture, + + radioInvTexture, + advancedSpaceBackTexture, + advancedSpaceWindowTexture, + advancedSpaceBlockTexture, + advancedSpacePart1Texture, + advancedSpacePart2Texture, + advancedSpacePart3Texture, + advancedSpacePart4Texture, + advancedSpaceFloorTexture, + doorInvTexture, + + oilTexture, + lianaTexture, + + branchWithoutTexture, + branchALittle1Texture, + branchALittle2Texture, + branchFullTexture, + + // Still Items + furnaceStoneOneTexture, + maceratorOneTexture, + furnaceElectricOneTexture, + labelOneTexture, + ashTexture, + coalWoodTexture, + snowTopTexture, + + // Bars + barEatTexture, + barWaterTexture, + barOxygenTexture, + barHeartTexture, + + // Textures blocks + //rocks0Texture, + //rocks1Texture, + //rocks2Texture, + //rocks3Texture, + TextureDirt, + gravelTexture, + sandTexture, + waterTexture, + snowTexture, + iceTexture, + cobblestoneTexture, + + //GrassBlock + TextureGrassBlockPlains, + TextureGrassBlockHills, + TextureGrassBlockForest, + TextureGrassBlockDesert, + TextureGrassBlockJungle, + TextureGrassBlockClay, + TextureGrassBlockCompost, + TextureGrassBlockSnow, + + //CraftingBlocks + bricksTexture, + deskTexture, + doorOpenTexture, + doorCloseTexture, + furnaceElectricTexture, + furnaceStoneTexture, + glassTexture, + hayBlockTexture, + labelTexture, + ladderTexture, + lampTexture, + + maceratorTexture, + minerTexture, + TextureMoon, + radioTexture, + + solarPanelTexture, + planksTexture, + + torchTexture, + flagTexture, + waterMillTexture, + windMillTexture, + + // Plants + plantAloreTexture, + plantCarrotTexture, + plantOnionTexture, + plantPeasTexture, + + ItemPeasTexture, + ItemCarrotTexture, + + blueberryPlantTexture, + strawberryPlantTexture, + rashberryPlantTexture, + + wheatTexture, + + cactusBigTexture, + cactusLittleTexture, + + grassJungleTexture, + grassDesertTexture, + grassForestTexture, + grassHillsTexture, + grassPlainsTexture, + + plantVioletTexture, + plantRoseTexture, + plantOrchidTexture, + plantDandelionTexture, + + torchInvTexture, + clayTexture, + + + + // Animals + fishTexture0, + fishTexture1, + + // Animations + destructionTexture, + + //Dusts + ItemAluminiumDustTexture, + ItemBronzeDustTexture, + ItemCoalDustTexture, + ItemCopperDustTexture, + ItemGoldDustTexture, + ItemIronDustTexture, + ItemSilverDustTexture, + ItemStoneDustTexture, + ItemTinDustTexture, + ItemWoodDustTexture, + + //Electronic + ItemBatteryTexture, + ItemBigCircuitTexture, + ItemBulbTexture, + ItemCircuitTexture, + ItemRubberTexture, + + + + #region Ingots + ItemAluminiumIngotTexture, + ItemBronzeIngotTexture, + ItemCopperIngotTexture, + ItemGoldIngotTexture, + ItemIronIngotTexture, + ItemSilverIngotTexture, + ItemTinIngotTexture, + #endregion + + // MashinesBlocks + ItemDoorTexture, + ItemFlagTexture, + ItemRocketTexture, + ItemWaterMillTexture, + ItemWindMillTexture, + + //Nature + ItemHayTexture, + ItemLeaveTexture, + ItemSeedsTexture, + ItemStickTexture, + ItemSticksTexture, + ItemWheatSeedsTexture, + ItemWheatStrawTexture, + + #region Rocks + ItemCoalTexture, + ItemCopperTexture, + ItemDiamondTexture, + ItemAluminiumTexture, + ItemGoldTexture, + ItemIronTexture, + ItemPlasticTexture, + ItemRubyTexture, + ItemSaphiriteTexture, + ItemSilverTexture, + ItemSmaragdTexture, + ItemBigStoneTexture, + ItemMediumStoneTexture, + ItemSmallStoneTexture, + ItemTinTexture, + #endregion + + ItemBackpackTexture, + ItemBucketTexture, + ItemBucketWaterTexture, + ItemRopeTexture; + #endregion + + #region Weather & time (day/night) + float windForce; + int dayLenght = 4800; + const int hour = 200; + + + List lights = new List(); + + // Rain + int rainDuration; + int changeRain = 1250; + List rainDots; + bool wind, rain; + + //Time + int day, timeToChageWind, timer5 = 10; + int time; + int _secondTimer = 60; + int timerDraw60 = 60; + + // Day / night + float dayAlpha; + float moonSpeed; + #endregion + + #region Inventory + InventoryType lastMashineType; + InventoryType inventory = InventoryType.Normal; + Mobile.System mobileOS; + string[] radioSongs; + int inventoryScrollbarValue = 0; + int selectedCraftingItem; + int inventoryScrollbarValueCrafting = 0; + int inventoryScrollbarValueCraftingMax = 0; + int boxSelected; + + bool mouseDraw = false; + bool invMove; + int invStart; + DInt invStartDInt; + bool leftMove; + int maxInvCount; + + DInt selectedMashine; + + GeDo gedo; + // List Inventory; + // List Crafting; + // List Need; + + int diserpeard = 255; + string text = ""; + + // int craftingType; + + bool hold; + int timeHold; + string lastKey; + #endregion + + #region Buttons + GameButtonSmall + buttonNext, + buttonRocket, + buttonRadio, + buttonPrev, + buttonCraft1x, + buttonCraft10x, + buttonCraft100x; + + ImgButton + buttonClose, + buttonClosePopUp, + buttonInvTabBlocks, + buttonInvTabPlants, + buttonInvTabTools, + buttonInvTabMashines, + buttonInvTabItems, + buttonInvTabCeramics, + buttonInvTabFood, + buttonInvTabGlass, + buttonInvTabMaterials, + buttonInvAnimals, + + + buttonInvHead, + buttonInvChest, + buttonInvLegs, + buttonInvShoes, + buttonInvUnderwear; + #endregion + + #region Window + Matrix camera, ZoomMatrix, Translation; + + int WindowXWithout, WindowYWithout, + WindowCenterX, WindowCenterY, + WindowX, WindowY; + + float WindowXPlayer, WindowYPlayer; + + RenderTarget2D sunLightTarget, modificatedLightTarget; + + readonly BlendState Multiply = new BlendState() { + AlphaSourceBlend=Blend.Zero, + AlphaDestinationBlend=Blend.SourceColor, + ColorSourceBlend=Blend.Zero, + ColorDestinationBlend=Blend.SourceColor + }; + + // readonly int Zoom16=(int)(16*Setting.Zoom); + + int terrainStartIndexX, terrainStartIndexY, terrainStartIndexW, terrainStartIndexH; + #endregion + + #region Mouse & keyboard + bool mouseLeftPress, + mouseLeftRelease, + mouseLeftDown, + + mouseRightPress, + mouseRightRelease, + mouseRightDown; + + MouseState newMouseState, oldMouseState; + KeyboardState oldKeyboardState, newKeyboardState; + + int previousScrollValue; + + Vector2 mousePos; + //DInt mousePosDiv16 = new DInt(), + // mouseRealPos = new DInt(), + // mousePosRound = new DInt(); + readonly DInt mousePosDiv16=new DInt(); + // mousePosRound=new DInt(), + // mouseRealPos=new DInt(); + public static int mouseRealPosX, mouseRealPosY; + #endregion + + #region Bars + float barWater = 16; + float barEat = 16; + float barOxygen = 0; + float barHeart = 16; + float barEnergy = 0; + #endregion + + #region Debug + bool debug; + float fps; + float fpss = 0; + PerformanceCounter cpu; + PerformanceCounter ram; + PerformanceCounter cpuUsage; + PerformanceCounter freeRam; + + float usageCpuProcess; + float usageCpu; + float usageRamProcess; + float usageRam; + + bool showInventory = true; + bool showPlayer = true; + #endregion + + #region World + int TerrainLenght; + + public string pathToWorld; + readonly string world = "Earth"; + int autoSave = 300; + List energy; + #endregion + + #region Block destruction + DInt destroyBlock; + + float destroingIndex; + float destringMaxIndex; + + bool destroing; + + BlockType destroingBlockDepth; + ushort destroingBlockType; + + const int DistanceBlockEdit = 200; + #endregion + + #region Fonts + SpriteFont + spriteFont_small, + spriteFont_small_italic, + spriteFont_medium, + spriteFont_big, + spriteFont_biggest; + #endregion + + #region Colors + readonly Color + color_r200_g200_b200_a100 = new Color(200, 200, 200, 100), + color_r0_g0_b0_a200 = new Color(0, 0, 0, 200), + color_r10_g140_b255 = new Color(10, 140, 255), + color_r128_g128_b128 = new Color(128, 128, 128), + color_r128_g128_b128_a128 = new Color(128, 128, 128, 128), + color_r150_g150_b150 = new Color(150, 150, 150), + color_r0_g0_b0_a100 = new Color(0, 0, 0, 100), + color_r255_g0_b0_a100 = new Color(255, 0, 0, 100), + color_r200_g200_b200 = new Color(200, 200, 200), + lampColorLight = new Color(255, 255, 220, 255); + #endregion + + #region Other + int walkingSoundDuration; + #endregion + + #endregion + + public override void Init() { + FallingLeaves=new List(); + Particles=new List(); + WavingPlants=new List(); + + Fullscreen=new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight); + Vector2_2=new Vector2(2,2); + + float m=0.5f+Setting.NightBrightness*0.5f; + ConstNightAlpha=0.1f+0.4f*Setting.NightBrightness; + ColorNightColorBack=new Color(m, m, m); + ColorNightColorBackRain=new Color(m, m, (int)(m*1.1f+0.5f)); + + itemBlank=new ItemInvBlank(); + ColorWhite=Color.White; + pixel=Rabcr.Pixel; + Vector2Zero=Vector2.Zero; + + buttonRadio=new GameButtonSmall(Textures.ButtonCenter/*,spriteFont_small,spriteFont_medium*/) { + Text="Otevřít", + }; + + currentState=Current.Checking; + SetMultiplayerLoadingText(); + Connect(); + + CountGravity(new GeneratePlanetSystem().SunSystem()); + + #region Load textures + TextureTestTube=GetDataTexture(@"Items\Dye\TestTube"); + + TextureChristmasBall=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBall"); + TextureChristmasBallYellow=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallYellow"); + TextureChristmasBallOrange=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallOrange"); + TextureChristmasBallRed=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallRed"); + TextureChristmasBallPurple=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallPurple"); + TextureChristmasBallPink=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallPink"); + TextureChristmasBallLightGreen=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallLightGreen"); + TextureChristmasBallBlue=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallBlue"); + TextureChristmasBallTeal=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallTeal"); + + TextureAngelHair=GetDataTexture(@"Items/Decorations/AngelHair"); + TextureAngelHairWithSpruceLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/AngelHair"); + + TextureChristmasBallGrayWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Gray"); + TextureChristmasBallYellowWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Yellow"); + TextureChristmasBallOrangeWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Orange"); + TextureChristmasBallRedWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Red"); + TextureChristmasBallPurpleWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Purple"); + TextureChristmasBallPinkWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Pink"); + TextureChristmasBallLightGreenWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/LightGreen"); + TextureChristmasBallBlueWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Blue"); + TextureChristmasBallTealWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Teal"); + + CreateGradientTexture(); + + #region Imventory + TextureBin=GetDataTexture("Inventories/bin"); + TextureSelectCrafting=GetDataTexture("Buttons/Other/SelectyCrafting"); + + inventoryNeedTexture=GetDataTexture("Inventories/InventoryNeed"); + inventorySlotTexture=GetDataTexture("Inventories/Slot"); + inventorySlotInTexture=GetDataTexture("Inventories/SlotIn"); + inventorySlotOutTexture=GetDataTexture("Inventories/SlotOut"); + + TextureInventoryClothes=GetDataTexture("Inventories/InventoryClothes"); + TextureBarBarrel=GetDataTexture("Inventories/BarBarrel"); + #endregion + TextureClouds=GetDataTexture("Animations\\Clouds"); + #region Items + #region Tools + // Axe + TextureAxeStone = GetDataTexture("Items/Tools/Axe/AxeStone"); + TextureAxeCopper = GetDataTexture("Items/Tools/Axe/AxeCopper"); + TextureAxeBronze = GetDataTexture("Items/Tools/Axe/AxeBronze"); + TextureAxeGold = GetDataTexture("Items/Tools/Axe/AxeGold"); + TextureAxeIron = GetDataTexture("Items/Tools/Axe/AxeIron"); + TextureAxeSteel = GetDataTexture("Items/Tools/Axe/AxeSteel"); + TextureAxeAluminium = GetDataTexture("Items/Tools/Axe/AxeAluminium"); + + // Pickaxe + TexturePickaxeStone = GetDataTexture("Items/Tools/Pickaxe/PickaxeStone"); + TexturePickaxeCopper = GetDataTexture("Items/Tools/Pickaxe/PickaxeCopper"); + TexturePickaxeBronze = GetDataTexture("Items/Tools/Pickaxe/PickaxeBronze"); + TexturePickaxeGold = GetDataTexture("Items/Tools/Pickaxe/PickaxeGold"); + TexturePickaxeIron = GetDataTexture("Items/Tools/Pickaxe/PickaxeIron"); + TexturePickaxeSteel = GetDataTexture("Items/Tools/Pickaxe/PickaxeSteel"); + TexturePickaxeAluminium = GetDataTexture("Items/Tools/Pickaxe/PickaxeAluminium"); + + // Shovel + TextureShovelStone = GetDataTexture("Items/Tools/Shovel/ShovelStone"); + TextureShovelBronze = GetDataTexture("Items/Tools/Shovel/ShovelBronze"); + TextureShovelCopper = GetDataTexture("Items/Tools/Shovel/ShovelCopper"); + TextureShovelGold = GetDataTexture("Items/Tools/Shovel/ShovelGold"); + TextureShovelIron = GetDataTexture("Items/Tools/Shovel/ShovelIron"); + TextureShovelSteel = GetDataTexture("Items/Tools/Shovel/ShovelSteel"); + TextureShovelAluminium = GetDataTexture("Items/Tools/Shovel/ShovelAluminium"); + + //Hoe + TextureHoeStone=GetDataTexture("Items/Tools/Hoe/StoneHoe"); + TextureHoeCopper=GetDataTexture("Items/Tools/Hoe/CopperHoe"); + TextureHoeBronze=GetDataTexture("Items/Tools/Hoe/BronzeHoe"); + TextureHoeGold=GetDataTexture("Items/Tools/Hoe/GoldHoe"); + TextureHoeIron=GetDataTexture("Items/Tools/Hoe/IronHoe"); + TextureHoeSteel=GetDataTexture("Items/Tools/Hoe/SteelHoe"); + TextureHoeAluminium=GetDataTexture("Items/Tools/Hoe/AluminiumHoe"); + + // Saw + TextureSawCopper=GetDataTexture("Items/Tools/Saw/SawCopper"); + TextureSawBronze=GetDataTexture("Items/Tools/Saw/SawBronze"); + TextureSawGold=GetDataTexture("Items/Tools/Saw/SawGold"); + TextureSawIron=GetDataTexture("Items/Tools/Saw/SawIron"); + TextureSawSteel=GetDataTexture("Items/Tools/Saw/SawSteel"); + TextureSawAluminium=GetDataTexture("Items/Tools/Saw/SawAluminium"); + + // Shears + TextureShearsCopper=GetDataTexture("Items/Tools/Shears/ShearsCopper"); + TextureShearsBronze=GetDataTexture("Items/Tools/Shears/ShearsBronze"); + TextureShearsGold=GetDataTexture("Items/Tools/Shears/ShearsGold"); + TextureShearsIron=GetDataTexture("Items/Tools/Shears/ShearsIron"); + TextureShearsSteel=GetDataTexture("Items/Tools/Shears/ShearsSteel"); + TextureShearsAluminium=GetDataTexture("Items/Tools/Shears/ShearsAluminium"); + + // Hammer + TextureHammerCopper=GetDataTexture("Items/Tools/Hammer/HammerCopper"); + TextureHammerBronze=GetDataTexture("Items/Tools/Hammer/HammerBronze"); + TextureHammerGold=GetDataTexture("Items/Tools/Hammer/HammerGold"); + TextureHammerIron=GetDataTexture("Items/Tools/Hammer/HammerIron"); + TextureHammerSteel=GetDataTexture("Items/Tools/Hammer/HammerSteel"); + TextureHammerAluminium=GetDataTexture("Items/Tools/Hammer/HammerAluminium"); + + // Knife + //TextureKnifeStone = GetDataTexture("Items/Tools/Knife/KnifeStone"); + TextureKnifeCopper = GetDataTexture("Items/Tools/Knife/KnifeCopper"); + TextureKnifeBronze = GetDataTexture("Items/Tools/Knife/KnifeBronze"); + TextureKnifeGold = GetDataTexture("Items/Tools/Knife/KnifeGold"); + TextureKnifeIron = GetDataTexture("Items/Tools/Knife/KnifeIron"); + TextureKnifeSteel = GetDataTexture("Items/Tools/Knife/KnifeSteel"); + TextureKnifeAluminium = GetDataTexture("Items/Tools/Knife/KnifeAluminium"); + + // Electronics + TextureTorchOff=GetDataTexture("Blocks/ForInventory/TorchOFF"); + LightElectricTexture=GetDataTexture("Items/Tools/Electric/Light"); + TextureDrillElectric=GetDataTexture("Items/Tools/Electric/Drill"); + electricSawTexture=GetDataTexture("Items/Tools/Electric/Saw"); + mobileTexture=GetDataTexture("Items/NonTools/mobile"); + + // Air tank + TextureAirTank=GetDataTexture("Items/NonTools/OxygenTank"); + TextureAirTank2=GetDataTexture("Items/NonTools/OxygenTank2"); + + // Gun + TextureAmmo = GetDataTexture("Items/NonTools/Ammo"); + TextureGun = GetDataTexture("Items/NonTools/Gun"); + + // Other + stoneHeadTexture = GetDataTexture("Items/Tools/StoneAxe"); + #endregion + + #region Tool heads + // Axe + TextureAxeHeadCopper = GetDataTexture("Items/ToolsHeads/Axe/Copper"); + TextureAxeHeadBronze = GetDataTexture("Items/ToolsHeads/Axe/Bronze"); + TextureAxeHeadGold = GetDataTexture("Items/ToolsHeads/Axe/Gold"); + TextureAxeHeadIron = GetDataTexture("Items/ToolsHeads/Axe/Iron"); + TextureAxeHeadSteel = GetDataTexture("Items/ToolsHeads/Axe/Steel"); + TextureAxeHeadAluminium = GetDataTexture("Items/ToolsHeads/Axe/Aluminium"); + + // Shovel + TextureShovelHeadCopper = GetDataTexture("Items/ToolsHeads/Shovel/Copper"); + TextureShovelHeadBronze = GetDataTexture("Items/ToolsHeads/Shovel/Bronze"); + TextureShovelHeadGold = GetDataTexture("Items/ToolsHeads/Shovel/Gold"); + TextureShovelHeadIron = GetDataTexture("Items/ToolsHeads/Shovel/Iron"); + TextureShovelHeadSteel = GetDataTexture("Items/ToolsHeads/Shovel/Steel"); + TextureShovelHeadAluminium = GetDataTexture("Items/ToolsHeads/Shovel/Aluminium"); + + // Pickaxe + TexturePickaxeHeadCopper= GetDataTexture("Items/ToolsHeads/Pickaxe/Copper"); + TexturePickaxeHeadBronze= GetDataTexture("Items/ToolsHeads/Pickaxe/Bronze"); + TexturePickaxeHeadGold= GetDataTexture("Items/ToolsHeads/Pickaxe/Gold"); + TexturePickaxeHeadIron= GetDataTexture("Items/ToolsHeads/Pickaxe/Iron"); + TexturePickaxeHeadSteel= GetDataTexture("Items/ToolsHeads/Pickaxe/Steel"); + TexturePickaxeHeadAluminium= GetDataTexture("Items/ToolsHeads/Pickaxe/Aluminium"); + + // Shears + TextureShearsHeadCopper= GetDataTexture("Items/ToolsHeads/Shears/Copper"); + TextureShearsHeadBronze= GetDataTexture("Items/ToolsHeads/Shears/Bronze"); + TextureShearsHeadGold= GetDataTexture("Items/ToolsHeads/Shears/Gold"); + TextureShearsHeadIron= GetDataTexture("Items/ToolsHeads/Shears/Iron"); + TextureShearsHeadSteel= GetDataTexture("Items/ToolsHeads/Shears/Steel"); + TextureShearsHeadAluminium= GetDataTexture("Items/ToolsHeads/Shears/Aluminium"); + + // Knife + TextureKnifeHeadCopper= GetDataTexture("Items/ToolsHeads/Knife/Copper"); + TextureKnifeHeadBronze= GetDataTexture("Items/ToolsHeads/Knife/Bronze"); + TextureKnifeHeadGold= GetDataTexture("Items/ToolsHeads/Knife/Gold"); + TextureKnifeHeadIron= GetDataTexture("Items/ToolsHeads/Knife/Iron"); + TextureKnifeHeadSteel= GetDataTexture("Items/ToolsHeads/Knife/Steel"); + TextureKnifeHeadAluminium= GetDataTexture("Items/ToolsHeads/Knife/Aluminium"); + + // Hoe + TextureHoeHeadCopper=GetDataTexture("Items/ToolsHeads/Hoe/Copper"); + TextureHoeHeadBronze=GetDataTexture("Items/ToolsHeads/Hoe/Bronze"); + TextureHoeHeadGold=GetDataTexture("Items/ToolsHeads/Hoe/Gold"); + TextureHoeHeadIron=GetDataTexture("Items/ToolsHeads/Hoe/Iron"); + TextureHoeHeadSteel=GetDataTexture("Items/ToolsHeads/Hoe/Steel"); + TextureHoeHeadAluminium=GetDataTexture("Items/ToolsHeads/Hoe/Aluminium"); + #endregion + + #region Clothes + // Head + TextureItemCap=GetDataTexture("Items/Clothes/Head/Cap"); + TextureItemHat=GetDataTexture("Items/Clothes/Head/Hat"); + TextureItemCrown=GetDataTexture("Items/Clothes/Head/Crown"); + TextureItemSpaceHelmet=GetDataTexture("Items/Clothes/Head/SpaceHelmet"); + + // Feet + TextureItemFormalShoes=GetDataTexture("Items/Clothes/Feet/FormalShoes"); + TextureItemPumps=GetDataTexture("Items/Clothes/Feet/Pumps"); + TextureItemSneakers=GetDataTexture("Items/Clothes/Feet/Sneakers"); + TextureItemSpaceBoots=GetDataTexture("Items/Clothes/Feet/SpaceBoots"); + + // Chest top + TextureItemCoatArmy=GetDataTexture("Items/Clothes/ChestTop/CoatArmy"); + TextureItemCoat=GetDataTexture("Items/Clothes/ChestTop/Coat"); + ItemJacketDenimTexture=GetDataTexture("Items/Clothes/ChestTop/JacketDenim"); + ItemJacketFormalTexture=GetDataTexture("Items/Clothes/ChestTop/JacketFormal"); + TextureItemJacketShort=GetDataTexture("Items/Clothes/ChestTop/JacketShort"); + + // Legs + TextureItemJeans=GetDataTexture("Items/Clothes/Legs/Jeans"); + TextureItemShorts=GetDataTexture("Items/Clothes/Legs/Shorts"); + TextureItemSpaceTrousers=GetDataTexture("Items/Clothes/Legs/SpaceTrousers"); + TextureItemArmyTrousers=GetDataTexture("Items/Clothes/Legs/ArmyTrousers"); + TextureItemSkirt=GetDataTexture("Items/Clothes/Legs/Skirt"); + TextureItemTShirt=GetDataTexture("Items/Clothes/Chest/TShirt"); + TextureItemSpaceSuit=GetDataTexture("Items/Clothes/ChestTop/SpaceSuit"); + TextureItemDress=GetDataTexture("Items/Clothes/Chest/Dress"); + TextureItemShirt=GetDataTexture("Items/Clothes/Chest/Shirt"); + + // Underwear Down + TextureItemUnderpants=GetDataTexture("Items/Clothes/DownUnderwear/Underpants"); + TextureItemBoxerShorts=GetDataTexture("Items/Clothes/DownUnderwear/BoxerShorts"); + TextureItemPanties=GetDataTexture("Items/Clothes/DownUnderwear/Panties"); + TextureItemSwimsuit=GetDataTexture("Items/Clothes/DownUnderwear/Swimsuit"); + TextureItemBikiniDown=GetDataTexture("Items/Clothes/DownUnderwear/Bikini"); + + // Underwear Up + TextureItemBra=GetDataTexture("Items/Clothes/UpUnderwear/Bra"); + TextureItemBikiniTop=GetDataTexture("Items/Clothes/UpUnderwear/TopBikini"); + + #endregion + + #region Electronics + condenserTexture=GetDataTexture("Items/Electronic/Condenser"); + diodeTexture=GetDataTexture("Items/Electronic/Diode"); + tranzistorTexture=GetDataTexture("Items/Electronic/Transistor"); + resistanceTexture=GetDataTexture("Items/Electronic/Resistance"); + motorTexture=GetDataTexture("Items/Electronic/Motor"); + ItemBatteryTexture = GetDataTexture("Items/Electronic/Battery"); + ItemBigCircuitTexture = GetDataTexture("Items/Electronic/BigCircuit"); + ItemBulbTexture = GetDataTexture("Items/Electronic/Bulb"); + ItemCircuitTexture = GetDataTexture("Items/Electronic/Circuit"); + bareLabelTexture=GetDataTexture("Items/Electronic/label"); + #endregion + + #region Nature + // From plants + flaxSeedsTexture=GetDataTexture("Items/Nature/FlaxSeeds"); + ItemHayTexture = GetDataTexture("Items/Nature/Hay"); + ItemLeaveTexture = GetDataTexture("Items/Nature/Leave"); + ItemSeedsTexture = GetDataTexture("Items/Nature/Seeds"); + ItemStickTexture = GetDataTexture("Items/Nature/Stick"); + ItemSticksTexture = GetDataTexture("Items/Nature/Sticks"); + ItemWheatSeedsTexture = GetDataTexture("Items/Nature/WheatSeeds"); + ItemWheatStrawTexture = GetDataTexture("Items/Nature/WheatStraw"); + ItemKapokFibreTexture=GetDataTexture("Items/Nature/KapokFibre"); + + // Crafted + clothTexture=GetDataTexture("Items/Nature/Cloth"); + yarnTexture=GetDataTexture("Items/Nature/Yarn"); + TextureResin=GetDataTexture("Items/Nature/Resin"); + #endregion + + #region Rocks + ItemAluminiumTexture = GetDataTexture("Items/Rocks/Aluminium"); + ItemCoalTexture = GetDataTexture("Items/Rocks/Coal"); + ItemCopperTexture = GetDataTexture("Items/Rocks/Copper"); + ItemDiamondTexture = GetDataTexture("Items/Rocks/Diamond"); + ItemGoldTexture = GetDataTexture("Items/Rocks/Gold"); + ItemIronTexture = GetDataTexture("Items/Rocks/Iron"); + ItemPlasticTexture= GetDataTexture("Items/Rocks/Plastic"); + ItemRubyTexture = GetDataTexture("Items/Rocks/Ruby"); + ItemSaphiriteTexture = GetDataTexture("Items/Rocks/Saphirite"); + ItemSilverTexture = GetDataTexture("Items/Rocks/Silver"); + ItemSmaragdTexture = GetDataTexture("Items/Rocks/Smaragd"); + ItemBigStoneTexture = GetDataTexture("Items/Rocks/StoneBig"); + ItemMediumStoneTexture = GetDataTexture("Items/Rocks/StoneMedium"); + ItemSmallStoneTexture = GetDataTexture("Items/Rocks/StoneSmall"); + ItemTinTexture = GetDataTexture("Items/Rocks/Tin"); + #endregion + + #region Dye + TextureDyeWhite= GetDataTexture("Items/Dye/White"); + TextureDyeYellow = GetDataTexture("Items/Dye/Yellow"); + TextureDyeGold = GetDataTexture("Items/Dye/Gold"); + TextureDyeOrange = GetDataTexture("Items/Dye/Orange"); + TextureDyeRed = GetDataTexture("Items/Dye/Red"); + TextureDyeDarkRed = GetDataTexture("Items/Dye/DarkRed"); + TextureDyePink = GetDataTexture("Items/Dye/Pink"); + TextureDyePurple = GetDataTexture("Items/Dye/Purple"); + TextureDyeLightBlue = GetDataTexture("Items/Dye/LightBlue"); + TextureDyeBlue = GetDataTexture("Items/Dye/Blue"); + TextureDyeDarkBlue = GetDataTexture("Items/Dye/DarkBlue"); + TextureDyeTeal = GetDataTexture("Items/Dye/Teal"); + TextureDyeLightGreen = GetDataTexture("Items/Dye/LightGreen"); + TextureDyeGreen = GetDataTexture("Items/Dye/Green"); + TextureDyeDarkGreen = GetDataTexture("Items/Dye/DarkGreen"); + TextureDyeBrown = GetDataTexture("Items/Dye/Brown"); + TextureDyeLightGray = GetDataTexture("Items/Dye/LightGray"); + TextureDyeGray = GetDataTexture("Items/Dye/Gray"); + TextureDyeDarkGray = GetDataTexture("Items/Dye/DarkGray"); + TextureDyeBlack = GetDataTexture("Items/Dye/Black"); + TextureDyeArmy = GetDataTexture("Items/Dye/Army"); + TextureDyeMagenta = GetDataTexture("Items/Dye/Magenta"); + TextureDyeRoseQuartz = GetDataTexture("Items/Dye/RoseQuartz"); + TextureDyeSpringGreen = GetDataTexture("Items/Dye/SpringGreen"); + TextureDyeViolet = GetDataTexture("Items/Dye/Violet"); + TextureDyeOlive = GetDataTexture("Items/Dye/Olive"); + #endregion + + #region Food + // Raw vegetable + ItemPeasTexture=GetDataTexture("Items/Food/Peas"); + ItemCarrotTexture=GetDataTexture("Items/Food/Carrot"); + + // Raw fruit + ItemOrangeTexture=GetDataTexture("Items/Food/Orange"); + ItemLemonTexture=GetDataTexture("Items/Food/Lemon"); + ItemOliveTexture=GetDataTexture("Items/Food/Olive"); + ItemAppleTexture = GetDataTexture("Items/Food/Apple"); + ItemBananaTexture = GetDataTexture("Items/Food/Banana"); + ItemCherryTexture = GetDataTexture("Items/Food/Cherry"); + ItemOnionTexture = GetDataTexture("Items/Food/Onion"); + ItemPlumTexture = GetDataTexture("Items/Food/Plum"); + rashberryTexture = GetDataTexture("Items/Food/Rashberry"); + blueberryTexture=GetDataTexture("Items/Food/Blueberry"); + strawberryTexture = GetDataTexture("Items/Food/Strawberry"); + + // Raw other + TextureItemEgg=GetDataTexture("Items/Food/egg"); + ItemRabbitMeatTexture = GetDataTexture("Items/Food/RabbitMeat"); + + // Boiled + TextureItemBoiledEgg=GetDataTexture("Items/Food/eggboiled"); + fishCookedTexture=GetDataTexture("Items/Food/FishCooked"); + ItemRabbtCookedMeatTexture = GetDataTexture("Items/Food/RabbitCookedMeat"); + + // Combined + bowlMushroomsTexture=GetDataTexture("Items/Food/BowlWithMushrooms"); + bowlVegetablesTexture=GetDataTexture("Items/Food/BowlWithVegetable"); + #endregion + + #region Other + RodTexture=GetDataTexture("Items/NonTools/Rod"); + nailTexture=GetDataTexture("Items/NonTools/Nail"); + plateCopperTexture=GetDataTexture("Items/Plates/PlateCopper"); + plateIronTexture=GetDataTexture("Items/Plates/PlateIron"); + plateBronzeTexture=GetDataTexture("Items/Plates/PlateBronze"); + plateAluminiumTexture=GetDataTexture("Items/Plates/PlateAluminium"); + plateGoldTexture=GetDataTexture("Items/Plates/PlateGold"); + #endregion + + + + bottleWaterTexture=GetDataTexture("Items/NonTools/BottleWater"); + bottleEmptyTexture=GetDataTexture("Items/NonTools/BottleEmpty"); + bottleOilTexture=GetDataTexture("Items/NonTools/BottleOil"); + bucketOilTexture=GetDataTexture("Items/NonTools/BucketOil"); + + coalWoodTexture = GetDataTexture("Items/Rocks/CoalWood"); + ItemBackpackTexture = GetDataTexture("Items/Clothes/Backpack"); + ItemBucketTexture = GetDataTexture("Items/NonTools/Bucket"); + ItemBucketWaterTexture = GetDataTexture("Items/NonTools/BucketWater"); + ItemRopeTexture = GetDataTexture("Items/NonTools/Rope"); + + #region Ingots + ItemAluminiumIngotTexture= GetDataTexture("Items/Ingots/Aluminium"); + ItemBronzeIngotTexture = GetDataTexture("Items/Ingots/Bronze"); + ItemCopperIngotTexture = GetDataTexture("Items/Ingots/Copper"); + ItemGoldIngotTexture = GetDataTexture("Items/Ingots/Gold"); + ItemIronIngotTexture = GetDataTexture("Items/Ingots/Iron"); + ItemSilverIngotTexture = GetDataTexture("Items/Ingots/Silver"); + ItemTinIngotTexture = GetDataTexture("Items/Ingots/Tin"); + TextureIngotSteel=GetDataTexture("Items/Ingots/Steel"); + + siliciumTexture=GetDataTexture("Items/Ingots/Silicium"); + + oneBrickTexture=GetDataTexture("Items/Ingots/Brick"); + oneMudBrickTexture=GetDataTexture("Items/Ingots/Mud"); + #endregion + + #region Dusts + // Metal + ItemCopperDustTexture = GetDataTexture("Items/Dusts/Copper"); + ItemTinDustTexture = GetDataTexture("Items/Dusts/Tin"); + ItemBronzeDustTexture = GetDataTexture("Items/Dusts/Bronze"); + ItemGoldDustTexture = GetDataTexture("Items/Dusts/Gold"); + ItemSilverDustTexture = GetDataTexture("Items/Dusts/Silver"); + ItemIronDustTexture = GetDataTexture("Items/Dusts/Iron"); + ItemAluminiumDustTexture= GetDataTexture("Items/Dusts/Aluminium"); + + // Other + ItemCoalDustTexture = GetDataTexture("Items/Dusts/Coal"); + ItemStoneDustTexture = GetDataTexture("Items/Dusts/Stone"); + ItemWoodDustTexture = GetDataTexture("Items/Dusts/Wood"); + ashTexture= GetDataTexture("Items/Dusts/Ash"); + TextureSulfur = GetDataTexture("Items/Dusts/Sulfur"); + TextureSaltpeter = GetDataTexture("Items/Dusts/Saltpeter"); + TextureGunpowder = GetDataTexture("Items/Dusts/Gunpowder"); + #endregion + + ItemRubberTexture = GetDataTexture("Items/Electronic/Rubber"); + bowlEmptyTexture=GetDataTexture("Items/NonTools/Bowl"); + #endregion + + #region Blocks + #region Mashines + // Mechanical + ComposterTexture=GetDataTexture("Blocks/Mashines/Composter"); + TextureBucketForRubber=GetDataTexture("Blocks/Mashines/BucketForRubber"); + TextureBucketWithLatex=GetDataTexture("Blocks/Mashines/BucketWithLatex"); + ComposterFullTexture=GetDataTexture("Blocks/Mashines/ComposterFull"); + shelfTexture=GetDataTexture("Blocks/Mashines/shelf"); + boxAdvTexture=GetDataTexture("Blocks/Mashines/box"); + boxWoodenTexture=GetDataTexture("Blocks/Mashines/boxWooden"); + deskTexture = GetDataTexture("Blocks/Mashines/Desk"); + doorOpenTexture = GetDataTexture("Blocks/Mashines/DoorOpen"); + doorCloseTexture = GetDataTexture("Blocks/Mashines/DoorClose"); + furnaceStoneTexture = GetDataTexture("Blocks/Mashines/FurnaceStone"); + torchTexture = GetDataTexture("Blocks/Mashines/Torch"); + TextureBarrel = GetDataTexture("Blocks/Mashines/Barrel"); + + // Electrinics + TextureOxygenMachine=GetDataTexture("Blocks/Mashines/OxygenMachine"); + chargerTexture=GetDataTexture("Blocks/Mashines/Charger"); + rocketTexture=GetDataTexture("Space/Rocket"); + radioTexture = GetDataTexture("Blocks/Mashines/Radio"); + maceratorTexture = GetDataTexture("Blocks/Mashines/Macerator"); + minerTexture = GetDataTexture("Blocks/Mashines/Miner"); + lampTexture = GetDataTexture("Blocks/Mashines/Lamp"); + solarPanelTexture = GetDataTexture("Blocks/Mashines/SolarPanel"); + labelTexture = GetDataTexture("Blocks/Mashines/Label"); + furnaceElectricTexture = GetDataTexture("Blocks/Mashines/FurnaceElectric"); + waterMillTexture = GetDataTexture("Blocks/Mashines/Watermill"); + windMillTexture = GetDataTexture("Blocks/Mashines/Windmill"); + sewingMachineTexture=GetDataTexture("Blocks/Mashines/SewingMachine"); + #endregion + + #region Trees + TextureBranches = GetDataTexture("Blocks/TreeBlocks/Branches"); + // Oak + TextureOakWood = GetDataTexture("Blocks/TreeBlocks/Oak/Wood"); + TextureOakLeaves = GetDataTexture("Blocks/TreeBlocks/Oak/Leaves"); + + // Spruce + spruceWoodTexture = GetDataTexture("Blocks/TreeBlocks/Spruce/Wood"); + spruceLeavesTexture = GetDataTexture("Blocks/TreeBlocks/Spruce/Leaves"); + + // Linden + TextureLindenWood = GetDataTexture("Blocks/TreeBlocks/Linden/Wood"); + TextureLindenLeaves = GetDataTexture("Blocks/TreeBlocks/Linden/Leaves"); + + // Pine + pineLeavesTexture = GetDataTexture("Blocks/TreeBlocks/Pine/Leaves"); + pineWoodTexture = GetDataTexture("Blocks/TreeBlocks/Pine/Wood"); + + // Apple + TextureAppleWood = GetDataTexture("Blocks/TreeBlocks/Apple/Wood"); + TextureAppleLeaves = GetDataTexture("Blocks/TreeBlocks/Apple/Leaves"); + TextureAppleBlossom = GetDataTexture("Blocks/TreeBlocks/Apple/Blossom"); + TextureAppleLeavesWithApples = GetDataTexture("Blocks/TreeBlocks/Apple/LeavesWithApples"); + + // Cherry + cherryWoodTexture = GetDataTexture("Blocks/TreeBlocks/Cherry/Wood"); + TextureCherryLeaves = GetDataTexture("Blocks/TreeBlocks/Cherry/Leaves"); + TextureCherryBlossom = GetDataTexture("Blocks/TreeBlocks/Cherry/Blossom"); + TextureCherryLeavesWithCherries = GetDataTexture("Blocks/TreeBlocks/Cherry/LeavesWithCherries"); + + // Plum + TexturePlumWood = GetDataTexture("Blocks/TreeBlocks/Plum/Wood"); + TexturePlumLeaves = GetDataTexture("Blocks/TreeBlocks/Plum/Leaves"); + TexturePlumBlossom = GetDataTexture("Blocks/TreeBlocks/Plum/Blossom"); + TexturePlumLeavesWithPlums = GetDataTexture("Blocks/TreeBlocks/Plum/LeavesWithPlums"); + + // Orange + TextureOrangeLeaves=GetDataTexture("Blocks/TreeBlocks/Orange/Leaves"); + TextureOrangeLeavesWithOranges=GetDataTexture("Blocks/TreeBlocks/Orange/LeavesWithOranges"); + TextureOrangeWood=GetDataTexture("Blocks/TreeBlocks/Orange/Wood"); + + // Lemon + TextureLemonWood=GetDataTexture("Blocks/TreeBlocks/Lemon/Wood"); + TextureLemonLeaves=GetDataTexture("Blocks/TreeBlocks/Lemon/Leaves"); + lemonLeavesWithLemonsTexture=GetDataTexture("Blocks/TreeBlocks/Lemon/LeavesWithLemons"); + + // Olive + TextureOliveLeavesWithOlives=GetDataTexture("Blocks/TreeBlocks/Olive/LeavesWithOlives"); + TextureOliveLeaves=GetDataTexture("Blocks/TreeBlocks/Olive/Leaves"); + TextureOliveWood=GetDataTexture("Blocks/TreeBlocks/Olive/Wood"); + + // Mangrove + TextureMangroveLeaves=GetDataTexture("Blocks/TreeBlocks/Mangrove/Leaves"); + TextureMangroveWood=GetDataTexture("Blocks/TreeBlocks/Mangrove/Wood"); + + // Willow + TextureWillowLeaves=GetDataTexture("Blocks/TreeBlocks/Willow/Leaves"); + TextureWillowWood=GetDataTexture("Blocks/TreeBlocks/Willow/Wood"); + + // Eucaliptus + TextureEucalyptusLeaves=GetDataTexture("Blocks/TreeBlocks/Eucalyptus/Leaves"); + TextureEucalyptusWood=GetDataTexture("Blocks/TreeBlocks/Eucalyptus/Wood"); + + // Rubber + TextureRubberTreeLeaves=GetDataTexture("Blocks/TreeBlocks/RubberTree/Leaves"); + TextureRubberTreeWood=GetDataTexture("Blocks/TreeBlocks/RubberTree/Wood"); + + // Accacia + TextureAcaciaLeaves=GetDataTexture("Blocks/TreeBlocks/Acacia/Leaves"); + TextureAcaciaWood=GetDataTexture("Blocks/TreeBlocks/Acacia/Wood"); + + // Kapok + TextureKapokBlossom=GetDataTexture("Blocks/TreeBlocks/Kapok/Blossom"); + TextureKapokLeavesFibre=GetDataTexture("Blocks/TreeBlocks/Kapok/LeavesWithFibre"); + TextureKapokLeaves=GetDataTexture("Blocks/TreeBlocks/Kapok/Leaves"); + TextureKapokWood=GetDataTexture("Blocks/TreeBlocks/Kapok/Wood"); + #endregion + + #region Saplings + cherrySaplingTexture = GetDataTexture("Plants/Saplings/Cherry"); + oakSaplingTexture = GetDataTexture("Plants/Saplings/Oak"); + spruceSaplingTexture = GetDataTexture("Plants/Saplings/Spruce"); + TextureLindenSapling = GetDataTexture("Plants/Saplings/Linden"); + TextureAppleSapling = GetDataTexture("Plants/Saplings/Apple"); + plumSaplingTexture = GetDataTexture("Plants/Saplings/Plum"); + TextureMangroveSapling=GetDataTexture("Plants/Saplings/Mangrove"); + lemonSaplingTexture=GetDataTexture("Plants/Saplings/Lemon"); + orangeSaplingTexture=GetDataTexture("Plants/Saplings/Orange"); + pineSaplingTexture = GetDataTexture("Plants/Saplings/Pine"); + TextureWillowSapling=GetDataTexture("Plants/Saplings/Willow"); + TextureEucalyptusSapling=GetDataTexture("Plants/Saplings/Eucalyptus"); + TextureOliveSapling=GetDataTexture("Plants/Saplings/Olive"); + TextureRubberTreeSapling=GetDataTexture("Plants/Saplings/RubberTree"); + TextureAcaciaSapling=GetDataTexture("Plants/Saplings/Acacia"); + TextureKapokSapling=GetDataTexture("Plants/Saplings/Kapok"); + #endregion + + #region Plants + branchWithoutTexture=GetDataTexture("Plants/Branch/Without"); + branchALittle1Texture=GetDataTexture("Plants/Branch/Little1"); + branchALittle2Texture=GetDataTexture("Plants/Branch/Little2"); + branchFullTexture=GetDataTexture("Plants/Branch/Full"); + + plantAloreTexture = GetDataTexture("Plants/Flowers/Alore"); + plantCarrotTexture = GetDataTexture("Plants/ForInventory/Carrot"); + plantOnionTexture = GetDataTexture("Plants/ForInventory/Onion"); + plantPeasTexture = GetDataTexture("Plants/ForInventory/Peas"); + grassForestTexture = GetDataTexture("Plants/Grass/Forest"); + grassPlainsTexture = GetDataTexture("Plants/Grass/Plains"); + grassJungleTexture = GetDataTexture("Plants/Grass/Jungle"); + grassDesertTexture = GetDataTexture("Plants/Grass/Desert"); + grassHillsTexture = GetDataTexture("Plants/Grass/Hills"); + strawberryPlantTexture = GetDataTexture("Plants/Grow/Strawberry"); + rashberryPlantTexture = GetDataTexture("Plants/Grow/Rashberry"); + wheatTexture = GetDataTexture("Plants/Grow/WheatGrow"); + plantDandelionTexture = GetDataTexture("Plants/Flowers/Dandelion"); + plantOrchidTexture = GetDataTexture("Plants/Flowers/Orchid"); + plantRoseTexture = GetDataTexture("Plants/Flowers/Rose"); + plantVioletTexture = GetDataTexture("Plants/Flowers/Violet"); + cactusLittleTexture = GetDataTexture("Plants/Cactus/Small"); + cactusBigTexture = GetDataTexture("Plants/Cactus/Big"); + blueberryPlantTexture=GetDataTexture("Plants/Grow/Blueberry"); + + coralTexture=GetDataTexture("Plants/Flowers/Coral"); + flaxTexture=GetDataTexture("Plants/Grow/Flax"); + toadstoolTexture=GetDataTexture("Plants/Mushrooms/Toadstoll"); + champignonTexture=GetDataTexture("Plants/Mushrooms/Champignon"); + sugarCaneTexture=GetDataTexture("Plants/Flowers/Sugarcane"); + seaweedTexture=GetDataTexture("Plants/Flowers/Seaweed"); + heatherTexture=GetDataTexture("Plants/Flowers/Heather"); + boletusTexture=GetDataTexture("Plants/Mushrooms/Boletus"); + lianaTexture = GetDataTexture("Plants/Flowers/Liana"); + #endregion + + #region Stone + mudstoneTexture=GetDataTexture("Blocks/BasicBlocks/Mudstone"); + dolomiteTexture=GetDataTexture("Blocks/BasicBlocks/Dolomite"); + basaltTexture=GetDataTexture("Blocks/BasicBlocks/Basalt"); + limestoneTexture=GetDataTexture("Blocks/BasicBlocks/Limestone"); + rhyoliteTexture=GetDataTexture("Blocks/BasicBlocks/Rhyolite"); + gneissTexture=GetDataTexture("Blocks/BasicBlocks/Gneiss"); + sandstoneTexture=GetDataTexture("Blocks/BasicBlocks/SandStone"); + schistTexture=GetDataTexture("Blocks/BasicBlocks/Schist"); + gabbroTexture=GetDataTexture("Blocks/BasicBlocks/Gabbro"); + dioritTexture=GetDataTexture("Blocks/BasicBlocks/Diorit"); + anorthositeTexture=GetDataTexture("Blocks/BasicBlocks/Anorthosite"); + regoliteTexture=GetDataTexture("Blocks/BasicBlocks/Regolite"); + flintTexture=GetDataTexture("Blocks/BasicBlocks/Flint"); + #endregion + + #region Ore + TextureOreCoal = GetDataTexture("Blocks/OreBlocks/Coal"); + TextureOreCopper = GetDataTexture("Blocks/OreBlocks/Copper"); + TextureOreTin = GetDataTexture("Blocks/OreBlocks/Tin"); + TextureOreGold = GetDataTexture("Blocks/OreBlocks/Gold"); + TextureOreSilver = GetDataTexture("Blocks/OreBlocks/Silver"); + TextureOreIron = GetDataTexture("Blocks/OreBlocks/Iron"); + TextureOreAluminium = GetDataTexture("Blocks/OreBlocks/Aluminium"); + TextureOreSulfur = GetDataTexture("Blocks/OreBlocks/Sulfur"); + TextureOreSaltpeter = GetDataTexture("Blocks/OreBlocks/Saltpeter"); + + + #endregion + + #region Basic + // Grass block + TextureGrassBlockPlains= GetDataTexture("Blocks/GrassBlocks/Plains"); + TextureGrassBlockHills = GetDataTexture("Blocks/GrassBlocks/Hills"); + TextureGrassBlockJungle = GetDataTexture("Blocks/GrassBlocks/Jungle"); + TextureGrassBlockForest = GetDataTexture("Blocks/GrassBlocks/Forest"); + TextureGrassBlockDesert = GetDataTexture("Blocks/GrassBlocks/Desert"); + TextureGrassBlockClay= GetDataTexture("Blocks/GrassBlocks/Clay"); + TextureGrassBlockCompost= GetDataTexture("Blocks/GrassBlocks/Compost"); + TextureGrassBlockSnow= GetDataTexture("Blocks/GrassBlocks/Snow"); + + // Sand + sandTexture = GetDataTexture("Blocks/BasicBlocks/Sand"); + TextureRedSand=GetDataTexture("Blocks/BasicBlocks/Redsand"); + + // Liquid + waterTexture = GetDataTexture("Blocks/BasicBlocks/Water"); + oilTexture = GetDataTexture("Blocks/OreBlocks/Oil"); + + TextureDirt = GetDataTexture("Blocks/BasicBlocks/Dirt"); + gravelTexture = GetDataTexture("Blocks/BasicBlocks/Gravel"); + clayTexture= GetDataTexture("Blocks/BasicBlocks/Clay"); + iceTexture = GetDataTexture("Blocks/BasicBlocks/Ice"); + snowTexture = GetDataTexture("Blocks/BasicBlocks/snow"); + snowTopTexture = GetDataTexture("Blocks/BasicBlocks/SnowTop"); + cobblestoneTexture = GetDataTexture("Blocks/BasicBlocks/Cobblestone"); + + #endregion + + #region Backgrounds + // Basic + backgroundDirtTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Dirt"); + backgroundGravelTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Gravel"); + backgroundSandTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Sand"); + backgroundCobblestoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Cobblestone"); + backgroundRegoliteTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/Regolite"); + backgroundRedSandTexture= GetDataTexture("Blocks/BlockBackgrounds/Other/RedSand"); + backgroundClayTexture=GetDataTexture("Blocks/BlockBackgrounds/Other/Clay"); + + // Stone + backgroundAnorthositeTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Anorthosite"); + backgroundBasaltTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Basalt"); + backgroundDioritTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Diorit"); + backgroundDolomiteTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Dolomite"); + backgroundFlintTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Flint"); + backgroundGabbroTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Gabbro"); + backgroundGneissTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Gneiss"); + backgroundLimestoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Limestone"); + backgroundMudstoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Mudstone"); + backgroundRhyoliteTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Rhyolite"); + backgroundSandstoneTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Sandstone"); + backgroundSchistTexture= GetDataTexture("Blocks/BlockBackgrounds/Stone/Schist"); + + // Ore + TextureBackSulfurOre= GetDataTexture("Blocks/BlockBackgrounds/Ore/Sulfur"); + TextureBackSaltpeterOre= GetDataTexture("Blocks/BlockBackgrounds/Ore/Saltpeter"); + backgroundCoalTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Coal"); + backgroundCopperTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Copper"); + backgroundTinTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Tin"); + backgroundIronTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Iron"); + backgroundAluminiumTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Aluminium"); + backgroundSilverTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Silver"); + backgroundGoldTexture= GetDataTexture("Blocks/BlockBackgrounds/Ore/Gold"); + #endregion + + if (easter) { + TextureEggDropE=new Texture2D[4]{ + GetDataTexture("Blocks/BasicBlocks/eggdrop2"), + GetDataTexture("Blocks/BasicBlocks/eggdrop3"), + GetDataTexture("Blocks/BasicBlocks/eggdrop4"), + GetDataTexture("Blocks/BasicBlocks/eggdrop5"), + }; + } + + TextureChristmasStar=GetDataTexture("Blocks/CraftedBlocks/Star"); + + TextureWaterGraystyle=GetDataTexture("Blocks/BasicBlocks/WaterGraystyle"); + TextureEggDrop=GetDataTexture("Blocks/BasicBlocks/eggdrop"); + CompostTexture=GetDataTexture("Blocks/BasicBlocks/Compost"); + + roof1Texture=GetDataTexture("Blocks/CraftedBlocks/Roof1"); + roof2Texture=GetDataTexture("Blocks/CraftedBlocks/Roof2"); + flagTexture = GetDataTexture("Blocks/CraftedBlocks/Flag"); + ladderTexture = GetDataTexture("Blocks/CraftedBlocks/Ladder"); + TextureRocks = new Texture2D[] { + GetDataTexture("Blocks/BasicBlocks/Rocks0"), + GetDataTexture("Blocks/BasicBlocks/Rocks1"), + GetDataTexture("Blocks/BasicBlocks/Rocks2"), + GetDataTexture("Blocks/BasicBlocks/Rocks3") + }; + bricksTexture = GetDataTexture("Blocks/CraftedBlocks/Bricks"); + glassTexture = GetDataTexture("Blocks/CraftedBlocks/Glass"); + hayBlockTexture = GetDataTexture("Blocks/CraftedBlocks/HayBlock"); + planksTexture = GetDataTexture("Blocks/CraftedBlocks/Planks"); + ItemRocketTexture = GetDataTexture("Blocks/ForInventory/Rocket"); + ItemWaterMillTexture = GetDataTexture("Blocks/ForInventory/WaterMill"); + ItemWindMillTexture = GetDataTexture("Blocks/ForInventory/WindMill"); + ItemDoorTexture = GetDataTexture("Blocks/ForInventory/Door"); + ItemFlagTexture = GetDataTexture("Blocks/ForInventory/Flag"); + labelOneTexture = GetDataTexture("Blocks/ForInventory/Label"); + maceratorOneTexture = GetDataTexture("Blocks/ForInventory/Macerator"); + furnaceStoneOneTexture = GetDataTexture("Blocks/ForInventory/FurnaceStone"); + furnaceElectricOneTexture = GetDataTexture("Blocks/ForInventory/FurnaceElectric"); + torchInvTexture = GetDataTexture("Blocks/ForInventory/Torch"); + advancedSpaceBackTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceBack"); + advancedSpaceWindowTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceWindow"); + advancedSpaceBlockTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceBlok"); + advancedSpacePart1Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart"); + advancedSpacePart2Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart2"); + advancedSpacePart3Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart3"); + advancedSpacePart4Texture= GetDataTexture("Blocks/Advanced/AdvancedSpacePart4"); + advancedSpaceFloorTexture= GetDataTexture("Blocks/Advanced/AdvancedSpaceFloor"); + doorInvTexture=GetDataTexture("Blocks/ForInventory/Door"); + lavaTexture=GetDataTexture("Blocks/BasicBlocks/Lava"); + #endregion + + #region Other + lightMaskLineTexture=GetDataTexture("Particles/lightMaskLine"); + lightMaskTexture=GetDataTexture("Particles/lightMask"); + lightMaskRoundTexture=GetDataTexture("Particles/lightMaskRound"); + + solidFuelSmokeTexture=GetDataTexture("Particles/AnimationsRocket/Solid"); + + messageLeft= GetDataTexture("Particles/MessageBox/Left"); + messageCenter = GetDataTexture("Particles/MessageBox/Center"); + messageRight = GetDataTexture("Particles/MessageBox/Right"); + + invStrawberryTexture=GetDataTexture("Plants/ForInventory/Strawberry"); + invRashberryTexture=GetDataTexture("Plants/ForInventory/Rashberry"); + invBlueberryTexture=GetDataTexture("Plants/ForInventory/Blueberry"); + flaxInvTexture=GetDataTexture("Plants/ForInventory/Flax"); + barEnergyTexture=GetDataTexture("Bars/Lightning"); + scrollbarUpTexture=GetDataTexture("Buttons/Scrollbar/Top"); + scrollbarBetweenTexture=GetDataTexture("Buttons/Scrollbar/Center"); + scrollbarDownTexture=GetDataTexture("Buttons/Scrollbar/Bottom"); + radioInvTexture=GetDataTexture("Blocks/ForInventory/Radio"); + sunTexture = GetDataTexture("Particles/Sun"); + + fishTexture0 = GetDataTexture("Animals/Fish/Fish0"); + fishTexture1 = GetDataTexture("Animals/Fish/Fish1"); + + RadioButtonPause=GetDataTexture("Buttons/Radio/Pause"); + RadioButtonPlay=GetDataTexture("Buttons/Radio/Play"); + chickenEatTexture = GetDataTexture("Animals/Chicken/Eating"); + chickenWalkTexture = GetDataTexture("Animals/Chicken/Walking"); + rabbitStillTexture = GetDataTexture("Animals/Rabbit/Still"); + chickenStillTexture = GetDataTexture("Animals/Chicken/Still"); + + rabbitEatTexture = GetDataTexture("Animals/Rabbit/Eating"); + rabbitWalkTexture = GetDataTexture("Animals/Rabbit/Walking"); + rabbitJumpTexture = GetDataTexture("Animals/Rabbit/Jumping"); + +destructionTexture = GetDataTexture("Animations/destruction"); + TextureMoon = GetDataTexture("Animations/Moon"); + barEatTexture= GetDataTexture("Bars/Eat"); + barWaterTexture = GetDataTexture("Bars/Water"); + barOxygenTexture = GetDataTexture("Bars/Oxygen"); + barHeartTexture = GetDataTexture("Bars/Heart"); + + #endregion + + #region Player + string dirLegs=(Setting.MaturePlayer==0 ? "Young" : "")+(Setting.sex==Sex.Girl ? "Girl" : "Men"); + string dirChest=Setting.sex==Sex.Men ? "0": Setting.MaturePlayer.ToString(); + + if (Setting.sex==Sex.Girl) { + TextureWalkingUpCensored=GetDataTexture("ClothesAnimations/Walking/UpUnderwear/Censored"); + TextureStaticUpCensored=GetDataTexture("ClothesAnimations/Static/UpUnderwear/Censored"); + TextureSwimmingUpCensored=GetDataTexture("ClothesAnimations/Swimming/UpUnderwear/Censored"); + } + + // Hair + if (Setting.hairType!=0) { + TexturePlayerStaticHair=GetDataTexture("ClothesAnimations/Static/Body/Hair/"+Setting.hairType); + TexturePlayerWalkingHair=GetDataTexture("ClothesAnimations/Walking/Body/Hair/"+Setting.hairType); + } + + // Moustage + if (Setting.moustageType!=0) { + TexturePlayerWalkingMoustage=GetDataTexture("ClothesAnimations/Walking/Body/Moustage/"+Setting.moustageType); + TexturePlayerStaticMoustage=GetDataTexture("ClothesAnimations/Static/Body/Moustage/"+Setting.moustageType); + } + + // Face + TexturePlayerWalkingFace=GetDataTexture("ClothesAnimations/Walking/Body/Face"); + TexturePlayerStaticFace=GetDataTexture("ClothesAnimations/Static/Body/Face"); + + // Mouth + TexturePlayerStaticMouth=GetDataTexture("ClothesAnimations/Static/Body/Mouth/Normal"); + TexturePlayerWalkingMouth=GetDataTexture("ClothesAnimations/Walking/Body/Mouth/Normal"); + + // Eyes + TexturePlayerStaticEyes=GetDataTexture("ClothesAnimations/Static/Body/Eyes/"+Setting.eyesType); + TexturePlayerWalkingEyes=GetDataTexture("ClothesAnimations/Walking/Body/Eyes/"+Setting.eyesType); + + // Feet + TexturePlayerStaticFeet=GetDataTexture("ClothesAnimations/Static/Body/Feet"); + TexturePlayerWalkingFeet=GetDataTexture("ClothesAnimations/Walking/Body/Feet"); + TexturePlayerSwimmingFeet=GetDataTexture("ClothesAnimations/Swimming/Body/Feet"); + + TexturePlayerWalkingFeetForShoes=GetDataTexture("ClothesAnimations/Walking/Body/FeetForShoes"); + + // Legs + TexturePlayerStaticLegs=GetDataTexture("ClothesAnimations/Static/Body/Legs/"+dirLegs); + TexturePlayerWalkingLegs=GetDataTexture("ClothesAnimations/Walking/Body/Legs/"+dirLegs); + TexturePlayerSwimmingLegs=GetDataTexture("ClothesAnimations/Swimming/Body/Legs/"+dirLegs); + + // Chest + TexturePlayerStaticChest=GetDataTexture("ClothesAnimations/Static/Body/Chest/"+dirChest); + TexturePlayerWalkingChest=GetDataTexture("ClothesAnimations/Walking/Body/Chest/"+dirChest); + //TexturePlayerSwimmingChest=GetDataTexture("ClothesAnimations/Swimming/Body/Chest/"+dirChest); + + + // Censored + TextureWalkingDownCensored=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Censored"); + TextureStaticDownCensored=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Censored"); + TextureSwimmingDownCensored=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Censored"); + + //TexturePlayerSwimmingLegsWoman=Rabcr.ColorizeTexture(GetDataTexture("ClothesAnimations/Swimming/Legs/YoungGirl"),Setting.ColorSkin); + + TextureHand=GetDataTexture(@"ClothesAnimations\Hand"); + //TextureHandDown=GetDataTexture(@"ClothesAnimations\Static\Hand\Down"); + + #region Boots + ClothesFormalShoes=new ClothesTypeBoots{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/FormalShoes"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/FormalShoes"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/FormalShoes"), + Color=ColorWhite, + }; + + ClothesPumps=new ClothesTypeBoots{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/Pumps"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/Pumps"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/Pumps"), + Colorize=true, + }; + + ClothesSneakers=new ClothesTypeBoots{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/Sneakers"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/Sneakers"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/Sneakers"), + Colorize=true, + }; + + ClothesSpaceBoots=new ClothesTypeBoots{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/SpaceBoots"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/SpaceBoots"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/SpaceBoots"), + Color=ColorWhite, + }; + #endregion + + #region Trousers + ClothesJeans = new ClothesTypeTrousers { + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/Jeans"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/Jeans"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/Jeans"), + Colorize=true, + }; + + ClothesShorts=new ClothesTypeTrousers{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/Shorts"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/Shorts"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/Shorts"), + ShowBodyLegs=true, + Colorize=true, + }; + ClothesSkirt=new ClothesTypeTrousers{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/Skirt"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/Skirt"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/Skirt"), + ShowBodyLegs=true, + Colorize=true, + }; + ClothesArmyTrousers=new ClothesTypeTrousers{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/ArmyTrousers"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/ArmyTrousers"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/ArmyTrousers"), + Colorize=true, + }; + ClothesSpaceTrousers=new ClothesTypeTrousers{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/SpaceTrousers"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/SpaceTrousers"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/SpaceTrousers"), + Color=ColorWhite, + }; + #endregion + + #region TShirt + ClothesTShirt=new ClothesTypeTShirt{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/TShirt"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/TShirt"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/Chest/TShirt"), + //Texture2DClothHandDown=GetDataTexture("ClothesAnimations/Hand/Chest/Down/TShirt"), + Colorize=true, + handSize=HandClothSize.NearlyFull, + }; + ClothesShirt=new ClothesTypeTShirt{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/Shirt"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/Shirt"), + // Texture2DClothHandUp=GetDataTexture("ClothesAnimations/Hand/Chest/Up/Shirt"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/Chest/Shirt"), + Colorize=true, + handSize=HandClothSize.NearlyFull, + }; + ClothesDress=new ClothesTypeTShirt{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/Dress"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/Dress"), + // Texture2DClothHandUp=GetDataTexture("ClothesAnimations/Hand/Chest/Up/Dress"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/Chest/Dress"), + Colorize=true, + handSize=HandClothSize.NearlyFull, + }; + ClothesTop=new ClothesTypeTShirt{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/Chest/"+dirChest+"/Top"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Chest/"+dirChest+"/Top"), + // Texture2DClothHandUp=GetDataTexture("ClothesAnimations/Hand/ChestTop/Up/Top"), + // Texture2DClothHandDown=GetDataTexture("ClothesAnimations/Hand/ChestTop/Down/Top"), + Colorize=true, + handSize=HandClothSize.None, + ShowBodyChest=true, + }; + #endregion + + #region Helmet + ClothesCap=new ClothesTypeHelmet{ + TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Cap"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Cap"), + Colorize=true, + }; + ClothesHad=new ClothesTypeHelmet{ + TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Had"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Had"), + Color=ColorWhite, + }; + ClothesCrown=new ClothesTypeHelmet{ + TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Crown"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Crown"), + Color=ColorWhite, + }; + ClothesSpaceHelmet=new ClothesTypeHelmet{ + TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/SpaceHelmet"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/SpaceHelmet"), + Color=ColorWhite, + }; + #endregion + + #region UnderwearDown + ClothesUnderpants=new ClothesTypeUnderwearDown{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Underpants"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Underpants"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Underpants"), + Colorize=true, + }; + ClothesBoxerShorts=new ClothesTypeUnderwearDown{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/BoxerShorts"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/BoxerShorts"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/BoxerShorts"), + Colorize=true, + }; + ClothesPanties=new ClothesTypeUnderwearDown{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Panties"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Panties"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Panties"), + Colorize=true, + }; + ClothesSwimsuit=new ClothesTypeUnderwearDown{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Swimsuit"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Swimsuit"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Swimsuit"), + Colorize=true, + }; + ClothesBikiniDown=new ClothesTypeUnderwearDown{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/DownUnderwear/Bikini"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/DownUnderwear/Bikini"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/DownUnderwear/Bikini"), + Colorize=true, + }; + #endregion + + #region UnderwearUp + ClothesBra=new ClothesTypeUnderwearUp{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/UpUnderwear/Bra"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/UpUnderwear/Bra"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/UpUnderwear/Bra"), + Colorize=true, + }; + ClothesBikiniTop=new ClothesTypeUnderwearUp{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/UpUnderwear/Bikini"), + TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/UpUnderwear/Bikini"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/UpUnderwear/Bikini"), + Colorize=true, + }; + #endregion + + #region Coat + ClothesCoatArmy=new ClothesTypeCoat{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/CoatArmy"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/CoatArmy"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/CoatArmy"), + Colorize=true, + handSize=HandClothSize.NearlyFull, + }; + ClothesCoat=new ClothesTypeCoat{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/Coat"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/Coat"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/Coat"), + Colorize=true, + handSize=HandClothSize.NearlyFull, + }; + ClothesJacketDenim=new ClothesTypeCoat{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/JacketDenim"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/JacketDenim"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/JacketDenim"), + Colorize=true, + handSize=HandClothSize.NearlyFull, + }; + ClothesJacketFormal=new ClothesTypeCoat{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/JacketFormal"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/JacketFormal"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/JacketFormal"), + Colorize=true, + handSize=HandClothSize.NearlyFull, + }; + ClothesJacketShort=new ClothesTypeCoat{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/JacketShort"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/JacketShort"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/JacketShort"), + Colorize=true, + handSize=HandClothSize.Half, + }; + ClothesSpaceSuit=new ClothesTypeCoat{ + TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/SpaceSuit"), + TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/SpaceSuit"), + Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/SpaceSuit"), + Color=ColorWhite, + handSize=HandClothSize.Full, + }; + #endregion + + + #endregion + #endregion + + inventoryScrollbar=new GameScrollbar(scrollbarUpTexture,scrollbarBetweenTexture,scrollbarDownTexture); + creativeScrollbar=new GameScrollbar(scrollbarUpTexture,scrollbarBetweenTexture,scrollbarDownTexture); + craftingScrollbar=new GameScrollbar(scrollbarUpTexture, scrollbarBetweenTexture, scrollbarDownTexture) { + maxheight=4*40 + }; + + #region Set lists other + energy=new List(); + rainDots=new List(); + lightsLamp=new List(); + + //Inventory=new List(); + //Crafting=new List(); + //Need=new List(); + #endregion + + #region Load buttons + buttonClose=new ImgButton(GetDataTexture("Buttons/Square/Close")); + buttonClosePopUp=new ImgButton(GetDataTexture("Buttons/Square/Close")); + buttonInvTabBlocks=new ImgButton(GetDataTexture("Buttons/Square/Blocks")); + buttonInvTabPlants=new ImgButton(GetDataTexture("Buttons/Square/Plants")); + buttonInvTabTools=new ImgButton(GetDataTexture("Buttons/Square/Tools")); + buttonInvTabMashines=new ImgButton(GetDataTexture("Buttons/Square/Mashines")); + buttonInvTabItems=new ImgButton(GetDataTexture("Buttons/Square/Items")); + buttonInvTabCeramics=new ImgButton(GetDataTexture("Buttons/Square/Ceramics")); + buttonInvTabFood=new ImgButton(GetDataTexture("Buttons/Square/Food")); + buttonInvTabGlass=new ImgButton(GetDataTexture("Buttons/Square/Glass")); + buttonInvTabMaterials=new ImgButton(GetDataTexture("Buttons/Square/Materials")); + buttonInvAnimals=new ImgButton(GetDataTexture("Buttons/Square/Animals")); + + buttonRocket=new GameButtonSmall(Textures.ButtonCenter/*,spriteFont_small,spriteFont_medium*/) { + Text="Odletět", + //center=true + }; + + buttonRadio=new GameButtonSmall(Textures.ButtonCenter/*,spriteFont_small,spriteFont_medium*/) { + Text="Otevřít", + // center=true + }; + + { + Texture2D button=GetDataTexture("Buttons/Other/Craft"); + buttonNext=new GameButtonSmall(button) { Text="->" }; + buttonPrev=new GameButtonSmall(button) { Text="<-" }; + + buttonCraft1x=new GameButtonSmall(button) { Text="1×" }; + buttonCraft10x=new GameButtonSmall(button) { Text="10×" }; + buttonCraft100x=new GameButtonSmall(button) { Text="100×" }; + } + #endregion + + #region Set lists other + DroppedItems=new List(); + windable=new List(); + FurnaceStone=new List(); + chunksWithPlants=new List(); + Chargers=new List(); + Miners=new List(); + movingAnimals=new List(); + Composters=new List(); + + + energy=new List(); + rainDots=new List(); + lightsLamp=new List(); + + // Inventory = new List(); + //Crafting=new List(); + //Need=new List(); + #endregion + + #region Set basic + //fogTarget= new RenderTarget2D(Graphics, Graphics.Viewport.Width, Graphics.Viewport.Height); + ZoomMatrix = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); + + newKeyboardState = Keyboard.GetState(); + newMouseState = Mouse.GetState(); + oldKeyboardState = newKeyboardState; + oldMouseState = newMouseState; + previousScrollValue = oldMouseState.ScrollWheelValue; + + InventoryCreative=new ItemInv[600]; + InventoryCrafting=new ItemInv[600]; + InventoryNormal=new ItemInv[200]; + InventoryClothes=new ItemInv[8]; + + maxInvCount=32+8; + #endregion + + //dayAlpha + if (time>hour*6&&timehour*18&&time=hour*7&&time<=hour*18) { + dayAlpha=1f; + } else { + dayAlpha=0.5f; + } + + + menu=new GameButtonMedium(Textures.ButtonCenter/*, spriteFont_medium, spriteFont_big*/) { + Text="Zpět do menu", + // center=true + }; + + state++; + Resize(); + } + + public static void AddStringToByteList(List bytes, string str) { + bytes.Add((byte)str.Length); + bytes.AddRange(System.Text.Encoding.UTF8.GetBytes(str)); + } + + public override void Shutdown() { + exit=true; + #region Send logout + if (currentState==Current.Playing) { + //Queue.Add( + // new DataToSend { + // Bytes=new Data { + // To="{Server}", + // Cmd=Command.Logout + // }.ToByte(), + // Importance=Importance.VeryImportant + // } + //); + } + + // if (cancelExit) { + try { + clientSocket.Disconnect(false); + } catch { } + try { + clientSocket.Close(); + clientSocket.Dispose(); + } catch { } + //} + + #endregion + + // return cancelExit; + } + + public override void Update(GameTime gameTime) { + if (Queue.Count!=0) { + try { + if (Queue[0]!=null) { + byte[] bytes = Queue[0].Bytes; + clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + } // } catch (Exception ex){ + // Console.WriteLine(ex.Message+"2"); + } finally { //Console.WriteLine("sending..."); + Queue.RemoveAt(0); + } + } + + if (Current.Playing!=currentState) { + #region Mouse + oldMouseState=newMouseState; + previousScrollValue=oldMouseState.ScrollWheelValue; + newMouseState=Mouse.GetState(); + mouseLeftPress=false; + mouseLeftRelease=false; + mouseRightPress=false; + mouseRightRelease=false; + + if (newMouseState.LeftButton==ButtonState.Pressed) { + mouseLeftDown=true; + if (oldMouseState.LeftButton==ButtonState.Released) mouseLeftPress=true; + } else { + mouseLeftDown=false; + if (oldMouseState.LeftButton==ButtonState.Pressed) mouseLeftRelease=true; + } + + if (newMouseState.RightButton==ButtonState.Pressed) { + mouseRightDown=true; + if (oldMouseState.RightButton==ButtonState.Released) mouseRightPress=true; + } else { + mouseRightDown=false; + if (oldMouseState.RightButton==ButtonState.Pressed) mouseRightRelease=true; + } + SetMousePos(); + //mousePosDiv16.X=(int)mousePos.X/16; + //mousePosDiv16.Y=(int)mousePos.Y/16; + + //mousePosRound.X=mousePosDiv16.X*16; + //mousePosRound.Y=mousePosDiv16.Y*16; + #endregion + + MousePos.mouseRealPosY=newMouseState.Y; + + MousePos.mouseRealPosX=newMouseState.X; + MousePos.mouseLeftDown=newMouseState.LeftButton==ButtonState.Pressed; + MousePos.mouseLeftRelease=!MousePos.mouseLeftDown && oldMouseState.LeftButton==ButtonState.Pressed; + //#region Set Mouse State and Keyboard + //oldMouseState=newMouseState; + //oldKeyboardState=newKeyboardState; + + //newKeyboardState=Keyboard.GetState(); + //newMouseState=Mouse.GetState(); + + //mouseLeftPress=false; + //mouseLeftRelease=false; + + //if (newMouseState.LeftButton==ButtonState.Pressed) { + // mouseLeftDown=true; + // if (oldMouseState.LeftButton==ButtonState.Released) mouseLeftPress=true; + //} else { + // mouseLeftDown=false; + // if (oldMouseState.LeftButton==ButtonState.Pressed) mouseLeftRelease=true; + //} + //#endregion + + if (sn!="") { + System.Windows.Forms.Form MyGameForm = (System.Windows.Forms.Form)System.Windows.Forms.Control.FromHandle(Rabcr.Game.Window.Handle); + MyGameForm.Text=sn; + + sn=""; + } + + if (menu.Update()) { + Rabcr.GoTo(new Menu(new MenuMultiplayer())); + } + } else { + + Rabcr.Game.Window.Title=serverName+" - "+Global.GameName; + + #region Mouse + oldMouseState=newMouseState; + previousScrollValue=oldMouseState.ScrollWheelValue; + newMouseState=Mouse.GetState(); + mouseLeftPress=false; + mouseLeftRelease=false; + mouseRightPress=false; + mouseRightRelease=false; + + if (newMouseState.LeftButton==ButtonState.Pressed) { + mouseLeftDown=true; + if (oldMouseState.LeftButton==ButtonState.Released) mouseLeftPress=true; + } else { + mouseLeftDown=false; + if (oldMouseState.LeftButton==ButtonState.Pressed) mouseLeftRelease=true; + } + + if (newMouseState.RightButton==ButtonState.Pressed) { + mouseRightDown=true; + if (oldMouseState.RightButton==ButtonState.Released) mouseRightPress=true; + } else { + mouseRightDown=false; + if (oldMouseState.RightButton==ButtonState.Pressed) mouseRightRelease=true; + } + SetMousePos(); + + mousePosDiv16.X=(int)mousePos.X/16; + mousePosDiv16.Y=(int)mousePos.Y/16; + + mousePosRoundX=mousePosDiv16.X*16; + mousePosRoundY=mousePosDiv16.Y*16; + + mouseRealPosX=newMouseState.X; + mouseRealPosY=newMouseState.Y; + #endregion + + #region Keyboard + oldKeyboardState=newKeyboardState; + newKeyboardState=Keyboard.GetState(); + + if (oldKeyboardState.IsKeyDown(Keys.F12)) { + if (newKeyboardState.IsKeyUp(Keys.F12)) { + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + } + + if (oldKeyboardState.IsKeyDown(Keys.F1)) { + if (newKeyboardState.IsKeyUp(Keys.F1)) { + if (debug) { + debug=false; + + cpu.Close(); + cpu.Dispose(); + cpu=null; + + ram.Close(); + ram.Dispose(); + ram=null; + + cpuUsage.Close(); + cpuUsage.Dispose(); + cpuUsage=null; + + freeRam.Close(); + freeRam.Dispose(); + freeRam=null; + } else { + // timer60=-1; + string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; + //cpu=new PerformanceCounter("Process", "Working Set - Private", processName); + //ram =new PerformanceCounter("Process", "% Processor Time", processName); + + //cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total"); + //freeRam = new PerformanceCounter("Memory", "Available MBytes"); + try { + cpu=new PerformanceCounter() { + CategoryName="Process", + CounterName="% Processor Time", + InstanceName=processName, + }; + ram=new PerformanceCounter() { + CategoryName="Process", + CounterName="Working Set - Private", + InstanceName=processName, + }; + cpuUsage=new PerformanceCounter() { + CategoryName="Processor", + CounterName="% Processor Time", + InstanceName="_Total", + }; + freeRam=new PerformanceCounter() { + CategoryName="Memory", + CounterName="Available MBytes" + }; + + // cpu=new PerformanceCounter("Process", "% Processor Time", processName); + // ram =new PerformanceCounter("Process", "Working Set - Private", processName); + + // cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total"); + // freeRam = new PerformanceCounter("Memory", "Available MBytes"); + + debug=true; + } catch { + System.Windows.Forms.MessageBox.Show("Chyba při inicializaci PerformanceCounter, Informace pro vývojáře budou skryty", "ERROR"); + debug=false; + } + + } + } + } + + if (oldKeyboardState.IsKeyDown(Keys.F2)) { + if (newKeyboardState.IsKeyUp(Keys.F2)) { + if (showInventory) showInventory=false; else showInventory=true; + } + } + + if (oldKeyboardState.IsKeyDown(Keys.F3)) { + if (newKeyboardState.IsKeyUp(Keys.F3)) { + if (showPlayer) showPlayer=false; else showPlayer=true; + } + } + + if (newKeyboardState.IsKeyDown(Setting.KeyExit)) { + if (oldKeyboardState.IsKeyUp(Setting.KeyExit)) { + ////////////////exit3, + //Shutdown(); + // Shutdown(); + // Log.WriteLine("Odhlašování ze serveru"); + Rabcr.GoTo(new Menu(new MenuMultiplayer())); + + } + } + + if (newKeyboardState.IsKeyDown(Setting.KeyInventory)) { + if (oldKeyboardState.IsKeyUp(Setting.KeyInventory)) { + ChangeInventoryState(); + + }// Console.WriteLine("!!!!!!!!!!!!!!!!!"); + } + + if (newKeyboardState.IsKeyDown(Setting.KeyMessage)) { + if (oldKeyboardState.IsKeyUp(Setting.KeyMessage)) { + if (inventory==0) inventory=InventoryType.Typing; + } + } + #endregion + + #region Player pos in Window + if (PlayerX>TerrainLenght*16-Global.WindowWidth) SetPlayerPos(Global.WindowWidth, PlayerY); + + if (PlayerX4 || PlayerY-WindowCenterY>4 || PlayerX-WindowCenterX<-4 || PlayerY-WindowCenterY<-4) { + WindowXPlayer+=(PlayerX-WindowCenterX)/16f; + WindowYPlayer+=(PlayerY-WindowCenterY)/16f; + + WindowXWithout=(int)WindowXPlayer; + WindowYWithout=(int)WindowYPlayer; + } + + WindowCenterX=WindowXWithout+Global.WindowWidthHalf; + WindowCenterY=WindowYWithout+Global.WindowHeightHalf; + + WindowX=WindowCenterX-(int)(Global.WindowWidthHalf/Setting.Zoom); + WindowY=WindowCenterY-(int)(Global.WindowHeightHalf/Setting.Zoom); + + terrainStartIndexX=(WindowX-1)/16; + terrainStartIndexY=WindowY/16; + + if (terrainStartIndexX<0) terrainStartIndexX=0; + if (terrainStartIndexY<0) terrainStartIndexY=0; + + terrainStartIndexW=(int)((WindowX+Global.WindowWidth/Setting.Zoom)/16)+1; + terrainStartIndexH=(int)((WindowY+Global.WindowHeight/Setting.Zoom)/16)+1; + + if (terrainStartIndexW>TerrainLenght) terrainStartIndexW=TerrainLenght; + if (terrainStartIndexH>124) terrainStartIndexH=124; + if (terrainStartIndexH<0) terrainStartIndexH=0; + + if (terrainStartIndexY>terrainStartIndexH) terrainStartIndexY=terrainStartIndexH; + #endregion + + #region Movement + if (inventory==InventoryType.Normal) { + if (newMouseState.ScrollWheelValue!=previousScrollValue) { + if (newMouseState.ScrollWheelValuepreviousScrollValue) { + if (boxSelected!=0) boxSelected--; + } + } + + if (rocket) { + if (rocketDown) PlayerY+=8; + else PlayerY-=10; + } else if (Global.WorldDifficulty==2) { + + if (newKeyboardState.IsKeyDown(Keys.Up)) { + if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY-=10; + else PlayerY-=3; + } + + if (newKeyboardState.IsKeyDown(Keys.Down)) { + if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY+=10; + else PlayerY+=3; + } + + if (newKeyboardState.IsKeyDown(Keys.Left)) { + if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX-=10; + else PlayerX-=3; + } + + if (newKeyboardState.IsKeyDown(Keys.Right)) { + if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX+=10; + else PlayerX+=3; + } + + if (newKeyboardState.IsKeyDown(Keys.Left)) { + if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX-=10; + else PlayerX-=3; + } + } else { + swimming=CheckWater(); + bool canbreatheDuringSwimming = !CheckWaterUp(); + waterDown=CheckWaterDown(); + + //if (waterDown || swimming){ + // barWater--; + // if (barWater<0)barWater=0; + //} + + if (canbreatheDuringSwimming) { + barOxygen--; + if (barOxygen<0) barOxygen=0; + } else { + barOxygen+=0.05f; + if (barOxygen>32) { + barHeart+=.08f; + if (barHeart>32) Die(Lang.Texts[161] /*"Nemůžeš dýchat vodu","You can't breathe water"*/); + } + } + + if (newKeyboardState.IsKeyDown(Setting.KeyJump)) { + if (CheckLadder()) { + PlayerY--; + + barEnergy+=0.01f; + barWater+=0.01f; + gravitySpeed=-2f; + } else if (swimming) { + PlayerY--; + barEnergy+=0.01f; + barWater+=0.01f; + gravitySpeed=-1f; + } else { + if (distanceToGround==0) { + if (gravitySpeed==0) { + gravitySpeed=-7; + PlayerY--; + + barEnergy+=0.05f; + } + } + } + } + + + // //playerImg+=20; + // //if (playerImg==420)playerImg=0; + // if (newKeyboardState.IsKeyDown(Setting.KeyJump)) { + // if (distanceToGround==0 && gravitySpeed==0){ + // gravitySpeed=-7; + // PlayerY--; + + // barEnergy+=0.05f; + // } + //} + if (!swimming&&!waterDown) playerState=0; + + // playerState=0; + + if (newKeyboardState.IsKeyDown(Setting.KeyLeft)) { + int dis = 1000; + for (int y = (PlayerY-20-1)/16; y<(PlayerY+20)/16; y++) { + int x = (PlayerX-11-16)/16; + if (terrain[x]!=null) { + if (y>=0&&y<125) { + if (terrain[x].IsSolidBlocks[y]) { + if (PlayerX-11-x*1618) { + if (newKeyboardState.IsKeyDown(Setting.KeyRun)) { + if (barEnergy<31) { + if (dis<4) PlayerX-=dis; + else PlayerX-=4; + + barEnergy+=0.08f; + + playerImg+=40; + + if (walkingSoundDuration<0) { + if (Global.HasSoundGraphics) { + SoundEffects.Steps.Play(); + walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; + } + } else walkingSoundDuration--; + + } else { + if (dis==1) PlayerX-=dis; + else PlayerX-=2; + + barEnergy+=0.045f; + + playerImg+=20; + + if (walkingSoundDuration<0) { + if (Global.HasSoundGraphics) { + SoundEffects.Steps.Play(); + walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; + } + } else walkingSoundDuration--; + } + if (playerImg>=420) playerImg=0; + + } else { + if (dis==1) PlayerX-=dis; + else PlayerX-=2; + + barEnergy+=0.045f; + + playerImg+=20; + if (playerImg>=420) playerImg=0; + + if (walkingSoundDuration<0) { + if (Global.HasSoundGraphics) { + SoundEffects.Steps.Play(); + walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; + } + } else walkingSoundDuration--; + } + playerState=1; + } + } + + if (newKeyboardState.IsKeyDown(Setting.KeyRight)) { + int dis = 1000; + for (int y = (PlayerY-20/*-16*/-1)/16; y<(PlayerY+20)/16; y++) { + int x = (PlayerX+11+16)/16; + if (terrain[x]!=null) { + if (y>=0&&y<125) { + if (terrain[x].IsSolidBlocks[y]/*==MBlockState.Exists*/) { + if (x*16-PlayerX-112) { + if (newKeyboardState.IsKeyDown(Setting.KeyRun)) { + if (barEnergy<31) { + if (dis<4) PlayerX+=dis; + else PlayerX+=4; + + barEnergy+=0.08f; + + playerImg+=40; + + if (walkingSoundDuration<0) { + if (Global.HasSoundGraphics) { + SoundEffects.Steps.Play(); + walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; + } + } else walkingSoundDuration--; + } else { + if (dis==1) PlayerX+=dis; + else PlayerX+=2; + + barEnergy+=0.045f; + + playerImg+=20; + + if (walkingSoundDuration<0) { + if (Global.HasSoundGraphics) { + SoundEffects.Steps.Play(); + walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; + } + } else walkingSoundDuration--; + } + + if (playerImg>=420) playerImg=0; + } else { + if (dis==1) PlayerX+=dis; + else PlayerX+=2; + + barEnergy+=0.045f; + + playerImg+=20; + if (playerImg>=420) playerImg=0; + + if (walkingSoundDuration<0) { + if (Global.HasSoundGraphics) { + SoundEffects.Steps.Play(); + walkingSoundDuration=SoundEffects.Steps.Duration.Milliseconds/16; + } + } else walkingSoundDuration--; + } + playerState=2; + } + + } + + if (barEnergy>32) barEnergy=32; + + PlayerGravity(); + // } + } + #endregion + + // #region Mouse scroll + // if (newMouseState.ScrollWheelValue != previousScrollValue) { + // if (inventory==0) { + //if (newMouseState.ScrollWheelValue < previousScrollValue) { + // if (boxSelected<4) boxSelected++; + //} else if (newMouseState.ScrollWheelValue > previousScrollValue) { + // if (boxSelected!=0) boxSelected--; + //} + // } else if (inventory==InventoryType.BasicInv) { + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4 && newMouseState.XGlobal.WindowHeightHalf-200+2 && newMouseState.YmaxInvCount) inventoryScrollbarValue=maxInvCount; + + // } else if (newMouseState.ScrollWheelValue > previousScrollValue) { + // inventoryScrollbarValue-=9; + // if (inventoryScrollbarValue<0) inventoryScrollbarValue=0; + // } + // if (maxInvCount<45) inventoryScrollbarValue=0; + // } else if (newMouseState.X>Global.WindowWidthHalf-300+4+40 && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8 && newMouseState.YinventoryScrollbarValueCraftingMax) inventoryScrollbarValueCrafting=inventoryScrollbarValueCraftingMax; + + // } else if (newMouseState.ScrollWheelValue > previousScrollValue) { + // inventoryScrollbarValueCrafting-=6; + // if (inventoryScrollbarValueCrafting<0) inventoryScrollbarValueCrafting=0; + // } + // if (inventoryScrollbarValueCraftingMax<6*4) inventoryScrollbarValueCrafting=0; + // } + // } + // } + // #endregion + + // #region Player pos in Window + // if (PlayerX> TerrainLenght * 16-Global.WindowWidth) { + // SetPlayerPos(Global.WindowWidth, PlayerY); + // // PlayerX=(int)(Global.WindowWidthHalf*Setting.Zoom); + // } + // if (PlayerX4 || PlayerY-WindowCenterY>4 || PlayerX-WindowCenterX<-4 || PlayerY-WindowCenterY<-4){ + // WindowXPlayer=WindowXPlayer+(PlayerX-WindowCenterX)/16f; + // WindowYPlayer=WindowYPlayer+(PlayerY-WindowCenterY)/16f; + + // WindowXWithout=(int)WindowXPlayer; + // WindowYWithout=(int)WindowYPlayer; + // } + + // WindowCenterX=WindowXWithout+Global.WindowWidthHalf; + // WindowCenterY=WindowYWithout+Global.WindowHeightHalf; + + // WindowX=WindowCenterX-(int)(Global.WindowWidthHalf/Setting.Zoom); + // WindowY=WindowCenterY-(int)(Global.WindowHeightHalf/Setting.Zoom); + + //// Console.WriteLine(WindowX); + // //int deltaX = (int)((Global.WindowWidth-Global.WindowWidth/Setting.Zoom)/2); + // //int deltaY = (int)((Global.WindowHeight-Global.WindowHeight/Setting.Zoom)/2); + // terrainStartIndexX=(WindowX-1)/16; + // terrainStartIndexY=WindowY/16; + + // if (terrainStartIndexX<0)terrainStartIndexX=0; + // if (terrainStartIndexY<0)terrainStartIndexY=0; + + // terrainStartIndexW=(int)((WindowX+Global.WindowWidth/Setting.Zoom)/16)+1; + // terrainStartIndexH=(int)((WindowY+Global.WindowHeight/Setting.Zoom)/16)+1; + + // if (terrainStartIndexW>TerrainLenght)terrainStartIndexW=TerrainLenght; + // if (terrainStartIndexH>125) terrainStartIndexH=125; + + // #endregion + if (diserpeard==250) { DoCommand(); } + if (diserpeard>0) diserpeard--; + + #region Game - destruction + place blocks + drop item + if (mouseRightDown) MouseRightAction(); + if (mouseRightPress) ItemEat(); + + if (mouseLeftDown) { + if (destroing) { + if (destroyBlock.X==mousePosDiv16.X&&destroyBlock.Y==mousePosDiv16.Y) { + destroingIndex++; + + if (destroingIndex>destringMaxIndex) { + if (destroyBlock.X>spawnX/16+safeSpawn||destroyBlock.X0&&mousePosDiv16.Y<125) { + if (terrain[mousePosDiv16.X]!=null) { + Destroy(mousePosDiv16.X, mousePosDiv16.Y); + } + } + } + } else destroing=false; + + if (newKeyboardState.IsKeyDown(Setting.KeyDropItem)) { + if (oldKeyboardState.IsKeyUp(Setting.KeyDropItem)) { + // bool all=newKeyboardState.IsKeyDown(Setting.KeyRun); + + if (InventoryNormal[boxSelected].Id!=0) { + Do(); + + void Do() { + switch (InventoryNormal[boxSelected]) { + case ItemInvBasic16 i1: + if (i1.GetCount>1) { + i1.SetCount=i1.GetCount-1; + } else { + InventoryNormal[boxSelected]=itemBlank; + } + if (i1.GetCount>0){ + if (PlayerX-mousePos.X>0) { + DroppedItems.Add(new Item{ + X = (int)PlayerX-11-16-1, + Y = (int)PlayerY-22, + item=new ItemNonInvBasic(i1.Id,1/*i1.GetCount*/), + Texture=i1.Texture, + }); + } else { + DroppedItems.Add(new Item { + X = (int)PlayerX+11+1, + Y = (int)PlayerY-22, + item=new ItemNonInvBasic(i1.Id,1/*i1.GetCount*/), + Texture=i1.Texture, + }); + } + } + break; + + case ItemInvFood16 i1: + i1.SetCount=i1.GetCount-1; + + if (PlayerX-mousePos.X>0) { + DroppedItems.Add(new Item{ + X = (int)PlayerX-11-16-1, + Y = (int)PlayerY-22, + item=new ItemNonInvFood(i1.Id,i1.GetCount,i1.CountMaximum,i1.GetDescay,i1.DescayMaximum), + Texture=i1.Texture, + }); + } else { + DroppedItems.Add(new Item{ + X =(int)PlayerX+11+1, + Y=(int)PlayerY-22, + item=new ItemNonInvFood(i1.Id,i1.GetCount,i1.CountMaximum,i1.GetDescay,i1.DescayMaximum), + Texture=i1.Texture, + }); + } + + if (i1.GetCount==0) InventoryNormal[boxSelected]=itemBlank; + return; + + case ItemInvBasicColoritzed32NonStackable i1: + if ((int)PlayerX-mousePos.X>0) { + DroppedItems.Add(new Item{ + X =(int)PlayerX-11-16-1, + Y=(int)PlayerY-22, + item=new ItemNonInvBasicColoritzedNonStackable(i1.Id,i1.color), + Texture=i1.Texture, + }); + } else { + DroppedItems.Add(new Item{ + X =(int)PlayerX+11+1, + Y=(int)PlayerY-22, + item=new ItemNonInvBasicColoritzedNonStackable(i1.Id,i1.color), + Texture=i1.Texture, + }); + } + + InventoryNormal[boxSelected]=itemBlank; + return; + + case ItemInvNonStackable16 i1: + if ((int)PlayerX-mousePos.X>0) { + DroppedItems.Add(new Item{ + X =(int)PlayerX-11-16-1, + Y=(int)PlayerY-22, + item=new ItemNonInvNonStackable(i1.Id), + Texture=i1.Texture, + }); + } else { + DroppedItems.Add(new Item{ + X =(int)PlayerX+11+1, + Y=(int)PlayerY-22, + item=new ItemNonInvNonStackable(i1.Id), + Texture=i1.Texture, + }); + } + + InventoryNormal[boxSelected]=itemBlank; + return; + + case ItemInvNonStackable32 i1: + if (PlayerX-mousePos.X>0) { + DroppedItems.Add(new Item { + X =(int)PlayerX-11-16-1, + Y=(int)PlayerY-22, + item=new ItemNonInvNonStackable(i1.Id), + Texture=i1.Texture, + }); + } else { + DroppedItems.Add(new Item { + X =(int)PlayerX+11+1, + Y=(int)PlayerY-22, + item=new ItemNonInvNonStackable(i1.Id), + Texture=i1.Texture, + }); + } + + InventoryNormal[boxSelected]=itemBlank; + return; + } + } + } + } + } + #endregion + // do not write here + #region Inventory + } else { + switch (inventory) { + #region 1 Typing + case InventoryType.Typing: + string newText=text; + text =TextEdit(text); + while (text.Length*13>750) text=text.Substring(0,text.Length-1); + if (newText!=text || textWriting==null) { + int xx=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); + while (text.Length*13>750) text=text.Substring(0,text.Length-1); + + int m = BitmapFont.bitmapFont18.MeasureTextSingleLineX(text); + textWriting=new TextWithMeasure(text,xx-m/2+5,Global.WindowHeightHalf-55-50+5+5/*,BitmapFont.bitmapFont18*/); + } + + if (newKeyboardState.IsKeyDown(Keys.Enter)) { + if (oldKeyboardState.IsKeyUp(Keys.Enter)) { + inventory=0; + diserpeard=255; + + // DInt m=; + + int texts= BitmapFont.bitmapFont18.MeasureTextSingleLineX(text)/2; + int x=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); + gedo=new GeDo(text,x-texts+20-10,Global.WindowHeightHalf-40-50-3); + textWriting=null; + } + } + break; + #endregion + + #region 2 Basic inventory + case InventoryType.BasicInv: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + + if (displayPopUpWindow) { + if (buttonClosePopUp.Update()) { + displayPopUpWindow=false; + } + } else { + if (previousScrollValue!=newMouseState.ScrollWheelValue) { + if (In(Global.WindowWidthHalf-300+4+200+4,Global.WindowHeightHalf-200+2,Global.WindowWidthHalf+300,Global.WindowHeightHalf)) { + inventoryScrollbar.Scroll((previousScrollValue-newMouseState.ScrollWheelValue)/2); + inventoryScrollbarValue=(int)(inventoryScrollbar.scale*(maxInvCount-45)); + } + + if (inventoryScrollbarValueCraftingMax>6*4) { + if (In(Global.WindowWidthHalf-300+4+40+4, Global.WindowHeightHalf-200+2+4+200+8,Global.WindowWidthHalf-300+4+40+4+40*6+10, Global.WindowHeightHalf-200+2+4+200+8+40*4+10)) { + int d=previousScrollValue-newMouseState.ScrollWheelValue; + if (d>0) { + inventoryScrollbarValueCrafting+=6; + if (inventoryScrollbarValueCrafting>inventoryScrollbarValueCraftingMax-6*3) inventoryScrollbarValueCrafting=inventoryScrollbarValueCraftingMax-6*3; + ReSetCraftingInventoryPositions(); + } + if (d<0) { + inventoryScrollbarValueCrafting-=6; + if (inventoryScrollbarValueCrafting<0) inventoryScrollbarValueCrafting=0; + ReSetCraftingInventoryPositions(); + } + + } } + } + + + ChangeInventory(); + + SelectItemCraft(); + CraftingEvents(); + CraftingEventsCraft(); + + if (buttonClose.Update()) { + inventory=0; + SetPlayerClothes(); + } + + if (buttonInvTabBlocks.Update()) SetInvCraftingBlocks(); + if (buttonInvTabMashines.Update()) SetInvCraftingMashines(); + if (buttonInvTabTools.Update()) SetInvCraftingTools(); + if (buttonInvTabPlants.Update()) SetInvCraftingNature(); + if (buttonInvTabItems.Update()) SetInvCraftingItems(); + } + break; + #endregion + + #region 3 Crafting + case InventoryType.Desk: + // ChangeInventoryBasic(); + + SelectItemCraft(); + + //if (buttonNext.Click) { + // craftingType++; + // DListInt[] l = GameMethods.Craft(Crafting[selectedCraftingItem].X); + // if (l!=null) { + // if (craftingType>l.Length-1) craftingType=0; + // Need=l[craftingType].List1; + // } + //} + + //if (buttonPrev.Click) { + // craftingType--; + // DListInt[] l = GameMethods.Craft(Crafting[selectedCraftingItem].X); + // if (l!=null) { + // if (craftingType<0) craftingType=l.Length-1; + // Need=l[craftingType].List1; + // } + //} + + //if (buttonClose.Click) inventory=0; + break; + #endregion + + #region 4 Furnace stone + case InventoryType.FurnaceStone: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + if (displayPopUpWindow) { + if (buttonClosePopUp.Update()) { + displayPopUpWindow=false; + } + } else { + if (In(Global.WindowWidthHalf-300+4+200+4,Global.WindowHeightHalf-200+2,Global.WindowWidthHalf+300,Global.WindowHeightHalf)) { + inventoryScrollbar.Scroll((previousScrollValue-newMouseState.ScrollWheelValue)/2); + inventoryScrollbarValue=(int)(inventoryScrollbar.scale*(maxInvCount-45)); + } + + if (inventoryScrollbarValueCraftingMax>6*4) { + if (In(Global.WindowWidthHalf-300+4+40+4, Global.WindowHeightHalf-200+2+4+200+8,Global.WindowWidthHalf-300+4+40+4+40*6+10, Global.WindowHeightHalf-200+2+4+200+8+40*4+10)) { + int d=previousScrollValue-newMouseState.ScrollWheelValue; + if (d>0) { + inventoryScrollbarValueCrafting+=6; + if (inventoryScrollbarValueCrafting>inventoryScrollbarValueCraftingMax-6*3) inventoryScrollbarValueCrafting=inventoryScrollbarValueCraftingMax-6*3; + ReSetCraftingInventoryPositions(); + } + if (d<0) { + inventoryScrollbarValueCrafting-=6; + if (inventoryScrollbarValueCrafting<0) inventoryScrollbarValueCrafting=0; + ReSetCraftingInventoryPositions(); + } + } + } + + ChangeInventory(); + + SelectItemBake(); + + if (buttonInvTabMaterials.Update()) SetInvBakeIngots(); + if (buttonInvTabGlass.Update()) SetInvBakeItems(); + if (buttonInvTabCeramics.Update()) SetInvBakeCeramics(); + if (buttonInvTabFood.Update()) SetInvBakeFood(); + if (buttonInvTabTools.Update()) SetInvBakeTools(); + + if (buttonClose.Update()) inventory=0; + CraftingEvents(); + + ItemInv[] inv=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; + float energy=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy; + + //for (int i=0; i<3; i++){ + // if (inv[i].Id!=0) { + // float ammout=GameMethods.FurnaceStoneBurnWood(inv[i].Id); + + // if (energy+ammout<1f) { + // ((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy+=ammout; + // break; + // } + // } + //} + + if (energy/*((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy*/>0.05f) + CraftingEventsCraft(); + if (buttonClose.Update()) inventory=0; + } + break; + #endregion + + #region 6 Macerator + case InventoryType.Macerator: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + if (displayPopUpWindow) { + if (buttonClosePopUp.Update()) { + displayPopUpWindow=false; + } + } else { + + if (In(Global.WindowWidthHalf-300+4+200+4,Global.WindowHeightHalf-200+2,Global.WindowWidthHalf+300,Global.WindowHeightHalf)) { + inventoryScrollbar.Scroll((previousScrollValue-newMouseState.ScrollWheelValue)/2); + inventoryScrollbarValue=(int)(inventoryScrollbar.scale*(maxInvCount-45)); + } else if (inventoryScrollbarValueCraftingMax>6*4) { + if (In(Global.WindowWidthHalf-300+4+40+4, Global.WindowHeightHalf-200+2+4+200+8,Global.WindowWidthHalf-300+4+40+4+40*6+10, Global.WindowHeightHalf-200+2+4+200+8+40*4+10)) { + int d=previousScrollValue-newMouseState.ScrollWheelValue; + if (d>0) { + inventoryScrollbarValueCrafting+=6; + if (inventoryScrollbarValueCrafting>inventoryScrollbarValueCraftingMax-6*3) inventoryScrollbarValueCrafting=inventoryScrollbarValueCraftingMax-6*3; + ReSetCraftingInventoryPositions(); + } + if (d<0) { + inventoryScrollbarValueCrafting-=6; + if (inventoryScrollbarValueCrafting<0) inventoryScrollbarValueCrafting=0; + ReSetCraftingInventoryPositions(); + } + } + } + + ChangeInventory(); + + SelectItemToDust(); + + if (buttonInvTabMaterials.Update()) SetInvToDustDusts(); + if (buttonInvTabPlants.Update()) SetInvToDustNature(); + if (buttonInvTabTools.Update()) SetInvToDustTools(); + if (buttonInvTabItems.Update()) SetInvToDustStone(); + if (buttonInvTabCeramics.Update()) SetInvToDustOther(); + + if (buttonClose.Update()) inventory=0; + } + + CraftingEvents(); + if (((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy>0) CraftingEventsCraft(); + break; + #endregion + + + #region Creative + case InventoryType.Creative: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + + if (displayPopUpWindow) { + if (buttonClosePopUp.Update()) { + displayPopUpWindow=false; + } + } else { + if (In(Global.WindowWidthHalf-300+4+200+4,Global.WindowHeightHalf-200+2,Global.WindowWidthHalf+300,Global.WindowHeightHalf)) { + inventoryScrollbar.Scroll((previousScrollValue-newMouseState.ScrollWheelValue)/2); + inventoryScrollbarValue=(int)(inventoryScrollbar.scale*(maxInvCount-45)); + } + + if (!creativeTabCrafting) ReSetInventoryCreativePositions(); + + if (!displayPopUpWindow) { + if (buttonClose.Update()) { + inventory=0; + SetPlayerClothes(); + } + } + + ChangeInventory(); + + if (!displayPopUpWindow) { + if (ButtonCrafting.Update()) {creativeTabCrafting=true; SetInvCraftingBlocks(); } + if (ButtonItems.Update()) {creativeTabCrafting=false; SetInvCreativeBlocks(); } + } + + if (creativeTabCrafting) { + //if (In(Global.WindowWidthHalf-300+4+200+4-100-100+60-14,Global.WindowHeightHalf-200+2+200+16+40-8,Global.WindowWidthHalf+300,Global.WindowHeightHalf+200+16)) { + // inventoryScrollbar.Scroll((previousScrollValue-newMouseState.ScrollWheelValue)/2); + // inventoryScrollbarValue=(int)(inventoryScrollbar.scale*(inventoryScrollbarValueCraftingMax-45)); + //} + + if (inventoryScrollbarValueCraftingMax>6*4) { + if (In(Global.WindowWidthHalf-300+4+40+4, Global.WindowHeightHalf-200+2+4+200+8,Global.WindowWidthHalf-300+4+40+4+40*6+10, Global.WindowHeightHalf-200+2+4+200+8+40*4+10)) { + int d=previousScrollValue-newMouseState.ScrollWheelValue; + if (d>0) { + inventoryScrollbarValueCrafting+=6; + if (inventoryScrollbarValueCrafting>inventoryScrollbarValueCraftingMax-6*3) inventoryScrollbarValueCrafting=inventoryScrollbarValueCraftingMax-6*3; + ReSetCraftingInventoryPositions(); + } + if (d<0) { + inventoryScrollbarValueCrafting-=6; + if (inventoryScrollbarValueCrafting<0) inventoryScrollbarValueCrafting=0; + ReSetCraftingInventoryPositions(); + } + } + } + + SelectItemCraftPlus(); + CraftingEventsPlus(); + + if (buttonInvTabBlocks.Update()) SetInvCraftingBlocks(); + if (buttonInvTabMashines.Update()) SetInvCraftingMashines(); + if (buttonInvTabTools.Update()) SetInvCraftingTools(); + if (buttonInvTabPlants.Update()) SetInvCraftingNature(); + if (buttonInvTabItems.Update()) SetInvCraftingItems(); + + } else { + CreativeGetItems(); + + if (In(Global.WindowWidthHalf-300+4+200+4-100-100+60-14,Global.WindowHeightHalf-200+2+200+16+40-8,Global.WindowWidthHalf+300,Global.WindowHeightHalf+200+16)) { + creativeScrollbar.Scroll((previousScrollValue-newMouseState.ScrollWheelValue)/2); + scrollBarCreative=(int)(inventoryScrollbar.scale*(inventoryScrollbarValueCraftingMax-45)); + } + + if (buttonInvTabBlocks.Update()) SetInvCreativeBlocks(); + if (buttonInvTabMashines.Update()) SetInvCreativeMashines(); + if (buttonInvTabTools.Update()) SetInvCreativeTools(); + if (buttonInvTabPlants.Update()) SetInvCreativePlants(); + if (buttonInvTabItems.Update()) SetInvCreativeItems(); + } + } + break; + #endregion + + #region 8 Shelf + case InventoryType.Shelf: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + ChangeInventory(); + + if (buttonClose.Update()) { + inventory=0; + ShelfBlock block=(ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]; + if (block.Inv[4].Id==0) block.IsSmallItem=false; + else { + Texture2D tex=ItemIdToTexture(block.Inv[4].Id); + if (tex!=null) { + block.SmalItemTexture=tex; + block.IsSmallItem=true; + }else block.IsSmallItem=false; + } + } + + break; + #endregion + + #region 9 Wooden box + case InventoryType.BoxWooden: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + ChangeInventory(); + + if (buttonClose.Update()) inventory=0; + break; + #endregion + + #region 10 Adv box + case InventoryType.BoxAdv: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + ChangeInventory(); + + if (buttonClose.Update()) inventory=0; + break; + #endregion + + + #region Mobile + case InventoryType.Mobile: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + if (buttonClose.Update()) inventory=0; + // mobileOS.mouse.X=mouseRealPos; + mobileOS.mouseDown=newMouseState.LeftButton==ButtonState.Pressed; + mobileOS.Update(); + break; + #endregion + + #region Rocket + case InventoryType.Rocket: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + if (buttonClose.Update()) inventory=0; + if (buttonRocket.Update()) { + AchievementFutureAge=true; + //Save(); + rocket=true; + rocketDown=false; + PlayerX=selectedMashine.X; + PlayerY=selectedMashine.Y; + inventory=0; + File.WriteAllText(pathToWorld+"UseRocket.txt",""); + MTerrain chunk=terrain[selectedMashine.X]; + // chunk.IsTopBlocks[selectedMashine.Y]=MBlockState.TmpRemoved; + // chunk.TopBlocks[selectedMashine.Y]=null; + } + break; + #endregion + + #region Charger + case InventoryType.Charger: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + ChangeInventory(); + + if (buttonClose.Update()) { + inventory=0; + } + break; + #endregion + + #region Miner + case InventoryType.Miner: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + ChangeInventory(); + + if (buttonClose.Update()) inventory=0; + break; + #endregion + + #region Radio + case InventoryType.Radio: + if (Constants.AnimationsControls) { + if (animationInvBack<100) { + animationInvBack+=5; + } + } + if (buttonRocket.Update()) { } + if (buttonClose.Update()) inventory=0; + + if (radioplaying) { + if (MediaPlayer.PlayPosition==TimeSpan.MinValue) radioplaying=false; + } + if (((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy>0) { + if (radioSongs!=null) { + for (int i=0; iGlobal.WindowWidthHalf-300-2+10+240 && newMouseState.Y>Global.WindowHeightHalf-234+10+40+i*40 + && newMouseState.XGlobal.WindowWidthHalf-24 && newMouseState.Y>Global.WindowHeightHalf-200+2+400-50 + && newMouseState.X6.283185307f) itemAnimationPos=0f; + Global.ItemAnimation=(float)Math.Cos(itemAnimationPos); + + itemAnimationPos2+=0.1047197551f; + if (itemAnimationPos2>6.283185307f) itemAnimationPos2=0f; + Global.ItemAnimation2=(float)Math.Cos(itemAnimationPos2); + UpdateItem(DroppedItems); + } + #endregion + + #region bars + if (barEnergy<=32) { + if (barEnergy>0) { + if (barEat>=0) { + if (barWater>=0) { + barEat+=0.0006f; + barWater+=0.0008f; + barEnergy-=0.04f; + + if (barEat<0) barEat=0; + if (barWater<0) barWater=0; + if (barEnergy<0) barEnergy=0; + } + } + } + } + #endregion + + #region Wheather + if (rain) { + rainDots.Add(new DInt(FastRandom.Int(848), -10)); + if (Global.HasSoundGraphics) { + if (rainDuration==0) { + SoundEffects.Rain.Play(); + rainDuration=(int)(SoundEffects.Rain.Duration.TotalMilliseconds/16.3333334d); + } else rainDuration--; + } + } + #endregion + + #region Chunks + for (int x = terrainStartIndexX; x10) { + SendRequestChunk(x); + } + } + + } + #endregion + + EnergySystem(); + + { + lightsFull.Clear(); + lightsHalf.Clear(); + + int w=(int)WindowY-8, w2=(int)WindowY/*+*/-8; + + for (int x=(terrainStartIndexX>2 ? terrainStartIndexX-2 : terrainStartIndexX); x60) { + GunShots.RemoveAt(i); + i--; + continue; + } + gs.Update(); + + // Kill mob with gun + int x=(int)(gs.X*divider_16); + MTerrain chunk=terrain[x]; + if (chunk!=null) { + int y=(int)(gs.Y*divider_16); + + for (int j = 0; j0) { + rocket=false; + PlayerY=0; + // InventoryAdd((int)Items.Rocket); + // File.Delete(pathToWorld+"UseRocket.txt"); + } + } else { + if (PlayerY<=-10000) { + //Save(); + + //File.WriteAllText(pathToWorld+@"\Settings.txt", + // debug+"\r\n"+ + // time+"\r\n"+ + // dayAlpha+"\r\n"+ + + // barWater+"\r\n"+ + // barEat+"\r\n"+ + // barHeart+"\r\n"+ + // barOxygen+"\r\n"+ + + // PlayerX+"\r\n"+ + // PlayerY+"\r\n"+ + // moonSpeed); + + //using (StreamWriter sr = new StreamWriter(pathToWorld+@"\Inventory.txt")) { + // foreach (DInt x in Inventory) { + // sr.WriteLine(x.X); + // sr.WriteLine(x.Y); + // } + //} + Rabcr.GoTo(new PlanetSystem(pathToWorld)); + } + } + } + + // UpdateWater(); + + // int x = WindowX<0 ? 0 : WindowX/16; + // int w= (WindowX+Global.WindowWidth)/16 >TerrainLenght ? TerrainLenght : (WindowX + Global.WindowWidth) / 16; + //for (int x = terrainStartIndexX; xy) NewEnergySolarPanel(x, y); + // break; + + // case BlockId.Watermill: + // NewEnergyWatermill(x, y); + // break; + + // case BlockId.Windmill: + // NewEnergySolarPanel(x, y); + // break; + // } + // } + // } + // } + //} + + + if (Global.HasSoundGraphics) { + if (MediaPlayer.State==MediaState.Stopped) { + Song play = null; + + if (notNeedScafander) { + switch (FastRandom.Int(4)) { + case 0: play=Songs.Happend; break; + case 1: play=Songs.Medium; break; + case 2: play=Songs.Root; break; + default: play=Songs.Storm; break; + } + } else play=Songs.Spacelandia; + + MediaPlayer.Play(play); + } + } + + #region Time + time++;//1hod=3000x zvýšení + if (time==dayLenght) { + day++; + if (day>365) day=0; + time=0; + } + + //Východ + if (time>hour*6&&timehour*18&&time=hour*7&&time<=hour*18) dayAlpha=1f; + else dayAlpha=.5f; + + + moonSpeed+=368f/(7f*dayLenght); + if (moonSpeed>=368) moonSpeed=0; + #endregion + + #region Furnace Stone burning + foreach (ShortAndByte d in FurnaceStone) { + MashineBlockBasic block = (MashineBlockBasic)terrain[d.X].TopBlocks[d.Y]; + if (block==null) { + FurnaceStone.Remove(d); + break; + } + + if (block.Inv[0].Id!=0 || block.Inv[1].Id!=0 || block.Inv[2].Id!=0) { + if (block.Inv[3].Id==(ushort)Items.None) Do(); + else if (block.Inv[3].Id==(ushort)Items.Ash) { + if (((ItemInvBasic16)block.Inv[3]).GetCount<99) Do(); + } + + void Do() { + for (int i=0; i<3; i++) { + //0 + float add = GameMethods.FurnaceStoneBurnWood(block.Inv[i].Id); + if (add!=-1f) { + if (add+block.Energy<1f) { + block.Energy+=add; + + ItemInvBasic16 invI=(ItemInvBasic16)block.Inv[i]; + + if (invI.GetCount==1) { + block.Inv[i]=itemBlank; + AddAsh(); + return; + } else { + invI.SetCount=invI.GetCount-1; + AddAsh(); + return; + } + + void AddAsh() { + if (block.Inv[3].Id==(ushort)Items.Ash) { + ItemInvBasic16 inv3 = (ItemInvBasic16)block.Inv[3]; + inv3.SetCount=inv3.GetCount+1; + } else { + DInt pos=InventoryGetPosFurnaceStone(3); + block.Inv[3]=new ItemInvBasic16(ashTexture, (ushort)Items.Ash, 1, pos.X, pos.Y); + + } + } + } + } + } + } + } + if (block.Energy>0) { + block.Energy-=0.001f; + block.Energy-=0.001f; + }else if (block.Energy<0) { + block.Energy=0; + } + } + #endregion + + //Animatable + if (wind) { + if (windForce<1) { + windForce+=.05f; + SetWintableSources(); + } + } else { + if (windForce>0) { + windForce-=.05f; + SetWintableSources(); + } + } + + #region Auto-destroy leaves + if (terrainStartIndexW-terrainStartIndexX>0) { + // #region Auto-destroy leaves + //AutoDestroyLeaves((ushort)BlockId.OakWood, (ushort)BlockId.OakLeaves); + //AutoDestroyLeaves((ushort)BlockId.SpruceWood, (ushort)BlockId.SpruceLeaves); + //AutoDestroyLeaves((ushort)BlockId.PineWood, (ushort)BlockId.PineLeaves); + //AutoDestroyLeaves((ushort)BlockId.LindenWood, (ushort)BlockId.LindenLeaves); + + //AutoDestroyLeaves((ushort)BlockId.AppleWood, (ushort)BlockId.AppleLeaves, (ushort)BlockId.AppleLeavesWithApples); + //AutoDestroyLeaves((ushort)BlockId.PlumWood, (ushort)BlockId.PlumLeaves, (ushort)BlockId.PlumLeavesWithPlums); + //AutoDestroyLeaves((ushort)BlockId.CherryWood, (ushort)BlockId.CherryLeaves, (ushort)BlockId.CherryLeavesWithCherries); + //AutoDestroyLeaves((ushort)BlockId.OrangeWood, (ushort)BlockId.OrangeLeaves, (ushort)BlockId.OrangeLeavesWithOranges); + //AutoDestroyLeaves((ushort)BlockId.LemonWood, (ushort)BlockId.LemonLeaves, (ushort)BlockId.LemonLeavesWithLemons); + //AutoDestroyLeaves((ushort)BlockId.AcaciaWood, (ushort)BlockId.AcaciaLeaves); + //AutoDestroyLeaves((ushort)BlockId.EucalyptusWood, (ushort)BlockId.EucalyptusLeaves); + //AutoDestroyLeaves((ushort)BlockId.KapokWood, (ushort)BlockId.KapokLeacesFibre,(ushort)BlockId.KapokLeacesFlowering); + //AutoDestroyLeaves((ushort)BlockId.KapokWood, (ushort)BlockId.KapokLeaves); + //AutoDestroyLeaves((ushort)BlockId.MangroveWood, (ushort)BlockId.MangroveLeaves); + //AutoDestroyLeaves((ushort)BlockId.OliveWood, (ushort)BlockId.OliveLeaves,(ushort)BlockId.OliveLeavesWithOlives); + //AutoDestroyLeaves((ushort)BlockId.RubberTreeWood, (ushort)BlockId.RubberTreeWood); + //AutoDestroyLeaves((ushort)BlockId.WillowWood, (ushort)BlockId.WillowLeaves); + //#endregion + } + #endregion + + // Start mooving + //if (terrainStartIndexW-terrainStartIndexX>0) { + // MoveChicken(); + // MoveRabbit(); + //} + + //// Finish mooving + //FinishMooving(); + + timer5=5; + } else timer5--; + + if (_secondTimer<0) { + //for (int i = 0; i25&&barWater>25) { + barHeart+=.06f; + if (barHeart>32) Die(Lang.Texts[162] /*"Měl bys jíst a pít","You shoud eat and drink"*/); + } + + if (CheckLava()) { + barHeart+=.06f; + if (barHeart>32) Die(Lang.Texts[163] /*"Dávej pozor! Láva..","Pay attention! Lava..."*/); + } + + if (barEnergy>31) { + if (FastRandom.Int(3)==1) { + barHeart+=.01f; + if (barHeart>32) Die(Lang.Texts[164] /*"Bez energie + spatné srdíčko = srmt","Without energy + wrong heart = die"*/); + } + } + #endregion + + if (debug) { + if (cpu!=null) { + usageCpuProcess=cpu.NextValue(); + usageCpu=cpuUsage.NextValue(); + usageRamProcess=ram.NextValue(); + usageRam=freeRam.NextValue(); + } + } + + #region Weather + if (changeRain<0) { + changeRain=100+FastRandom.Int(50); + if (rain) rain=false; else rain=true; + } else changeRain--; + + if (timeToChageWind<0) { + timeToChageWind=2000+FastRandom.Int(1000); + wind=!wind; + } else timeToChageWind--; + + foreach (DInt r in rainDots) { + if (Global.WindowHeight5000) energy.RemoveRange(5000, energy.Count-5000); + #endregion + + switch (InventoryNormal[boxSelected].Id) { + case (ushort)Items.TorchON: + { + ItemInvTool16 t=(ItemInvTool16)InventoryNormal[boxSelected]; + if (t.GetCount>1) { + t.SetCount=t.GetCount-1; + } else { + InventoryAddOne((ushort)Items.Stick); + } + playerLight=true; + } + break; + + case (ushort)Items.TorchElectricON: + { + ItemInvTool32 t=(ItemInvTool32)InventoryNormal[boxSelected]; + if (t.GetCount>1) { + t.SetCount=t.GetCount-1; + } else { + InventoryAddOne((ushort)Items.TorchElectricOFF); + } + playerLight=true; + } + break; + + default: + playerLight=false; + break; + } + + // foreach (ShortAndByte d in Miners) MinerJob(d); + + //autoSave--; + //if (autoSave==0) { + //Save(); + + //File.WriteAllText(pathToWorld+@"\Settings.txt", + // debug+"\r\n"+ + // time+"\r\n"+ + // dayAlpha+"\r\n"+ + + // barWater+"\r\n"+ + // barEat+"\r\n"+ + // barHeart+"\r\n"+ + // barOxygen+"\r\n"+ + + // PlayerX+"\r\n"+ + // PlayerY+"\r\n"+ + // moonSpeed); + + //using (StreamWriter sr = new StreamWriter(pathToWorld+@"\Inventory.txt")) { + // foreach (DInt x in Inventory) { + // sr.WriteLine(x.X); + // sr.WriteLine(x.Y); + // } + //} + // autoSave=300; + // } + + if (inventory==InventoryType.Radio) { + try { + if (Directory.Exists(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData\\Default\\Songs\\Radio")) { + radioSongs=Directory.GetFiles(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData\\Default\\Songs\\Radio"); + List songs = new List(); + foreach (string s in radioSongs) { + if (s.EndsWith(".wma")) songs.Add(s); + } + radioSongs=songs.ToArray(); + } + } catch { } + } + + + #region Multiplayer + //Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.MyPlayerData, + // Message=PlayerX+"|"+PlayerY, + // To=toServer, + // }.ToByte(), + // Importance=Importance.Low + //}); + #endregion + + //if (Inventory[boxSelected].X==(int)Items.TorchON) { + // if (Inventory[boxSelected].Y>2) { + // if (FastRandom.Int(2)==1) InventoryRemoveDInt(); + // } else { + // Inventory[boxSelected].X=(int)Items.Stick; + // } + + // playerLight=true; + //} else playerLight=false; + + _secondTimer=60; + } else _secondTimer--; + + CameraMatrix(); + } + + + base.Update(gameTime); + } + + public override void Draw(GameTime gameTime) { + Rabcr.spriteBatch=spriteBatch; + oldMouseState=newMouseState; + newMouseState=Mouse.GetState(); + + if (currentState==Current.Playing) { + #region Died + if (died) { + Graphics.SetRenderTarget(null); + Graphics.Clear(Color.DarkRed); + spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp); + Vector2 text = spriteFont_small.MeasureString(diedInfo); + float a; + if (timerStayDied>200) a=1-(timerStayDied-200)/110f; + else if (timerStayDied<100) a=timerStayDied/100f; + else a=1; + string m = Lang.Texts[28];// Setting.czechLanguage? "Právě jsi zemřel(a)": "You died"; + string respawntext = Lang.Texts[28]+" "+(timerStayDied/60+1);//(Setting.czechLanguage? "Znovuzrodíš se za ": "Respawn in ")+(timerStayDied/60+1); + + spriteBatch.DrawString(spriteFont_medium, m, new Vector2(Global.WindowWidthHalf-(int)spriteFont_medium.MeasureString(m).X/2, Global.WindowHeightHalf-60), Color.White*a); + GameDraw.DrawTextShadowMin(Global.WindowWidthHalf-(int)text.X/2, Global.WindowHeightHalf, diedInfo, Color.White*a); + GameDraw.DrawTextShadowMin(Global.WindowWidthHalf-(int)spriteFont_small.MeasureString(respawntext).X/2, Global.WindowHeightHalf+30, respawntext, Color.White*a); + + spriteBatch.End(); + } else { + #endregion + + #region Draw lighting + Graphics.SetRenderTarget(sunLightTarget); + Graphics.Clear(Color.Black); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, camera); + for (int x = terrainStartIndexX; x=terrainStartIndexX*16) { + if (m.Position.X<=terrainStartIndexW*16) { + if (m.Position.Y>=terrainStartIndexY*16) { + if (m.Position.Y<=terrainStartIndexH*16) { + if (m.Energy>0) { + m.Energy-=0.01f; + if (m.Energy<0) m.Energy=0; + spriteBatch.Draw(lightMaskRoundTexture, new Rectangle((int)m.Position.X-48*2*2+8, (int)m.Position.Y-48*2*2+8, 96*2*2, 96*2*2), lampColorLight); + } + } + } + } + } + } + // playerLight=true; + if (playerLight) spriteBatch.Draw(lightMaskRoundTexture, new Rectangle(PlayerX-48*2+8, PlayerY-48*2+8, 96*2, 96*2), lampColorLight); + spriteBatch.End(); + #endregion + + //#region Draw lighting + //Graphics.SetRenderTarget(fogTarget); + //Graphics.Clear(/*Color.Black*/Color.White*0.1f); + //spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp ,null, null, null, camera); + ////for (int x= startIndex-2>0 ? startIndex-2:0; x=terrainStartIndexX*16){ + // if (m.Position.X<=terrainStartIndexW*16){ + // if (m.Position.Y>=terrainStartIndexY*16){ + // if (m.Position.Y<=terrainStartIndexH*16){ + // if (m.Energy>0){ + // m.Energy-=0.01f; + // if (m.Energy<0)m.Energy=0; + // spriteBatch.Draw(lightmap, new Rectangle((int)m.Position.X-48*2+8, (int)m.Position.Y-48*2+8,96*2,96*2), Color.White); + // } + // } + // } + // } + // } + //} + //spriteBatch.End(); + //#endregion + + #region Draw game + Graphics.SetRenderTarget(null); + Graphics.Clear(Color.LightSkyBlue); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera); + + #region Weather + if (rain) { + if (WindowY<0) { + foreach (DInt r in rainDots) { + + r.Y++; + + if (wind) { + if (FastRandom.Int(4)==1) r.X--; else if (FastRandom.Int(2)==1) r.X++; + } else { + if (FastRandom.Int(3)==1) r.X++; else if (FastRandom.Int(2)==1) r.X--; + } + spriteBatch.Draw(Rabcr.Pixel, new Rectangle(WindowX+r.X, WindowY+r.Y, 1, 1), Color.White); + } + } else { + foreach (DInt r in rainDots) { + + r.Y+=3; + + if (wind) { + if (FastRandom.Int(2)==1) r.X++; + } + spriteBatch.Draw(Rabcr.Pixel, new Rectangle(WindowX+r.X, WindowY+r.Y, 1, 2), Color.Blue); + } + } + } + #endregion + + for (int x = terrainStartIndexX; xterrainStartIndexY ? chunk.StartSomething : terrainStartIndexY; y0) spriteBatch.Draw(TextureSwimmingUpCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } + } + } + } + } + if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureWalking, vectorChest, null, ClothesChestTop.Color, FastMath.PI1_5, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (ClothesChestTop is null) { + if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); + } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); + + void DrawItemInHandTop(Texture2D texCloth, Color colorCloth, int size){ + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); + + if (InventoryNormal[boxSelected]!=null){ + if (InventoryNormal[boxSelected].Id!=0) { + Rectangle recItem=new Rectangle( + (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), + (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), + 8, + 8 + ); + + switch (InventoryNormal[boxSelected]) { + case ItemInvBasic16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasic32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasicColoritzed32NonStackable i: + spriteBatch.Draw(i.Texture, recItem, i.color); + break; + + case ItemInvFood16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvFood32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + #if DEBUG + default: throw new Exception("Unknown category"); + #endif + } + } + } + } + + void DrawItemInHandBack(Texture2D texCloth, Color colorCloth, int size){ + recHand = new Rectangle(0,0,4,HandSize-size); + vecOrigin=new Vector2(2,2-size); + recCloth =new Rectangle(0,0,4,size); + + spriteBatch.Draw( + TextureHand, + rameno, + recHand, + new Color( + (byte)(Setting.ColorSkin.R*0.75f), + (byte)(Setting.ColorSkin.G*0.75f), + (byte)(Setting.ColorSkin.B*0.75f), + (byte)255 + ), + handAngle-FastMath.PI, + vecOrigin, + 1f, + SpriteEffects.None, + 1f); + if (texCloth!=null) spriteBatch.Draw(texCloth, rameno, recCloth, new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f),(byte)255), handAngle-FastMath.PI, Vector2_2, 1, SpriteEffects.None,1f); + } + } else { + //-> + Rectangle curImg=new Rectangle(playerImg/22*39, 0, 39, 20); + Vector2 vector=new Vector2(PlayerX-11-15-3, PlayerY+8); + Vector2 vectorHead=new Vector2(PlayerX-11+46/2, PlayerY+8); + Vector2 vectorChest=new Vector2(PlayerX-11-22+44, PlayerY+8+2-3+2); + + Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2+7+20, vector.Y-39/2+12-1+38/2); + handAngle=swimmingTicks*2*FastMath.PI; + + Rectangle recHand, recCloth; + Vector2 vecOrigin; + + if (ClothesChestTop is null) { + if (ClothesChest is null) DrawItemInHandBack(null, Color.White, 0); + else DrawItemInHandBack(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); + } else DrawItemInHandBack(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); + + //feet + if (ClothesFeet!=null) spriteBatch.Draw(ClothesFeet.TextureSwimming, vector, curImg, ClothesFeet.Color, 0, Vector2Zero, 1,SpriteEffects.FlipHorizontally, 1f); + else spriteBatch.Draw(TexturePlayerSwimmingFeet, vector, curImg, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + + // legs + if (ClothesLegs!=null) { + if (ClothesLegs.ShowBodyLegs) spriteBatch.Draw(TexturePlayerSwimmingLegs, vector, curImg, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + spriteBatch.Draw(ClothesLegs.TextureSwimming, vector, curImg, ClothesLegs.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } else { + spriteBatch.Draw(TexturePlayerSwimmingLegs, vector, curImg, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (ClothesUnderwearDown!=null) { + if (ClothesChest==null) spriteBatch.Draw(ClothesUnderwearDown.TextureSwimming, vector, curImg, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureSwimming, vector, curImg, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } else { + if (Global.YoungPlayer) spriteBatch.Draw(TextureSwimmingDownCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } + } + + // Head + spriteBatch.Draw(TexturePlayerWalkingFace, vectorHead, null, Setting.ColorSkin,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerWalkingMoustage, vectorHead, null, Setting.moustageColor,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + spriteBatch.Draw(TexturePlayerWalkingMouth, vectorHead, null, ColorWhite,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerWalkingHair, vectorHead, null, Setting.hairColor,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + spriteBatch.Draw(TexturePlayerWalkingEyes, vectorHead, null, Setting.eyesColor,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + + if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureStatic, vectorHead, null, ClothesHead.Color, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + + //Chest + if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChest!=null) spriteBatch.Draw(ClothesChest.TextureWalking, /*vectorChest*/new Vector2(vectorChest.X, vectorChest.Y-2), null, ClothesChest.Color, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else { + spriteBatch.Draw(TexturePlayerWalkingChest, vectorChest, null, Setting.ColorSkin, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + if (ClothesUnderwearUp!=null) spriteBatch.Draw(ClothesUnderwearUp.TextureSwimming,new Vector2(vector.X-5,vector.Y) /*vectorChest*/, null, ClothesUnderwearUp.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else { + if (Setting.sex==Sex.Girl) { + if (Global.YoungPlayer) { + if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureSwimmingUpCensored, vector, null,Color.White /*ClothesUnderwearUp.Color*/, 0, Vector2Zero, 1, SpriteEffects.None, 0); + } + } + } + } + } + if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureWalking, vectorChest, null, ClothesChestTop.Color, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + if (ClothesChestTop is null) { + if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); + } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); + + void DrawItemInHandTop(Texture2D texCloth, Color colorCloth, int size){ + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); + + if (InventoryNormal[boxSelected]!=null){ + if (InventoryNormal[boxSelected].Id!=0) { + Rectangle recItem=new Rectangle( + (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), + (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), + 8, + 8 + ); + + switch (InventoryNormal[boxSelected]) { + case ItemInvBasic16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasic32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasicColoritzed32NonStackable i: + spriteBatch.Draw(i.Texture, recItem, i.color); + break; + + case ItemInvFood16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvFood32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + #if DEBUG + default: throw new Exception("Unknown category"); + #endif + } + } + } + } + + void DrawItemInHandBack(Texture2D texCloth, Color colorCloth, int size){ + recHand = new Rectangle(0,0,4,HandSize-size); + vecOrigin=new Vector2(2,2-size); + recCloth=new Rectangle(0,0,4,size); + + spriteBatch.Draw(TextureHand, rameno, recHand, new Color((byte)(Setting.ColorSkin.R*0.75f), (byte)(Setting.ColorSkin.G*0.75f), (byte)(Setting.ColorSkin.B*0.75f),(byte)255), handAngle-FastMath.PI, vecOrigin, 1, SpriteEffects.None,1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f),(byte)255), handAngle-FastMath.PI, Vector2_2, 1, SpriteEffects.None,1f); + } + } + } else { + switch (playerState) { + default: + { + Vector2 vector=new Vector2((int)PlayerX-11, (int)PlayerY-(int)(39*0.5f)); + + Vector2 pointing=new Vector2(mouseRealPosX-Global.WindowWidthHalf, mouseRealPosY-Global.WindowHeightHalf); + Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2, vector.Y-39/2+12-1+38/2); + Vector2 hand=Vector2.Normalize(pointing)*HandSize; + hand.X+=rameno.X; + hand.Y+=rameno.Y; + Vector2 center=(hand+rameno)/2; + + handAngle=(float)Math.Atan2(rameno.Y-hand.Y, rameno.X-hand.X)+FastMath.PIHalf; + + // Legs + if (ClothesLegs!=null) { + if (ClothesLegs.ShowBodyLegs) spriteBatch.Draw(TexturePlayerStaticLegs, vector, Setting.ColorSkin); + spriteBatch.Draw(ClothesLegs.TextureStatic, vector, ClothesLegs.Color); + } else { + spriteBatch.Draw(TexturePlayerStaticLegs, vector, Setting.ColorSkin); + if (ClothesUnderwearDown!=null) { + if (ClothesChest==null)spriteBatch.Draw(ClothesUnderwearDown.TextureStatic, vector, ClothesUnderwearDown.Color); + else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureStatic, vector, ClothesUnderwearDown.Color); + } else { + if (Global.YoungPlayer) spriteBatch.Draw(TextureStaticDownCensored, vector, ColorWhite); + } + } + + // Chest + if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChest!=null) { + spriteBatch.Draw(ClothesChest.TextureStatic, vector, ClothesChest.Color); + } else { + spriteBatch.Draw(TexturePlayerStaticChest, vector, Setting.ColorSkin); + if (ClothesUnderwearUp!=null) spriteBatch.Draw(ClothesUnderwearUp.TextureStatic, vector, ClothesUnderwearUp.Color); + else { + if (Setting.sex==Sex.Girl) { + if (Global.YoungPlayer) { + if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureStaticUpCensored, vector, ColorWhite); + } + } + } + } + } + + if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureStatic, vector, ClothesChestTop.Color); + + // Feet + if (ClothesFeet!=null) spriteBatch.Draw(ClothesFeet.TextureStatic, vector, ClothesFeet.Color); + else spriteBatch.Draw(TexturePlayerStaticFeet, vector, Setting.ColorSkin); + + // Head + spriteBatch.Draw(TexturePlayerStaticFace, vector, Setting.ColorSkin); + if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerStaticMoustage, vector, Setting.moustageColor); + spriteBatch.Draw(TexturePlayerStaticMouth, vector, ColorWhite); + if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerStaticHair, vector, Setting.hairColor); + spriteBatch.Draw(TexturePlayerStaticEyes, vector, Setting.eyesColor); + + if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureStatic, vector, ClothesHead.Color); + + if (ClothesChestTop is null) { + if (ClothesChest is null)DrawItemInHand(null, Color.White, 0); + else DrawItemInHand(ClothesChest?.Texture2DClothHand, ClothesChest.Color, (int)ClothesChest?.handSize); + } else DrawItemInHand(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color, (int)ClothesChestTop.handSize); + + void DrawItemInHand(Texture2D texCloth, Color colorCloth, int size) { + Rectangle recHand= new Rectangle(0,0,4,HandSize-size), recCloth=new Rectangle(0,0,4,size); + Vector2 vecOrigin=new Vector2(2,2-size); + + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); + + // Right + rameno.X+=17; + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, 0, vecOrigin, 1, SpriteEffects.None,1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, 0, Vector2_2, 1, SpriteEffects.None,1f); + rameno.X-=17; + + if (InventoryNormal[boxSelected]!=null){ + if (InventoryNormal[boxSelected].Id!=0) { + Rectangle recItem=new Rectangle( + (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), + (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), + 8, + 8 + ); + + switch (InventoryNormal[boxSelected]) { + case ItemInvBasic16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasic32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasicColoritzed32NonStackable i: + spriteBatch.Draw(i.Texture, recItem, i.color); + break; + + case ItemInvFood16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvFood32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + #if DEBUG + default: throw new Exception("Unknown category"); + #endif + } + } + } + + } + } + break; + + case 2://-> + { + Rectangle curImg=new Rectangle((playerImg/20)*20, 0, 20, 39); + Vector2 vector=new Vector2(PlayerX-11, PlayerY-39/2); + + Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); + int ticks=gameTime.TotalGameTime.Milliseconds; + + Rectangle recHand, recCloth; + Vector2 vecOrigin; + + if (ticks<250) handAngle=-ticks/250f*WalkingHandMaxAngle; + else if (ticks<750) handAngle=((ticks-250)/250f)*WalkingHandMaxAngle-WalkingHandMaxAngle; + else handAngle=WalkingHandMaxAngle-((ticks-750)/250f)*WalkingHandMaxAngle; + + if (ClothesChestTop is null) { + if (ClothesChest is null) DrawItemInHandBack(null, Color.White, 0); + else DrawItemInHandBack(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); + } else DrawItemInHandBack(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); + + // Feet + if (ClothesFeet!=null) { + spriteBatch.Draw(TexturePlayerWalkingFeetForShoes, vector, curImg, Setting.ColorSkin); + spriteBatch.Draw(ClothesFeet.TextureWalking, vector, curImg, ClothesFeet.Color); + } else spriteBatch.Draw(TexturePlayerWalkingFeet, vector, curImg, Setting.ColorSkin); + + // Head + spriteBatch.Draw(TexturePlayerWalkingFace, new Vector2(vector.X-1, vector.Y), Setting.ColorSkin); + spriteBatch.Draw(TexturePlayerWalkingEyes, new Vector2(vector.X-1, vector.Y), Setting.eyesColor); + spriteBatch.Draw(TexturePlayerWalkingMouth, new Vector2(vector.X-1, vector.Y), ColorWhite); + if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerWalkingMoustage, new Vector2(vector.X-1, vector.Y), Setting.moustageColor); + if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerWalkingHair, new Vector2(vector.X-1, vector.Y), Setting.hairColor); + + // Legs + if (ClothesLegs!=null) { + if (ClothesLegs.ShowBodyLegs) spriteBatch.Draw(TexturePlayerWalkingLegs, vector, curImg, Setting.ColorSkin); + spriteBatch.Draw(ClothesLegs.TextureWalking, vector, curImg, ClothesLegs.Color); + } else { + spriteBatch.Draw(TexturePlayerWalkingLegs, vector, curImg, Setting.ColorSkin); + if (ClothesUnderwearDown!=null) { + if (ClothesChest==null) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color); + else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color); + } else { + if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, vector, null, ColorWhite); + } + } + // Chest + if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChest!=null) spriteBatch.Draw(ClothesChest.TextureWalking, vector, null, ClothesChest.Color); + else { + spriteBatch.Draw(TexturePlayerWalkingChest, vector, null, Setting.ColorSkin); + if (ClothesUnderwearUp!=null) spriteBatch.Draw(ClothesUnderwearUp.TextureWalking, vector, null, ClothesUnderwearUp.Color); + else { + if (Setting.sex==Sex.Girl) { + if (Global.YoungPlayer) { + if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureWalkingUpCensored, vector, null, /*ClothesUnderwearUp.*/Color.White); + } + } + } + } + } + + if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureWalking, vector, null, ClothesChestTop.Color); + if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureWalkingOrSwimming, new Vector2(vector.X-1, vector.Y), ClothesHead.Color); + + + if (ClothesChestTop is null) { + if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color, (int)ClothesChest.handSize); + } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color, (int)ClothesChestTop.handSize); + + void DrawItemInHandTop(Texture2D texCloth, Color colorCloth, int size){ + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); + if (texCloth!=null) spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); + + if (InventoryNormal[boxSelected]!=null){ + if (InventoryNormal[boxSelected].Id!=0) { + Rectangle recItem=new Rectangle( + (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), + (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), + 8, + 8 + ); + + switch (InventoryNormal[boxSelected]) { + case ItemInvBasic16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasic32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasicColoritzed32NonStackable i: + spriteBatch.Draw(i.Texture, recItem, i.color); + break; + + case ItemInvFood16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvFood32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + #if DEBUG + default: throw new Exception("Unknown category"); + #endif + } + } + } + } + + void DrawItemInHandBack(Texture2D texCloth, Color colorCloth, int size){ + recHand= new Rectangle(0,0,4,HandSize-size); + vecOrigin=new Vector2(2,2-size); + + spriteBatch.Draw(TextureHand, rameno, recHand, new Color((byte)(Setting.ColorSkin.R*0.75f), (byte)(Setting.ColorSkin.G*0.75f), (byte)(Setting.ColorSkin.B*0.75f),(byte)255), -handAngle, vecOrigin, 1, SpriteEffects.None,1f); + + recCloth=new Rectangle(0,0,4,size); + if (texCloth!=null) { + spriteBatch.Draw(texCloth, rameno, recCloth, new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f),(byte)255), -handAngle, Vector2_2, 1, SpriteEffects.None,1f); + } + } + } + break; + + case 1://<- + { + Rectangle curImg=new Rectangle((playerImg/20)*20, 0, 20, 39); + // Rectangle curImg2=new Rectangle((playerImg2/20)*20, 0, 20, 39); + + Vector2 vector=new Vector2(PlayerX-11, PlayerY-39/2); + + Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); + int ticks=gameTime.TotalGameTime.Milliseconds; + + Rectangle recHand, recCloth; + Vector2 vecOrigin; + + if (ticks<250) handAngle=-ticks/250f*WalkingHandMaxAngle; + else if (ticks<750) handAngle=((ticks-250)/250f)*WalkingHandMaxAngle-WalkingHandMaxAngle; + else handAngle=WalkingHandMaxAngle-((ticks-750)/250f)*WalkingHandMaxAngle; + + if (ClothesChestTop is null) { + if (ClothesChest is null) DrawItemInHandBack(null, Color.White, 0); + else DrawItemInHandBack(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); + } else DrawItemInHandBack(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); + + // Feet + if (ClothesFeet!=null) { + spriteBatch.Draw(TexturePlayerWalkingFeetForShoes, vector, curImg/*2*/, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + spriteBatch.Draw(ClothesFeet.TextureWalking, vector, curImg/*2*/, ClothesFeet.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } else spriteBatch.Draw(TexturePlayerWalkingFeet, vector, curImg/*2*/, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + + + spriteBatch.Draw(TexturePlayerWalkingFace, new Vector2(vector.X-1,vector.Y), null, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + spriteBatch.Draw(TexturePlayerWalkingEyes, new Vector2(vector.X-1,vector.Y), null, Setting.eyesColor, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + spriteBatch.Draw(TexturePlayerWalkingMouth,new Vector2(vector.X-1,vector.Y), null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerWalkingMoustage, new Vector2(vector.X-1,vector.Y), null, Setting.moustageColor, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerWalkingHair, new Vector2(vector.X-1,vector.Y), null, Setting.hairColor, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + + if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureWalkingOrSwimming, new Vector2(vector.X-1,vector.Y), null, ClothesHead.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + + // Legs + if (ClothesLegs!=null) { + if (ClothesLegs.ShowBodyLegs) spriteBatch.Draw(TexturePlayerWalkingLegs, vector, curImg, Setting.ColorSkin); + spriteBatch.Draw(ClothesLegs.TextureWalking, vector, curImg, ClothesLegs.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } else { + spriteBatch.Draw(TexturePlayerWalkingLegs, vector, curImg, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (ClothesUnderwearDown!=null) { + if (ClothesChest==null) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } else { + if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } + } + // Chest + if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChest!=null) spriteBatch.Draw(ClothesChest.TextureWalking, new Vector2(vector.X-2, vector.Y) , null, ClothesChest.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else { + spriteBatch.Draw(TexturePlayerWalkingChest,new Vector2(vector.X-2, vector.Y)/*vector*//*vector*/, null, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (ClothesUnderwearUp!=null) spriteBatch.Draw(ClothesUnderwearUp.TextureWalking, vector, null, ClothesUnderwearUp.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else { + if (Setting.sex==Sex.Girl) { + if (Global.YoungPlayer) { + if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureWalkingUpCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + } + } + } + } + } + if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureWalking, vector, null, ClothesChestTop.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + + + if (ClothesChestTop is null) { + if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); + } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); + + void DrawItemInHandTop(Texture2D texCloth, Color colorCloth, int size){ + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth/*new Rectangle(0,0,4,size)*/, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); + + if (InventoryNormal[boxSelected]!=null){ + if (InventoryNormal[boxSelected].Id!=0) { + Rectangle recItem=new Rectangle( + (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), + (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), + 8, + 8 + ); + + switch (InventoryNormal[boxSelected]) { + case ItemInvBasic16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasic32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvBasicColoritzed32NonStackable i: + spriteBatch.Draw(i.Texture, recItem, i.color); + break; + + case ItemInvFood16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvFood32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvNonStackable16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool16 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + case ItemInvTool32 i: + spriteBatch.Draw(i.Texture, recItem, ColorWhite); + break; + + #if DEBUG + default: throw new Exception("Unknown category"); + #endif + } + } + } + } + + void DrawItemInHandBack(Texture2D texCloth, Color colorCloth, int size){ + recHand= new Rectangle(0,0,4,HandSize-size); + vecOrigin=new Vector2(2,2-size); + + spriteBatch.Draw(TextureHand, rameno, recHand, new Color((byte)(Setting.ColorSkin.R*0.75f), (byte)(Setting.ColorSkin.G*0.75f), (byte)(Setting.ColorSkin.B*0.75f),(byte)255), -handAngle, vecOrigin, 1, SpriteEffects.None,1f); + recCloth = new Rectangle(0,0,4,size); + if (texCloth!=null) { + spriteBatch.Draw(texCloth, rameno, new Rectangle(0,0,4,size), new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f), (byte)255), -handAngle, Vector2_2, 1, SpriteEffects.None,1f); + } + } + } + break; + } + } + } + #endregion + + for (int i = 0; i100) { + spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), ColorWhite); + spriteBatch.Draw(messageCenter,new Rectangle(x-texts+19-10,Global.WindowHeightHalf-55-50,texts*2,57), ColorWhite); + spriteBatch.Draw(messageRight,new Vector2(x+texts+19-10,Global.WindowHeightHalf-55-50), ColorWhite); + + gedo.DrawGedo(1f,spriteBatch); + } else { + float alphaC =diserpeard/100f; + Color alphaCC=new Color(alphaC,alphaC,alphaC,alphaC); + + spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), alphaCC); + spriteBatch.Draw(messageCenter,new Rectangle(x-texts+19-10,Global.WindowHeightHalf-55-50,texts*2,57), alphaCC); + spriteBatch.Draw(messageRight,new Vector2(x+texts+19-10,Global.WindowHeightHalf-55-50), alphaCC); + + gedo.DrawGedo(alphaC,spriteBatch); + } + } + } + + #region Basic right inventory + { + int w=Global.WindowWidth-40, h=Global.WindowHeightHalf-80; + for (int i = 0; i<5; i++) { + if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), Color.LightBlue); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), ColorWhite); + } + } + + for (int i = 0; i<5; i++) InventoryNormal[i].Draw(); + #endregion + + break; + #endregion + + #region Writing message + case InventoryType.Typing: + { + int xx=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); + + int half=textWriting.MeasureX/2; + spriteBatch.Draw(messageLeft,new Vector2(xx-half-10,Global.WindowHeightHalf-55-50), ColorWhite); + spriteBatch.Draw(messageCenter,new Rectangle(xx-half+19-10,Global.WindowHeightHalf-55-50,textWriting.MeasureX,57), ColorWhite); + spriteBatch.Draw(messageRight,new Vector2(xx+half+19-10,Global.WindowHeightHalf-55-50), ColorWhite); + + textWriting.Draw(spriteBatch); + + spriteBatch.Draw(pixel,new Rectangle(xx+half+20-10,Global.WindowHeightHalf-40-50+3,1,15), Color.Black); + + DrawSideInventory(); + } + break; + #endregion + + #region Basic inventory - clothes, inventory and basic crafting + case InventoryType.BasicInv: + spriteBatch.Draw(pixel, new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight), new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); + + buttonClose.ButtonDraw(); + + spriteBatch.Draw(TextureInventoryClothes,new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), ColorWhite); + textOpenInventory.Draw(spriteBatch); + + DrawInventoryWithMoving(); + InventoryDrawClothes(); + + #region Crafting + { + if (inventoryScrollbarValueCraftingMax>6*4) { + int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); + + int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / (inventoryScrollbarValueCraftingMax-6*3)*(160-size2) )*8; + if (size2>20) { + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + } else { + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + } + } + + int xx =0; + int yh=0; + + for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + + if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r128_g128_b128); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); + } else { + if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + } + + InventoryCrafting[i].DrawCreative(); + //Texture2D tex=ItemIdToTexture(InventoryCrafting[i].X); + //if (tex!=null) GameDraw.DrawItemInInventory(tex,1,Global.WindowWidthHalf-300+4+40+xx+4+4,Global.WindowHeightHalf-200+2+4+200+8+yh+4+8); + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + #endregion + + DrawNeedNew(); + + buttonInvTabBlocks.ButtonDraw(); + buttonInvTabMashines.ButtonDraw(); + buttonInvTabTools.ButtonDraw(); + buttonInvTabPlants.ButtonDraw(); + buttonInvTabItems.ButtonDraw(); + + DrawSideInventory(); + + if (displayPopUpWindow)DrawChooseItemWindow(); + else if (showMouseItemWhileMooving) InvMouseDraw(); + else if (mouseDrawItemTextInfo) DrawItemMouse(); + break; + #endregion + + #region Desk + case InventoryType.Desk: + spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); + + buttonClose.ButtonDraw(); + + spriteBatch.Draw(deskTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + textOpenInventory.Draw(spriteBatch); + + DrawInventoryNormal(); + + #region Crafting + { + if (inventoryScrollbarValueCraftingMax>6*4) { + int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); + + int pos2 = (int)(((float)(inventoryScrollbarValueCrafting*5/40f)/(inventoryScrollbarValueCraftingMax-3*6))*(160-size2)); + if (size2>20) { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + } else { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + } + } + + int xx =0; + int yh=0; + + for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.Y0 ?0 :16,0,16,16), ColorWhite); + + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-2, Global.WindowHeightHalf-200+2+4-6,202+2,5),Color.Black); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1, Global.WindowHeightHalf-200+2+4-5,(int)(energy*2.02),3),Color.Green); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1+(int)(energy*2.02),Global.WindowHeightHalf-200+2+4-5,202-(int)(energy*2.02),3),Color.Red); + textOpenInventory.Draw(spriteBatch); + + DrawInventoryWithMoving(); + + #region Bake + { + if (inventoryScrollbarValueCraftingMax>6*4) { + int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); + int pos2 = (int)(((inventoryScrollbarValueCrafting*5/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; + if (size2>20) { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + } else { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + } + } + + int xx = 0; + int yh = 0; + + for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Y6*4) { + int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); + int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; + if (size2>20) { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + } else { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + } + } + + int xx = 0; + int yh = 0; + + for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Y6*4) { + int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); + int pos2 = (int)(((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax*(160-size2))*8; + if (size2>20) { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + } else { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + } + } + + int xx = 0; + int yh = 0; + + for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + + if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r128_g128_b128); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); + } else { + if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + } + InventoryCrafting[i].Draw(); + //Texture2D tex = ItemIdToTexture(InventoryCrafting[i].X); + //if (tex!=null) GameDraw.DrawItemInInventory(tex, 1, Global.WindowWidthHalf-300+4+40+xx+4+4, Global.WindowHeightHalf-200+2+4+200+8+yh+4+8); + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + #endregion + + DrawNeedNew(); + + buttonInvTabMaterials.ButtonDraw(); + buttonInvTabPlants.ButtonDraw(); + buttonInvTabTools.ButtonDraw(); + buttonInvTabItems.ButtonDraw(); + buttonInvTabCeramics.ButtonDraw(); + + DrawSideInventory(); + if (displayPopUpWindow)DrawChooseItemWindow(); + else if (showMouseItemWhileMooving) InvMouseDraw(); + else if (mouseDrawItemTextInfo) DrawItemMouse(); + break; + #endregion + + #region Creative + case InventoryType.Creative: + spriteBatch.Draw(pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0, 0, 0, animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2+30,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434+30,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2+30), Color.LightBlue); + + buttonClose.ButtonDraw(); + + spriteBatch.Draw(TextureInventoryClothes, new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), ColorWhite); + + textOpenInventory.Draw(spriteBatch); + + int AddH=35; + DrawInventoryWithMoving(); + InventoryDrawClothes(); + + if (creativeTabCrafting) { + #region Crafting + { + if (inventoryScrollbarValueCraftingMax>6*4) { + int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); + int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / (inventoryScrollbarValueCraftingMax-6*3)*(160-size2) )*8+50-15; + if (size2>20) { + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + } else { + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + } + } + + int xx =0; + int yh=0; + + for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH)) { + if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r128_g128_b128); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r200_g200_b200); + } else { + if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r150_g150_b150); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), ColorWhite); + } + // InventoryCrafting[i].SetPos(xx,yh); + InventoryCrafting[i].DrawCreative(); + //Texture2D tex=ItemIdToTexture(InventoryInventoryCrafting[i].X); + //if (tex!=null) GameDraw.DrawItemInInventory(tex,1,Global.WindowWidthHalf-300+4+40+xx+4+4,Global.WindowHeightHalf-200+2+4+200+8+yh+4+8+AddH); + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + #endregion + + DrawNeedNewPlus(); + } + + buttonInvTabBlocks.ButtonDraw(); + buttonInvTabMashines.ButtonDraw(); + buttonInvTabTools.ButtonDraw(); + buttonInvTabPlants.ButtonDraw(); + buttonInvTabItems.ButtonDraw(); + + DrawSideInventory(); + + if (creativeTabCrafting) { + ButtonCrafting.ButtonDrawSelected(); + ButtonItems.ButtonDraw(); + } else { + DrawCreative(); + ButtonCrafting.ButtonDraw(); + ButtonItems.ButtonDrawSelected(); + } + + if (displayPopUpWindow)DrawChooseItemWindow(); + else if (showMouseItemWhileMooving) InvMouseDraw(); + else if (mouseDrawItemTextInfo) DrawItemMouse(); + break; + #endregion + + #region Shelf + case InventoryType.Shelf: + { + spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); + + buttonClose.ButtonDraw(); + + spriteBatch.Draw(shelfTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + textOpenInventory.Draw(spriteBatch); + ItemInv[] invShelf=((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; + + DrawInventoryWithMoving(); + + DrawSideInventory(); + + #region Shelf inventory + { + // int i=0; + for (int y = 0; y<3*40; y+=40) { + for (int x = 0; x<3*40; x+=40) { + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+x+20+5+1+2, Global.WindowHeightHalf+20-2+y+20+3+2), ColorWhite); + + // if (!invMove||(invMove && invStartInventory[invStartId]!=invShelf[i])) { + + //Texture2D tex = ItemIdToTexture(invShelf[i].X); + //if (tex!=null) GameDraw.DrawItemInInventory(tex, invShelf[i], Global.WindowWidthHalf-300+10+x+20+5+1+2+4, Global.WindowHeightHalf+20-2+y+20+3+2+4); + //} + // i++; + } + } + + invShelf[0].Draw(); + invShelf[1].Draw(); + invShelf[2].Draw(); + + invShelf[3].Draw(); + invShelf[4].Draw(); + invShelf[5].Draw(); + + invShelf[6].Draw(); + invShelf[7].Draw(); + invShelf[8].Draw(); + } + #endregion + + if (showMouseItemWhileMooving) InvMouseDraw(); + else if (mouseDrawItemTextInfo) DrawItemMouse(); + } + break; + #endregion + + #region Wooden box + case InventoryType.BoxWooden: + { + spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); + + buttonClose.ButtonDraw(); + + spriteBatch.Draw(boxWoodenTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + textOpenInventory.Draw(spriteBatch); + ItemInv[] invBoxWooden=((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; + + DrawInventoryWithMoving(); + + DrawSideInventory(); + + #region Box + { + int i=0; + for (int y = 0; y<2*40; y+=40) { + for (int x = 0; x<12*40; x+=40) { + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+x+59, Global.WindowHeightHalf+59+y), ColorWhite); + + // if (!invMove||(invMove&&invStartInventory[invStartId]!=invBoxWooden[i])) { + invBoxWooden[i].Draw(); + //Texture2D tex = ItemIdToTexture(invBoxWooden[i].X); + //if (tex!=null) GameDraw.DrawItemInInventory(tex, invBoxWooden[i], Global.WindowWidthHalf-300+x+63, Global.WindowHeightHalf+y+63); + //} + i++; + } + } + } + #endregion + + if (showMouseItemWhileMooving) InvMouseDraw(); + else if (mouseDrawItemTextInfo) DrawItemMouse(); + } + break; + #endregion + + #region Adv box + case InventoryType.BoxAdv: + { + spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); + + buttonClose.ButtonDraw(); + + spriteBatch.Draw(boxAdvTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + + textOpenInventory.Draw(spriteBatch); + ItemInv[] invAdvBox=((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; + + DrawInventoryWithMoving(); + + DrawSideInventory(); + + #region Box + { + int i=0; + for (int y = 0; y<4*40; y+=40) { + for (int x = 0; x<12*40; x+=40) { + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+20+x, Global.WindowHeightHalf+23+y), ColorWhite); + + // if (!invMove||(invMove&&invStartInventory[invStartId]!=invAdvBox[i])) { + invAdvBox[i].Draw(); + //Texture2D tex = ItemIdToTexture(invAdvBox[i].X); + //if (tex!=null) GameDraw.DrawItemInInventory(tex, invAdvBox[i], Global.WindowWidthHalf-300+24+x, Global.WindowHeightHalf+23+4+y); + //} + i++; + } + } + } + #endregion + + if (showMouseItemWhileMooving) InvMouseDraw(); + else if (mouseDrawItemTextInfo) DrawItemMouse(); + } + break; + #endregion + + #region Phone + case InventoryType.Mobile: + spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-150-2, Global.WindowHeightHalf-234,304,464+2,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-150-1, Global.WindowHeightHalf-233,302,464,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-232,300,34), color_r10_g140_b255); + + buttonClose.ButtonDraw(); + textOpenInventory.Draw(spriteBatch); + + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430), Color.Black); + mobileOS.Draw(spriteBatch,Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430); + break; + #endregion + + #region Rocket + case InventoryType.Rocket: + spriteBatch.Draw(pixel, new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight), new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-150-2, Global.WindowHeightHalf-234,304,464+2,1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-150-1, Global.WindowHeightHalf-233,302,464,1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-232,300,34), color_r10_g140_b255); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430), Color.LightBlue); + + buttonClose.ButtonDraw(); + + textOpenInventory.Draw(spriteBatch); + spriteBatch.Draw(rocketTexture,new Rectangle(Global.WindowWidthHalf-62, Global.WindowHeightHalf-190,123,380), ColorWhite); + + buttonRocket.ButtonDraw(); + break; + #endregion + + #region Charger + case InventoryType.Charger: + { + spriteBatch.Draw(pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0,0,0,animationInvBack)); + + DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); + DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); + + buttonClose.ButtonDraw(); + + spriteBatch.Draw(chargerTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + textOpenInventory.Draw(spriteBatch); + + ItemInv[] invCharger=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; + + DrawInventoryWithMoving(); + + #region Place for charging + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+40+20+5+1+2, Global.WindowHeightHalf+20-2+40+20+3+2), ColorWhite); + + // if (!invMove||(invMove&&invStartInventory[invStartId]!=invCharger[0])) { + invCharger[0].Draw(); + //Texture2D tex = ItemIdToTexture(invCharger[0].X); + //if (tex!=null) GameDraw.DrawItemInInventory(tex, invCharger[0], Global.WindowWidthHalf-300+10+40+20+5+1+2+4, Global.WindowHeightHalf+20-2+40+20+3+2+4); + // } + #endregion -// DrawSideInventory(); + DrawSideInventory(); -// if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// } -// break; -// #endregion - -// #region Miner -// case InventoryType.Miner: -// { -// spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(minerTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); -// textOpenInventory.Draw(spriteBatch); - -// ItemInv[] invMiner=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; - -// DrawInventoryWithDIntMoving(); - -// DrawSideInventory(); - -// #region Box -// { -// int i=0; -// for (int y = 0; y<2*40; y+=40) { -// for (int x = 0; x<12*40; x+=40) { -// spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+x+59, Global.WindowHeightHalf+59+y), ColorWhite); - -// // if (!invMove||(invMove&&invStartInventory[invStartId]!=invMiner[i])) { -// invMiner[i].Draw(); -// //Texture2D tex = ItemIdToTexture(invMiner[i].Id); -// //if (tex!=null) GameDraw.DrawItemInInventory(tex, invMiner[i], Global.WindowWidthHalf-300+x+63, Global.WindowHeightHalf+y+63); -// // } -// i++; -// } -// } -// } -// #endregion - -// if (showMouseItemWhileMooving) InvMouseDraw(); -// else if (mouseDrawItemTextInfo) DrawItemMouse(); -// } -// break; -// #endregion - -// #region Radio -// case InventoryType.Radio: -// { -// spriteBatch.Draw(pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,animationInvBack)); - -// DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); -// DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); -// spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); - -// buttonClose.ButtonDraw(); - -// spriteBatch.Draw(radioTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200),new Rectangle(16*(int)(15*_secondTimer/60f),0,16,16), ColorWhite); -// textOpenInventory.Draw(spriteBatch); - - -// if (radioSongs!=null) { -// for (int i=0; i6*4) { -// int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); -// int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; -// if (size2>20) { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); -// } else { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); -// } -// } - -// int xx = 0; -// int yh = 0; - -// for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Y6*4) { + int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); + int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; + if (size2>20) { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + } else { + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + } + } + + int xx = 0; + int yh = 0; + + for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Y (F1 skrýt)"+Environment.NewLine+"----------------------------------"+Environment.NewLine+ -// "[Pozice hráče] X: "+PlayerX+", Y: "+PlayerY+Environment.NewLine+ -// "[Pozice myše] X: "+(int)mousePos.X+", Y: "+(int)mousePos.Y+Environment.NewLine+ -// Environment.NewLine+ -// "[Velikost světa]: "+TerrainLenght+Environment.NewLine+ -// "[Vykreslovací plocha] "+((terrainStartIndexW-terrainStartIndexX)*(terrainStartIndexH-terrainStartIndexY))+Environment.NewLine+ -// "[Svět]: "+world+Environment.NewLine+ -// "[Gravitační zrychlení]: "+(gravity*20)+Environment.NewLine+ -// Environment.NewLine+ -// "[Počet Itemů]: "+DroppedItems.Count+Environment.NewLine+ -// "[Energie]: "+energy.Count+Environment.NewLine+ -// "[Čas]: "+time/hour+":"+((int)((time-(time/hour*hour))*(60f/hour))).ToString("00")+Environment.NewLine+ -// "[Světlo]: "+dayAlpha+Environment.NewLine+ -// "[Moon]: "+(moonSpeed/46)+Environment.NewLine+ -// Environment.NewLine+ -// "[Fps]: "+(int)Math.Round(fps, 2)+Environment.NewLine+ -// "[CPU] Proces: "+(usageCpuProcess/Environment.ProcessorCount).ToString("0.00")+"%, Volné cpu: "+(100-usageCpu).ToString("0.00")+"%"+Environment.NewLine+ -// "[RAM] Proces: "+(usageRamProcess/1048576).ToString("0.00")+"MB, Volná ram: "+usageRam.ToString("0.00")+"MB"+Environment.NewLine, Color.White); -// } else if (Setting.Fps) { -// fpss+=1000f/(float)gameTime.ElapsedGameTime.TotalMilliseconds; -// timerDraw60--; -// if (timerDraw60<0) { -// timerDraw60=59; -// fps=fpss/60f; - -// fpss=0; -// } -// if (gameTime.ElapsedGameTime.TotalMilliseconds!=0) DrawTextShadowMin(5, 5, "Fps: "+(int)Math.Round(fps, 2), new Color(dayAlpha, dayAlpha, dayAlpha)); -// } -// #endregion - -// spriteBatch.End(); -// #endregion - - -// // DrawPlayer(spriteBatch); -// // spriteBatch.End(); - -// // spriteBatch.Begin(SpriteSortMode.Deferred, null, Setting.SamplerState, null, null, null); - -// // if (show) { - -// // #region Draw Bars -// // if (Global.WorldDifficulty!=2) { -// // // Energy bar -// // spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8),new Rectangle(0,0,32,(int)barEnergy),Color.Gray); -// // spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8+(int)barEnergy),new Rectangle(0,(int)barEnergy,32,32-(int)barEnergy),Color.White); - -// // // Oxygen bar -// // spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8),new Rectangle(0,0,32,(int)barOxygen),Color.Gray); -// // spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8+(int)barOxygen),new Rectangle(0,(int)barOxygen,32,32-(int)barOxygen),Color.White); - -// // // Water bar -// // spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8),new Rectangle(0,0,32,(int)barWater),Color.Gray); -// // spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8+(int)barWater),new Rectangle(0,(int)barWater,32,32-(int)barWater),Color.White); - -// // // Eat bar -// // spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8),new Rectangle(0,0,32,(int)barEat),Color.Gray); -// // spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8+(int)barEat),new Rectangle(0,(int)barEat,32,32-(int)barEat),Color.White); - -// // // Heart bar -// // spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8),new Rectangle(0,0,32,(int)barHeart),Color.Gray); -// // spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8+(int)barHeart),new Rectangle(0,(int)barHeart,32,32-(int)barHeart),Color.White); -// // } -// // #endregion - -// // buttonInv.ButtonDraw(spriteBatch,newMouseState.X,newMouseState.Y,Global.WindowWidth-32,Global.WindowHeight-32); - -// // if (buttonInv.Click) ChangeInventoryState(false); - -// //#region Draw Inventory -// // switch (inventory) { -// // #region Normal -// // case 0: -// // if (diserpeard==0) { -// // gedo=null; -// // text=""; -// // } else { -// // if (gedo!=null) { -// // if (gedo.Text!="") { -// // float alphaC; -// // if (diserpeard>100) alphaC=1f; -// // else alphaC=diserpeard/100f; -// // Color alphaCC=new Color(alphaC,alphaC,alphaC,alphaC); - -// // spriteBatch.Draw(messageLeft,new Vector2(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(gedo.Text).X/2),Global.WindowHeightHalf-55), alphaCC); -// // spriteBatch.Draw(messageCenter,new Rectangle(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(gedo.Text).X/2)+19,Global.WindowHeightHalf-55,(int)spriteFont_small.MeasureString(gedo.Text).X,57), alphaCC); -// // spriteBatch.Draw(messageRight,new Vector2(Global.WindowWidthHalf+(int)(spriteFont_small.MeasureString(gedo.Text).X/2)+19,Global.WindowHeightHalf-55), alphaCC); - -// // gedo.DrawGedo(spriteBatch,true,Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(gedo.Text).X/2)+20,Global.WindowHeightHalf-40,(int)(alphaC*255)); -// // } -// // } -// // } - -// // // Basic right inventory -// // for (int i=0; i<5; i++) { -// // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),Color.LightBlue); -// // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),null); - -// // if (!invMove || (invMove && invStart!=i)) { -// // Texture2D tex=ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80+i*40+4); -// // } -// // } -// // break; -// // #endregion - -// // #region Writing message -// // case 1: -// // text =TextEdit(text); -// // while (text.Length*13>750) text=text.Substring(0,text.Length-1); -// // text =text.Replace("€","#"); - -// // spriteBatch.Draw(messageLeft,new Vector2(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(text).X/2),Global.WindowHeightHalf-55), Color.White); -// // spriteBatch.Draw(messageCenter,new Rectangle(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(text).X/2)+19,Global.WindowHeightHalf-55,(int)spriteFont_small.MeasureString(text).X,57), Color.White); -// // spriteBatch.Draw(messageRight,new Vector2(Global.WindowWidthHalf+(int)(spriteFont_small.MeasureString(text).X/2)+19,Global.WindowHeightHalf-55), Color.White); - -// // DrawTextShadowMin(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(text).X/2)+20,Global.WindowHeightHalf-40,text); -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf+(int)(spriteFont_small.MeasureString(text).X/2)+20,Global.WindowHeightHalf-40,1,15),Color.Black); - -// // // ChangeInventory(); - -// // // Basic right inventory -// // for (int i=0; i<5; i++) { -// // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+4+i*40),Color.LightBlue); -// // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+4+i*40),null); - -// // if (!invMove || (invMove && invStart!=i)) { -// // Texture2D tex=ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80-4+i*40); -// // } -// // } -// // break; -// // #endregion - -// // #region Basic inventory - clothes, inventory and basic crafting -// // case 2: -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,100)); - -// // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, new Color(0,0,0,100)); -// // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, new Color(0,0,0,200)); -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), new Color(10,140,255)); -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); - -// // buttonClose.ButtonDraw(spriteBatch,newMouseState.X,newMouseState.Y,Global.WindowWidthHalf+300-32,Global.WindowHeightHalf-232+1); - -// // spriteBatch.Draw(ItemBackpackTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); -// // if (Setting.czechLanguage)DrawTextShadowMin(spriteFont_small,Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Baťůžek"); -// // else DrawTextShadowMin(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, "Backpack"); -// // #region Inventory -// // { -// // int xx =0; -// // int yh=0; -// // for (int i=inventoryScrollbarValue+5; imaxInvCount) break; -// // spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); - -// // if (!invMove || (invMove && invStart!=i)) { -// // Texture2D tex=ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex,Inventory[i].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); -// // } -// // xx+=40; - -// // if (xx==9*40) { -// // xx=0; -// // yh+=40; -// // } -// // } -// // if (maxInvCount>45) { -// // int size=(int)( (1f/((( (int)(maxInvCount/9f)+1 )*40)/200f))*200 ); -// // int pos=(int)( ( ((inventoryScrollbarValue*9)/40f) / maxInvCount)*(200-size) )*4; -// // if (size>20) { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); -// // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1,20,size-20), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), null); -// // } else { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), null); -// // } -// // } -// // } -// // #endregion - -// // #region Crafting -// // { -// // if (inventoryScrollbarValueCraftingMax>6*4) { -// // int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); -// // int pos2=(int)( ( ((inventoryScrollbarValueCrafting*5)/40f) / inventoryScrollbarValueCraftingMax)*(160-size2) )*8; -// // if (size2>20) { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); -// // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), null); -// // } else { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), null); -// // } -// // } - -// // //spriteBatch.Draw(inventoryChooseTexture,new Vector2(Global.WindowWidthHalf-300+4+40, Global.WindowHeightHalf-200+2+4+200+8), null); -// // int xx =0; -// // int yh=0; - -// // for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; - -// // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.Yl.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// // } - -// // if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l=Craft(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// // } - -// // buttonCraft1x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10,Global.WindowHeightHalf+160-30+8+16)); -// // buttonCraft10x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+80+8+10+10,Global.WindowHeightHalf+160-30+8+16)); -// // buttonCraft100x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+170+8,Global.WindowHeightHalf+160-30+8+16)); - -// // buttonPrev.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); -// // buttonNext.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); - -// // #region Craft new item -// // if (buttonCraft1x.Click) { -// // bool ok=true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); -// // } -// // } -// // } - -// // if (buttonCraft10x.Click) { -// // for (int mm=0; mm<10; mm++) { -// // bool ok=true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); -// // } -// // } -// // } -// // } - -// // if (buttonCraft100x.Click) { -// // for (int mm=0; mm<100; mm++) { -// // bool ok=true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); -// // } -// // } -// // } -// // } -// // #endregion - -// // // Basic right inventory -// // for (int i=0; i<5; i++) { -// // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),Color.LightBlue); -// // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),null); - -// // if (!invMove || (invMove && invStart!=i)) { -// // Texture2D tex=ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80+i*40+4); -// // } -// // } -// // ChangeInventoryBasic(); -// // text=""; -// // break; -// // #endregion - -// // #region Basic inventory - clothes, inventory and full crafting -// // case 3: -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,100)); - -// // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, new Color(0,0,0,100)); -// // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, new Color(0,0,0,200)); -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), new Color(10,140,255)); -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); - -// // buttonClose.ButtonDraw(spriteBatch,newMouseState.X,newMouseState.Y,Global.WindowWidthHalf+300-32,Global.WindowHeightHalf-232+1); - -// // // spriteBatch.Draw(inventoryClothesTexture,new Vector2(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4), null); - -// // spriteBatch.Draw(deskTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); -// // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Stůl"); -// // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Desk"); -// // #region Inventory -// // { -// // int xx =0; -// // int yh=0; -// // for (int i=inventoryScrollbarValue+5; imaxInvCount) break; -// // spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); - -// // if (!invMove || (invMove && invStart!=i)) { -// // Texture2D tex=ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex,Inventory[i].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); -// // } -// // xx+=40; - -// // if (xx==9*40) { -// // xx=0; -// // yh+=40; -// // } -// // } -// // if (maxInvCount>45) { -// // int size=(int)( (1f/((( (int)(maxInvCount/9f)+1 )*40)/200f))*200 ); -// // int pos=(int)( ( ((inventoryScrollbarValue*9)/40f) / maxInvCount)*(200-size) )*4; -// // if (size>20) { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); -// // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1,20,size-20), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), null); -// // } else { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), null); -// // } -// // } -// // } -// // #endregion - -// // #region Crafting -// // { -// // if (inventoryScrollbarValueCraftingMax>6*4) { -// // int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); -// // int pos2=(int)( ( ((inventoryScrollbarValueCrafting*5)/40f) / inventoryScrollbarValueCraftingMax)*(160-size2) )*8; -// // if (size2>20) { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); -// // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), null); -// // } else { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), null); -// // } -// // } - -// // //spriteBatch.Draw(inventoryChooseTexture,new Vector2(Global.WindowWidthHalf-300+4+40, Global.WindowHeightHalf-200+2+4+200+8), null); -// // int xx =0; -// // int yh=0; - -// // for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; - -// // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.Yl.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// // } - -// // if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l= Craft(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// // } - -// // buttonCraft1x.ButtonDraw(spriteBatch,newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10,Global.WindowHeightHalf+160-30+8+16)); -// // buttonCraft10x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+80+8+10+10,Global.WindowHeightHalf+160-30+8+16)); -// // buttonCraft100x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+170+8,Global.WindowHeightHalf+160-30+8+16)); - -// // buttonPrev.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); -// // buttonNext.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); - -// // #region Craft new item -// // if (buttonCraft1x.Click) { -// // bool ok=true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); -// // } -// // } -// // } - -// // if (buttonCraft10x.Click) { -// // for (int mm=0; mm<10; mm++) { -// // bool ok=true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); -// // } -// // } -// // } -// // } - -// // if (buttonCraft100x.Click) { -// // for (int mm=0; mm<100; mm++) { -// // bool ok=true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); -// // } -// // } -// // } -// // } -// // #endregion - -// // // Basic right inventory -// // for (int i=0; i<5; i++) { -// // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),Color.LightBlue); -// // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),null); - -// // if (!invMove || (invMove && invStart!=i)) { -// // Texture2D tex=ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80+i*40+4); -// // } -// // } -// // ChangeInventoryBasic(); -// // text=""; -// // break; -// // #endregion - -// // #region Furnace -// // case 4: -// // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0, 0, 0, 100)); - -// // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, new Color(0, 0, 0, 100)); -// // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, new Color(0, 0, 0, 200)); -// // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), new Color(10, 140, 255)); -// // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); - -// // buttonClose.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf+300-32, Global.WindowHeightHalf-232+1); - -// // // spriteBatch.Draw(inventoryClothesTexture,new Vector2(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4), null); - -// // spriteBatch.Draw(furnaceElectricOneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); -// // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Pec"); -// // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Furnace"); - -// // #region Inventory -// // { -// // int xx = 0; -// // int yh = 0; -// // for (int i = inventoryScrollbarValue+5; imaxInvCount) break; -// // spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); - -// // if (!invMove||(invMove&&invStart!=i)) { -// // Texture2D tex = ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidthHalf-300+4+200+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); -// // } -// // xx+=40; - -// // if (xx==9*40) { -// // xx=0; -// // yh+=40; -// // } -// // } -// // if (maxInvCount>45) { -// // int size = (int)((1f/((((int)(maxInvCount/9f)+1)*40)/200f))*200); -// // int pos = (int)((((inventoryScrollbarValue*9)/40f)/maxInvCount)*(200-size))*4; -// // if (size>20) { -// // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); -// // spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1, 20, size-20), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), null); -// // } else { -// // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); -// // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), null); -// // } -// // } -// // } -// // #endregion - -// // #region Bake -// // { -// // if (inventoryScrollbarValueCraftingMax>6*4) { -// // int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); -// // int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; -// // if (size2>20) { -// // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); -// // spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), null); -// // } else { -// // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); -// // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), null); -// // } -// // } - -// // //spriteBatch.Draw(inventoryChooseTexture,new Vector2(Global.WindowWidthHalf-300+4+40, Global.WindowHeightHalf-200+2+4+200+8), null); -// // int xx = 0; -// // int yh = 0; - -// // for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; - -// // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Yl.Length-1) craftingType=0; -// // Need=l[craftingType].List1; -// // } -// // } - -// // if (buttonPrev.Click) { -// // craftingType--; -// // DListInt[] l = Bake(Crafting[selectedCraftingItem].X); -// // if (l!=null) { -// // if (craftingType<0) craftingType=l.Length-1; -// // Need=l[craftingType].List1; -// // } -// // } - -// // buttonCraft1x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10, Global.WindowHeightHalf+160-30+8+16)); -// // buttonCraft10x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+10+80+8+10+10, Global.WindowHeightHalf+160-30+8+16)); -// // buttonCraft100x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+10+170+8, Global.WindowHeightHalf+160-30+8+16)); - -// // buttonPrev.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); -// // buttonNext.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); - -// // #region Craft new item -// // if (buttonCraft1x.Click) { -// // bool ok = true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X, d.Y, new DInt(PlayerX, (int)PlayerY)); -// // } -// // } -// // } - -// // if (buttonCraft10x.Click) { -// // for (int mm = 0; mm<10; mm++) { -// // bool ok = true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X, d.Y, new DInt(PlayerX, (int)PlayerY)); -// // } -// // } -// // } -// // } - -// // if (buttonCraft100x.Click) { -// // for (int mm = 0; mm<100; mm++) { -// // bool ok = true; -// // foreach (DInt n in Need) { -// // int inInv = 0; -// // foreach (DInt ii in Inventory) { -// // if (n.X==ii.X) { -// // inInv+=ii.Y; -// // } -// // } -// // if (inInvcount) { -// // Inventory[i].Y-=count; -// // break; -// // } else { -// // count-=Inventory[i].Y; -// // Inventory[i]=new DInt(); -// // } -// // } -// // } -// // } - - -// // foreach (DInt d in craft.List2) { -// // ItemDrop(d.X, d.Y, new DInt(PlayerX, (int)PlayerY)); -// // } -// // } -// // } -// // } -// // #endregion - -// // // Basic right inventory -// // for (int i = 0; i<5; i++) { -// // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.LightBlue); -// // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), null); - -// // if (!invMove||(invMove&&invStart!=i)) { -// // Texture2D tex = ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidth-36, Global.WindowHeightHalf-80+i*40+4); -// // } -// // } -// // ChangeInventoryBasic(); -// // text=""; -// // break; -// // #endregion - -// // #region Macerator -// // case 5: -// // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(PlayerX-424,(int)PlayerY-280,848,560),new Color(0,0,0,100)); -// // //spriteBatch.Draw(boxSelectedTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2+boxSelected*32),Color.White); -// // //spriteBatch.Draw(boxInventoryTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2),Color.White); -// // //spriteBatch.Draw(maceratorInventoryTexture,new Vector2(PlayerX-240,PlayerY-108),Color.White); -// // //if (macerator[selectMacerator].Energy>5) { -// // // if (furnaceM1==0) { -// // // //TDust(64); - -// // // } -// // //} -// // spriteBatch.Draw(ItemBackpackTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); -// // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Drtič"); -// // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Macerator"); -// // InventoryDrawItems(); -// // //InventoryDrawDIntsMacerator(); -// // //ChangeInventoryMacerator(); -// // InventoryDrawItems(); -// // text =""; -// // break; -// // #endregion - -// // #region creative -// // case 7: -// // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0, 0, 0, 100)); - -// // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, new Color(0, 0, 0, 100)); -// // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, new Color(0, 0, 0, 200)); -// // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), new Color(10, 140, 255)); -// // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); - -// // buttonClose.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf+300-32, Global.WindowHeightHalf-232+1); -// // // spriteBatch.Draw(ItemBackpackTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); -// // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Itemy"); -// // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Items"); { -// // int xx = 0; -// // int yh = 0; -// // for (int i = inventoryScrollbarValue+5; imaxInvCount) break; -// // spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+32+8+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); - -// // if (!invMove||(invMove&&invStart!=i)) { -// // Texture2D tex = ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidthHalf-300+32+8+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); -// // } -// // xx+=40; - -// // if (xx==13*40) { -// // xx=0; -// // yh+=40; -// // } -// // } -// // } - -// // if (buttonClose.Click) inventory=0; - -// // buttonInvTabBlocks.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-200+20-2-8); -// // buttonInvTabMashines.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+2-2); -// // buttonInvTabTools.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+32+4-2); -// // buttonInvTabPlants.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+32+32+6-2); -// // buttonInvTabItems.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+64+32+8-2); - -// // if (buttonInvTabBlocks.Click) SetInvCreativeBlocks(); -// // if (buttonInvTabMashines.Click) SetInvCreativeMashines(); -// // if (buttonInvTabTools.Click) SetInvCreativeTools(); -// // if (buttonInvTabPlants.Click) SetInvCreativePlants(); -// // if (buttonInvTabItems.Click) SetInvCreativeItems(); - -// // //buttonPrev.ButtonDraw(spriteBatch,<1>ew Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); -// // ////buttonNext.ButtonDraw(spriteBatch, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); - -// // // Basic right inventory -// // for (int i = 0; i<5; i++) { -// // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.LightBlue); -// // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), null); - -// // if (!invMove||(invMove&&invStart!=i)) { -// // Texture2D tex = ItemIdToTexture(Inventory[i].X); -// // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidth-36, Global.WindowHeightHalf-80+i*40+4); -// // } -// // } -// // ChangeInventoryCreative(); -// // text=""; - - -// // break; -// // #endregion - -// // #region Shelf -// // case 8: -// // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(PlayerX-424, (int)PlayerY-280, 848, 560), new Color(0, 0, 0, 100)); -// // //spriteBatch.Draw(boxSelectedTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2+boxSelected*32),Color.White); -// // //spriteBatch.Draw(boxInventoryTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2),Color.White); -// // //spriteBatch.Draw(maceratorInventoryTexture,new Vector2(PlayerX-240,PlayerY-108),Color.White); -// // //if (macerator[selectMacerator].Energy>5) { -// // // if (furnaceM1==0) { -// // // //TDust(64); - -// // // } -// // //} -// // spriteBatch.Draw(ItemBackpackTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); -// // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Polička"); -// // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Shelf"); -// // InventoryDrawItems(); -// // //InventoryDrawDIntsMacerator(); -// // //ChangeInventoryMacerator(); -// // InventoryDrawItems(); -// // text=""; -// // break; -// // #endregion -// // } -// // #endregion - -// // #region Draw debug -// // if (gameTime.ElapsedGameTime.TotalMilliseconds!=0) { -// // if (debug) DrawTextShadowMin(spriteFont_small,5, 5, " Informace (F1 skrýt)" + Environment.NewLine +"----------------------------------"+Environment.NewLine + -// // "[Pozice hráče] X: " + PlayerX + ", Y: " + PlayerY + Environment.NewLine + -// // "[Pozice myše] X: " + (int)mousePos.X + ", Y: " + (int)mousePos.Y + Environment.NewLine + -// // "[počet instancí]: " + ( -// //grassPlains.Count + -// //grassHills.Count + -// //grassJungle.Count + -// //grassForest.Count + -// //grassDesert.Count + - -// //grassPlainsBlock.Count + -// //grassForestBlock.Count + -// //grassJungleBlock.Count + -// //grassDesertBlock.Count + -// //grassHillsBlock.Count + - -// //dirt.Count + -// ////stone.Count + - -// // dolomite.Count+ -// // rhyolite.Count+ -// // limestone.Count+ -// // gneiss.Count+ -// // schist.Count+ -// // sandstone.Count+ -// // basalt.Count+ -// // gabbro.Count+ -// // diorit.Count+ - -// //sand.Count + -// //gravel.Count+ -// //cobblestone.Count+ -// //ice.Count+ -// //snow.Count+ -// //waterBlock.Count+ -// //snowTop.Count+ - -// //plantDandelion.Count + -// //plantOrchid.Count + -// //plantViolet.Count + -// //plantRose.Count + - -// //ironOre.Count + -// //goldOre.Count + -// //aluminiumOre.Count + -// //silverOre.Count + -// //tinOre.Count + -// //copperOre.Count + -// //coalOre.Count+ -// //oil.Count+ - -// //cactusBig.Count + -// //cactusLittle.Count + -// //plantAlore.Count+ -// //rocks.Count+ -// //liana.Count+ - -// //appleLeaves.Count+ -// //appleWood.Count+ -// //plumLeaves.Count+ -// //plumWood.Count+ -// //cherryLeaves.Count+ -// //cherryWood.Count+ -// //oakLeaves.Count+ -// //oakWood.Count+ -// //lindenWood.Count+ -// //lindenLeaves.Count+ -// //spruceLeaves.Count+ -// //spruceWood.Count+ -// //pineLeaves.Count+ -// //pineWood.Count+ -// // desk.Count+ -// //cherrySapling.Count+ -// //oakSapling.Count+ -// //appleSapling.Count+ -// //plumSapling.Count) + Environment.NewLine + -// // "[Počet Itemů]: "+(DIntBlockLeaves.Count+DIntBricks.Count+DIntDirt.Count+DIntGlass.Count+DIntGravel.Count+DIntHayBlock.Count+DIntSand.Count+DIntAluminiumDust.Count+DIntBronzeDust.Count+DIntCoalDust.Count+DIntCopperDust.Count+DIntGoldDust.Count+DIntIronDust.Count+DIntSilverDust.Count+DIntStoneDust.Count -// // +DIntDustSulfid.Count+DIntTinDust.Count+DIntUranDust.Count+DIntWoodDust.Count+DIntBattery.Count+DIntBigCircuit.Count+DIntBulb.Count+DIntCircuit.Count+DIntRubber.Count+DIntApple.Count+DIntBanana.Count+DIntCherry.Count+DIntOnion.Count+DIntPlum.Count+/*DIntPotatoes.Count+*/DIntRabbtCookedMeat.Count+DIntRabbitMeat.Count -// // +DIntRashberry.Count+DIntStrawberry.Count+DIntAluminiumIngot.Count+DIntBronzeIngot.Count+DIntCopperIngot.Count+DIntGoldIngot.Count+DIntIronIngot.Count+DIntSilverIngot.Count+DIntTinIngot.Count+DIntUranIngot.Count+DIntDesk.Count+DIntDoor.Count+DIntFlag.Count+DIntFurnaceElectric.Count+DIntFurnaceStone.Count -// // +DIntLabel.Count+DIntLadder.Count+DIntLamp.Count+DIntMacerator.Count+DIntMiner.Count+DIntRadio.Count+DIntRocket.Count+DIntSolarPanel.Count+DIntTorch.Count+DIntWaterMill.Count+DIntWindMill.Count+DIntCactus.Count+DIntDandelion.Count+DIntHay.Count+DIntLeather.Count+DIntLeave.Count+DIntOrchid.Count+DIntRose.Count -// // +DIntSeeds.Count+DIntStick.Count+DIntSticks.Count+DIntViolet.Count+DIntWheatSeeds.Count+DIntWheatStraw.Count+DIntOakSapling.Count+DIntPineSapling.Count+DIntLindenSapling.Count+DIntPlumSapling.Count+DIntCherrySapling.Count+DIntAppleSapling.Count+DIntSpruceSapling.Count+DIntStrawberryPlant.Count+DIntRashberryPlant.Count -// // +/*DIntPotatoesPlant.Count+*/DIntCoal.Count+DIntCopper.Count+DIntDiamond.Count+DIntGold.Count+DIntIron.Count+DIntPyrit.Count+DIntRuby.Count+DIntSaphirite.Count+DIntSilver.Count+DIntSmaragd.Count+DIntBigStone.Count+DIntMediumStone.Count+DIntSmallStone.Count+DIntTin.Count+/*DIntUran.Count+*/DIntBackpack.Count+DIntBucket.Count -// // +DIntBucketWater.Count+DIntRope.Count+DIntLindenPlanks.Count+DIntLindenWood.Count+DIntSprucePlanks.Count+DIntSpruceWood.Count+DIntOakPlanks.Count+DIntOakWood.Count+DIntPinePlanks.Count+DIntPineWood.Count+DIntCherryPlanks.Count+DIntCherryWood.Count+DIntPlumPlanks.Count+DIntPlumWood.Count+DIntApplePlanks.Count+DIntAppleWood.Count)+Environment.NewLine+ -// // "[Počet animací]: "+ (waterSquirt.Count + backgroundDirt.Count+ backgroundStone.Count+ backgroundGravel.Count+ backgroundSand.Count)+Environment.NewLine+ -// // "[Zvířata] Ryba(y):" + fish.Count + ", Zajíc(i): "+rabbit.Count+", Kur "+chicken.Count+Environment.NewLine + -// // "[Energie]: "+energy.Count+Environment.NewLine+ -// // "[Čas]: hodina(y): " + (time/3000)+" minuta(y): " + ((time- (time/3000)*3000)/50)+Environment.NewLine+ -// //"[Den]: "+day+Environment.NewLine,Color.DarkGray); -// // else { -// // if (Setting.Fps) { -// // if (show) DrawTextShadowMin(spriteFont_small,5, 5, "Fps: " + Math.Round(1000 / gameTime.ElapsedGameTime.TotalMilliseconds),Color.DarkGray); -// // } -// // } -// //} -// //#endregion -// // } - -// //#region Draw debug -// //// if (gameTime.ElapsedGameTime.TotalMilliseconds!=0) { -// //if (debug) DrawTextShadowMin(spriteFont_small, 5, 5, " Informace (F1 skrýt)"+Environment.NewLine+"----------------------------------"+Environment.NewLine+ -// // "[Pozice hráče] X: "+PlayerX+", Y: "+PlayerY+Environment.NewLine+ -// // "[Pozice myše] X: "+(int)mousePos.X+", Y: "+(int)mousePos.Y+Environment.NewLine+ -// // "[počet instancí]: "+( -// // grassPlains.Count+ -// // grassHills.Count+ -// // grassJungle.Count+ -// // grassForest.Count+ -// // grassDesert.Count+ - -// // grassPlainsBlock.Count+ -// // grassForestBlock.Count+ -// // grassJungleBlock.Count+ -// // grassDesertBlock.Count+ -// // grassHillsBlock.Count+ - -// // dirt.Count+ -// // //stone.Count+ -// // sand.Count+ -// // gravel.Count+ -// // cobblestone.Count+ -// // ice.Count+ -// // snow.Count+ -// // waterBlock.Count+ -// // snowTop.Count+ - -// // plantDandelion.Count+ -// // plantOrchid.Count+ -// // plantViolet.Count+ -// // plantRose.Count+ - -// // ironOre.Count+ -// // goldOre.Count+ -// // aluminiumOre.Count+ -// // silverOre.Count+ -// // tinOre.Count+ -// // copperOre.Count+ -// // coalOre.Count+ -// // oil.Count+ - -// // cactusBig.Count+ -// // cactusLittle.Count+ -// // plantAlore.Count+ -// // rocks.Count+ -// // liana.Count+ - -// // appleLeaves.Count+ -// // appleWood.Count+ -// // plumLeaves.Count+ -// // plumWood.Count+ -// // cherryLeaves.Count+ -// // cherryWood.Count+ -// // oakLeaves.Count+ -// // oakWood.Count+ -// // lindenWood.Count+ -// // lindenLeaves.Count+ -// // spruceLeaves.Count+ -// // spruceWood.Count+ -// // pineLeaves.Count+ -// // pineWood.Count+ -// // desk.Count+ -// // cherrySapling.Count+ -// // oakSapling.Count+ -// // appleSapling.Count+ -// // plumSapling.Count)+Environment.NewLine+ -// // // "[Počet DIntů]: "+(DIntBlockLeaves.Count+DIntBricks.Count+DIntDirt.Count+DIntGlass.Count+DIntGravel.Count+DIntHayBlock.Count+DIntSand.Count+DIntAluminiumDust.Count+DIntBronzeDust.Count+DIntCoalDust.Count+DIntCopperDust.Count+DIntGoldDust.Count+DIntIronDust.Count+DIntSilverDust.Count+DIntStoneDust.Count -// // // +DIntDustSulfid.Count+DIntTinDust.Count+DIntUranDust.Count+DIntWoodDust.Count+DIntBattery.Count+DIntBigCircuit.Count+DIntBulb.Count+DIntCircuit.Count+DIntRubber.Count+DIntApple.Count+DIntBanana.Count+DIntCherry.Count+DIntOnion.Count+DIntPlum.Count+/*DIntPotatoes.Count+*/DIntRabbtCookedMeat.Count+DIntRabbitMeat.Count -// // // +DIntRashberry.Count+DIntStrawberry.Count+DIntAluminiumIngot.Count+DIntBronzeIngot.Count+DIntCopperIngot.Count+DIntGoldIngot.Count+DIntIronIngot.Count+DIntSilverIngot.Count+DIntTinIngot.Count+DIntUranIngot.Count+DIntDesk.Count+DIntDoor.Count+DIntFlag.Count+DIntFurnaceElectric.Count+DIntFurnaceStone.Count -// // // +DIntLabel.Count+DIntLadder.Count+DIntLamp.Count+DIntMacerator.Count+DIntMiner.Count+DIntRadio.Count+DIntRocket.Count+DIntSolarPanel.Count+DIntTorch.Count+DIntWaterMill.Count+DIntWindMill.Count+DIntCactus.Count+DIntDandelion.Count+DIntHay.Count+DIntLeather.Count+DIntLeave.Count+DIntOrchid.Count+DIntRose.Count -// // // +DIntSeeds.Count+DIntStick.Count+DIntSticks.Count+DIntViolet.Count+DIntWheatSeeds.Count+DIntWheatStraw.Count+DIntOakSapling.Count+DIntPineSapling.Count+DIntLindenSapling.Count+DIntPlumSapling.Count+DIntCherrySapling.Count+DIntAppleSapling.Count+DIntSpruceSapling.Count+DIntStrawberryPlant.Count+DIntRashberryPlant.Count -// // // +/*DIntPotatoesPlant.Count+*/DIntCoal.Count+DIntCopper.Count+DIntDiamond.Count+DIntGold.Count+DIntIron.Count+DIntPyrit.Count+DIntRuby.Count+DIntSaphirite.Count+DIntSilver.Count+DIntSmaragd.Count+DIntBigStone.Count+DIntMediumStone.Count+DIntSmallStone.Count+DIntTin.Count+/*DIntUran.Count+*/DIntBackpack.Count+DIntBucket.Count -// // // +DIntBucketWater.Count+DIntRope.Count+DIntLindenPlanks.Count+DIntLindenWood.Count+DIntSprucePlanks.Count+DIntSpruceWood.Count+DIntOakPlanks.Count+DIntOakWood.Count+DIntPinePlanks.Count+DIntPineWood.Count+DIntCherryPlanks.Count+DIntCherryWood.Count+DIntPlumPlanks.Count+DIntPlumWood.Count+DIntApplePlanks.Count+DIntAppleWood.Count)+Environment.NewLine+ -// // "[Počet animací]: "+(waterSquirt.Count+backgroundDirt.Count+backgroundStone.Count+backgroundGravel.Count+backgroundSand.Count)+Environment.NewLine+ -// // "[Zvířata] Ryba(y):"+fish.Count+", Zajíc(i): "+rabbit.Count+", Kur "+chicken.Count+Environment.NewLine+ -// // "[Energie]: "+energy.Count+Environment.NewLine+ - -// // "[Čas]: hodina(y): "+((int)time).ToString()+" minuta(y): "+((int)((float)(time-(int)time)*60)).ToString()+" sekunda(y): "+((int)((((time-(int)time)*(float)60)-(int)((time-(int)time)*(float)60))*60)).ToString()+Environment.NewLine+ -// // "[Den]: "+day.ToString()+Environment.NewLine+ -// // "[Stattum Inv]: "+inventory, Color.DarkGray); -// //else { -// // if (Setting.Fps) { -// // if (show) DrawTextShadowMin(spriteFont_small, 5, 5, "Fps: "+Math.Round(1000/gameTime.ElapsedGameTime.TotalMilliseconds), Color.DarkGray); -// // } -// // // } -// //} -// //#endregion -// // } else { -// // spriteBatch.Begin(); -// // Graphics.Clear(Color.White); - -// // for (int i=0; i4) { -// // // Error=true; -// // // ErrorCode="Server se příliš dlouho hledá."; -// // // ErrorMessage="Časový limit vypršel"; -// // // try { clientSocket.Disconnect(false);}catch {} -// // // menu.ButtonDraw(spriteBatch,new Vector2(ms.X,ms.Y),new Vector2(Global.WindowWidth-400,WindowHeight-50)); -// // // DrawTextShadowMin(spriteFont_medium,WindowWidth-400+100,WindowHeight-50+5,"Zpět do menu"); -// // // } -// // //} - -// // if (Error) { -// // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString(ErrorMessage).X)/2),WindowHeight/2-40,ErrorMessage); -// // DrawTextShadowMin(spriteFont_small,(int)((Global.WindowWidth-spriteFont_small.MeasureString(ErrorCode).X)/2),WindowHeight/2+80,ErrorCode); -// // } else { -// // switch (step) { -// // case Step.Checking: -// // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Připojování...").X)/2),WindowHeight/2-50,"Připojování..."); -// // break; - -// // case Step.Logining: -// // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Připojování...").X)/2),WindowHeight/2-50,"Připojování..."); -// // break; - -// // case Step.Terrain: -// // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Získávání terénu").X)/2),WindowHeight/2-50,"Získávání terénu"); -// // break; - -// // case Step.Assets: -// // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Načítání herních komponent").X)/2),WindowHeight/2-50,"Načítání herních komponent"); -// // break; -// // } -// // } -// //spriteBatch.End(); -// } -// } -// } else { -// Graphics.SetRenderTarget(null); -// Graphics.Clear(Color.White); -// spriteBatch.Begin(); - -// //Back -// for (int i = 0; i125) return; - -// if (terrain[x]!=null) { -// #region Liquits -// if (Inventory[boxSelected].X==(int)Items.Bottle) { -// if (terrain[x].IsTopBlocks[y]==MBlockState.Exists) { -// if (terrain[x].TopBlocks[y].Id==(int)BlockId.Oil) { -// SendRemovedBlock(); -// if (Global.WorldDifficulty!=2) { -// InventoryRemoveDInt(); -// for (int i = 0; i<99; i++) InventoryAdd((int)Items.BottleOil); -// } -// terrain[x].TopBlocks[y]=null; -// terrain[x].IsTopBlocks[y]=false; -// return; -// } -// if (terrain[x].TopBlocks[y].Id==(int)BlockId.WaterBlock) { -// if (Global.WorldDifficulty!=2) { -// InventoryRemoveDInt(); -// for (int i = 0; i<99; i++) InventoryAdd((int)Items.BottleWater); -// } -// terrain[x].TopBlocks[y]=null; -// terrain[x].IsTopBlocks[y]=false; -// return; -// } -// if (terrain[x].TopBlocks[y].Id==(int)BlockId.WaterSalt) { -// if (Global.WorldDifficulty!=2) { -// InventoryRemoveDInt(); -// for (int i = 0; i<99; i++) InventoryAdd((int)Items.BottleWater); -// } -// terrain[x].TopBlocks[y]=null; -// terrain[x].IsTopBlocks[y]=false; -// return; -// } -// } -// } -// if (Inventory[boxSelected].X==(int)Items.Bucket) { -// if (terrain[x].IsTopBlocks[y]==MBlockState.Exists) { -// if (terrain[x].TopBlocks[y].Id==(int)BlockId.Oil) { -// if (Global.WorldDifficulty!=2) { -// InventoryRemoveDInt(); -// for (int i = 0; i<99; i++) InventoryAdd((int)Items.BottleOil); -// } -// terrain[x].TopBlocks[y]=null; -// SendedBlockToRemove -// terrain[x].IsTopBlocks[y]=false; -// return; -// } -// if (terrain[x].TopBlocks[y].Id==(int)BlockId.WaterBlock) { -// if (Global.WorldDifficulty!=2) { -// InventoryRemoveDInt(); -// for (int i = 0; i<99; i++) InventoryAdd((int)Items.BottleWater); -// } -// terrain[x].TopBlocks[y]=null; -// terrain[x].IsTopBlocks[y]=false; -// return; -// } -// if (terrain[x].TopBlocks[y].Id==(int)BlockId.WaterSalt) { -// if (Global.WorldDifficulty!=2) { -// InventoryRemoveDInt(); -// for (int i = 0; i<99; i++) InventoryAdd((int)Items.BottleWater); -// } -// terrain[x].TopBlocks[y]=null; -// terrain[x].IsTopBlocks[y]=false; -// return; -// } -// } -// //InventoryRemoveDInt(); -// //for (int i=0; i<99; i++)InventoryAdd((int)Items.BucketWater); -// //return; -// } -// #endregion - -// #region Get food -// if (terrain[x].IsTopBlocks[y]) { -// switch ((BlockId)terrain[x].TopBlocks[y].Id) { -// case BlockId.BucketWithLatex: -// DropItemToPos(mousePosRound, Items.Resin); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.BucketForRubber, new Vector2(mousePosRound.X, mousePosRound.Y)); -// bucketRubber.Add(new ShortAndByte(x, y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case BlockId.PlumLeavesWithPlums: -// DropItemToPos(mousePosRound, Items.Plum); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.PlumLeaves, new Vector2(mousePosRound.X, mousePosRound.Y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case BlockId.CherryLeavesWithCherries: -// DropItemToPos(mousePosRound, Items.Cherry); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.CherryLeaves, new Vector2(mousePosRound.X, mousePosRound.Y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case BlockId.AppleLeavesWithApples: -// DropItemToPos(mousePosRound, Items.Apple); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.AppleLeaves, new Vector2(mousePosRound.X, mousePosRound.Y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case BlockId.LemonLeavesWithLemons: -// DropItemToPos(mousePosRound, Items.Lemon); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.LemonLeaves, new Vector2(mousePosRound.X, mousePosRound.Y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case BlockId.OrangeLeavesWithOranges: -// DropItemToPos(mousePosRound.X, mousePosRound.Y, Items.Orange); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.OrangeLeaves, new Vector2(mousePosRound.X, mousePosRound.Y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case BlockId.OliveLeavesWithOlives: -// DropItemToPos(mousePosRound.X, mousePosRound.Y, Items.Olive); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.OliveLeaves, new Vector2(mousePosRound.X, mousePosRound.Y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case BlockId.KapokLeacesFibre: -// DropItemToPos(mousePosRound.X, mousePosRound.Y, Items.KapokFibre); -// terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.KapokLeaces, new Vector2(mousePosRound.X, mousePosRound.Y)); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; -// } -// } - - -// foreach (Plant m in terrain[x].Plants) { -// if (m.Height==y) { -// if (!m.Growing) { -// switch (m.Id) { -// case (byte)BlockId.Blueberry: -// DropItemToPos(mousePosRound, Items.Blueberries); -// m.Grow=125; -// m.Growing=true; -// m.Update(); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case (byte)BlockId.Strawberry: -// DropItemToPos(mousePosRound, Items.Strawberry); -// m.Grow=125; -// m.Growing=true; -// m.Update(); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; - -// case (byte)BlockId.Rashberry: -// DropItemToPos(mousePosRound, Items.Rashberry); -// m.Grow=125; -// m.Growing=true; -// m.Update(); -// barEnergy+=0.02f; -// if (barEnergy>32) barEnergy=32; -// return; -// } -// } -// Console.WriteLine("Grow: "+m.Grow+"; Growing: "+m.Growing+"; Height: "+m.Height+"; Id: "+m.Id+"; Vector: "+m.Vector+"; mousePosRound: "+mousePosRound+"; x,y: "+x+" "+y); -// } -// } -// #endregion - -// #region Drink Water -// if (terrain[x].IsTopBlocks[y]) { -// if (terrain[x].TopBlocks[y].Id==(byte)BlockId.WaterBlock) { -// barWater--; -// if (barWater<0) barWater=0; -// // DropSomethingToWater(x,y,8); -// return; -// } -// } -// #endregion - -// #region Hoe -// if (terrain[x].IsSolidBlocks[y]) { -// if (Inventory[boxSelected].X==(int)Items.HoeBronze -// ||Inventory[boxSelected].X==(int)Items.HoeCopper -// ||Inventory[boxSelected].X==(int)Items.HoeIron -// ||Inventory[boxSelected].X==(int)Items.HoeStone) { - -// if ((BlockId)terrain[x].SolidBlocks[y].Id==BlockId.GrassBlockClay -// ||(BlockId)terrain[x].SolidBlocks[y].Id==BlockId.GrassBlockDesert -// ||(BlockId)terrain[x].SolidBlocks[y].Id==BlockId.GrassBlockForest -// ||(BlockId)terrain[x].SolidBlocks[y].Id==BlockId.GrassBlockHills -// ||(BlockId)terrain[x].SolidBlocks[y].Id==BlockId.GrassBlockJungle -// ||(BlockId)terrain[x].SolidBlocks[y].Id==BlockId.GrassBlockPlains) { -// terrain[x].SolidBlocks[y]=TopBlockFromId((byte)BlockId.Dirt, mousePosRound.Vector()); -// barEnergy+=0.02f; -// barWater+=0.02f; -// if (barEnergy>32) barEnergy=32; -// if (barWater>32) barWater=32; -// RemovePartTool(); -// return; -// } -// } -// } -// #endregion - -// #region Inventory -// if (Inventory[boxSelected].X==(int)Items.Mobile) { -// MobileON(); -// inventory=InventoryType.Mobile; -// return; -// } - -// if (Vector2.Distance(mousePosRound.Vector(), new Vector2(PlayerX, PlayerY))<5*16) { -// if (terrain[x].IsTopBlocks[y]) { -// switch ((BlockId)terrain[x].TopBlocks[y].Id) { -// case BlockId.Desk: -// inventory=InventoryType.Desk; -// selectedMashine=mousePosDiv16.Clone(); -// SetInvCraftingBlocks(); -// if (lastMashineType!=inventory) SetUpInvToNew(); - -// SetNeed(); -// return; - -// case BlockId.Shelf: -// inventory=InventoryType.Shelf; -// selectedMashine=mousePosDiv16.Clone(); ; -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; - -// case BlockId.BoxWooden: -// inventory=InventoryType.BoxWooden; -// selectedMashine=mousePosDiv16.Clone(); ; -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; - -// case BlockId.BoxAdv: -// inventory=InventoryType.BoxAdv; -// selectedMashine=mousePosDiv16.Clone(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; - -// case BlockId.Radio: -// inventory=InventoryType.Radio; -// selectedMashine=mousePosDiv16.Clone(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// //PrepareRadioDialog(); -// return; - -// case BlockId.FurnaceStone: -// inventory=InventoryType.FurnaceStone; -// selectedMashine=mousePosDiv16.Clone(); -// SetInvBakeIngots(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// SetNeed(); -// return; - -// case BlockId.FurnaceElectric: -// inventory=InventoryType.FurnaceElectric; -// selectedMashine=mousePosDiv16.Clone(); -// SetInvBakeIngots(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// SetNeed(); -// return; - -// case BlockId.Macerator: -// inventory=InventoryType.Macerator; -// selectedMashine=mousePosDiv16.Clone(); -// SetInvToDustDusts(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// SetNeed(); -// return; - -// case BlockId.Charger: -// inventory=InventoryType.Charger; -// selectedMashine=mousePosDiv16.Clone(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; - - -// case BlockId.SewingMachine: -// inventory=InventoryType.SewingMachine; -// selectedMashine=mousePosDiv16.Clone(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// SetNeed(); -// return; - -// case BlockId.Miner: -// inventory=InventoryType.Miner; -// selectedMashine=mousePosDiv16.Clone(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; - -// case BlockId.Composter: -// inventory=InventoryType.Composter; -// selectedMashine=mousePosDiv16.Clone(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; -// } -// } - -// for (int potencialRocketY = y; potencialRocketY>y-5; potencialRocketY--) { -// if (potencialRocketY<0) break; - -// if (terrain[x].IsTopBlocks[potencialRocketY]) { -// if (terrain[x].TopBlocks[potencialRocketY].Id==(byte)BlockId.Rocket) { -// inventory=InventoryType.Rocket; -// selectedMashine=new DInt(x, potencialRocketY); -// //PrepareRocketDialog(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; -// } -// } -// if (terrain[x-1].IsTopBlocks[potencialRocketY]) { -// if (terrain[x-1].TopBlocks[potencialRocketY].Id==(byte)BlockId.Rocket) { -// inventory=InventoryType.Rocket; -// selectedMashine=new DInt(x-1, potencialRocketY); -// //PrepareRocketDialog(); -// if (lastMashineType!=inventory) SetUpInvToNew(); -// return; -// } -// } -// } -// } -// #endregion - -// #region Place block -// if (Vector2.Distance(mousePosRound.Vector(), new Vector2(PlayerX, PlayerY))y) terrain[x].StartSomething=(byte)y; -// terrain[x].SolidBlocks[y]=block; -// terrain[x].IsSolidBlocks[y]=true; - -// RefreshLighting(x); - -// Inventory[boxSelected].Y--; -// if (Inventory[boxSelected].Y==0) Inventory[boxSelected].X=0; -// return; -// } - -// if (y!=0) { -// if (y+1<=125) -// if (terrain[x].IsSolidBlocks[y+1]) { -// if (terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.Dirt||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.Compost) { -// if (!terrain[x].IsTopBlocks[y]) { - -// bool isNotPlant = true; -// foreach (Plant p in terrain[x].Plants) { -// if (p.Height==y) { -// isNotPlant=false; -// break; -// } -// } -// if (isNotPlant) { -// switch (id) { -// case Items.Seeds: -// switch (random.Next(10)) { -// default: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.Dandelion, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 1: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.Orchid, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 2: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.Rose, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 3: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.Heather, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 4: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.Violet, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 5: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.GrassDesert, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 6: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.GrassForest, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 7: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.GrassHills, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 8: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.GrassJungle, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// case 9: terrain[x].TopBlocks[y]=TopBlockFromId((byte)BlockId.GrassPlains, new Vector2(mousePosRound.X, mousePosRound.Y)); break; -// } -// terrain[x].IsTopBlocks[y]=true; -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.WheatSeeds: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Wheat, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.FlaxSeeds: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Flax, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.Carrot: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Carrot, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.Onion: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Onion, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.Peas: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Peas, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.PlantRashberry: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Rashberry, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.PlantStrawberry: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Strawberry, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; - -// case Items.PlantBlueberry: -// terrain[x].Plants.Add(GetPlantFromId((byte)BlockId.Blueberry, (byte)y, 0, (short)x)); -// RegisterPlant(x); -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// InventoryRemoveDInt(); -// return; -// } -// } -// } -// } - -// BlockId mobId = GameMethods.MobFromItem(id); -// if (mobId!=BlockId.None) { -// bool NotExists = true; -// foreach (Mob mob in terrain[x].Mobs) { -// if (mob.Height==y) { -// NotExists=false; -// break; -// } -// } - -// if (NotExists) { -// Mob m = GetMobFromId(mobId, (byte)y, random.Next()==1, x); -// if (m!=null) { -// terrain[x].Mobs.Add(m); -// } -// } -// } -// } -// } -// } - -// if (!terrain[x].IsBackground[y]) { -// Block block = BackBlockFromId((byte)GameMethods.BackBlockFromItem(id), new Vector2(mousePosRound.X, mousePosRound.Y)); - -// if (block!=null) { -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; -// terrain[x].Background[y]=block; -// terrain[x].IsBackground[y]=true; - -// Inventory[boxSelected].Y--; -// if (Inventory[boxSelected].Y==0) Inventory[boxSelected].X=0; -// return; -// } -// } - -// if (!terrain[x].IsTopBlocks[y]) { -// Block block = TopBlockFromId((byte)GameMethods.TopBlockFromItem(id), mousePosRound.Vector()); - -// if (block!=null) { -// if (!GameMethods.IsDirtPlaceable((BlockId)block.Id)) { -// if (terrain[x].IsSolidBlocks[y+1]) { -// if (terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.Dirt -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.Compost -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.Clay -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.GrassBlockClay -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.GrassBlockDesert -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.GrassBlockForest -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.GrassBlockHills -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.GrassBlockJungle -// ||terrain[x].SolidBlocks[y+1].Id==(byte)BlockId.GrassBlockPlains) { -// terrain[x].TopBlocks[y]=block; -// terrain[x].IsTopBlocks[y]=true; -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; - -// Inventory[boxSelected].Y--; -// if (Inventory[boxSelected].Y==0) Inventory[boxSelected].X=0; -// return; -// } else return; -// } else return; -// } else { -// if (id==Items.BucketForRubber) { -// if (!terrain[x].IsBackground[y]) return; -// if (terrain[x].Background[y].Id!=(int)BlockId.RubberTreeWood) return; -// } - -// terrain[x].TopBlocks[y]=block; -// terrain[x].IsTopBlocks[y]=true; -// if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; - -// switch (id) { -// case Items.FurnaceStone: -// ((MashineBlockBasic)block).Inv=new List(){ -// // Wood -// new DInt(),new DInt(),new DInt(), - -// //Ash -// new DInt(), -// }; -// FurnaceStone.Add(new ShortAndByte(x, y)); -// break; - -// case Items.Charger: -// ((MashineBlockBasic)block).Inv=new List { -// new DInt() -// }; -// Chargers.Add(new ShortAndByte((short)x, (byte)y)); -// RefreshAroundLabels(x, y); -// break; - -// case Items.Miner: -// ((MashineBlockBasic)block).Inv=new List(); -// for (int i = 0; i<12*2; i++) ((MashineBlockBasic)block).Inv.Add(new DInt()); -// Miners.Add(new ShortAndByte((short)x, (byte)y)); -// RefreshAroundLabels(x, y); -// break; - -// case Items.Composter: -// ((ShelfBlock)block).Inv=new List(); -// for (int i = 0; i<12*2; i++) ((ShelfBlock)block).Inv.Add(new DInt()); -// Composters.Add(new ShortAndByte((short)x, (byte)y)); -// break; - -// case Items.BucketForRubber: -// if (terrain[x].IsBackground[y]) { -// if (terrain[x].Background[y].Id==(int)BlockId.RubberTreeWood) { -// bucketRubber.Add(new ShortAndByte((short)x, (byte)y)); -// } else { -// ItemDrop((int)Items.BucketForRubber, 1, x, y); -// terrain[x].IsBackground[y]=false; -// terrain[x].Background[y]=null; -// } -// } else { -// ItemDrop((int)Items.BucketForRubber, 1, x, y); -// terrain[x].IsBackground[y]=false; -// terrain[x].Background[y]=null; -// } -// //((ShelfBlock)block).Inv=new List(); -// //for (int i = 0; i<12*2; i++) ((ShelfBlock)block).Inv.Add(new DInt()); - - -// break; - -// case Items.Lamp: -// RefreshAroundLabels(x, y); -// break; - -// case Items.Radio: -// RefreshAroundLabels(x, y); -// break; - -// case Items.Label: -// SetIndexLabel(x, y); -// RefreshAroundLabels(x, y); -// break; - -// case Items.Shelf: -// ((ShelfBlock)block).Inv=new List(){ -// new DInt(),new DInt(),new DInt(), -// new DInt(),new DInt(),new DInt(), -// new DInt(),new DInt(),new DInt(), -// }; -// break; - -// case Items.BoxWooden: -// ((BoxBlock)block).Inv=new List(); -// for (int i = 0; i<12*2; i++) ((BoxBlock)block).Inv.Add(new DInt()); -// break; - -// case Items.BoxAdv: -// ((BoxBlock)block).Inv=new List(); -// for (int i = 0; i<14*4; i++) ((BoxBlock)block).Inv.Add(new DInt()); -// break; - -// case Items.Flag: -// windable.Add(new ShortAndByte((short)x, (byte)y)); -// break; - -// case Items.WindMill: -// windable.Add(new ShortAndByte((short)x, (byte)y)); -// RefreshAroundLabels(x, y); -// break; -// } -// Inventory[boxSelected].Y--; -// if (Inventory[boxSelected].Y==0) Inventory[boxSelected].X=0; -// return; -// } -// } -// } -// } -// } -// #endregion -// } -// } - -// Color StringToColor(string str) { -// string h = str.Replace("[", "").Replace("]", "").Replace(" ", ""); -// return new Color(int.Parse(h.Substring(0, h.IndexOf(","))), -// int.Parse(h.Substring(h.IndexOf(",")+1, h.LastIndexOf(",")-h.IndexOf(",")-1)), -// int.Parse(h.Substring(h.LastIndexOf(",")+1))); -// } - -// void GrowTreeFood(int reg) { -// int id = random.Next(1000-1)+1+reg; - -// int i = random.Next(124)+1; -// if (terrain[id].IsTopBlocks[i]) { -// switch (terrain[id].TopBlocks[i].Id) { -// case (byte)BlockId.AppleLeaves: -// terrain[id].TopBlocks[i]=TopBlockFromId((byte)BlockId.AppleLeavesWithApples, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.PlumLeaves: -// terrain[id].TopBlocks[i]=TopBlockFromId((byte)BlockId.PlumLeavesWithPlums, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.LemonLeaves: -// terrain[id].TopBlocks[i]=TopBlockFromId((byte)BlockId.LemonLeavesWithLemons, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.OrangeLeaves: -// terrain[id].TopBlocks[i]=TopBlockFromId((byte)BlockId.OrangeLeavesWithOranges, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.CherryLeaves: -// terrain[id].TopBlocks[i]=TopBlockFromId((byte)BlockId.CherryLeavesWithCherries, new Vector2(id*16, i*16)); -// return; -// } -// } else if (random.Next(10000)==1) { -// if (terrain[id].IsSolidBlocks[i]) { -// switch (terrain[id].SolidBlocks[i].Id) { -// case (byte)BlockId.Compost: -// terrain[id].SolidBlocks[i]=SolidBlockFromId((byte)BlockId.Dirt, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.Dirt: -// if (!terrain[id].IsSolidBlocks[i-1]) { -// int r = random.Next(2)==1 ? 1 : -1; -// if (terrain[id+r].IsSolidBlocks[i]) { -// switch (terrain[id+r].SolidBlocks[i].Id) { -// case (byte)BlockId.GrassBlockDesert: -// terrain[id].SolidBlocks[i]=SolidBlockFromId((byte)BlockId.GrassBlockDesert, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.GrassBlockForest: -// terrain[id].SolidBlocks[i]=SolidBlockFromId((byte)BlockId.GrassBlockForest, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.GrassBlockHills: -// terrain[id].SolidBlocks[i]=SolidBlockFromId((byte)BlockId.GrassBlockHills, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.GrassBlockJungle: -// terrain[id].SolidBlocks[i]=SolidBlockFromId((byte)BlockId.GrassBlockJungle, new Vector2(id*16, i*16)); -// return; - -// case (byte)BlockId.GrassBlockPlains: -// terrain[id].SolidBlocks[i]=SolidBlockFromId((byte)BlockId.GrassBlockPlains, new Vector2(id*16, i*16)); -// return; -// } -// } -// } -// return; - -// case (byte)BlockId.Clay: -// if (!terrain[id].IsSolidBlocks[i-1]) { -// int r = random.Next(2)==1 ? 1 : -1; -// if (terrain[id+r].IsSolidBlocks[i]) { -// if (terrain[id+r].SolidBlocks[i].Id==(byte)BlockId.GrassBlockClay) { -// terrain[id].SolidBlocks[i]=SolidBlockFromId((byte)BlockId.GrassBlockClay, new Vector2(id*16, i*16)); -// return; -// } -// } -// } -// return; - -// } -// } -// } -// } - -// public void Connect() { -// clientSocket=new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { -// ReceiveTimeout=10 -// }; -// IPAddress ipAddress = ip; - -// if (ipAddress.ToString()==IPAddress.Any.ToString()) { ipAddress=IPAddress.Loopback; ip=IPAddress.Loopback; } - -// IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port); - -// Console.WriteLine("Připojování: "+ipAddress.ToString()+":"+port); - -// clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null); -// } - -// public void ConnectDuringGameError() { -// clientSocket=new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { -// ReceiveTimeout=10 -// }; -// IPAddress ipAddress = ip; - -// if (ipAddress.ToString()==IPAddress.Any.ToString()) ipAddress=IPAddress.Loopback; - -// IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port); - -// Console.WriteLine("Znovupřipojování: "+ipAddress.ToString()+":"+port); - -// clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null); -// } - -// void SendMyInventory() { -// Data data = new Data { -// Cmd=Command.Message, -// To=toServer, -// Message="*int-set ", -// }; - -// data.Message+=maxInvCount+" "; - -// for (int i = 0; i inv = null; -// int id = terrain[x].TopBlocks[y].Id; - -// if (terrain[x].TopBlocks[y] is BoxBlock) { -// inv=((BoxBlock)terrain[x].TopBlocks[y]).Inv; -// } else if (terrain[x].TopBlocks[y] is MashineBlockBasic) { -// inv=((MashineBlockBasic)terrain[x].TopBlocks[y]).Inv; -// } else if (terrain[x].TopBlocks[y] is ShelfBlock) { -// inv=((ShelfBlock)terrain[x].TopBlocks[y]).Inv; -// } else return; - -// Data data = new Data { -// Cmd=Command.Message, -// To=toServer, -// Message="*inv-machine-set "+x+" "+y+" ", -// }; - -// data.Message+=inv.Count+" "; - -// for (int i = 0; i inv=null; - - -// Data data = new Data { -// Cmd=Command.Message, -// To=toServer, -// Message="*inv-set ", -// }; - -// data.Message+=maxInvCount+" "; - -// for (int i = 0; iDistanceBlockEdit) destrustionSlow=-1; -// else if (distance0) { -// if (Global.WorldDifficulty==2) { -// if (terrain[x].IsSolidBlocks[y]) { -// destroingIndex=0; -// destroingBlockType=terrain[x].SolidBlocks[y].Id; -// destringMaxIndex=10; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Solid; -// destroing=true; -// return; -// } - -// foreach (Plant p in terrain[x].Plants) { -// if (p.Vector.Y/16==y) { -// destroingIndex=0; -// destroingBlockType=p.Id; -// destringMaxIndex=10; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Plant; -// destroing=true; -// return; -// } -// } - -// foreach (Mob m in terrain[x].Mobs) { -// if (m.Height==y) { -// destroingIndex=0; -// destroingBlockType=m.Id; -// destringMaxIndex=10; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Mob; -// destroing=true; -// return; -// } -// } - -// if (terrain[x].IsTopBlocks[y]) { -// destroingBlockType=terrain[x].TopBlocks[y].Id; -// if (GameMethods.CanDestroy((BlockId)destroingBlockType)) { -// destroingIndex=0; -// destringMaxIndex=10; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Top; -// destroing=true; -// return; -// } else destroing=false; -// } - -// if (terrain[x].IsBackground[y]) { -// destroingIndex=0; -// destroingBlockType=terrain[x].Background[y].Id; -// destringMaxIndex=10; - -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Back; -// destroing=true; -// return; -// } -// } else { -// if (terrain[x].IsSolidBlocks[y]) { -// destroingIndex=0; -// destroingBlockType=terrain[x].SolidBlocks[y].Id; -// destringMaxIndex=GetSolidBlockDestroingSpeed(destroingBlockType)*destrustionSlow; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Solid; -// destroing=true; -// return; -// } - -// foreach (Plant p in terrain[x].Plants) { -// if (p.Height==y) { -// destroingIndex=0; -// destroingBlockType=p.Id; -// destringMaxIndex=GetPlantDestroingSpeed(destroingBlockType)*destrustionSlow; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Plant; -// destroing=true; -// return; -// } -// } - -// foreach (Mob m in terrain[x].Mobs) { -// if (m.Height==y) { -// destroingIndex=0; -// destroingBlockType=m.Id; -// destringMaxIndex=GetMobDestroingSpeed(destroingBlockType)*destrustionSlow; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Mob; -// destroing=true; -// return; -// } -// } - -// if (terrain[x].IsTopBlocks[y]) { -// destroingBlockType=terrain[x].TopBlocks[y].Id; -// if (GameMethods.CanDestroy((BlockId)destroingBlockType)) { -// destroingIndex=0; -// destringMaxIndex=GetTopBlockDestroingSpeed(destroingBlockType)*destrustionSlow; -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Top; -// destroing=true; -// return; -// } else destroing=false; -// } - -// if (terrain[x].IsBackground[y]) { -// destroingIndex=0; -// destroingBlockType=terrain[x].Background[y].Id; -// destringMaxIndex=GetBackBlockDestroingSpeed(destroingBlockType)*destrustionSlow; - -// destroyBlock=new DInt { X=x, Y=y }; -// destroingBlockDepth=BlockType.Back; -// destroing=true; -// return; -// } -// } -// } -// } - -// void DestroyGrassUp(int x, int y) { -// if (terrain[x].IsTopBlocks[y]) { -// BlockId id = (BlockId)terrain[x].TopBlocks[y].Id; - -// if (id==BlockId.Alore -// ||id==BlockId.Rose -// ||id==BlockId.Orchid -// ||id==BlockId.Dandelion -// ||id==BlockId.Violet -// ||id==BlockId.Heather -// ||id==BlockId.GrassDesert -// ||id==BlockId.GrassForest -// ||id==BlockId.GrassHills -// ||id==BlockId.GrassJungle -// ||id==BlockId.GrassPlains - -// ||id==BlockId.BranchALittle1 -// ||id==BlockId.BranchALittle2 -// ||id==BlockId.BranchFull -// ||id==BlockId.BranchWithout - -// ||id==BlockId.CherrySapling -// ||id==BlockId.AppleSapling -// ||id==BlockId.LemonSapling -// ||id==BlockId.LindenSapling -// ||id==BlockId.OakSapling -// ||id==BlockId.OrangeSapling -// ||id==BlockId.PineSapling -// ||id==BlockId.PlumSapling -// ||id==BlockId.SpruceSapling - -// ||id==BlockId.Rocks - -// ||id==BlockId.Boletus -// ||id==BlockId.Champignon -// ||id==BlockId.Toadstool) { -// destroingBlockDepth=BlockType.Top; -// GetItemsFromBlock((byte)id, x, y/*,destroingBlockDepth*/); -// terrain[x].IsTopBlocks[y]=false; -// terrain[x].TopBlocks[y]=null; -// } -// } - -// foreach (Plant p in terrain[x].Plants) { -// if (p.Height==y) { -// destroingBlockDepth=0; -// GetItemsFromBlock(p.Id, x, y/*,destroingBlockDepth*/); -// terrain[x].Plants.Remove(p); -// RemovePlant(x); -// break; -// } -// } -// } - -// void DestroySandUp(int x, int y) { -// if (terrain[x].IsTopBlocks[y]) { -// BlockId id = (BlockId)terrain[x].TopBlocks[y].Id; - -// if (id==BlockId.Alore -// ||id==BlockId.GrassDesert -// ||id==BlockId.BranchALittle1 -// ||id==BlockId.BranchALittle2 -// ||id==BlockId.BranchFull -// ||id==BlockId.BranchWithout -// ||id==BlockId.Rocks) { -// GetItemsFromBlock((byte)id, x, y/*,BlockType.Top*/); -// terrain[x].IsTopBlocks[y]=false; -// terrain[x].TopBlocks[y]=null; -// } - -// if (id==BlockId.CactusBig) { - -// // current -// GetItemsFromBlock((byte)id, x, y/*,BlockType.Top*/); -// terrain[x].IsTopBlocks[y]=false; -// terrain[x].TopBlocks[y]=null; - -// //if more -// for (int yy = y-1; yy>=0; yy--) { -// if (terrain[x].IsTopBlocks[yy]) { -// BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; - -// if (potencialCactus==BlockId.CactusBig) { -// GetItemsFromBlock((byte)id, x, yy/*,BlockType.Top*/); -// terrain[x].IsTopBlocks[yy]=false; -// terrain[x].TopBlocks[yy]=null; -// } -// } else return; -// } -// } - -// if (id==BlockId.CactusSmall) { - -// // current -// GetItemsFromBlock((byte)id, x, y/*,BlockType.Top*/); -// terrain[x].IsTopBlocks[y]=false; -// terrain[x].TopBlocks[y]=null; - -// //if more -// for (int yy = y-1; yy>=0; yy--) { -// if (terrain[x].IsTopBlocks[yy]) { -// BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; - -// if (potencialCactus==BlockId.CactusSmall) { -// GetItemsFromBlock((byte)id, x, yy/*,BlockType.Top*/); -// terrain[x].IsTopBlocks[yy]=false; -// terrain[x].TopBlocks[yy]=null; -// } -// } else return; -// } -// } -// } -// } - -// void DestroyCactusBig(int x, int y) { -// for (int yy = y-1; yy>=0; yy--) { -// if (terrain[x].IsTopBlocks[yy]) { -// BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; - -// if (potencialCactus==BlockId.CactusBig) { -// GetItemsFromBlock((byte)BlockId.CactusBig, x, yy/*,BlockType.Top*/); -// terrain[x].IsTopBlocks[yy]=false; -// terrain[x].TopBlocks[yy]=null; -// } -// } else return; -// } -// } - -// void DestroyCactusSmall(int x, int y) { -// for (int yy = y-1; yy>=0; yy--) { -// if (terrain[x].IsTopBlocks[yy]) { -// BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; - -// if (potencialCactus==BlockId.CactusSmall) { -// GetItemsFromBlock((byte)BlockId.CactusSmall, x, yy/*,BlockType.Top*/); -// terrain[x].IsTopBlocks[yy]=false; -// terrain[x].TopBlocks[yy]=null; -// } -// } else return; -// } -// } - -// void AutoDestroyLeaves(byte wood, byte leaves) { -// int Xran = terrainStartIndexX+random.Next(terrainStartIndexW-terrainStartIndexX), -// Yran = terrainStartIndexY+random.Next(terrainStartIndexH-terrainStartIndexY); - -// if (terrain[Xran].IsTopBlocks[Yran]) { -// if (terrain[Xran].TopBlocks[Yran].Id==leaves) { - -// //Rectangle -// int startX = Xran-4, startY = Yran-4, endX = Xran+4, endY = Yran+4; - -// //Limit -// if (startX<0) startX=0; -// if (startY<0) startY=0; - -// if (endX>TerrainLenght) endX=TerrainLenght; -// if (endY>120) endY=120; - -// if (IsNotNearWood(wood, startX, startY, endX, endY)) { -// GetItemsFromBlock(leaves, Xran, Yran/*,BlockType.Top*/); -// terrain[Xran].IsTopBlocks[Yran]=false; -// terrain[Xran].TopBlocks[Yran]=null; -// } -// } -// } -// } - -// void AutoDestroyLeaves(byte wood, byte leaves, byte alternativeLeaves) { -// int Xran = terrainStartIndexX+random.Next(terrainStartIndexW-terrainStartIndexX), -// Yran = terrainStartIndexY+random.Next(terrainStartIndexH-terrainStartIndexY); - -// if (terrain[Xran].IsTopBlocks[Yran]) { -// if (terrain[Xran].TopBlocks[Yran].Id==leaves||terrain[Xran].TopBlocks[Yran].Id==alternativeLeaves) { - -// //Rectangle -// int startX = Xran-4, startY = Yran-4, endX = Xran+4, endY = Yran+4; - -// //Limit -// if (startX<0) startX=0; -// if (startY<0) startY=0; - -// if (endX>TerrainLenght) endX=TerrainLenght; -// if (endY>120) endY=120; - -// if (IsNotNearWood(wood, startX, startY, endX, endY)) { -// if (terrain[Xran].TopBlocks[Yran].Id==leaves) GetItemsFromBlock(leaves, Xran, Yran/*,BlockType.Top*/); -// else GetItemsFromBlock(alternativeLeaves, Xran, Yran/*,BlockType.Top*/); - -// terrain[Xran].IsTopBlocks[Yran]=false; -// terrain[Xran].TopBlocks[Yran]=null; -// } -// } -// } -// } - -// bool IsNotNearWood(byte wood, int startX, int startY, int endX, int endY) { -// for (int x = startX; x backBlocks=new List(); -// // List solidBlocks= new List(); -// // List topBlocks= new List(); - -// // byte backblockzeros=0; -// // byte topblockzeros = 0; -// // byte solidblockzeros = 0; - -// // for (int i=0; i<125; i++) { - -// // // Back blocks -// // if (terrain[pos].IsBackground[i]) { - -// // if (backblockzeros!=0) { -// // if (backblockzeros>2){ -// // backBlocks.Add(1); -// // backBlocks.Add(backblockzeros); -// // } else{ -// // for (int j=0; j2) { -// // solidBlocks.Add(1); -// // solidBlocks.Add(solidblockzeros); -// // } else { -// // for (int j = 0; j2) { -// // topBlocks.Add(1); -// // topBlocks.Add(topblockzeros); -// // }else { -// // for (int j = 0; j inv=((ShelfBlock)terrain[pos].TopBlocks[i]).Inv; - -// // foreach (DInt d in inv){ -// // topBlocks.Add((byte)d.X); -// // topBlocks.Add((byte)d.Y); -// // } -// // } else if (id==(byte)BlockId.BoxWooden) { -// // List inv=((BoxBlock)terrain[pos].TopBlocks[i]).Inv; - - -// // foreach (DInt d in inv){ -// // topBlocks.Add((byte)d.X); -// // topBlocks.Add((byte)d.Y); -// // } -// // } else if (id==(byte)BlockId.BoxAdv) { -// // List inv=((BoxBlock)terrain[pos].TopBlocks[i]).Inv; - -// // foreach (DInt d in inv){ -// // topBlocks.Add((byte)d.X); -// // topBlocks.Add((byte)d.Y); -// // } -// // } -// // } else { -// // topblockzeros++; -// // } -// // } - -// // if (backblockzeros>2) { -// // backBlocks.Add(1); -// // backBlocks.Add(backblockzeros); -// // }else{ -// // for (int j = 0; j2) { -// // solidBlocks.Add(1); -// // solidBlocks.Add(solidblockzeros); -// // } else { -// // for (int j = 0; j2) { -// // topBlocks.Add(1); -// // topBlocks.Add(topblockzeros); -// // } else { -// // for (int j = 0; j plants=new List(); -// // foreach (Plant m in terrain[pos].Plants) { -// // plants.Add(m.Id); -// // plants.Add(m.Height); -// // plants.Add(m.Grow); -// // } - -// // List mobs = new List(); -// // foreach (Mob m in terrain[pos].Mobs) { -// // mobs.Add(m.Id); -// // mobs.Add((byte)(m.Position.Y/16)); -// // mobs.Add(m.Lives); -// // mobs.Add(m.Dir ? (byte)1 : (byte)0); -// // } - - -// // stream.WriteByte(terrain[pos].LightPos); - -// // stream.Write(backBlocks.ToArray(),0,backBlocks.ToArray().Length); -// // stream.Write(solidBlocks.ToArray(),0,solidBlocks.ToArray().Length); -// // stream.Write(topBlocks.ToArray(),0,topBlocks.ToArray().Length); - -// // stream.Write(plants.ToArray(),0,plants.ToArray().Length); -// // stream.WriteByte(1); -// // stream.Write(mobs.ToArray(),0,mobs.ToArray().Length); -// // } -// //} - -// //void Load(int pos) { -// // if (File.Exists(playedWorld+ @"Earth\Terrain ["+pos+"].rch")) { -// // using (StreamReader sr = new StreamReader(playedWorld+ @"Earth\Terrain ["+pos+"].rch")) { -// // BinaryReader br = new BinaryReader(sr.BaseStream); - -// // // terrain[pos] -// // MTerrain chunk=terrain[pos]=new MTerrain(){ -// // LightPos=br.ReadByte(), -// // }; -// // chunk.LightVec=new Vector2(pos*16-48+8,chunk. LightPos*16-48+8); -// // chunk.LightPos16=chunk.LightPos*16; -// // int ss=125; - -// // //0=nic -// // //1=připrav se, další byte o přeskočení - -// // //BackBlocks -// // for (int lenght=0; lenght<125; lenght++) { -// // byte input = br.ReadByte(); - -// // if (input>1){ -// // Block block=BackBlockFromId(input, new Vector2(pos*16, lenght*16)); -// // if (block!=null){ -// // if (ss>lenght) ss=lenght; -// // chunk.Background[lenght]=block; -// // chunk.IsBackground[lenght]=true; -// // } -// // } else if (input==1) lenght+=br.ReadByte()-1; -// // } - -// // // SolidBlocks -// // for (int lenght=0; lenght<125; lenght++) { -// // byte input = br.ReadByte(); - -// // if (input>1){ -// // Block block=SolidBlockFromId(input, new Vector2(pos*16, lenght*16)); -// // if (block!=null){ -// // if (ss>lenght) ss=lenght; -// // chunk.SolidBlocks[lenght]=block; -// // chunk.IsSolidBlocks[lenght]=true; -// // } -// // } else if (input==1)lenght+=br.ReadByte()-1; -// // } - -// // // TopBlocks -// // for (int lenght=0; lenght<125; lenght++) { -// // byte input = br.ReadByte(); - -// // if (input>1){ -// // Block block=TopBlockFromId(input, new Vector2(pos*16, lenght*16)); -// // if (block!=null){ -// // if (ss>lenght) ss=lenght; - -// // chunk.IsTopBlocks[lenght]=true; -// // chunk.TopBlocks[lenght]=block; - -// // if (input==(int)BlockId.Label) { -// // SetIndexLabel(pos, lenght); -// // if (lenght!=0 && lenght!=125) RefreshAroundLabels(pos, lenght); -// // } else if (input==(int)BlockId.FurnaceStone) { -// // ((MashineBlockBasic)block).Inv=new List(){ -// // // Wood -// // new DInt(br.ReadByte(),br.ReadByte()), -// // new DInt(br.ReadByte(),br.ReadByte()), -// // new DInt(br.ReadByte(),br.ReadByte()), - -// // //Ash -// // new DInt(br.ReadByte(),br.ReadByte()), -// // }; - -// // //Energy -// // ((MashineBlockBasic)block).Energy=br.ReadByte()/255f; -// // } else if (input==(int)BlockId.Shelf) { -// // ((ShelfBlock)block).Inv=new List(){ -// // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), -// // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), -// // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), -// // }; - -// // if (((ShelfBlock)block).Inv[4].X!=0){ -// // Texture2D tex=ItemIdToTexture(((ShelfBlock)block).Inv[4].X); -// // if (text!=null){ -// // ((ShelfBlock)block).SmalItemTexture=tex; -// // ((ShelfBlock)block).IsSmallItem=true; -// // } -// // } -// // } else if (input==(int)BlockId.BoxWooden) { -// // ((BoxBlock)block).Inv=new List(); -// // for (int i=0; i<2*12;i++)((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(),br.ReadByte())); - -// // }else if (input==(int)BlockId.BoxAdv) { -// // ((BoxBlock)block).Inv=new List(); -// // for (int i=0; i<4*14;i++)((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(),br.ReadByte())); -// // } -// // } -// // } else if (input==1) lenght+=br.ReadByte()-1; -// // } - -// // { -// // for (int i=0; i<64;i++){ -// // if (br.BaseStream.Position==br.BaseStream.Length)break; -// // byte input=br.ReadByte(); -// // if (input==1)break; - -// // Plant plant=GetPlantFromId(input, br.ReadByte(),br.ReadByte(),pos); -// // if (plant!=null)chunk.Plants.Add(plant); - -// // } - -// // for (int i=0; i<64;i++){ -// // if (sr.BaseStream.Position==sr.BaseStream.Length)break; -// // byte input=br.ReadByte(); -// // if (input==1)break; - -// // switch ((BlockId)input) { -// // case BlockId.Fish: -// // chunk.Mobs.Add(new Fish(input,br.ReadByte(), br.ReadByte(), pos,br.ReadByte()==1, fishTexture0, fishTexture1, random)); -// // break; - -// // case BlockId.Chicken: -// // chunk.Mobs.Add(new Chicken(input, br.ReadByte(),br.ReadByte(), pos, br.ReadByte()==1, chickenWalkTexture, chickenEatTexture, random)); -// // break; - -// // case BlockId.Rabbit: -// // chunk.Mobs.Add(new Rabbit(input,br.ReadByte(), br.ReadByte(), pos, br.ReadByte()==1, rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture, random)); -// // break; -// // } -// // } -// // } - -// // // (byte)sr.ReadByte(); - -// // chunk.StartSomething=ss; -// // } -// // } -// //} - -// void LoadFromBytes(byte[] bytes, int pos) { -// using (MemoryStream sr = new MemoryStream(bytes)) { -// BinaryReader br = new BinaryReader(sr); - -// // terrain[pos] -// MTerrain chunk = terrain[pos]; -// chunk.LightPos=br.ReadByte(); -// // Console.WriteLine("v "+chunk.LightPos); -// chunk.LightVec=new Vector2(pos*16-48+8, chunk.LightPos*16-48+8+48); -// chunk.LightPos16=chunk.LightPos*16; - -// int ss = 125; - -// //0=nic -// //1=připrav se, další byte o přeskočení - -// //BackBlocks -// for (int lenght = 0; lenght<125; lenght++) { -// byte input = br.ReadByte(); - -// if (input>1) { -// Block block = BackBlockFromId(input, new Vector2(pos*16, lenght*16)); -// if (block!=null) { -// if (ss>lenght) ss=lenght; -// chunk.Background[lenght]=block; -// chunk.IsBackground[lenght]=true; -// } -// } else if (input==1) lenght+=br.ReadByte()-1; -// } - -// // SolidBlocks -// for (int lenght = 0; lenght<125; lenght++) { -// byte input = br.ReadByte(); - -// if (input>1) { -// Block block = SolidBlockFromId(input, new Vector2(pos*16, lenght*16)); -// if (block!=null) { -// if (ss>lenght) ss=lenght; -// chunk.SolidBlocks[lenght]=block; -// chunk.IsSolidBlocks[lenght]=true; -// } -// } else if (input==1) lenght+=br.ReadByte()-1; -// } - -// // TopBlocks -// for (int lenght = 0; lenght<125; lenght++) { -// byte input = br.ReadByte(); - -// if (input>1) { -// Block block = TopBlockFromId(input, new Vector2(pos*16, lenght*16)); -// if (block!=null) { -// if (ss>lenght) ss=lenght; - -// chunk.IsTopBlocks[lenght]=true; -// chunk.TopBlocks[lenght]=block; - -// if (input==(int)BlockId.Label) { -// SetIndexLabel(pos, lenght); -// if (lenght!=0&&lenght!=125) RefreshAroundLabels(pos, lenght); -// } else if (input==(int)BlockId.FurnaceStone) { -// ((MashineBlockBasic)block).Inv=new List(){ -// // Wood -// new DInt(br.ReadByte(),br.ReadByte()), -// new DInt(br.ReadByte(),br.ReadByte()), -// new DInt(br.ReadByte(),br.ReadByte()), - -// //Ash -// new DInt(br.ReadByte(),br.ReadByte()), -// }; - -// //Energy -// ((MashineBlockBasic)block).Energy=br.ReadByte()/255f; -// } else if (input==(int)BlockId.Shelf) { -// ((ShelfBlock)block).Inv=new List(){ -// new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), -// new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), -// new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), -// }; - -// if (((ShelfBlock)block).Inv[4].X!=0) { -// Texture2D tex = ItemIdToTexture(((ShelfBlock)block).Inv[4].X); -// if (text!=null) { -// ((ShelfBlock)block).SmalItemTexture=tex; -// ((ShelfBlock)block).IsSmallItem=true; -// } -// } -// } else if (input==(int)BlockId.BoxWooden) { -// ((BoxBlock)block).Inv=new List(); -// for (int i = 0; i<2*12; i++) ((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(), br.ReadByte())); - -// } else if (input==(int)BlockId.BoxAdv) { -// ((BoxBlock)block).Inv=new List(); -// for (int i = 0; i<4*14; i++) ((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(), br.ReadByte())); -// } -// } -// } else if (input==1) lenght+=br.ReadByte()-1; -// } - -// { -// for (int i = 0; i<64; i++) { -// if (br.BaseStream.Position==br.BaseStream.Length) break; -// byte input = br.ReadByte(); -// if (input==1) break; - -// Plant plant = GetPlantFromId(input, br.ReadByte(), br.ReadByte(), (short)pos); -// if (plant!=null) chunk.Plants.Add(plant); - -// } - -// for (int i = 0; i<64; i++) { -// if (sr.Position==sr.Length) break; -// byte input = br.ReadByte(); -// if (input==1) break; - -// switch ((BlockId)input) { -// case BlockId.Fish: -// chunk.Mobs.Add(new Fish(input, br.ReadByte(), /*br.ReadByte(),*/ pos, br.ReadByte()==1, fishTexture0, fishTexture1)); -// break; - -// case BlockId.Chicken: -// chunk.Mobs.Add(new Chicken(input, br.ReadByte(),/*br.ReadByte(),*/ pos, br.ReadByte()==1, chickenWalkTexture, chickenEatTexture)); -// break; - -// case BlockId.Rabbit: -// chunk.Mobs.Add(new Rabbit(input, br.ReadByte(), /*br.ReadByte(),*/ pos, br.ReadByte()==1, rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture)); -// break; -// } -// } -// } - -// chunk.StartSomething=(byte)ss; -// chunk.state=MChunkState.Downloaded; -// // terrain[pos]=chunk; -// } -// } - - -// void RefreshLighting(int pos) { -// int LightPos; -// for (LightPos=0; LightPos<125; LightPos++) { -// if (terrain[pos].IsSolidBlocks[LightPos]==MBlockState.Exists) break; -// } - -// if (terrain[pos].LightPos!=(byte)LightPos) { -// terrain[pos].LightPos=(byte)LightPos; -// terrain[pos].LightVec=new Vector2(pos*16-48+8, LightPos*16-48+8+48); -// terrain[pos].LightPos16=LightPos*16; - -// byte StartSomething; -// for (StartSomething=0; StartSomething<125; StartSomething++) { -// if (terrain[pos].IsBackground[StartSomething]==MBlockState.Exists) break; -// if (terrain[pos].IsSolidBlocks[StartSomething]==MBlockState.Exists) break; -// if (terrain[pos].IsTopBlocks[StartSomething]==MBlockState.Exists) break; -// } - -// terrain[pos].StartSomething=StartSomething; -// } -// } - -// #endregion - -// #region Networking -// void SolveErrorDuringGame(int errorCode, string info, string more) { -// if (current==Current.ErrorDuringGame) { -// ShowError(info, more); -// } else { -// // current==Current.ErrorDuringGame -// // Stávající připojení bylo ukončeno vzdáleným hostitelem -// if (errorCode==10054) { -// try { -// clientSocket.Close(); -// clientSocket.Dispose(); -// } catch (Exception ex) { -// Console.WriteLine("SolveErrorDuringGame 1 "+ex.Message); -// } - -// ConnectDuringGameError(); -// } else { -// ShowError(info, more); -// } -// } -// } - -// void SendRemovedBlock(int x, int y, int id, BlockType bt) { -// sendedBlockToRemove.Add(new SendedBlockToRemove { -// blockPos=new DInt(x,y), -// blockType=bt, -// World="Earth", -// sended=DateTime.Now, -// }); - -// switch (bt) { -// case BlockType.Back: -// terrain[x].IsBackground[y]=MBlockState.TmpRemoved; -// break; - -// case BlockType.Solid: -// terrain[x].IsSolidBlocks[y]=MBlockState.TmpRemoved; -// break; - -// case BlockType.Top: -// terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; -// break; - -// case BlockType.Plant: -// terrain[x].Plants.[y]=MBlockState.TmpRemoved; -// break; - -// case BlockType.Mob: -// terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved; -// break; -// } - -// Queue.Add(new DataToSend { -// Importance=Importance.Middle, -// Bytes=new Data { -// Cmd=Command.EditTerrain, -// From=Setting.Name, -// To=toServer, -// Message="-|"+x+"|"+y+"|"+world+"|"+(int)BlockType.Top+"|"+id+"|", -// }.ToByte(), -// }); -// } - -// void DoCommand() { -// if (!text.StartsWith("*")) return; - -// string[] word = text.Split(' '); -// word[0]=word[0].ToLower(); - -// switch (word[0]) { -// case "*spawn": -// if (tpSpawn) { -// if (word.Length==1) { -// PlayerX=spawnX; -// PlayerY=spawnY; -// DisplayText("Byl jsi teleportován na spawn"); -// } else DisplayText("Za příkaz *spawn nic nepište"); -// } else DisplayText("Na tento příkaz namáte oprávnění"); -// return; - -// case "*ping": -// if (cmdPing) { -// if (word.Length==1) { -// DisplayText("Počkejte chviličku..."); -// diserpeard=250; -// Data msg = new Data { -// Cmd=Command.Request, -// // From=Setting.Name, -// To=toServer, -// }; -// Queue.Add(new DataToSend { -// Bytes=msg.ToByte(), -// Importance=Importance.VeryImportant -// }); -// } -// } -// DisplayText("Na tento příkaz namáte oprávnění"); -// return; - -// case "*players": -// if (word.Length==1) { -// string t = ""; -// foreach (Player p in players) t+=p.name+", "; - -// DisplayText(t); -// } -// return; - -// case "*help": -// if (word.Length==1) { -// string t = "players, help, "; -// if (tpSpawn) t+="spawn, "; -// if (cmdPing) t+="ping, "; -// if (tpPlayer) t+="tp, "; -// DisplayText(t); -// } -// return; - -// //case "*web": -// // if (cmdWeb){ -// // if (word.Length==1) { -// // System.Diagnostics.Process.Start(web); -// // DisplayText("Otevírá se..."+web); -// // } -// // } else DisplayText("Na tento příkaz namáte oprávnění"); -// // return; - - -// case "*tp": -// if (tpPlayer) { -// if (word.Length==2) { -// bool notExists = true; - -// foreach (Player p in players) { -// if (word[1]==p.name) { -// notExists=false; - -// if (tpPlayerMessage) { - -// Data msg = new Data { -// Cmd=Command.PlayersTeleportMessageToTarget, -// // From=Setting.Name, -// To=toServer, -// Message="3|"+p.name, -// }; - -// Queue.Add(new DataToSend { -// Bytes=msg.ToByte(), -// Importance=Importance.High -// }); -// tpPlayerTime=DateTime.Now; - -// DisplayText("Odesílám požadavek o teleportaci ..."); -// tpPlayerMsgWaiting=p.name; -// return; -// } else { -// PlayerX=p.x; -// PlayerY=p.y; -// DisplayText("Teleportace úspěštná"); -// return; -// } -// } - -// if (notExists) { -// DisplayText("Hráč nenelezen"); -// } -// } -// } -// } else if (tpEverywhere) { -// if (word.Length==3) { -// if (int.TryParse(word[1], out int x)) { -// if (int.TryParse(word[2], out int y)) { -// PlayerX=x; -// PlayerY=y; -// } else { -// DisplayText("Použití: \"*tp \"; y je číslo"); -// } -// } else { -// if (int.TryParse(word[2], out int y)) { -// DisplayText("Použití: \"*tp \"; x je číslo"); -// } else { -// DisplayText("Použití: \"*tp \"; x a y je číslo"); -// } -// } -// } -// } else { -// DisplayText("Na tento příkaz namáte oprávnění"); -// } -// return; - -// case "*warp-set": -// if (word.Length==2) { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*warp-set "+word[1]+" "+PlayerX+" "+PlayerY, -// }.ToByte(), -// Importance=Importance.Middle -// }); -// DisplayText("Nastavuji warp "+word[1]); -// } -// break; - -// case "*warp": -// if (word.Length==2) { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*warp "+word[1], -// }.ToByte(), -// Importance=Importance.Middle -// }); -// } -// break; - -// case "*kick": -// if (word.Length==2) { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*kick "+word[1], -// }.ToByte(), -// Importance=Importance.Middle -// }); -// } -// break; - -// case "*ban": -// if (word.Length==2) { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*ban "+word[1], -// }.ToByte(), -// Importance=Importance.Middle -// }); -// } -// break; - -// case "*unban": -// if (word.Length==2) { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*unban "+word[1], -// }.ToByte(), -// Importance=Importance.Middle -// }); -// } -// break; - -// case "*warp-remove": -// if (word.Length==2) { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*warp-remove "+word[1], -// }.ToByte(), -// Importance=Importance.Middle -// }); -// } -// break; - -// case "*group-set": -// if (word.Length==3) { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*group-set "+word[1]+" "+word[2], -// }.ToByte(), -// Importance=Importance.Middle -// }); -// } -// break; - -// case "*itemsclear": -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*itemsclear", -// }.ToByte(), -// Importance=Importance.Middle -// }); -// break; - -// case "*server-backup": -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*server-backup", -// }.ToByte(), -// Importance=Importance.Middle -// }); -// break; - -// case "*server-reset": -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*server-reset", -// }.ToByte(), -// Importance=Importance.Middle -// }); -// break; - -// case "*server-end": -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*server-end", -// }.ToByte(), -// Importance=Importance.Middle -// }); -// break; - -// case "*changepassword": -// password=new Password(); -// password.Show(); -// break; - -// case "*spawn-set": -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*spawn-set "+PlayerX+" "+PlayerY, -// }.ToByte(), -// Importance=Importance.Middle -// }); -// break; - -// case "*gamemode": -// if (word.Length==2) { -// if (word[1]=="Dobrodružná"||word[1]=="Výzkum"||word[1]=="Kreativní" -// ||word[1]=="0"||word[1]=="1"||word[1]=="2" -// ||word[1]=="d"||word[1]=="v"||word[1]=="k") { -// Queue.Add(new DataToSend { -// Bytes=new Data { -// Cmd=Command.Message, -// // From=Setting.Name, -// To=toServer, -// Message="*gamemode "+word[1], -// }.ToByte(), -// Importance=Importance.Middle -// }); -// } else DisplayText("Neplatný příkaz, zkus \"*help\""); -// } -// break; - -// default: -// DisplayText("Neplatný příkaz, zkus \"*help\""); -// return; -// } -// } - -// void OnCheck(IAsyncResult ar) { -// try { -// state++; -// clientSocket.EndConnect(ar); - -// Data msgToSend = new Data { -// Cmd=Command.Check, -// // From=Setting.Name, -// To=toServer, -// Message="" -// }; - -// byteData=msgToSend.ToByte(); - -// clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); - -// byteData=new byte[1024]; - -// clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null); - -// //current=Current.EndChecking; -// state++; -// } catch (SocketException ex) { - -// //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl -// if (10061==ex.ErrorCode) { -// ShowError("Nelze se připojit k serveru", "Žádný server není spuštěn na adrese "+ip+":"+port); -// } else { -// //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel -// if (10060==ex.ErrorCode) { -// ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho."); -// } else if (10013==ex.ErrorCode) { -// ShowError("Nelze se připojit k serveru", "Pravděpodobně Váš firewall blokuje připojení (Zkuste ho vypnout)"); -// } else ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnCheck: "+ex.Message+"; Kód: "+ex.ErrorCode); -// } -// } - -// //if (!Global.OnlineAccount){ -// // string url="https://geftgames.ga/System/rabcr/ifplayerexists.php?username="+Setting.Name; -// // MyWebClient wc=new MyWebClient { -// // Encoding=Encoding.UTF8, -// // }; -// // try{ -// // string get=wc.DownloadString(new Uri(url)); -// // Console.WriteLine(6); -// // if (string.IsNullOrEmpty(get)) { -// // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); -// // } else { -// // string[]g=get.Split('|'); - -// // if (g.Length>1){ -// // switch (g[0]) { -// // case "E": - -// // break; - -// // case "O": -// // //ok -// // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá"); -// // break; - -// // default: -// // // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá"); -// // break; -// // } -// // } else { -// // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); -// // } -// // } -// // }catch{ -// // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); -// // } -// //} - -// } - -// void OnConnectDuringGameError(IAsyncResult ar) { - -// try { - -// clientSocket.EndConnect(ar); - -// Data msgToSend = new Data { -// Cmd=Command.ConnectDuringGame, -// // From=Setting.Name, -// To=toServer, -// Message="" -// }; - -// byteData=msgToSend.ToByte(); -// clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); - -// byteData=new byte[1024]; -// clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null); - -// //current=Current.EndChecking; -// state++; -// } catch (SocketException ex) { - -// //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl -// if (10061==ex.ErrorCode) { -// ShowError("Nelze se připojit k serveru", "Pravděpodobně není spuštěn server."); -// } else { -// //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel -// if (10060==ex.ErrorCode) { -// ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho."); -// } else { -// ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnConnectDuringGameError: "+ex.Message); -// } -// } -// } -// } - -// void OnSend(IAsyncResult ar) { -// try { -// // clientSocket.Connected -// //Process=0.55f; -// clientSocket.EndSend(ar); -// //Process=1f; -// //ready=true; -// //Loading=false; -// } catch (SocketException ex) { -// //Console.WriteLine(ex.ErrorCode+" 2 "+ex.Message); -// ////Process=1f; -// //ready=true; -// //Error=true; -// //ErrorCode=ex.Message; -// if (!exit) ShowError("Nelze odeslat sáček", ""+ex.Message); -// } -// // Console.WriteLine("send"); -// } - -// void SendEveryone(string text) { -// try { -// //Fill the info for the message to be send -// Data msgToSend = new Data { -// //Console.WriteLine(text); -// // From=Setting.Name, -// To=toEveryone, -// Message=text, -// Cmd=Command.Message -// }; - -// //byte[] byteData = -// Queue.Add(new DataToSend { -// Bytes=msgToSend.ToByte(), -// Importance=Importance.High -// }); -// //Send it to the server -// //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSendAfter), null); -// // Console.WriteLine("sending: "+System.Text.Encoding.UTF8.GetString(byteData)); -// // txtMessage.Text = null; -// } catch (Exception) { -// //Console.WriteLine("Unable to send message to the server."); -// } -// } - -// //void OnSendAfter(IAsyncResult ar) { -// // try { -// // clientSocket.EndSend(ar); -// // } catch (ObjectDisposedException) { - - -// // } catch/* (Exception ex)*/ { -// // //Console.WriteLine(ex.Message); -// // } -// //} - -// void OnReceive(IAsyncResult ar) { -// // Console.WriteLine("rec"); -// try { -// clientSocket.EndReceive(ar); -// } catch (Exception ex) { -// if (ex.HResult==10054) { -// //ShowError("Spojení bylo přerušeno", ex.Message); -// //clientSocket.Shutdown(new SocketShutdown()); -// //clientSocket.Close(); -// //clientSocket.Dispose(); -// if (!exit) SolveErrorDuringGame(ex.HResult, "", ""); -// return; -// } else { -// Console.WriteLine(ex.Message+" rec1"); -// } -// } - -// Data msgReceived = new Data(byteData); -// msgReceived.Talk(); - -// switch (msgReceived.Cmd) { -// case Command.SendingWorldData: { -// if (msgReceived.terrain!=null) { -// if (msgReceived.terrain.Length>2) { -// LoadFromBytes(msgReceived.terrain, msgReceived.pos); - -// if (current==Current.GettingSpawn) { -// if (downloadedSpawnArea bytes = new List(); -// if (strs.Length==5) { -// if (strs[4]!="") { -// foreach (string s in strs[4].Split(',')) { -// bytes.Add(byte.Parse(s)); -// } -// } -// } -// if (strs[0]=="+") { -// int x = int.Parse(strs[1]), -// y = int.Parse(strs[2]); -// if (terrain[x]==null) break; -// byte id = byte.Parse(strs[3]); -// bool stay = true; - -// { -// Block b = SolidBlockFromId(id, new Vector2(x, y)); -// if (b!=null) { -// if (terrain[x].IsSolidBlocks[y]) GetItemsFromBlock(id, x, y); -// terrain[x].IsSolidBlocks[y]=true; -// terrain[x].SolidBlocks[y]=b; -// stay=false; -// } -// } -// if (stay) { -// Block b = TopBlockFromId(id, new Vector2(x, y)); -// if (b!=null) { -// if (terrain[x].IsTopBlocks[y]) GetItemsFromBlock(id, x, y); -// terrain[x].IsTopBlocks[y]=true; -// terrain[x].TopBlocks[y]=b; -// stay=false; -// } -// } -// if (stay) { -// Block b = BackBlockFromId(id, new Vector2(x, y)); -// if (b!=null) { -// if (terrain[x].IsBackground[y]) GetItemsFromBlock(id, x, y); -// terrain[x].IsBackground[y]=true; -// terrain[x].Background[y]=null; -// stay=false; -// } -// } - -// if (stay) { -// Plant p = GetPlantFromId(id, (byte)y,/*?*/255, (short)x); -// if (p!=null) { -// foreach (Plant px in terrain[x].Plants) { -// if (px.Height==y) { -// GetItemsFromPlant(id, new DInt(x, y), px.Grow==255); -// terrain[x].Plants.Remove(px); -// break; -// } -// } -// stay=false; -// terrain[x].Plants.Add(p); -// } -// } - - -// //if (stay) { -// // Block b=ani(id,new Vector2(x,y)); -// // if (b!=null) { -// // foreach (Mob m in terrain[x].Mobs) { -// // if (m.Height==y) { -// // if (m.Id==id) {GetItemsFromBlock(id,new DInt(x,y)); -// // terrain[x].Mobs.Remove(m); -// // stay=false; -// // break; -// // } -// // } -// // } -// //} -// } else { -// int x = int.Parse(strs[1]), -// y = int.Parse(strs[2]); -// if (terrain[x]==null) break; -// byte id = byte.Parse(strs[3]); -// bool stay = true; - -// if (terrain[x].IsSolidBlocks[y]) { -// if (terrain[x].SolidBlocks[y].Id==id) { -// terrain[x].IsSolidBlocks[y]=false; -// terrain[x].SolidBlocks[y]=null; -// stay=false; -// } -// } -// if (stay) { -// if (terrain[x].IsTopBlocks[y]) { -// if (terrain[x].TopBlocks[y].Id==id) { -// terrain[x].IsTopBlocks[y]=false; -// terrain[x].TopBlocks[y]=null; -// stay=false; -// } -// } -// } -// if (stay) { -// if (terrain[x].IsBackground[y]) { -// if (terrain[x].Background[y].Id==id) { -// terrain[x].IsBackground[y]=false; -// terrain[x].Background[y]=null; -// stay=false; -// } -// } -// } - -// if (stay) { -// foreach (Plant p in terrain[x].Plants) { -// if (p.Height==y) { -// if (p.Id==id) { -// terrain[x].Plants.Remove(p); -// stay=false; -// break; -// } -// } -// } -// } -// if (stay) { -// foreach (Mob m in terrain[x].Mobs) { -// if (m.Height==y) { -// if (m.Id==id) { -// terrain[x].Mobs.Remove(m); -// stay=false; -// break; -// } -// } -// } -// } -// } -// } -// } -// } -// break; - -// case Command.PostLogin: { -// if (msgReceived.Message!=null) { -// string[] strs = msgReceived.Message.Split('|'); -// if (strs.Length>0) { -// if (strs[0]=="0") { -// // Console.WriteLine("Wrong password!"); -// System.Windows.Forms.MessageBox.Show("Špatné heslo", "Pro připojení k serveru je potřeba zadat správné heslo"); -// // System.Windows.Forms.MessageBox.Show("Zadali jste špatné heslo","Špatné heslo"); -// clientSocket.Disconnect(false); -// // Rabcr.GoTo(new MenuMultiplayer()); -// } else if (strs[0]=="1") { -// //Console.WriteLine("Setting vars"); - -// TerrainLenght=int.Parse(strs[1]); -// terrain=new MTerrain[TerrainLenght]; -// Console.WriteLine(TerrainLenght+" len"); - -// for (int c = 0; c0) { -// // switch (strs[0]) { -// // case "0": -// // if (strs.Length==3) { -// // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]+Environment.NewLine+"zkuste tento web: "+strs[2]); -// // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); -// // break; - -// // case "1": -// // if (strs.Length==2) { -// // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]); -// // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); -// // break; - -// // case "2": -// // if (strs.Length==4) { -// // int x = int.Parse(strs[0]); -// // int y = int.Parse(strs[1]); -// // string password = strs[2]; -// // int type = int.Parse(strs[3]); - -// // if (password!="") { -// // chp=new CheckPassword(); -// // chp.Show(); -// // waitingPassword=true; -// // this.password=password; -// // } -// // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]); -// // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); -// // break; - -// // case "3": -// // if (strs.Length==2) { -// // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství"+Environment.NewLine+strs[1]); -// // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); -// // break; - -// // case "4": -// // if (strs.Length==1) { -// // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství"); -// // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); -// // break; - -// // case "5": - -// // break; -// // } -// //} - -// //int.TryParse(strs[1], out spawnX); -// //int.TryParse(strs[2], out spawnY); -// //int.TryParse(strs[3], out safeSpawn); - -// //PlayerX=spawnX; -// //PlayerY=spawnY; - -// //SendMsgTerrain(); -// state++; -// } -// break; - -// //case Command.Logout: -// // clientSocket.Disconnect(false); -// // break; - -// case Command.PlayersTeleportMessageToSource: { -// if (!string.IsNullOrEmpty(msgReceived.Message)) { -// string[] strs = msgReceived.Message.Split('|'); - -// if (int.TryParse(strs[0], out int num)) { -// if (num==1) { -// //DisplayText("Vaše žádost byla zamítnuta"); -// } -// if (num==2) { -// if ((DateTime.Now-tpPlayerTime.Date).TotalMinutes<=2) { -// foreach (Player p in players) { -// if (tpPlayerMsgWaiting==p.name) { -// // DisplayText("Teleportuji..."); -// text="Teleportuji..."; -// PlayerX=p.x; -// PlayerY=p.y; -// break; -// } -// } -// } -// } -// if (num==3) { -// if (strs[1]==Setting.Name) { -// //SomeoneWantTeleportToYou=true; -// SomeoneWantTeleportToYouName=msgReceived.From; -// gedo.BuildString("Hráč "+SomeoneWantTeleportToYouName+" se chce k vám teleportovat.\r\nPoužij \"*tp-allow\" pro přijení nebo \"*tp-deny\" pro zamítnutí."); -// diserpeard=255; -// } -// } -// } -// } -// } -// break; - -// case Command.Message: -// if (msgReceived.Message!=null||msgReceived.Message!="") { -// if (msgReceived.Message.StartsWith("*")) { -// string[] word = msgReceived.Message.Split(' '); -// switch (word[0]) { -// case "*setplayerpos": -// if (word.Length==3) { -// PlayerX=int.Parse(word[1]); -// PlayerY=int.Parse(word[2]); -// DisplayText("Teleportuji..."); -// SetPlayerPos(PlayerX, PlayerY); -// } -// break; - -// case "*spawnwaschanged": -// spawnX=int.Parse(word[1]); -// spawnY=int.Parse(word[2]); -// break; - -// case "*int-set": { -// int count = int.Parse(word[1]); - -// List tmpInv = new List(); - -// for (int i = 0; i tmpInv = new List(); - -// for (int i = 0; i"+msgReceived.cmdCommand.ToString()+"<>"+msgReceived.strMessage); -// //} else Console.WriteLine("!jméno "+msgReceived.strName); -// break; - -// case Command.Request: { -// Data msg = new Data { -// Cmd=Command.Request, -// // From=Setting.Name, -// To=toServer, -// Message="" -// }; -// //byteData=new byte[1024]; -// //byteData=msg.ToByte(); - -// //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); -// Queue.Add(new DataToSend { -// Bytes=msg.ToByte(), -// Importance=Importance.VeryImportant -// }); -// } -// break; - -// case Command.Check: { -// state++; -// string[] get = msgReceived.Message.Split('|'); - -// if (get.Length>0) { -// maxplayers=int.Parse(get[1]); -// joinedPlayers=int.Parse(get[2]); -// string version = get[3]; -// //smd=true; -// if (version==Version.This) { -// Data msg = new Data { -// Cmd=Command.Login, -// // From=Setting.Name, -// To=toServer, -// //Message=Setting.Name -// }; -// //byteData=msg.ToByte(); -// current=Current.EndChecking; -// //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); -// Queue.Add(new DataToSend { -// Bytes=msg.ToByte(), -// Importance=Importance.VeryImportant -// }); -// } else { -// ShowError("Jiná verze serveru", "Verze serveru ("+version+") je rozdílná od verze hry."); -// } -// } else { -// ShowError("Chyba sáčku", "Hra obdržela od serveru prázdný soubor s informacemi."); -// } -// // Console.WriteLine(msgReceived.strMessage); -// //string _new =msgReceived.strMessage; -// //string version=_new.Substring(_new.LastIndexOf("|")+1); -// //_new=_new.Substring(0,_new.LastIndexOf("|")); -// //int.TryParse(_new.Substring(_new.LastIndexOf("|")+1),out maxplayers); -// //_new=_new.Substring(0,_new.LastIndexOf("|")); -// //int.TryParse(_new.Substring(_new.LastIndexOf("|")+1),out joinedPlayers); -// //_new=_new.Substring(0,_new.LastIndexOf("|")); -// //Console.WriteLine("sdfgdfgfdf"); -// //if -// // if (joinedPlayersJejda tento příkaz není povolen (zkus *help)"); -// } - -// void ShowError(string main, string toShow) { -// Error=true; -// ErrorHeader=main; -// ErrorText=toShow; -// current=Current.ErrorDuringGame; -// } - -// void DisplayText(string s) { -// diserpeard=250; -// if (gedo==null) gedo=new GeDo(spriteFont_small,/*spriteFont_small_italic,*/s/*,false*/); -// else gedo.BuildString(text); -// text=""; - -// } - -// string TextEdit(string editText) { -// string newKey = Add(); - -// string add; - -// if (newKeyboardState.IsKeyDown(Keys.RightAlt)||newKeyboardState.IsKeyDown(Keys.LeftAlt)) add=ConvertNormalToAtls(newKey); -// else if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) add=ConvertNormalToUpper(newKey); -// else if (newKeyboardState.IsKeyDown(Keys.LeftControl)||newKeyboardState.IsKeyDown(Keys.RightControl)) add=ConvertNormalToCtrls(newKey); -// else add=newKey; - -// if (newKey=="") { -// hold=false; -// timeHold=30; -// } else { -// if (hold) { -// switch (add) { -// //case "Delete": -// // if (editText.Length > 4) editText = editText.Substring(0, editText.Length - 5); else editText = ""; -// // break; - -// case "Delete": -// if (editText.Length>0) editText=editText.Substring(0, editText.Length-1); /*else editText = "";*/ -// break; - -// case "Copy": -// if (editText!=""&&editText!=null) System.Windows.Forms.Clipboard.SetText(editText); -// break; - -// case "Paste": -// if (System.Windows.Forms.Clipboard.ContainsText()) editText+=System.Windows.Forms.Clipboard.GetText(); -// break; - -// //case "§": -// // break; - -// //case "Remove": -// // editText = ""; -// // break; - -// // case "Double": -// // editText += editText; -// // break; -// // case "Quick": -// // editText += "RabigonCraft The most of my World"; -// // break; - -// //case "Alt": -// // olderKey = "Alt"; -// // break; - -// default: -// editText+=add; -// break; -// } -// } else { -// if (timeHold==0) hold=true; -// else { -// if (lastKey==newKey) { -// if (timeHold==30) { -// switch (add) { -// //case "Delete": -// // if (editText.Length>4) editText=editText.Substring(0,editText.Length-5); else editText=""; -// // break; - -// case "Delete": -// if (editText.Length>0) editText=editText.Substring(0, editText.Length-1); /*else editText="";*/ -// break; - -// case "Copy": -// if (editText!="") System.Windows.Forms.Clipboard.SetText(editText); -// break; - -// case "Paste": -// if (System.Windows.Forms.Clipboard.ContainsText()) editText+=System.Windows.Forms.Clipboard.GetText(); -// break; - -// //case "Remove": -// // editText = ""; -// // break; - -// //case "Double": -// // editText += editText; -// // break; - -// //case "§": -// // break; - -// //case "Quick": -// // editText += "RabigonCraft The most of my World"; -// // break; - -// //case "Alt": -// // olderKey = "Alt"; -// // break; - -// default: -// editText+=add; -// //editText =editText.Replace("<,", "<"); -// //editText =editText.Replace(",<", "<"); - -// //editText =editText.Replace(">.", ">"); -// //editText =editText.Replace(".>", ">"); - -// //editText =editText.Replace("/ú", "/"); -// //editText =editText.Replace("ú/", "/"); -// break; -// } -// } -// timeHold--; -// } else { -// hold=false; -// timeHold=30; -// } -// } -// } -// } -// // olderKey = lastKey; -// lastKey=newKey; - -// return editText; -// } - -// string Add() { -// if (newKeyboardState.IsKeyDown(Keys.Space)) return " "; - -// if (newKeyboardState.IsKeyDown(Keys.Q)) return "g"; -// if (newKeyboardState.IsKeyDown(Keys.W)) return "w"; -// if (newKeyboardState.IsKeyDown(Keys.E)) return "e"; -// if (newKeyboardState.IsKeyDown(Keys.R)) return "r"; -// if (newKeyboardState.IsKeyDown(Keys.T)) return "t"; -// if (newKeyboardState.IsKeyDown(Keys.Z)) return "z"; -// if (newKeyboardState.IsKeyDown(Keys.U)) return "u"; -// if (newKeyboardState.IsKeyDown(Keys.I)) return "i"; -// if (newKeyboardState.IsKeyDown(Keys.O)) return "o"; -// if (newKeyboardState.IsKeyDown(Keys.P)) return "p"; -// if (newKeyboardState.IsKeyDown(Keys.A)) return "a"; -// if (newKeyboardState.IsKeyDown(Keys.S)) return "s"; -// if (newKeyboardState.IsKeyDown(Keys.D)) return "d"; -// if (newKeyboardState.IsKeyDown(Keys.F)) return "f"; -// if (newKeyboardState.IsKeyDown(Keys.G)) return "g"; -// if (newKeyboardState.IsKeyDown(Keys.H)) return "h"; -// if (newKeyboardState.IsKeyDown(Keys.J)) return "j"; -// if (newKeyboardState.IsKeyDown(Keys.K)) return "k"; -// if (newKeyboardState.IsKeyDown(Keys.L)) return "l"; -// if (newKeyboardState.IsKeyDown(Keys.Y)) return "y"; -// if (newKeyboardState.IsKeyDown(Keys.X)) return "x"; -// if (newKeyboardState.IsKeyDown(Keys.C)) return "c"; -// if (newKeyboardState.IsKeyDown(Keys.V)) return "v"; -// if (newKeyboardState.IsKeyDown(Keys.B)) return "b"; -// if (newKeyboardState.IsKeyDown(Keys.N)) return "n"; -// if (newKeyboardState.IsKeyDown(Keys.M)) return "m"; - -// if (newKeyboardState.IsKeyDown(Keys.D1)) return "ó"; -// if (newKeyboardState.IsKeyDown(Keys.D2)) return "ě"; -// if (newKeyboardState.IsKeyDown(Keys.D3)) return "š"; -// if (newKeyboardState.IsKeyDown(Keys.D4)) return "č"; -// if (newKeyboardState.IsKeyDown(Keys.D5)) return "ř"; -// if (newKeyboardState.IsKeyDown(Keys.D6)) return "ž"; -// if (newKeyboardState.IsKeyDown(Keys.D7)) return "ý"; -// if (newKeyboardState.IsKeyDown(Keys.D8)) return "á"; -// if (newKeyboardState.IsKeyDown(Keys.D9)) return "í"; -// if (newKeyboardState.IsKeyDown(Keys.D0)) return "é"; - -// if (newKeyboardState.IsKeyDown(Keys.NumPad0)) return "0"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad1)) return "1"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad2)) return "2"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad3)) return "3"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad4)) return "4"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad5)) return "5"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad6)) return "6"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad7)) return "7"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad8)) return "8"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad9)) return "9"; -// if (newKeyboardState.IsKeyDown(Keys.NumPad9)) return "9"; - -// if (newKeyboardState.IsKeyDown(Keys.Back)) return "Delete"; -// if (newKeyboardState.IsKeyDown(Keys.Delete)) return "Delete"; - -// if (newKeyboardState.IsKeyDown(Keys.OemComma)) return ","; -// if (newKeyboardState.IsKeyDown(Keys.OemPeriod)) return "."; -// if (newKeyboardState.IsKeyDown(Keys.OemMinus)) return "-"; -// if (newKeyboardState.IsKeyDown(Keys.OemQuestion)) return "'"; -// if (newKeyboardState.IsKeyDown(Keys.OemPlus)) return "="; -// if (newKeyboardState.IsKeyDown(Keys.OemCloseBrackets)) return ")"; -// if (newKeyboardState.IsKeyDown(Keys.OemSemicolon)) return "ů"; -// if (newKeyboardState.IsKeyDown(Keys.OemOpenBrackets)) return "ú"; -// if (newKeyboardState.IsKeyDown(Keys.Divide)) return "/"; -// if (newKeyboardState.IsKeyDown(Keys.Add)) return "+"; -// if (newKeyboardState.IsKeyDown(Keys.Divide)) return "/"; -// if (newKeyboardState.IsKeyDown(Keys.Decimal)) return ","; -// if (newKeyboardState.IsKeyDown(Keys.Subtract)) return "-"; -// if (newKeyboardState.IsKeyDown(Keys.Multiply)) return "*"; -// if (newKeyboardState.IsKeyDown(Keys.OemQuotes)) return "§"; - -// return ""; -// } - -// string ConvertNormalToUpper(string key) { -// switch (key) { -// case "q": return "Q"; -// case "w": return "W"; -// case "e": return "E"; -// case "r": return "R"; -// case "t": return "T"; -// case "z": return "Z"; -// case "u": return "U"; -// case "i": return "I"; -// case "o": return "O"; -// case "p": return "P"; -// case "a": return "A"; -// case "s": return "S"; -// case "d": return "D"; -// case "f": return "F"; -// case "g": return "G"; -// case "h": return "H"; -// case "j": return "J"; -// case "k": return "K"; -// case "l": return "L"; -// case "y": return "Y"; -// case "x": return "X"; -// case "c": return "C"; -// case "v": return "V"; -// case "b": return "B"; -// case "n": return "N"; -// case "m": return "M"; -// case "ú": return "/"; -// case ")": return "("; -// case ",": return "?"; -// case ".": return ":"; -// case "-": return "_"; -// case "¨": return "'"; -// case "´": return "ˇ"; -// case "=": return "%"; -// } -// return ""; -// } - -// string ConvertNormalToCtrls(string key) { -// switch (key) { -// case "x": return "Delete"; -// case "c": return "Copy"; -// case "v": return "Paste"; -// } -// return ""; -// } - -// string ConvertNormalToAtls(string key) { -// switch (key) { -// case "q": return "\""; -// case "w": return "|"; -// case "f": return "["; -// case "g": return "]"; -// case "x": return "#"; -// case "c": return "&"; -// case "v": return "@"; -// case "b": return "{"; -// case "n": return "}"; -// case "ú": return "÷"; -// case ")": return "×"; -// case ",": return "<"; -// case ".": return ">"; -// case "-": return "*"; -// case "+": return "~"; -// case "š": return "^"; -// case "ř": return "°"; -// } -// return ""; -// } - -// #endregion - -// #region New blocks -// Block BackBlockFromId(byte type, Vector2 position) { -// switch ((BlockId)type) { - -// // Blocks -// case BlockId.Lava: return new Block(lavaTexture, type, position); - -// // Backs -// case BlockId.BackDirt: return new Block(backgroundDirtTexture, type, position); -// case BlockId.BackSand: return new Block(backgroundSandTexture, type, position); -// case BlockId.BackCobblestone: return new Block(backgroundCobblestoneTexture, type, position); -// case BlockId.BackClay: return new Block(backgroundClayTexture, type, position); - -// case BlockId.BackRedSand: return new Block(backgroundRedSandTexture, type, position); - -// case BlockId.BackRegolite: return new Block(backgroundRegoliteTexture, type, position); -// case BlockId.BackGravel: return new Block(backgroundGravelTexture, type, position); - -// case BlockId.BackAnorthosite: return new Block(backgroundAnorthositeTexture, type, position); -// case BlockId.BackBasalt: return new Block(backgroundBasaltTexture, type, position); -// case BlockId.BackDiorit: return new Block(backgroundDioritTexture, type, position); -// case BlockId.BackDolomite: return new Block(backgroundDolomiteTexture, type, position); -// case BlockId.BackFlint: return new Block(backgroundFlintTexture, type, position); -// case BlockId.BackGabbro: return new Block(backgroundGabbroTexture, type, position); -// case BlockId.BackGneiss: return new Block(backgroundGneissTexture, type, position); -// case BlockId.BackLimestone: return new Block(backgroundLimestoneTexture, type, position); -// case BlockId.BackMudstone: return new Block(backgroundMudstoneTexture, type, position); -// case BlockId.BackRhyolite: return new Block(backgroundRhyoliteTexture, type, position); -// case BlockId.BackSandstone: return new Block(backgroundSandstoneTexture, type, position); -// case BlockId.BackSchist: return new Block(backgroundSchistTexture, type, position); - -// case BlockId.BackCoal: return new Block(backgroundCoalTexture, type, position); -// case BlockId.BackCopper: return new Block(backgroundCopperTexture, type, position); -// case BlockId.BackTin: return new Block(backgroundTinTexture, type, position); -// case BlockId.BackIron: return new Block(backgroundIronTexture, type, position); -// case BlockId.BackAluminium: return new Block(backgroundAluminiumTexture, type, position); -// case BlockId.BackSilver: return new Block(backgroundSilverTexture, type, position); -// case BlockId.BackGold: return new Block(backgroundGoldTexture, type, position); - - -// // Wood -// case BlockId.AppleWood: return new Block(appleWoodTexture, type, position); -// case BlockId.CherryWood: return new Block(cherryWoodTexture, type, position); -// case BlockId.LemonWood: return new Block(lemonWoodTexture, type, position); -// case BlockId.LindenWood: return new Block(lindenWoodTexture, type, position); -// case BlockId.OakWood: return new Block(oakWoodTexture, type, position); -// case BlockId.OrangeWood: return new Block(orangeWoodTexture, type, position); -// case BlockId.PineWood: return new Block(pineWoodTexture, type, position); -// case BlockId.PlumWood: return new Block(plumWoodTexture, type, position); -// case BlockId.SpruceWood: return new Block(spruceWoodTexture, type, position); -// case BlockId.WillowWood: return new Block(TextureWillowWood, type, position); -// case BlockId.MangroveWood: return new Block(TextureMangroveWood, type, position); -// case BlockId.EucalyptusWood: return new Block(TextureEucalyptusWood, type, position); -// case BlockId.OliveWood: return new Block(TextureOliveWood, type, position); -// case BlockId.RubberTreeWood: return new Block(TextureRubberTreeWood, type, position); -// case BlockId.AcaciaWood: return new Block(TextureAcaciaWood, type, position); -// case BlockId.KapokWood: return new Block(TextureKapokWood, type, position); - -// // Artifical -// case BlockId.AdvancedSpaceBack: return new Block(advancedSpaceBackTexture, type, position); -// case BlockId.AdvancedSpaceWindow: return new Block(advancedSpaceWindowTexture, type, position); -// case BlockId.Glass: return new Block(glassTexture, type, position); - -// case BlockId.Coral: return new Block(coralTexture, type, position); -// case BlockId.Seaweed: return new Block(seaweedTexture, type, position); - -// default: return null; -// } -// } - -// Block SolidBlockFromId(byte type, Vector2 position) { -// switch ((BlockId)type) { -// // Stone -// case BlockId.StoneBasalt: return new Block(basaltTexture, type, position); -// case BlockId.StoneDiorit: return new Block(dioritTexture, type, position); -// case BlockId.StoneDolomite: return new Block(dolomiteTexture, type, position); -// case BlockId.StoneGabbro: return new Block(gabbroTexture, type, position); -// case BlockId.StoneGneiss: return new Block(gneissTexture, type, position); -// case BlockId.StoneLimestone: return new Block(limestoneTexture, type, position); -// case BlockId.StoneRhyolite: return new Block(rhyoliteTexture, type, position); -// case BlockId.StoneSandstone: return new Block(sandstoneTexture, type, position); -// case BlockId.StoneSchist: return new Block(schistTexture, type, position); -// case BlockId.Anorthosite: return new Block(anorthositeTexture, type, position); -// case BlockId.MudStone: return new Block(mudstoneTexture, type, position); -// case BlockId.Regolite: return new Block(regoliteTexture, type, position); -// case BlockId.RedSand: return new Block(redsandTexture, type, position); - -// case BlockId.Compost: return new Block(CompostTexture, type, position); - -// // Ore -// case BlockId.OreAluminium: return new Block(aluminiumOreTexture, type, position); -// case BlockId.OreCopper: return new Block(copperOreTexture, type, position); -// case BlockId.OreGold: return new Block(goldOreTexture, type, position); -// case BlockId.OreIron: return new Block(ironOreTexture, type, position); -// case BlockId.OreSilver: return new Block(silverOreTexture, type, position); -// case BlockId.OreTin: return new Block(tinOreTexture, type, position); -// case BlockId.Coal: return new Block(coalOreTexture, type, position); - -// // Blocks -// case BlockId.Cobblestone: return new Block(cobblestoneTexture, type, position); -// case BlockId.Gravel: return new Block(gravelTexture, type, position); -// case BlockId.Sand: return new Block(sandTexture, type, position); -// case BlockId.Dirt: return new Block(dirtTexture, type, position); -// case BlockId.Ice: return new Block(iceTexture, type, position); -// case BlockId.Clay: return new Block(clayTexture, type, position); - -// // Grass -// case BlockId.GrassBlockDesert: return new Block(grassBlockDesertTexture, type, position); -// case BlockId.GrassBlockForest: return new Block(grassBlockForestTexture, type, position); -// case BlockId.GrassBlockHills: return new Block(grassBlockHillsTexture, type, position); -// case BlockId.GrassBlockJungle: return new Block(grassBlockJungleTexture, type, position); -// case BlockId.GrassBlockPlains: return new Block(grassBlockPlainsTexture, type, position); -// case BlockId.GrassBlockClay: return new Block(grassBlockClayTexture, type, position); - -// // Artifical -// case BlockId.Roof1: return new Block(roof1Texture, type, position); -// case BlockId.Roof2: return new Block(roof2Texture, type, position); -// case BlockId.Bricks: return new Block(bricksTexture, type, position); - -// case BlockId.DoorClose: return new Block(doorCloseTexture, type, position); -// case BlockId.Planks: return new Block(planksTexture, type, position); - -// case BlockId.AdvancedSpaceBlock: return new Block(advancedSpaceBlockTexture, type, position); -// case BlockId.AdvancedSpaceFloor: return new Block(advancedSpaceFloorTexture, type, position); -// case BlockId.AdvancedSpacePart1: return new Block(advancedSpacePart1Texture, type, position); -// case BlockId.AdvancedSpacePart2: return new Block(advancedSpacePart2Texture, type, position); -// case BlockId.AdvancedSpacePart3: return new Block(advancedSpacePart3Texture, type, position); -// case BlockId.AdvancedSpacePart4: return new Block(advancedSpacePart4Texture, type, position); - -// case BlockId.Snow: return new Block(snowTexture, type, position); - -// default: return null; -// } -// } - -// Block TopBlockFromId(byte type, Vector2 position) { -// switch ((BlockId)type) { -// case BlockId.BucketForRubber: return new Block(TextureBucketForRubber, type, position); -// // Leaves -// case BlockId.AppleLeaves: return new Block(appleLeavesTexture, type, position); -// case BlockId.LemonLeavesWithLemons: return new Block(lemonLeavesWithLemonsTexture, type, position); -// case BlockId.LindenLeaves: return new Block(lindenLeavesTexture, type, position); -// case BlockId.OakLeaves: return new Block(oakLeavesTexture, type, position); -// case BlockId.OrangeLeaves: return new Block(orangeLeavesTexture, type, position); -// case BlockId.SpruceLeaves: return new Block(spruceLeavesTexture, type, position); -// case BlockId.PlumLeavesWithPlums: return new Block(plumLeavesWithPlumsTexture, type, position); -// case BlockId.PlumLeaves: return new Block(plumLeavesTexture, type, position); -// case BlockId.PineLeaves: return new Block(pineLeavesTexture, type, position); -// case BlockId.OrangeLeavesWithOranges: return new Block(orangeLeavesWithOrangesTexture, type, position); -// case BlockId.AppleLeavesWithApples: return new Block(appleLeavesWithApplesTexture, type, position); -// case BlockId.CherryLeaves: return new Block(cherryLeavesTexture, type, position); -// case BlockId.CherryLeavesWithCherries: return new Block(cherryLeavesWithCherriesTexture, type, position); -// case BlockId.LemonLeaves: return new Block(lemonLeavesTexture, type, position); - - -// case BlockId.WillowLeaves: return new Block(TextureWillowLeaves, type, position); - -// case BlockId.MangroveLeaves: return new Block(TextureMangroveLeaves, type, position); - -// case BlockId.EucalyptusLeaves: return new Block(TextureEucalyptusLeaves, type, position); - -// case BlockId.OliveLeavesWithOlives: return new Block(TextureOliveLeavesWithOlives, type, position); -// case BlockId.OliveLeaves: return new Block(TextureOliveLeaves, type, position); - -// case BlockId.RubberTreeLeaves: return new Block(TextureRubberTreeLeaves, type, position); - -// case BlockId.AcaciaLeaves: return new Block(TextureAcaciaLeaves, type, position); - -// case BlockId.KapokLeacesFlowering: return new Block(TextureKapokLeavesFlowering, type, position); -// case BlockId.KapokLeacesFibre: return new Block(TextureKapokLeavesFibre, type, position); -// case BlockId.KapokLeaces: return new Block(TextureKapokLeaves, type, position); - -// case BlockId.WillowSapling: return new Block(TextureWillowSapling, type, position); -// case BlockId.MangroveSapling: return new Block(TextureMangroveSapling, type, position); -// case BlockId.EucalyptusSapling: return new Block(TextureEucalyptusSapling, type, position); -// case BlockId.OliveSapling: return new Block(TextureOliveSapling, type, position); -// case BlockId.RubberTreeSapling: return new Block(TextureRubberTreeSapling, type, position); -// case BlockId.AcaciaSapling: return new Block(TextureAcaciaSapling, type, position); -// case BlockId.KapokSapling: return new Block(TextureKapokSapling, type, position); - - - -// // Blocks - -// case BlockId.SnowTop: return new Block(snowTopTexture, type, position); -// case BlockId.Glass: return new Block(glassTexture, type, position); -// case BlockId.Oil: return new Block(oilTexture, type, position); -// case BlockId.WaterBlock: return new Water(waterTexture, type, position); -// case BlockId.WaterSalt: return new Water(waterTexture, type, position); -// case BlockId.Rocks: { -// switch (random.Next(4)) { -// default: return new Block(rocks0Texture, type, position); -// case 1: return new Block(rocks1Texture, type, position); -// case 2: return new Block(rocks2Texture, type, position); -// case 3: return new Block(rocks3Texture, type, position); -// } -// } - -// // Saplings -// case BlockId.AppleSapling: return new Block(appleSaplingTexture, type, position); -// case BlockId.CherrySapling: return new Block(cherrySaplingTexture, type, position); -// case BlockId.LemonSapling: return new Block(lemonSaplingTexture, type, position); -// case BlockId.LindenSapling: return new Block(lindenSaplingTexture, type, position); -// case BlockId.OakSapling: return new Block(oakSaplingTexture, type, position); -// case BlockId.OrangeSapling: return new Block(orangeSaplingTexture, type, position); -// case BlockId.PineSapling: return new Block(pineSaplingTexture, type, position); -// case BlockId.PlumSapling: return new Block(plumSaplingTexture, type, position); -// case BlockId.SpruceSapling: return new Block(spruceSaplingTexture, type, position); - -// // Flowers -// case BlockId.Violet: return new Block(plantVioletTexture, type, position); -// case BlockId.Dandelion: return new Block(plantDandelionTexture, type, position); -// case BlockId.Heather: return new Block(heatherTexture, type, position); -// case BlockId.Alore: return new Block(plantAloreTexture, type, position); -// case BlockId.Rose: return new Block(plantRoseTexture, type, position); -// case BlockId.Orchid: return new Block(plantOrchidTexture, type, position); - -// case BlockId.CactusBig: return new Block(cactusBigTexture, type, position); -// case BlockId.CactusSmall: return new Block(cactusLittleTexture, type, position); -// case BlockId.Liana: return new Block(lianaTexture, type, position); -// case BlockId.SugarCane: return new Block(sugarCaneTexture, type, position); - -// case BlockId.Toadstool: return new Block(toadstoolTexture, type, position); -// case BlockId.Boletus: return new Block(boletusTexture, type, position); -// case BlockId.Champignon: return new Block(champignonTexture, type, position); - -// case BlockId.BranchALittle1: return new Block(branchALittle1Texture, type, position); -// case BlockId.BranchALittle2: return new Block(branchALittle2Texture, type, position); -// case BlockId.BranchFull: return new Block(branchFullTexture, type, position); -// case BlockId.BranchWithout: return new Block(branchWithoutTexture, type, position); - -// // Grass -// case BlockId.GrassDesert: return new Block(grassDesertTexture, type, position); -// case BlockId.GrassForest: return new Block(grassForestTexture, type, position); -// case BlockId.GrassHills: return new Block(grassHillsTexture, type, position); -// case BlockId.GrassJungle: return new Block(grassJungleTexture, type, position); -// case BlockId.GrassPlains: return new Block(grassPlainsTexture, type, position); - -// // Artifical Blocks -// case BlockId.DoorOpen: return new Block(doorOpenTexture, type, position); - -// // Mechanical -// case BlockId.Flag: return new AnimatedBlock(flagTexture, position, 25, 35, type); -// case BlockId.Desk: return new Block(deskTexture, type, position); - -// case BlockId.Ladder: return new Block(ladderTexture, type, position); -// case BlockId.BoxAdv: return new BoxBlock(boxAdvTexture, type, position); -// case BlockId.BoxWooden: return new BoxBlock(boxWoodenTexture, type, position); -// case BlockId.Shelf: return new ShelfBlock(shelfTexture, type, position); -// case BlockId.BurningTorch: return new AnimatedBlock(torchTexture, position, 16, 16, type); -// case BlockId.NotBurningTorch: return new Block(torchTexture, type, position); - -// // Electric mashines -// case BlockId.Lamp: -// MashineBlockBasic m = new MashineBlockBasic(lampTexture, type, position); -// lightsLamp.Add(m); -// return m; - -// case BlockId.Radio: return new MashineBlockBasic(radioTexture, type, position); -// case BlockId.Rocket: return new Block(rocketTexture, type, position); - -// // Generating energy -// case BlockId.Windmill: return new AnimatedBlock(windMillTexture, position, 26, 45, type); -// case BlockId.SewingMachine: return new MashineBlockBasic(sewingMachineTexture, type, position); -// case BlockId.FurnaceStone: return new MashineBlockBasic(furnaceStoneTexture, type, position); -// case BlockId.Miner: return new MashineBlockBasic(minerTexture, type, position); -// case BlockId.Macerator: return new MashineBlockBasic(maceratorTexture, type, position); -// case BlockId.FurnaceElectric: return new MashineBlockBasic(furnaceElectricTexture, type, position); -// case BlockId.Charger: return new MashineBlockBasic(chargerTexture, type, position); -// case BlockId.Composter: return new ShelfBlock(ComposterTexture, type, position); -// case BlockId.SolarPanel: return new Block(solarPanelTexture, type, position); -// case BlockId.Label: return new ScreenBlock(labelTexture, position, 16, 16, type); - -// default: return null; -// } -// } - -// Plant GetPlantFromId(byte input, byte height, byte grow, short x) { -// switch ((BlockId)input) { -// case BlockId.Wheat: return new Plant(input, height, grow, x, wheatTexture); -// case BlockId.Onion: return new Plant(input, height, grow, x, plantOnionTexture); -// case BlockId.Peas: return new Plant(input, height, grow, x, plantPeasTexture); -// case BlockId.Carrot: return new Plant(input, height, grow, x, plantCarrotTexture); -// case BlockId.Flax: return new Plant(input, height, grow, x, flaxTexture); -// case BlockId.Strawberry: return new Plant(input, height, grow, x, strawberryPlantTexture); -// case BlockId.Rashberry: return new Plant(input, height, grow, x, rashberryPlantTexture); -// case BlockId.Blueberry: return new Plant(input, height, grow, x, blueberryPlantTexture); - -// default: return null; -// } -// } - -// Mob GetMobFromId(BlockId input, byte height, bool dir, int x) { -// switch (input) { -// case BlockId.Fish: return new Fish((byte)input, height, x, dir, fishTexture0, fishTexture1); -// case BlockId.Chicken: return new Chicken((byte)input, height, x, dir, chickenWalkTexture, chickenEatTexture); -// case BlockId.Rabbit: return new Rabbit((byte)input, height, x, dir, rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture); - -// default: return null; -// } -// } -// #endregion - -// #region Labels -// void RefreshAroundLabels(int x, int y) { -// if (terrain[x].TopBlocks[y+1]!=null) { if (terrain[x].TopBlocks[y+1].Id==(int)BlockId.Label) SetIndexLabel(x, y+1); } -// if (terrain[x].TopBlocks[y-1]!=null) { if (terrain[x].TopBlocks[y-1].Id==(int)BlockId.Label) SetIndexLabel(x, y-1); } - -// if (terrain[x+1]!=null) { -// if (terrain[x+1].TopBlocks[y]!=null) { -// if (terrain[x+1].TopBlocks[y].Id==(int)BlockId.Label) SetIndexLabel(x+1, y); -// } -// } -// if (terrain[x-1]!=null) { -// if (terrain[x-1].TopBlocks[y]!=null) { -// if (terrain[x-1].TopBlocks[y].Id==(int)BlockId.Label) SetIndexLabel(x-1, y); -// } -// } -// } - -// void SetIndexLabel(int x, int y) { -// bool up = false, down = false, left = false, right = false; - -// if (terrain[x].TopBlocks[y-1]!=null) -// up=terrain[x].TopBlocks[y-1].Id==(int)BlockId.Label -// ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Lamp -// ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Radio -// ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.FurnaceElectric -// ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Macerator -// ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.SolarPanel -// ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Windmill; - -// if (terrain[x].TopBlocks[y+1]!=null) -// down=terrain[x].TopBlocks[y+1].Id==(int)BlockId.Label -// ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Lamp -// ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Radio -// ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.FurnaceElectric -// ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Macerator -// ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Watermill -// ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Windmill; - -// if (terrain[x-1]!=null) { -// if (terrain[x-1].TopBlocks[y]!=null) -// left=terrain[x-1].TopBlocks[y].Id==(int)BlockId.Label -// ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Lamp -// ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Radio -// ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.FurnaceElectric -// ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Macerator -// ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.SolarPanel -// ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Watermill -// ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Windmill; -// } - -// if (terrain[x+1]!=null) { -// if (terrain[x+1].TopBlocks[y]!=null) -// right=terrain[x+1].TopBlocks[y].Id==(int)BlockId.Label -// ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Lamp -// ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.FurnaceElectric -// ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Macerator -// ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Radio -// ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.SolarPanel -// ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Watermill -// ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Windmill; -// } - -// if (up&&down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=15; return; } -// if (!up&&down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=14; return; } -// if (up&&down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=13; return; } -// if (up&&!down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=12; return; } -// if (up&&down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=11; return; } -// if (up&&down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=10; return; } -// if (!up&&!down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=9; return; } -// if (up&&!down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=8; return; } -// if (!up&&down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=7; return; } -// if (!up&&down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=6; return; } -// if (up&&!down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=5; return; } -// if (!up&&!down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=4; return; } -// if (!up&&down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=3; return; } -// if (!up&&!down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=2; return; } -// if (up&&!down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=1; return; } -// if (!up&&!down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=0; return; } -// } -// #endregion - -// #region Draw Inventory -// Texture2D ItemIdToTexture(int id) { -// switch ((Items)id) { -// case Items.BoxAdv: return boxAdvTexture; -// case Items.BoxWooden: return boxWoodenTexture; -// case Items.Shelf: return shelfTexture; -// case Items.Heater: return heatherTexture; -// case Items.WoodDust: return ItemWoodDustTexture; -// case Items.AluminiumDust: return ItemAluminiumDustTexture; -// case Items.FlaxSeeds: return flaxSeedsTexture; -// case Items.MudIngot: return oneMudBrickTexture; -// case Items.AluminiumIngot: return ItemAluminiumIngotTexture; -// case Items.Nail: return nailTexture; -// case Items.Silicium: return siliciumTexture; -// case Items.StoneBasalt: return basaltTexture; -// case Items.StoneLimestone: return limestoneTexture; -// case Items.StoneRhyolite: return rhyoliteTexture; -// case Items.StoneGneiss: return gneissTexture; -// case Items.StoneSandstone: return sandstoneTexture; -// case Items.StoneSchist: return schistTexture; -// case Items.StoneGabbro: return gabbroTexture; -// case Items.StoneDiorit: return dioritTexture; -// case Items.StoneDolomite: return dolomiteTexture; -// case Items.Flax: return flaxInvTexture; -// case Items.Dirt: return dirtTexture; -// case Items.Sand: return sandTexture; -// case Items.Lava: return lavaTexture; -// case Items.Cobblestone: return cobblestoneTexture; -// case Items.Gravel: return gravelTexture; - -// case Items.WoodOak: return oakWoodTexture; -// case Items.WoodSpruce: return spruceWoodTexture; -// case Items.WoodLinden: return lindenWoodTexture; -// case Items.WoodPine: return pineWoodTexture; -// case Items.WoodApple: return appleWoodTexture; -// case Items.WoodCherry: return cherryWoodTexture; -// case Items.WoodPlum: return plumWoodTexture; -// case Items.WoodLemon: return lemonWoodTexture; -// case Items.WoodOrange: return orangeWoodTexture; - -// case Items.OakLeaves: return oakLeavesTexture; - -// case Items.GrassBlockDesert: return grassBlockDesertTexture; -// case Items.GrassBlockForest: return grassBlockForestTexture; -// case Items.GrassBlockHills: return grassBlockHillsTexture; -// case Items.GrassBlockJungle: return grassBlockJungleTexture; -// case Items.GrassBlockPlains: return grassBlockPlainsTexture; - -// //Crafted -// case Items.Glass: return glassTexture; -// case Items.Bricks: return bricksTexture; - -// case Items.Planks: return planksTexture; - -// case Items.Desk: return deskTexture; -// case Items.Door: return ItemDoorTexture; -// case Items.Ladder: return ladderTexture; -// case Items.Flag: return ItemFlagTexture; -// case Items.TorchON: return torchInvTexture; -// case Items.Rope: return ItemRopeTexture; - -// case Items.HayBlock: return hayBlockTexture; - -// case Items.Roof1: return roof1Texture; -// case Items.Roof2: return roof2Texture; - -// //Mashines -// case Items.AdvancedSpaceBack: return advancedSpaceBackTexture; -// case Items.AdvancedSpaceWindow: return advancedSpaceWindowTexture; -// case Items.AdvancedSpaceBlock: return advancedSpaceBlockTexture; -// case Items.AdvancedSpaceFloor: return advancedSpaceFloorTexture; -// case Items.AdvancedSpacePart1: return advancedSpacePart1Texture; -// case Items.AdvancedSpacePart2: return advancedSpacePart2Texture; -// case Items.AdvancedSpacePart3: return advancedSpacePart3Texture; -// case Items.AdvancedSpacePart4: return advancedSpacePart4Texture; - -// case Items.WindMill: return ItemWindMillTexture; -// case Items.WaterMill: return ItemWaterMillTexture; -// case Items.SolarPanel: return solarPanelTexture; - -// case Items.Miner: return minerTexture; -// case Items.Macerator: return maceratorOneTexture; -// case Items.Lamp: return lampTexture; -// case Items.Radio: return radioInvTexture; -// case Items.Label: return labelOneTexture; -// case Items.Rocket: return ItemRocketTexture; -// case Items.FurnaceElectric: return furnaceElectricOneTexture; -// case Items.FurnaceStone: return furnaceStoneOneTexture; - -// //Food -// case Items.Banana: return ItemBananaTexture; -// case Items.Cherry: return ItemCherryTexture; -// case Items.Lemon: return ItemLemonTexture; -// case Items.Orange: return ItemOrangeTexture; -// case Items.Plum: return ItemPlumTexture; -// case Items.Apple: return ItemAppleTexture; -// case Items.Rashberry: return rashberryTexture; -// case Items.Strawberry: return strawberryTexture; -// case Items.Blueberries: return blueberryTexture; - -// case Items.RabbtCookedMeat: return ItemRabbtCookedMeatTexture; -// case Items.RabbitMeat: return ItemRabbitMeatTexture; - -// case Items.Fish: return fishTexture0; -// case Items.FishMeatCooked: return fishCookedTexture; - -// //Clothes -// case Items.Backpack: return ItemBackpackTexture; - -// //Items -// case Items.CoalDust: return ItemCoalDustTexture; -// case Items.BronzeDust: return ItemBronzeDustTexture; -// case Items.GoldDust: return ItemGoldDustTexture; -// case Items.IronDust: return ItemIronDustTexture; -// case Items.SilverDust: return ItemSilverDustTexture; -// case Items.CopperDust: return ItemCopperDustTexture; -// case Items.TinDust: return ItemTinDustTexture; - -// case Items.BronzeIngot: return ItemBronzeIngotTexture; -// case Items.GoldIngot: return ItemGoldIngotTexture; -// case Items.IronIngot: return ItemIronIngotTexture; -// case Items.TinIngot: return ItemTinIngotTexture; -// case Items.SilverIngot: return ItemSilverIngotTexture; -// case Items.CopperIngot: return ItemCopperIngotTexture; - -// case Items.PlateIron: return plateIronTexture; -// case Items.PlateBronze: return plateBronzeTexture; -// case Items.plateAluminium: return plateAluminiumTexture; -// case Items.PlateCopper: return plateCopperTexture; -// case Items.PlateGold: return plateGoldTexture; - -// case Items.OreCoal: return ItemCoalTexture; -// case Items.ItemGold: return ItemGoldTexture; -// case Items.ItemTin: return ItemTinTexture; -// case Items.ItemSilver: return ItemSilverTexture; -// case Items.ItemIron: return ItemIronTexture; -// case Items.ItemCopper: return ItemCopperTexture; -// case Items.Ash: return ashTexture; -// case Items.CoalWood: return coalWoodTexture; - -// case Items.Saphirite: return ItemSaphiriteTexture; -// case Items.Diamond: return ItemDiamondTexture; -// case Items.Smaragd: return ItemSmaragdTexture; -// case Items.Ruby: return ItemRubyTexture; -// case Items.SmallStone: return ItemSmallStoneTexture; -// case Items.BigStone: return ItemBigStoneTexture; -// case Items.MediumStone: return ItemMediumStoneTexture; - -// case Items.Bulb: return ItemBulbTexture; -// case Items.Circuit: return ItemCircuitTexture; -// case Items.ItemBattery: return ItemBatteryTexture; -// case Items.BigCircuit: return ItemBigCircuitTexture; -// case Items.OneBrick: return oneBrickTexture; -// case Items.Cloth: return clothTexture; -// case Items.Yarn: return yarnTexture; - -// case Items.Condenser: return condenserTexture; -// case Items.Diode: return diodeTexture; -// case Items.Tranzistor: return tranzistorTexture; -// case Items.Rezistance: return resistanceTexture; -// case Items.Motor: return motorTexture; -// case Items.BareLabel: return bareLabelTexture; - -// //Plants -// case Items.OakSapling: return oakSaplingTexture; -// case Items.LindenSapling: return lindenSaplingTexture; -// case Items.PineSapling: return pineSaplingTexture; -// case Items.AppleSapling: return appleSaplingTexture; -// case Items.LemonSapling: return lemonSaplingTexture; -// case Items.CherrySapling: return cherrySaplingTexture; -// case Items.PlumSapling: return plumSaplingTexture; -// case Items.SpruceSapling: return spruceSaplingTexture; -// case Items.OrangeSapling: return orangeSaplingTexture; - -// case Items.Dandelion: return plantDandelionTexture; -// case Items.PlantRose: return plantRoseTexture; -// case Items.PlantOrchid: return plantOrchidTexture; -// case Items.PlantViolet: return plantVioletTexture; - -// case Items.PlantStrawberry: return invStrawberryTexture; -// case Items.PlantRashberry: return invRashberryTexture; -// case Items.PlantBlueberry: return invBlueberryTexture; - -// case Items.CactusBig: return cactusBigTexture; -// case Items.CactusSmall: return cactusLittleTexture; - -// case Items.SugarCane: return sugarCaneTexture; -// case Items.Onion: return ItemOnionTexture; - -// case Items.Toadstool: return toadstoolTexture; -// case Items.Boletus: return boletusTexture; -// case Items.Champignon: return champignonTexture; - -// case Items.Coral: return coralTexture; -// case Items.Seaweed: return seaweedTexture; -// case Items.PlantOnion: return plantOnionTexture; - -// //Nature -// case Items.WheatSeeds: return ItemWheatSeedsTexture; -// case Items.Seeds: return ItemSeedsTexture; - -// case Items.WheatStraw: return ItemWheatStrawTexture; -// case Items.Hay: return ItemHayTexture; - -// case Items.Leave: return ItemLeaveTexture; -// case Items.Stick: return ItemStickTexture; -// case Items.Sticks: return ItemSticksTexture; -// case Items.Rubber: return ItemRubberTexture; -// // case Items.Leather: return ItemLeatherTexture; - -// //Tools -// case Items.Bucket: return ItemBucketTexture; -// case Items.BucketWater: return ItemBucketWaterTexture; - -// case Items.StoneHead: return stoneHeadTexture; - -// case Items.IronHeadAxe: return ItemIronHeadAxeTexture; -// case Items.IronHeadShovel: return ItemIronHeadShovelTexture; -// case Items.IronHeadPickaxe: return ItemIronHeadPickaxeTexture; - -// case Items.StoneAxe: return ItemStoneAxeTexture; -// case Items.StoneShovel: return ItemStoneShovelTexture; -// case Items.StonePickaxe: return ItemStonePickaxeTexture; -// case Items.IronAxe: return ItemIronAxeTexture; -// case Items.IronShovel: return ItemIronShovelTexture; -// case Items.IronPickaxe: return ItemIronPickaxeTexture; -// case Items.HammerBronze: return hammerBronzeTexture; -// case Items.HammerIron: return hammerIronTexture; - -// case Items.ShearsCopper: return shearsCopperTexture; -// case Items.ShearsIron: return shearsIronTexture; -// case Items.ShearsBronze: return shearsBronzeTexture; - -// case Items.SawCopper: return sawCopperTexture; -// case Items.SawBronze: return sawBronzeTexture; -// case Items.SawIron: return sawIronTexture; - -// case Items.ElectricDrill: return electricDrillTexture; -// case Items.ElectricSaw: return electricSawTexture; - -// case Items.OreAluminium: return aluminiumOreTexture; -// case Items.OreCopper: return copperOreTexture; -// case Items.OreGold: return goldOreTexture; -// case Items.OreIron: return ironOreTexture; -// case Items.OreSilver: return silverOreTexture; -// case Items.OreTin: return tinOreTexture; - -// case Items.AppleLeaves: return appleLeavesTexture; -// case Items.AppleLeavesWithApples: return appleLeavesWithApplesTexture; -// case Items.OrangeLeaves: return orangeLeavesTexture; -// case Items.OrangeLeavesWithOranges: return orangeLeavesWithOrangesTexture; -// case Items.PlumLeaves: return plumLeavesTexture; -// case Items.PlumLeavesWithPlums: return plumLeavesWithPlumsTexture; -// case Items.CherryLeaves: return cherryLeavesTexture; -// case Items.CherryLeavesWithCherries: return cherryLeavesWithCherriesTexture; -// case Items.LemonLeaves: return lemonLeavesTexture; -// case Items.LemonLeavesWithLemons: return lemonLeavesWithLemonsTexture; -// case Items.LindenLeaves: return lindenLeavesTexture; -// case Items.SpruceLeaves: return spruceLeavesTexture; -// case Items.PineLeaves: return pineLeavesTexture; - -// case Items.Snow: return snowTexture; -// case Items.SnowTop: return snowTopTexture; -// case Items.Ice: return iceTexture; - -// case Items.GrassDesert: return grassDesertTexture; -// case Items.GrassForest: return grassForestTexture; -// case Items.GrassHills: return grassHillsTexture; -// case Items.GrassJungle: return grassJungleTexture; -// case Items.GrassPlains: return grassPlainsTexture; - -// case Items.Alore: return plantAloreTexture; -// case Items.Plastic: return ItemPlasticTexture; - -// case Items.Carrot: return ItemCarrotTexture; -// case Items.PlantCarrot: return plantCarrotTexture; -// case Items.Peas: return ItemPeasTexture; -// case Items.PlantPeas: return plantPeasTexture; - -// case Items.Battery: return plantPeasTexture; - -// default: return null; -// } -// } - -// void DrawItemInInventory(Texture2D texture, DInt inv, int x, int y) { -// if (texture.Width==16&&texture.Height==16) spriteBatch.Draw(texture, new Rectangle(x, y, texture.Width*2, texture.Height*2), Color.White); -// else if (texture.Width==32&&texture.Height==32) spriteBatch.Draw(texture, new Vector2(x, y), Color.White); -// else spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height), texture.Width*2, texture.Height*2), Color.White); - -// if (inv.X<(short)Items._SystemMaxTools) { -// spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); -// spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(inv.Y*0.3f), 3), Color.Green); -// spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(inv.Y*0.3f), y+29, 28-(int)(inv.Y*0.3), 3), Color.Red); -// } else if (inv.Y!=1) DrawTextShadowMin(x, y+20, inv.Y.ToString()); -// } - -// void DrawItemInInventory(Texture2D texture, int count, int x, int y) { -// if (texture.Width==16&&texture.Height==16) spriteBatch.Draw(texture, new Rectangle(x, y, texture.Width*2, texture.Height*2), Color.White); -// else if (texture.Width==32&&texture.Height==32) spriteBatch.Draw(texture, new Vector2(x, y), Color.White); -// else spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height), texture.Width*2, texture.Height*2), Color.White); - -// if (count!=1) DrawTextShadowMin(x, y+20, count.ToString()); -// } - -// void InvMouseDraw(int item) { -// Texture2D tex = ItemIdToTexture(Inventory[item].X); -// if (tex!=null) DrawItemInInventory(tex, Inventory[item], newMouseState.X, newMouseState.Y); -// } - -// void InvMouseDraw(DInt item) { - -// Texture2D tex = ItemIdToTexture(item.X); -// if (tex!=null) DrawItemInInventory(tex, item, newMouseState.X, newMouseState.Y); -// } -// #endregion - -// #region Inventory change -// //void InventoryRemoveDInt(int inventory) { -// // Inventory[inventory].Y--; -// // if (Inventory[inventory].Y==0) Inventory[inventory].X=0; -// //} - -// void ChangeInventoryBasic() { -// // Move from ... -// if (!invMove) { -// mouseDraw=false; -// if (mouseLeftPress) { -// // Basic right inventory -// for (int i = 0; i<5; i++) { -// if (newMouseState.X>Global.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// //DrawItemInInventory(tex,Inventory[i+5].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.Y100) { -// int to_ = Inventory[to].Y; -// int from_ = Inventory[from].Y; -// int ss_ = to_+from_; -// Inventory[to].Y=99; -// Inventory[from].Y=ss_-99; -// } else { -// Inventory[to].Y+=Inventory[from].Y; -// Inventory[from].Y=0; -// Inventory[from].X=0; -// } -// } else { -// int xx = Inventory[from].X; -// int yy = Inventory[from].Y; - -// Inventory[from].X=Inventory[to].X; -// Inventory[from].Y=Inventory[to].Y; - -// Inventory[to].X=xx; -// Inventory[to].Y=yy; -// } -// } -// } -// invMove=false; -// } - -// void InvMoveOne(int from, int to) { -// if (Inventory[from].Y!=0) { -// if (Inventory[to].Y==0) { -// Inventory[to].X=Inventory[from].X; -// Inventory[to].Y++; -// Inventory[from].Y--; -// if (Inventory[from].Y==0) Inventory[from].X=0; -// inventoryChanged=true; -// } else invMove=false; -// } else invMove=false; -// } - -// void InvMoveDouble(int from, int to) { -// if (Inventory[from].X!=0&&Inventory[to].X==0) { -// if (Inventory[from].Y>1) { -// int half = (int)((float)Inventory[from].Y/2); -// int fromY = Inventory[from].Y-half; - -// Inventory[to].Y=half; -// Inventory[from].Y=fromY; - -// Inventory[to].X=Inventory[from].X; -// inventoryChanged=true; -// } else invMove=false; -// } else invMove=false; -// } - -// void InvMove(DInt from, DInt to) { -// if (from!=to) { -// if (from.X!=0) { -// if (from.X==to.X) { -// if (to.Y+from.Y>100) { -// int to_ = to.Y; -// int from_ = from.Y; -// int ss_ = to_+from_; -// to.Y=99; -// from.Y=ss_-99; -// inventoryChanged=true; -// } else { -// to.Y+=from.Y; -// from.Y=0; -// from.X=0; -// inventoryChanged=true; -// } -// } else { -// int xx = from.X; -// int yy = from.Y; - -// from.X=to.X; -// from.Y=to.Y; - -// to.X=xx; -// to.Y=yy; -// inventoryChanged=true; -// } -// } -// } -// invMove=false; -// } - -// void InvMoveOne(DInt from, DInt to) { -// if (from.Y!=0) { -// if (to.Y==0) { -// to.X=from.X; -// to.Y++; -// from.Y--; -// if (from.Y==0) from.X=0; -// inventoryChanged=true; -// } else invMove=false; -// } else invMove=false; -// } - -// void InvMoveDouble(DInt from, DInt to) { -// if (from.X!=0&&to.X==0) { -// if (from.Y>1) { -// int half = (int)((float)from.Y/2); -// int fromY = from.Y-half; - -// to.Y=half; -// from.Y=fromY; - -// to.X=from.X; -// inventoryChanged=true; -// } else invMove=false; -// } else invMove=false; -// } - -// bool InventoryAdd(int index) { -// for (int i = 0; iGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// //DrawItemInInventory(tex,Inventory[i+5].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+53+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// //DrawItemInInventory(tex,Inventory[i+5].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.Y0&&y<125&&x>0&&x0&&y<125&&x>0&&x0&&y<125&&x>0&&x0&&y<125&&x>0&&x0&&y<125&&x>0&&xscreenScaleW) { -// mousePos=new Vector2((int)((newMouseState.X-Global.WindowWidthHalf)/screenScaleW/Setting.Zoom+(Global.WindowWidth-(int)(screenScaleW*848f))/2)+WindowCenterX, (int)((newMouseState.Y-Global.WindowHeightHalf)/screenScaleW/Setting.Zoom)+WindowCenterY); -// return; -// } else { -// mousePos=new Vector2((int)((newMouseState.X-Global.WindowWidthHalf)/screenScaleH/Setting.Zoom)+WindowCenterX, (int)((newMouseState.Y-Global.WindowHeightHalf)/screenScaleH/Setting.Zoom)+WindowCenterX+(Global.WindowHeight-(int)(screenScaleH*560f))/2); -// return; -// } -// } - -// mousePos=new Vector2((newMouseState.X-Global.WindowWidthHalf)/(Global.WindowWidth/848f)/Setting.Zoom+WindowCenterX, (newMouseState.Y-Global.WindowHeightHalf)/((float)Global.WindowHeight/560f)/Setting.Zoom+WindowCenterY); -// } - -// void PlayerGravity() { -// distanceToGround=100000; - -// for (int y = (PlayerY+20-16)/16; y<(PlayerY+20-16)/16+6; y++) { - -// for (int x = (PlayerX-11)/16; x<(PlayerX+11+16)/16; x++) { -// if (terrain[x]!=null) { -// if (y>124) break; -// if (terrain[x].IsSolidBlocks[y]) { -// if (/*y*16-PlayerY-39/2>0 &&*/ y*16-PlayerY-200) { -// PlayerY+=distanceToGround; -// gravitySpeed=0; -// // return false; -// } else { -// gravitySpeed+=.4905f; -// if (gravitySpeed>6) gravitySpeed=6; -// PlayerY+=(int)gravitySpeed; - - -// } - -// } - -// void CameraMatrix() { -// if (Setting.Scale.Without==Setting.currentScale) { -// camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))*Translation; -// return; -// } - -// if (Setting.Scale.Proportions==Setting.currentScale) { -// float _screenScaleW = Global.WindowWidth/848f; -// float _screenScaleH = Global.WindowHeight/560f; - -// if (_screenScaleH>_screenScaleW) { -// camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))* -// Matrix.CreateScale(_screenScaleW, _screenScaleW, 0)*Translation; -// return; -// } else { -// camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))* -// Matrix.CreateScale(_screenScaleH, _screenScaleH, 0)*Translation; -// return; -// } -// } - -// camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))* -// Matrix.CreateScale(new Vector3(Global.WindowWidth/848f, Global.WindowHeight/560f, 0))*Translation; -// } - -// void SetPlayerPos(int x, int y) { -// PlayerX=x; -// PlayerY=y; - -// WindowXPlayer=WindowXPlayer+(PlayerX-WindowCenterX)/*/16f*/; -// WindowYPlayer=WindowYPlayer+(PlayerY-WindowCenterY)/*/16f*/; - -// WindowX=x-Global.WindowWidthHalf; -// WindowY=y-Global.WindowHeightHalf; - -// WindowCenterX=(int)WindowXPlayer; -// WindowCenterY=(int)WindowYPlayer; -// } -// #endregion - -// #region Destruction -// void GetItemsFromBlock(byte type, int X, int Y/*, BlockType bt*/) { -// int X16 = X*16, Y16 = Y*16; - -// // switch (bt) { -// // case BlockType.Top: - -// switch ((BlockId)type) { -// case BlockId.Macerator: - -// DropItemToPos(X16, Y16, Items.Macerator); -// RefreshAroundLabels(X, Y); -// return; - -// case BlockId.Miner: - -// DropItemToPos(X16, Y16, Items.Miner); -// RefreshAroundLabels(X, Y); -// RemovefromMiners(X16, Y16); -// return; - -// case BlockId.Composter: -// DropItemToPos(X16, Y16, Items.Composter); -// RefreshAroundLabels(X, Y); -// RemovefromComposters(X16, Y16); -// return; - -// case BlockId.FurnaceElectric: -// DropItemToPos(X16, Y16, Items.FurnaceElectric); -// RefreshAroundLabels(X16, Y16); -// return; - -// case BlockId.FurnaceStone: -// DropItemToPos(X16, Y16, Items.FurnaceStone); -// RemovefromFurnaceStone(X16, Y16); -// return; - -// case BlockId.Rocket: -// DropItemToPos(X16, Y16, Items.Rocket); -// return; - -// case BlockId.Desk: -// DropItemToPos(X16, Y16, Items.Desk); -// return; - -// case BlockId.Ladder: -// DropItemToPos(X16, Y16, Items.Ladder); -// return; - -// case BlockId.Lamp: -// DropItemToPos(X16, Y16, Items.Lamp); -// RefreshAroundLabels(X16, Y16); -// foreach (MashineBlockBasic m in lightsLamp) { -// if (m.Position.X==X16) { -// if (m.Position.Y==Y16) { -// lightsLamp.Remove(m); -// return; -// } -// } -// } -// return; - -// case BlockId.Windmill: -// DropItemToPos(X16, Y16, Items.WindMill); -// RefreshAroundLabels(X16, Y16); -// return; - -// case BlockId.Flag: -// DropItemToPos(X16, Y16, Items.Flag); -// return; - -// case BlockId.Label: -// DropItemToPos(X16, Y16, Items.Label); -// RefreshAroundLabels(X16, Y16); -// return; - -// case BlockId.AppleLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.AppleSapling); -// return; -// } -// } -// return; - -// case BlockId.EucalyptusLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.EucalyptusLeaves); -// return; -// } -// } -// return; - -// case BlockId.AcaciaLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.AcaciaSapling); -// return; -// } -// } -// return; - -// case BlockId.WillowLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.WillowSapling); -// return; -// } -// } -// return; - -// case BlockId.OliveLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.OliveSapling); -// return; -// } -// } -// return; - -// case BlockId.RubberTreeLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.RubberTreeSapling); -// return; -// } -// } -// return; - -// case BlockId.KapokLeaces: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.KapokSapling); -// return; -// } -// } -// return; - -// case BlockId.KapokLeacesFlowering: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.KapokLeacesFlowering); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.KapokLeacesFlowering); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.KapokSapling); -// return; -// } -// } -// return; - -// case BlockId.KapokLeacesFibre: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.KapokLeacesFibre); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.KapokLeacesFibre); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.KapokSapling); -// return; -// } -// } -// return; - -// case BlockId.OliveLeavesWithOlives: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Olive); -// return; - -// case 4: -// DropItemToPos(X16, Y16, Items.Olive); -// return; - -// case 5: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.OliveSapling); -// return; -// } -// } -// return; - -// case BlockId.LemonLeavesWithLemons: -// DropItemToPos(X16, Y16, Items.Lemon); - -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.LemonSapling); -// return; -// } -// } -// return; - -// case BlockId.LindenLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.LindenSapling); -// return; -// } -// } -// return; - -// case BlockId.OakLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.OakSapling); -// return; -// } -// } -// return; - -// case BlockId.OrangeLeaves: -// DropItemToPos(X16, Y16, Items.Orange); - -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.OrangeSapling); -// return; -// } -// } -// return; - -// case BlockId.SpruceLeaves: -// if (random.Next(2)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Stick); -// else if (random.Next(4)==1) DropItemToPos(X16, Y16, Items.SpruceSapling); -// } -// return; - -// case BlockId.PlumLeavesWithPlums: -// DropItemToPos(X16, Y16, Items.Plum); - -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.PlumSapling); -// return; -// } -// } -// return; - -// case BlockId.PlumLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.PlumSapling); -// return; -// } -// } -// return; - -// case BlockId.PineLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.PineSapling); -// else DropItemToPos(X16, Y16, Items.Banana); -// return; -// } -// } -// return; - -// case BlockId.OrangeLeavesWithOranges: -// DropItemToPos(X16, Y16, Items.Orange); - -// if (random.Next(4)==1) { -// switch (random.Next(6)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.OrangeSapling); -// return; -// } -// } -// return; - -// case BlockId.AppleLeavesWithApples: -// DropItemToPos(X16, Y16, Items.Apple); - -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.AppleSapling); -// return; -// } -// } -// return; - -// case BlockId.CherryLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CherrySapling); -// return; -// } -// } -// return; - -// case BlockId.CherryLeavesWithCherries: -// DropItemToPos(X16, Y16, Items.Cherry); - -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CherrySapling); -// return; -// } -// } -// return; - -// case BlockId.LemonLeaves: -// if (random.Next(4)==1) { -// switch (random.Next(5)) { -// case 1: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case 2: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case 3: -// DropItemToPos(X16, Y16, Items.Leave); -// return; - -// case 4: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.LemonSapling); -// return; -// } -// } -// return; - -// case BlockId.Violet: -// DropItemToPos(X16, Y16, Items.PlantViolet); -// return; - -// case BlockId.Dandelion: -// DropItemToPos(X16, Y16, Items.Dandelion); -// return; - -// case BlockId.Heather: -// DropItemToPos(X16, Y16, Items.Heater); -// return; - -// case BlockId.Alore: -// DropItemToPos(X16, Y16, Items.Alore); -// return; - -// case BlockId.CactusBig: -// DropItemToPos(X16, Y16, Items.CactusBig); -// return; - -// case BlockId.CactusSmall: -// DropItemToPos(X16, Y16, Items.CactusSmall); -// return; - -// case BlockId.AppleSapling: -// DropItemToPos(X16, Y16, Items.AppleSapling); -// return; - -// case BlockId.CherrySapling: -// DropItemToPos(X16, Y16, Items.CherrySapling); -// return; - -// case BlockId.LemonSapling: -// DropItemToPos(X16, Y16, Items.LemonSapling); -// return; - -// case BlockId.LindenSapling: -// DropItemToPos(X16, Y16, Items.LindenSapling); -// return; - -// case BlockId.OakSapling: -// DropItemToPos(X16, Y16, Items.OakSapling); -// return; - -// case BlockId.OrangeSapling: -// DropItemToPos(X16, Y16, Items.OrangeSapling); -// return; - -// case BlockId.PineSapling: -// DropItemToPos(X16, Y16, Items.PineSapling); -// return; - -// case BlockId.PlumSapling: -// DropItemToPos(X16, Y16, Items.PlumSapling); -// return; - -// case BlockId.SpruceSapling: -// DropItemToPos(X16, Y16, Items.SpruceSapling); -// return; - -// case BlockId.GrassDesert: -// if (random.Next(6)==1) DropItemToPos(X16, Y16, Items.Seeds); -// else if (random.Next(3)==1) DropItemToPos(X16, Y16, Items.Hay); -// return; - -// case BlockId.GrassForest: -// if (random.Next(5)==1) DropItemToPos(X16, Y16, Items.Seeds); -// else if (random.Next(4)==1) DropItemToPos(X16, Y16, Items.Hay); -// else if (random.Next(10)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); -// return; - -// case BlockId.GrassHills: -// if (random.Next(7)==1) DropItemToPos(X16, Y16, Items.Seeds); -// else if (random.Next(5)==1) DropItemToPos(X16, Y16, Items.Hay); -// else if (random.Next(10)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); -// return; - -// case BlockId.GrassJungle: -// if (random.Next(5)==1) DropItemToPos(X16, Y16, Items.Seeds); -// else if (random.Next(5)==1) DropItemToPos(X16, Y16, Items.Hay); -// else if (random.Next(20)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); -// return; - -// case BlockId.GrassPlains: -// if (random.Next(5)==1) DropItemToPos(X16, Y16, Items.Seeds); -// else if (random.Next(3)==1) DropItemToPos(X16, Y16, Items.Hay); -// else if (random.Next(10)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); -// return; - - - -// case BlockId.Glass: -// DropItemToPos(X16, Y16, Items.Glass); -// return; - -// case BlockId.Orchid: -// DropItemToPos(X16, Y16, Items.PlantOrchid); -// return; - -// case BlockId.Radio: -// DropItemToPos(X16, Y16, Items.Radio); -// RefreshAroundLabels(X16, Y16); -// return; - -// case BlockId.Rose: -// DropItemToPos(X16, Y16, Items.PlantRose); -// return; - -// case BlockId.Toadstool: -// DropItemToPos(X16, Y16, Items.Toadstool); -// return; - -// case BlockId.Boletus: -// DropItemToPos(X16, Y16, Items.Boletus); -// return; - -// case BlockId.BranchALittle1: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Stick); -// else DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case BlockId.BranchALittle2: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Stick); -// else DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case BlockId.BranchFull: -// DropItemToPos(X16, Y16, Items.Sticks); -// return; - -// case BlockId.BranchWithout: -// DropItemToPos(X16, Y16, Items.Stick); -// return; - -// case BlockId.Champignon: -// DropItemToPos(X16, Y16, Items.Champignon); -// return; - -// case BlockId.DoorOpen: -// DropItemToPos(X16, Y16, Items.Door); -// return; - -// case BlockId.Charger: -// DropItemToPos(X16, Y16, Items.Charger); -// RefreshAroundLabels(X16, Y16); -// RemovefromChargers(X16, Y16); -// return; - -// case BlockId.SolarPanel: -// DropItemToPos(X16, Y16, Items.SolarPanel); -// RefreshAroundLabels(X16, Y16); -// return; - -// case BlockId.Watermill: -// DropItemToPos(X16, Y16, Items.WaterMill); -// RefreshAroundLabels(X16, Y16); -// return; - -// case BlockId.Rocks: -// switch (random.Next(100)) { -// case 0: DropItemToPos(X16, Y16, Items.Ruby); return; -// case 1: DropItemToPos(X16, Y16, Items.Smaragd); return; -// case 2: DropItemToPos(X16, Y16, Items.Saphirite); return; -// case 3: DropItemToPos(X16, Y16, Items.Diamond); return; -// case 4: DropItemToPos(X16, Y16, Items.ItemGold); return; -// case 5: DropItemToPos(X16, Y16, Items.ItemSilver); return; -// case 6: DropItemToPos(X16, Y16, Items.ItemIron); return; -// case 7: DropItemToPos(X16, Y16, Items.ItemIron); return; -// case 8: DropItemToPos(X16, Y16, Items.ItemIron); return; -// case 9: DropItemToPos(X16, Y16, Items.ItemCopper); return; -// case 10: DropItemToPos(X16, Y16, Items.ItemCopper); return; -// case 11: DropItemToPos(X16, Y16, Items.ItemCopper); return; -// case 12: DropItemToPos(X16, Y16, Items.ItemTin); return; -// case 13: DropItemToPos(X16, Y16, Items.ItemTin); return; -// case 14: DropItemToPos(X16, Y16, Items.ItemTin); return; -// case 15: DropItemToPos(X16, Y16, Items.CoalWood); return; -// case 16: DropItemToPos(X16, Y16, Items.ItemCoal); return; -// case 17: DropItemToPos(X16, Y16, Items.ItemCoal); return; -// case 18: DropItemToPos(X16, Y16, Items.ItemCoal); return; -// case 19: DropItemToPos(X16, Y16, Items.StoneHead); return; -// case 20: DropItemToPos(X16, Y16, Items.StoneHead); return; -// case 21: DropItemToPos(X16, Y16, Items.StoneHead); return; -// case 22: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 23: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 24: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 25: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 26: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 27: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 28: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 29: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 30: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 31: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 32: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 33: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 34: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 35: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 36: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 37: DropItemToPos(X16, Y16, Items.BigStone); return; -// case 38: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 39: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 40: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 41: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 42: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 43: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 44: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 45: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 46: DropItemToPos(X16, Y16, Items.SmallStone); return; -// case 47: DropItemToPos(X16, Y16, Items.Gravel); return; -// case 48: DropItemToPos(X16, Y16, Items.Silicium); return; -// default: DropItemToPos(X16, Y16, Items.MediumStone); return; -// } -// // break; -// // } -// // break; - -// // case BlockType.Solid: -// // switch ((BlockId)type) { -// case BlockId.Compost: -// DropItemToPos(X16, Y16, Items.Compost); -// return; - -// case BlockId.Snow: -// DropItemToPos(X16, Y16, Items.Snow); -// return; - -// case BlockId.Roof1: -// DropItemToPos(X16, Y16, Items.Roof1); -// return; - -// case BlockId.Roof2: -// DropItemToPos(X16, Y16, Items.Roof2); -// return; - -// case BlockId.DoorClose: -// DropItemToPos(X16, Y16, Items.Door); -// return; - -// case BlockId.StoneBasalt: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackBasalt, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneDiorit: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDiorit, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneDolomite: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDolomite, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneGabbro: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackGabbro, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneGneiss: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=new Block(backgroundGneissTexture, (int)BlockId.BackGneiss, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneLimestone: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackLimestone, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneRhyolite: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackRhyolite, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneSandstone: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSandstone, new Vector2(X16, Y16)); -// return; - -// case BlockId.StoneSchist: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(50)==1) { -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Ruby); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Diamond); -// } -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSchist, new Vector2(X16, Y16)); -// return; - -// case BlockId.Coal: -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CoalWood); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackCoal, new Vector2(X16, Y16)); -// return; - -// case BlockId.OreAluminium: -// if (random.Next(4)!=1) DropItemToPos(X16, Y16, Items.Aluminium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackAluminium, new Vector2(X16, Y16)); -// return; - -// case BlockId.OreCopper: -// if (random.Next(4)!=1) DropItemToPos(X16, Y16, Items.ItemCopper); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.CopperDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackCopper, new Vector2(X16, Y16)); -// return; - -// case BlockId.OreGold: -// if (random.Next(4)!=1) DropItemToPos(X16, Y16, Items.ItemGold); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.GoldDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackGold, new Vector2(X16, Y16)); -// return; - -// case BlockId.OreIron: -// if (random.Next(4)!=1) DropItemToPos(X16, Y16, Items.ItemIron); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.IronDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackIron, new Vector2(X16, Y16)); -// return; - -// case BlockId.OreSilver: -// if (random.Next(4)!=1) DropItemToPos(X16, Y16, Items.ItemSilver); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SilverDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Silicium); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSilver, new Vector2(X16, Y16)); -// return; - -// case BlockId.OreTin: -// if (random.Next(4)!=1) DropItemToPos(X16, Y16, Items.ItemTin); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.TinDust); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackTin, new Vector2(X16, Y16)); -// return; - -// case BlockId.Cobblestone: -// DropItemToPos(X16, Y16, Items.BigStone); -// if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Gravel); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.BigStone); -// else if (random.Next(2)==1) DropItemToPos(X16, Y16, Items.Sand); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackCobblestone, new Vector2(X16, Y16)); -// return; - -// case BlockId.Gravel: -// DropItemToPos(X16, Y16, Items.Gravel); -// DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackGravel, new Vector2(X16, Y16)); -// return; - -// case BlockId.Sand: -// DropItemToPos(X16, Y16, Items.Sand); -// DestroySandUp(destroyBlock.X, destroyBlock.Y-1); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSand, new Vector2(X16, Y16)); -// return; - -// case BlockId.Dirt: -// DropItemToPos(X16, Y16, Items.Dirt); -// DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); -// return; - -// case BlockId.GrassBlockDesert: -// DropItemToPos(X16, Y16, Items.Dirt); -// DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); -// return; - -// case BlockId.GrassBlockForest: -// DropItemToPos(X16, Y16, Items.Dirt); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); -// return; - -// case BlockId.GrassBlockHills: -// DropItemToPos(X16, Y16, Items.Dirt); -// DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); -// return; - -// case BlockId.GrassBlockJungle: -// DropItemToPos(X16, Y16, Items.Dirt); -// DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); -// return; - -// case BlockId.GrassBlockPlains: -// DropItemToPos(X16, Y16, Items.Dirt); -// DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); -// terrain[X].IsBackground[Y]=true; -// terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); -// return; - -// case BlockId.Planks: -// DropItemToPos(X16, Y16, Items.Planks); -// return; - -// case BlockId.Bricks: -// DropItemToPos(X16, Y16, Items.Bricks); -// return; - -// case BlockId.AdvancedSpacePart1: -// DropItemToPos(X16, Y16, Items.AdvancedSpacePart1); -// return; - -// case BlockId.AdvancedSpacePart2: -// DropItemToPos(X16, Y16, Items.AdvancedSpacePart2); -// return; - -// case BlockId.AdvancedSpacePart3: -// DropItemToPos(X16, Y16, Items.AdvancedSpacePart3); -// return; - -// case BlockId.AdvancedSpacePart4: -// DropItemToPos(X16, Y16, Items.AdvancedSpacePart4); -// return; - -// case BlockId.Clay: -// DropItemToPos(X16, Y16, Items.Clay); -// return; - -// case BlockId.GrassBlockClay: -// DropItemToPos(X16, Y16, Items.Clay); -// return; - -// // } -// // break; - -// // case BlockType.Back: -// // switch ((BlockId)type) { -// case BlockId.AppleWood: -// DropItemToPos(X16, Y16, Items.WoodApple); -// return; - -// case BlockId.CherryWood: -// DropItemToPos(X16, Y16, Items.WoodCherry); -// return; - -// case BlockId.LemonWood: -// DropItemToPos(X16, Y16, Items.WoodLemon); -// return; - -// case BlockId.LindenWood: -// DropItemToPos(X16, Y16, Items.WoodLinden); -// return; - -// case BlockId.OakWood: -// DropItemToPos(X16, Y16, Items.WoodOak); -// return; - -// case BlockId.OrangeWood: -// DropItemToPos(X16, Y16, Items.WoodOrange); -// return; - -// case BlockId.PineWood: -// DropItemToPos(X16, Y16, Items.WoodPine); -// return; - -// case BlockId.PlumWood: -// DropItemToPos(X16, Y16, Items.WoodPlum); -// return; - -// case BlockId.SpruceWood: -// DropItemToPos(X16, Y16, Items.WoodSpruce); -// return; - -// case BlockId.MangroveWood: -// DropItemToPos(X16, Y16, Items.MangroveWood); -// return; - -// case BlockId.WillowWood: -// DropItemToPos(X16, Y16, Items.WillowWood); -// return; - -// case BlockId.OliveWood: -// DropItemToPos(X16, Y16, Items.OliveWood); -// return; - -// case BlockId.RubberTreeWood: -// DropItemToPos(X16, Y16, Items.RubberTreeWood); -// return; - -// case BlockId.KapokWood: -// DropItemToPos(X16, Y16, Items.KapokWood); -// return; - -// case BlockId.EucalyptusWood: -// DropItemToPos(X16, Y16, Items.EucalyptusWood); -// return; - -// case BlockId.AcaciaWood: -// DropItemToPos(X16, Y16, Items.AcaciaWood); -// return; -// } -// // break; - -// //case BlockType.Plant: -// // switch ((BlockId)type) { -// // case BlockId.Wheat: -// // DropItemToPos(X16, Y16, Items.WheatStraw); -// // DropItemToPos(X16, Y16, Items.WheatSeeds); -// // if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.WheatSeeds); -// // return; - -// // case BlockId.Onion: -// // DropItemToPos(X16, Y16, Items.Onion); -// // return; - -// // case BlockId.Flax: -// // DropItemToPos(X16, Y16, Items.Flax); -// // DropItemToPos(X16, Y16, Items.FlaxSeeds); -// // if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); -// // return; - -// // case BlockId.Strawberry: -// // DropItemToPos(X16, Y16, Items.PlantStrawberry); -// // if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.PlantStrawberry); -// // return; - -// // case BlockId.Rashberry: -// // DropItemToPos(X16, Y16, Items.PlantRashberry); -// // if (random.Next(8)==1)DropItemToPos(X16, Y16, Items.PlantRashberry); -// // return; - -// // case BlockId.Blueberry: -// // DropItemToPos(X16, Y16, Items.PlantBlueberry); -// // if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.PlantBlueberry); -// // return; -// // } -// // break; - -// //case BlockType.Mob: -// // switch ((BlockId)type) { -// // case BlockId.Chicken: -// // if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.WheatStraw); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.WheatSeeds); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.Seeds); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.Hay); -// // DropItemToPos(X16, Y16, Items.RabbitMeat); -// // return; - -// // case BlockId.Rabbit: -// // if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.WheatStraw); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.WheatSeeds); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.Seeds); -// // else if (random.Next(8)==1) DropItemToPos(X16, Y16, Items.Hay); -// // DropItemToPos(X16, Y16, Items.RabbitMeat); -// // return; - -// // case BlockId.Fish: -// // DropItemToPos(X16, Y16, Items.Fish); -// // return; -// // } -// // break; -// // } -// } - -// float GetBackBlockDestroingSpeed(byte type) { - -// switch ((BlockId)type) { -// // case BlockId.Lava: return new Block(lavaTexture,type); -// case BlockId.AdvancedSpaceBack: return 400*DestroyPickaxe(); - -// case BlockId.AppleWood: return 300*DestroyAxe(); -// case BlockId.CherryWood: return 300*DestroyAxe(); -// case BlockId.LemonWood: return 300*DestroyAxe(); -// case BlockId.LindenWood: return 320*DestroyAxe(); -// case BlockId.OakWood: return 320*DestroyAxe(); -// case BlockId.OrangeWood: return 300*DestroyAxe(); -// case BlockId.PineWood: return 300*DestroyAxe(); -// case BlockId.PlumWood: return 300*DestroyAxe(); -// case BlockId.SpruceWood: return 280*DestroyAxe(); -// } - -// return 0; -// } - -// float GetSolidBlockDestroingSpeed(byte type) { -// switch ((BlockId)type) { -// // case BlockId.Lava: return new Block(lavaTexture,type); -// case BlockId.GrassBlockDesert: return 100*DestroyShovel(); -// case BlockId.GrassBlockForest: return 100*DestroyShovel(); -// case BlockId.GrassBlockHills: return 105*DestroyShovel(); -// case BlockId.GrassBlockJungle: return 105*DestroyShovel(); -// case BlockId.GrassBlockPlains: return 95*DestroyShovel(); - -// case BlockId.Dirt: return 90*DestroyShovel(); -// case BlockId.Gravel: return 120*DestroyShovel(); - -// case BlockId.Sand: return 60*DestroyShovel(); - -// case BlockId.Cobblestone: return 280*DestroyPickaxe(); - - -// case BlockId.Roof1: return 120*DestroyPickaxe(); -// case BlockId.Roof2: return 120*DestroyPickaxe(); -// case BlockId.DoorClose: return 280*DestroyPickaxe(); - -// case BlockId.StoneBasalt: return 320*DestroyPickaxe(); -// case BlockId.StoneDiorit: return 300*DestroyPickaxe(); -// case BlockId.StoneDolomite: return 280*DestroyPickaxe(); -// case BlockId.StoneGabbro: return 320*DestroyPickaxe(); -// case BlockId.StoneGneiss: return 320*DestroyPickaxe(); -// case BlockId.StoneLimestone: return 280*DestroyPickaxe(); -// case BlockId.StoneRhyolite: return 300*DestroyPickaxe(); -// case BlockId.StoneSandstone: return 260*DestroyPickaxe(); -// case BlockId.StoneSchist: return 300*DestroyPickaxe(); - -// case BlockId.Coal: return 260*DestroyPickaxe(); -// case BlockId.OreAluminium: return 320*DestroyPickaxe(); -// case BlockId.OreCopper: return 320*DestroyPickaxe(); -// case BlockId.OreGold: return 300*DestroyPickaxe(); -// case BlockId.OreIron: return 320*DestroyPickaxe(); - -// case BlockId.OreSilver: return 300*DestroyPickaxe(); - -// case BlockId.OreTin: return 300*DestroyPickaxe(); - -// case BlockId.Ice: return 120*DestroyAxe(); - -// case BlockId.AdvancedSpaceBlock: return 100*DestroyPickaxe(); -// case BlockId.AdvancedSpaceFloor: return 100*DestroyPickaxe(); -// case BlockId.AdvancedSpaceWindow: return 100*DestroyPickaxe(); - -// case BlockId.Planks: return 100*DestroyAxe(); -// case BlockId.Bricks: return 160*DestroyPickaxe(); - -// //case BlockId.DolomiteBricks: return 280*DestroyPickaxe(); -// //case BlockId.BasaltBricks: return 280*DestroyPickaxe(); -// //case BlockId.LimestoneBricks: return 280*DestroyPickaxe(); -// //case BlockId.RhyoliteBricks: return 280*DestroyPickaxe(); -// //case BlockId.GneissBricks: return 280*DestroyPickaxe(); -// //case BlockId.SandstoneBricks: return 280*DestroyPickaxe(); -// //case BlockId.SchistBricks: return 280*DestroyPickaxe(); -// //case BlockId.GabbroBricks: return 280*DestroyPickaxe(); -// //case BlockId.DioritBricks: return 280*DestroyPickaxe(); - -// case BlockId.AdvancedSpacePart1: return 90*DestroyPickaxe(); -// case BlockId.AdvancedSpacePart2: return 90*DestroyPickaxe(); -// case BlockId.AdvancedSpacePart3: return 90*DestroyPickaxe(); -// case BlockId.AdvancedSpacePart4: return 90*DestroyPickaxe(); - -// } - -// return 0; -// } - -// float GetTopBlockDestroingSpeed(byte type) { -// switch ((BlockId)type) { -// case BlockId.Desk: return 45; -// case BlockId.FurnaceElectric: return 45; -// case BlockId.FurnaceStone: return 45; -// case BlockId.Ladder: return 90*DestroyAxe(); -// case BlockId.Lamp: return 45; -// case BlockId.Windmill: return 45; -// case BlockId.Watermill: return 45; -// case BlockId.Flag: return 45; -// case BlockId.SolarPanel: return 45; -// case BlockId.Label: return 30; - -// case BlockId.Snow: return 100*DestroyShovel(); - -// case BlockId.AppleLeaves: return 15; -// case BlockId.LemonLeavesWithLemons: return 15; -// case BlockId.LindenLeaves: return 15; -// case BlockId.OakLeaves: return 15; -// case BlockId.OrangeLeaves: return 15; -// case BlockId.SpruceLeaves: return 15; -// case BlockId.PlumLeavesWithPlums: return 15; -// case BlockId.PlumLeaves: return 15; -// case BlockId.PineLeaves: return 15; -// case BlockId.OrangeLeavesWithOranges: return 15; -// case BlockId.AppleLeavesWithApples: return 15; -// case BlockId.CherryLeaves: return 15; -// case BlockId.CherryLeavesWithCherries: return 15; -// case BlockId.LemonLeaves: return 15; - -// case BlockId.Violet: return 30*DestroyShovel(); -// case BlockId.Dandelion: return 30*DestroyShovel(); -// case BlockId.Heather: return 30*DestroyShovel(); -// case BlockId.Alore: return 30*DestroyShovel(); -// case BlockId.CactusBig: return 60; -// case BlockId.CactusSmall: return 60; - -// case BlockId.AppleSapling: return 30*DestroyShovel(); -// case BlockId.CherrySapling: return 30*DestroyShovel(); -// case BlockId.LemonSapling: return 30*DestroyPickaxe(); -// case BlockId.LindenSapling: return 30*DestroyPickaxe(); -// case BlockId.OakSapling: return 30*DestroyPickaxe(); -// case BlockId.OrangeSapling: return 30*DestroyPickaxe(); -// case BlockId.PineSapling: return 30*DestroyPickaxe(); -// case BlockId.PlumSapling: return 30*DestroyPickaxe(); -// case BlockId.SpruceSapling: return 30*DestroyPickaxe(); - -// case BlockId.GrassDesert: return 30*DestroyPickaxe(); -// case BlockId.GrassForest: return 30*DestroyPickaxe(); -// case BlockId.GrassHills: return 30*DestroyPickaxe(); -// case BlockId.GrassJungle: return 30*DestroyPickaxe(); -// case BlockId.GrassPlains: return 30*DestroyPickaxe(); - -// case BlockId.Liana: return 30*DestroyAxe(); -// case BlockId.Macerator: return 45; -// case BlockId.Miner: return 45; - -// case BlockId.Wheat: return 30; -// case BlockId.Onion: return 30; -// case BlockId.Flax: return 30; -// case BlockId.Glass: return 30; -// case BlockId.Orchid: return 30*DestroyShovel(); - -// case BlockId.Radio: return 45; -// case BlockId.Rose: return 30*DestroyShovel(); -// case BlockId.Seaweed: return 30; -// case BlockId.SugarCane: return 30; -// case BlockId.Toadstool: return 30; -// case BlockId.Strawberry: return 30; -// case BlockId.Rashberry: return 30; -// case BlockId.Blueberry: return 30; -// case BlockId.Boletus: return 30; - -// case BlockId.SnowTop: return 45; -// case BlockId.Roof1: return 90; -// case BlockId.Coral: return 60; -// case BlockId.BranchALittle1: return 30; -// case BlockId.BranchALittle2: return 30; -// case BlockId.BranchFull: return 30; -// case BlockId.BranchWithout: return 30; -// case BlockId.Champignon: return 30; -// case BlockId.DoorOpen: return 45; -// } - -// return 0; -// } - -// float GetPlantDestroingSpeed(byte type) { -// switch ((BlockId)type) { -// case BlockId.Wheat: return 30; -// case BlockId.Onion: return 30; -// case BlockId.Flax: return 30; - -// case BlockId.Strawberry: return 30; -// case BlockId.Rashberry: return 30; -// case BlockId.Blueberry: return 30; -// } - -// return 0; -// } - -// float DestroyPickaxe() { -// Items id = (Items)Inventory[boxSelected].X; -// if (id==Items.StonePickaxe) return 0.5f; -// if (id==Items.IronPickaxe) return 0.2f; -// if (id==Items.ElectricDrill) return 0.1f; -// if (id==Items.IronHeadPickaxe) return 0.87f; -// if (id==Items.StoneHead) return 0.90f; -// if (id==Items.MediumStone) return 0.96f; -// if (id==Items.SmallStone) return 0.98f; -// if (id==Items.BigStone) return 0.94f; -// return 1; -// } - -// float DestroyAxe() { -// Items id = (Items)Inventory[boxSelected].X; -// if (id==Items.StoneAxe) return 0.5f; -// if (id==Items.IronAxe) return 0.2f; -// if (id==Items.ElectricSaw) return 0.1f; -// if (id==Items.IronHeadAxe) return 0.87f; -// if (id==Items.StoneHead) return 0.90f; -// if (id==Items.MediumStone) return 0.96f; -// if (id==Items.SmallStone) return 0.98f; -// if (id==Items.BigStone) return 0.94f; -// if (id==Items.SawCopper) return 0.4f; -// if (id==Items.SawBronze) return 0.15f; -// if (id==Items.SawIron) return 0.08f; -// return 1; -// } - -// float DestroyShovel() { -// Items id = (Items)Inventory[boxSelected].X; -// if (id==Items.StoneShovel) return 0.5f; -// if (id==Items.IronShovel) return 0.2f; -// if (id==Items.ElectricDrill) return 0.1f; -// if (id==Items.IronHeadShovel) return 0.87f; -// if (id==Items.StoneHead) return 0.90f; -// if (id==Items.MediumStone) return 0.96f; -// if (id==Items.SmallStone) return 0.98f; -// if (id==Items.BigStone) return 0.94f; -// return 1; -// } - -// void GetItemsFromPlant(byte type, DInt _pos, bool grow) { -// DInt pos = new DInt(_pos.X*16, _pos.Y*16); -// if (grow) { -// switch ((BlockId)type) { -// case BlockId.Wheat: -// DropItemToPos(pos, Items.WheatStraw); -// DropItemToPos(pos, Items.WheatSeeds); -// if (random.Next(8)==1) DropItemToPos(pos, Items.WheatSeeds); -// break; - -// case BlockId.Onion: -// if (random.Next(2)==1) DropItemToPos(pos, Items.Onion); -// if (random.Next(2)==1) DropItemToPos(pos, Items.Onion); -// if (random.Next(2)==1) DropItemToPos(pos, Items.Onion); -// break; - -// case BlockId.Flax: -// DropItemToPos(pos, Items.Flax); -// DropItemToPos(pos, Items.FlaxSeeds); -// if (random.Next(8)==1) DropItemToPos(pos, Items.FlaxSeeds); -// break; - -// case BlockId.Strawberry: -// DropItemToPos(pos, Items.PlantStrawberry); -// if (random.Next(8)==1) DropItemToPos(pos, Items.PlantStrawberry); -// break; - -// case BlockId.Rashberry: -// DropItemToPos(pos, Items.PlantRashberry); -// if (random.Next(8)==1) DropItemToPos(pos, Items.PlantRashberry); -// break; - -// case BlockId.Blueberry: -// DropItemToPos(pos, Items.PlantBlueberry); -// if (random.Next(8)==1) DropItemToPos(pos, Items.PlantBlueberry); -// break; -// } -// } else { -// switch ((BlockId)type) { -// case BlockId.Wheat: -// // DropItemToPos(pos,Items.WheatStraw); -// // DropItemToPos(pos,Items.WheatSeeds); -// if (random.Next(8)==1) DropItemToPos(pos, Items.WheatSeeds); -// break; - -// case BlockId.Onion: -// DropItemToPos(pos, Items.Onion); -// break; - -// case BlockId.Flax: -// // DropItemToPos(pos,Items.Flax); -// // DropItemToPos(pos,Items.FlaxSeeds); -// if (random.Next(8)==1) DropItemToPos(pos, Items.FlaxSeeds); -// break; - -// case BlockId.Strawberry: -// DropItemToPos(pos, Items.PlantStrawberry); -// // if (random.Next(8)==1)DropItemToPos(pos,Items.StrawberryPlant); -// break; - -// case BlockId.Rashberry: -// DropItemToPos(pos, Items.PlantRashberry); -// // if (random.Next(8)==1)DropItemToPos(pos,Items.RashberryPlant); -// break; - -// case BlockId.Blueberry: -// DropItemToPos(pos, Items.PlantBlueberry); -// // if (random.Next(8)==1)DropItemToPos(pos,Items.PlantBlueberry); -// break; -// } -// } -// } - -// #endregion - -// #region Energy -// void EnergySystem() { -// for (int i = 0; i5) { -// foreach (Item item in DroppedItems) { -// if (item.X==ch.X*16) { -// if (item.Y>ch.Y*16) { -// if (MinerAddItem((int)item.Id, miner)) { -// DroppedItems.Remove(item); -// return; -// } -// } -// } -// } -// for (int y = ch.Y+1; y<100; y++) { -// if (terrain[ch.X].IsSolidBlocks[y]) { -// destroyBlock=new DInt(ch.X, y); -// GetItemsFromBlock(terrain[ch.X].SolidBlocks[y].Id, ch.X, y/*,BlockType.Solid*/); -// terrain[ch.X].SolidBlocks[y]=null; -// terrain[ch.X].IsSolidBlocks[y]=false; -// return; -// } -// } -// } -// } - -// void ChargerJob(ShortAndByte ch) { -// MashineBlockBasic charger = (MashineBlockBasic)terrain[ch.X].TopBlocks[ch.Y]; -// if (charger.Inv[0].X!=0) { -// if (charger.Energy>5) { -// if (charger.Inv[0].Y==1) { -// switch ((Items)charger.Inv[0].X) { -// case Items.ElectricDrillOff: -// charger.Inv[0].X=(int)Items.ElectricDrill; -// return; - -// case Items.ElectricSawOff: -// charger.Inv[0].X=(int)Items.ElectricSaw; -// return; - -// case Items.TorchElectricOFF: -// charger.Inv[0].X=(int)Items.TorchElectricON; -// return; -// } -// } - -// if (charger.Inv[0].Y<99) { -// switch ((Items)charger.Inv[0].X) { -// case Items.ElectricDrill: -// charger.Inv[0].Y++; -// charger.Energy-=5; -// return; - -// case Items.ElectricSaw: -// charger.Inv[0].Y++; -// charger.Energy-=5; -// return; - -// case Items.TorchElectricON: -// charger.Inv[0].Y++; -// charger.Energy-=5; -// return; -// } -// } -// } -// } -// } - -// #endregion - -// #region Prepare dialogs -// void MobileON() => (mobileOS=new Mobile.System() { Content=Rabcr.content }).Init(); - -// //void PrepareRocketDialog() { -// // if (buttonRocket==null) -// // buttonRocket=new GameButton(Textures.ButtonCenter,spriteFont_small,spriteFont_medium){ -// // Text="Odletět", -// // // center=true -// // }; -// //} - -// //void PrepareRadioDialog() { -// // if (buttonRocket==null) -// // buttonRocket=new GameButton(Textures.ButtonCenter,spriteFont_small,spriteFont_medium) { -// // Text="Otevřít", -// // // center=true -// // }; -// //} - -// #endregion - -// #region Inventory -// void ItemEat() { -// if (barEat>1) { -// switch (Inventory[boxSelected].X) { -// case (int)Items.Banana: -// barEat-=10; -// barWater-=1; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Olive: -// barEat-=2; -// barWater-=0.1f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Toadstool: -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// Die(Lang.Texts[166]/* "Muchomůrka je jedovatá","Toadstool is poisonous"*/); -// break; - -// case (int)Items.Boletus: -// barEat-=1.5f; -// barWater-=0.1f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Champignon: -// barEat-=1.5f; -// barWater-=0.1f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Lemon: -// barEat-=5; -// // barHeart -=0.1; -// barWater-=3; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Orange: -// barEat-=9; -// barWater-=3; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Cherry: -// barEat-=2; -// barWater-=0.1f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.BucketWater: -// barEat-=0.01f; -// barWater-=20; -// DropItemToPos(PlayerX, PlayerY, Items.Bucket); -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Dandelion: -// barEat-=2; -// barWater-=0.01f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Plum: -// barEat-=5; -// barWater-=0.05f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Rashberry: -// barEat-=2; -// barWater-=0.3f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Apple: -// barEat-=12; -// barWater--; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.RabbtCookedMeat: -// barEat-=30; -// barWater-=2; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.RabbitMeat: -// barEat-=10; -// barWater-=1; -// if (random.Next(5)==1) { -// barHeart+=5; -// if (barHeart>32) barHeart=32; -// } -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Strawberry: -// barEat-=3; -// barWater-=0.5f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.WheatSeeds: -// barEat--; -// barWater-=0.002f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// case (int)Items.Blueberries: -// barEat-=2; -// barWater-=0.2f; -// InventoryRemoveDInt(); -// if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); -// break; - -// } -// } - -// if (barWater>1) { -// if (Inventory[boxSelected].Y>2) { -// switch (Inventory[boxSelected].X) { -// case (int)Items.BottleWater: -// barWater-=5; -// InventoryRemoveDInt(); -// break; -// } -// } else { -// switch (Inventory[boxSelected].X) { -// case (int)Items.BottleWater: -// barWater-=5; -// Inventory[boxSelected].X=(int)Items.Bottle; -// break; -// } -// } -// } - -// if (barEat>32) barEat=32; -// if (barWater>32) barWater=32; -// if (barEat<0) barEat=0; -// if (barWater<0) barWater=0; -// } - -// void RemovePartTool() { -// int id = Inventory[boxSelected].X; -// int count = Inventory[boxSelected].Y; - -// if (id<(int)Items._SystemMaxTools) { -// //if (count==1) { -// // Items newId=GameMethods.ToolToBasic((Items)id); -// // if (newId!=Items.None) { -// // Inventory[boxSelected].X=(int)newId; -// // return; -// // } -// float i = GameMethods.ToolMaxUses((Items)id); - -// if (count>1) { -// if (i!=-1) { -// if (i==(int)i) { -// if (i(i-(int)i)*100 ? 1 : 0)+(int)i; -// if (newii*100) { -// if (i list) { -// foreach (Item i in list) { -// // i.UpdateItem(); -// //Console.WriteLine(i.X +"|"+ PlayerX +"|"+i.Y +"|"+ PlayerY); -// if (i.X>PlayerX-11-16&&i.XPlayerY-20&&i.Y0&&i.Y<124*16) { -// if (!terrain[i.X/16].IsSolidBlocks[i.Y/16+1]) { -// i.Y+=2; -// } -// } -// if (i.Y>5000) { -// list.Remove(i); -// break; -// } -// } -// } -// } - -// void ItemGravity(DInt item) { -// distanceToGround=100000; - -// for (int y = (item.X+20-16)/16; y<(item.Y+20-16)/16+6; y++) { -// for (int x = (item.X-11)/16; x<(item.X+11+16)/16; x++) { -// if (terrain[x]!=null) { -// if (terrain[x].IsSolidBlocks[y]) { -// if (/*y*16-PlayerY-39/2>0 &&*/ y*16-item.Y-200) { -// item.Y+=distanceToGround; -// gravitySpeed=0; -// return; -// } else { -// gravitySpeed+=.4905f; -// if (gravitySpeed>6) gravitySpeed=6; -// item.Y+=(int)gravitySpeed; - - -// } -// // } - - -// } - -// // Crafting basic -// void SetInvCraftingBlocks() { -// inventoryScrollbarValueCraftingMax=2; -// for (int i = 0; i(int)Items._NonStacktable) { -// for (int i = 0; iGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+53+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; - -// if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YinventoryScrollbarValueCraftingMax) break; - -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { - -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx) { -// // if (newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8) { -// // if (newMouseState.YinventoryScrollbarValueCraftingMax) break; - -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { - -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YinventoryScrollbarValueCraftingMax) break; - -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YinventoryScrollbarValueCraftingMax) break; - -// if (In40(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; -// if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; -// if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) { -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; -// if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; -// if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; -// if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; -// if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.Yx+39) return false; -// if (mouseRealPos.Y>y+39) return false; -// return true; -// } - -// bool In(int x, int y, int w, int h) { -// if (mouseRealPos.Yw) return false; -// if (mouseRealPos.Y>h) return false; -// return true; -// } - -// void CraftingEventsCraft() { - -// if (buttonCraft1x.Click) { MakeCrafting(1); return; } - -// if (buttonCraft10x.Click) { MakeCrafting(10); return; } - -// if (buttonCraft100x.Click) { MakeCrafting(100); return; } -// } - -// void CraftingEvents() { - - -// if (SelectedCraftingRecipe!=-1) { -// if (CurrentDeskCrafting==null) throw new Exception("Pravděpodobně chybí recept - doplň v GameMethods"); -// CraftingIn[] slots = CurrentDeskCrafting[SelectedCraftingRecipe].Input; -// if (CurrentDeskCrafting!=null) { -// if (CurrentDeskCrafting.Length!=1) { -// // CraftingIn[] slots=CurrentDeskCrafting[SelectedCraftingRecipe].Input; - -// if (buttonNext.Click) { -// SelectedCraftingRecipe++; -// if (SelectedCraftingRecipe==CurrentDeskCrafting.Length) SelectedCraftingRecipe=0; -// SetNeed(); -// } - -// if (buttonPrev.Click) { -// SelectedCraftingRecipe--; -// if (SelectedCraftingRecipe==-1) SelectedCraftingRecipe=CurrentDeskCrafting.Length-1; -// SetNeed(); -// } -// } -// } - - - -// int i = 0; -// for (int y = 0; y<2; y++) { -// for (int x = 0; x<6; x++) { -// if (slots.Length==i) break; -// CraftingIn slot = slots[i]; -// DInt[] item = slot.ItemSlot; -// if (item.Length>1) { -// if (mouseLeftDown) { -// // Global.WindowWidthHalf-300+4+200+80+40+8+x*40, y*40+Global.WindowHeightHalf-200+2+4+200+8+8, 40, 40 - -// if (In40(Global.WindowWidthHalf-300+4+200+80+40+8+x*40, y*40+Global.WindowHeightHalf-200+2+4+200+8+8)) { - -// //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+80+40+8+x*40 -// //&& newMouseState.Y>y*40+Global.WindowHeightHalf-200+2+4+200+8+8 -// //&& newMouseState.X< Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40 -// //&& newMouseState.Ycount) { -// Inventory[i].Y-=count; -// break; -// } else { -// count-=Inventory[i].Y; -// if (item.X>(int)Items._SystemMaxTools) { -// Inventory[i].X=0; -// Inventory[i].Y=0; -// } else { -// Items expec = GameMethods.ToolToBasic((Items)Inventory[i].X); -// if (expec==Items.None) { -// Inventory[i].X=0; -// Inventory[i].Y=0; -// } else { -// Inventory[i].Y=1; -// Inventory[i].X=(int)expec; -// } -// } -// } -// } -// } -// } - -// foreach (CraftingOut d in CurrentDeskCrafting[selectedCraftingItem].Output) { -// if (d.EveryTime) ItemDrop(d.Item.X, d.Item.Y, PlayerX-11, PlayerY-16); -// else ItemDrop(d.Item.X, random.Next(d.ChanceMin, d.ChanceMax), PlayerX-11, PlayerY-16); -// } -// } -// } -// SetNeed(); -// } - -// void SetNeed() { -// if (SelectedCraftingRecipe==-1) return; -// if (CurrentDeskCrafting==null) return; -// CraftingIn[] slots = CurrentDeskCrafting[SelectedCraftingRecipe].Input; - -// int i = 0; -// for (int y = 0; y<2; y++) { -// for (int x = 0; x<6; x++) { -// if (slots.Length==i) break; -// CraftingIn slot = slots[i]; -// DInt[] item = slot.ItemSlot; - -// if (slot.SelectedItem==-1) { -// slot.TmpSelected=random.Next(item.Length); -// slot.Texture=ItemIdToTexture(item[slot.TmpSelected].X); -// } else { -// DInt selectedSlot = item[slot.SelectedItem]; -// if (item.Length==1) { -// slot.Texture=ItemIdToTexture(item[0].X); -// slot.HaveItemInInventory=TotalItemsInInventory(slot.ItemSlot[0].X)>=slot.ItemSlot[0].Y; -// } else { -// slot.Texture=ItemIdToTexture(item[slot.SelectedItem].X); -// } - - -// } - -// i++; - - -// } -// } -// } - -// void SetPlayerClothes() { -// switch (InventoryClothes[0].X) { -// case (int)Items.Cap: -// TextureWalkingClothesHead=TextureWalkingCap; -// TextureStaticClothesHead=TextureStaticCap; -// break; - -// case (int)Items.Hat: -// TextureWalkingClothesHead=TextureWalkingHad; -// TextureStaticClothesHead=TextureStaticHad; -// break; - -// case (int)Items.Crown: -// TextureWalkingClothesHead=TextureWalkingCrown; -// TextureStaticClothesHead=TextureStaticCrown; -// break; - -// case (int)Items.SpaceHelmet: -// TextureWalkingClothesHead=TextureWalkingSpaceHelmet; -// TextureStaticClothesHead=TextureStaticSpaceHelmet; -// break; - -// default: -// TextureWalkingClothesHead=null; -// TextureStaticClothesHead=null; -// break; -// } - -// switch (InventoryClothes[1].X) { -// case (int)Items.CoatArmy: -// TextureWalkingClothesChestTop=TextureWalkingCoatArmy; -// TextureStaticClothesChestTop=TextureStaticCoatArmy; -// TextureSwimmingClothesChestTop=TextureSwimmingCoatArmy; -// break; - -// case (int)Items.CoatGray: -// TextureWalkingClothesChestTop=TextureWalkingCoatGray; -// TextureStaticClothesChestTop=TextureStaticCoatGray; -// TextureSwimmingClothesChestTop=TextureSwimmingCoatGray; -// break; - -// case (int)Items.JacketDenim: -// TextureWalkingClothesChestTop=TextureWalkingJacketDenim; -// TextureStaticClothesChestTop=TextureStaticJacketDenim; -// TextureSwimmingClothesChestTop=TextureSwimmingJacketDenim; -// break; - -// case (int)Items.JacketFormal: -// TextureWalkingClothesChestTop=TextureWalkingJacketFormal; -// TextureStaticClothesChestTop=TextureStaticJacketFormal; -// TextureSwimmingClothesChestTop=TextureSwimmingJacketFormal; -// break; - -// case (int)Items.JacketRed: -// TextureWalkingClothesChestTop=TextureWalkingJacketRed; -// TextureStaticClothesChestTop=TextureStaticJacketRed; -// TextureSwimmingClothesChestTop=TextureSwimmingJacketRed; -// break; - -// case (int)Items.JacketShort: -// TextureWalkingClothesChestTop=TextureWalkingJacketShort; -// TextureStaticClothesChestTop=TextureStaticJacketShort; -// TextureSwimmingClothesChestTop=TextureSwimmingJacketShort; -// break; - -// case (int)Items.SpaceSuit: -// TextureWalkingClothesChestTop=TextureWalkingSpaceSuit; -// TextureStaticClothesChestTop=TextureStaticSpaceSuit; -// TextureSwimmingClothesChestTop=TextureSwimmingSpaceSuit; -// break; - -// default: -// TextureWalkingClothesChestTop=null; -// TextureStaticClothesChestTop=null; -// TextureSwimmingClothesChestTop=null; -// break; -// } - -// switch (InventoryClothes[2].X) { -// case (int)Items.BlueDress: -// TextureWalkingClothesChest=TextureWalkingBlueDress; -// TextureStaticClothesChest=TextureStaticBlueDress; -// TextureSwimmingClothesChest=TextureSwimmingBlueDress; -// break; - -// case (int)Items.GreenTShirt: -// TextureWalkingClothesChest=TextureWalkingGreenTShirt; -// TextureStaticClothesChest=TextureStaticGreenTShirt; -// TextureSwimmingClothesChest=TextureSwimmingGreenTShirt; -// break; - -// case (int)Items.LightBlueTShirt: -// TextureWalkingClothesChest=TextureWalkingLightBlueTShirt; -// TextureStaticClothesChest=TextureStaticLightBlueTShirt; -// TextureSwimmingClothesChest=TextureSwimmingLightBlueTShirt; -// break; - -// case (int)Items.Shirt: -// TextureWalkingClothesChest=TextureWalkingShirt; -// TextureStaticClothesChest=TextureStaticShirt; -// TextureSwimmingClothesChest=TextureSwimmingShirt; -// break; - -// case (int)Items.WhiteDress: -// TextureWalkingClothesChest=TextureWalkingWhiteDress; -// TextureStaticClothesChest=TextureStaticWhiteDress; -// TextureSwimmingClothesChest=TextureSwimmingWhiteDress; -// break; - -// default: -// TextureWalkingClothesChest=null; -// TextureStaticClothesChest=null; -// TextureSwimmingClothesChest=null; -// break; -// } - -// switch (InventoryClothes[3].X) { -// case (int)Items.TopBlackBikini: -// TextureWalkingClothesUpUnderwear=TextureWalkingTopBlackBikini; -// TextureStaticClothesUpUnderwear=TextureStaticTopBlackBikini; -// TextureSwimmingClothesUpUnderwear=TextureSwimmingTopBlackBikini; -// break; - -// case (int)Items.TopBlueBikini: -// TextureWalkingClothesUpUnderwear=TextureWalkingTopBlueBikini; -// TextureStaticClothesUpUnderwear=TextureStaticTopBlueBikini; -// TextureSwimmingClothesUpUnderwear=TextureSwimmingTopBlueBikini; -// break; - -// case (int)Items.GrayBra: -// TextureWalkingClothesUpUnderwear=TextureWalkingGrayBra; -// TextureStaticClothesUpUnderwear=TextureStaticGrayBra; -// TextureSwimmingClothesUpUnderwear=TextureSwimmingGrayBra; -// break; - -// case (int)Items.PurpleBra: -// TextureWalkingClothesUpUnderwear=TextureWalkingPurpleBra; -// TextureStaticClothesUpUnderwear=TextureStaticPurpleBra; -// TextureSwimmingClothesUpUnderwear=TextureSwimmingPurpleBra; -// break; - -// case (int)Items.RedBra: -// TextureWalkingClothesUpUnderwear=TextureWalkingRedBra; -// TextureStaticClothesUpUnderwear=TextureStaticRedBra; -// TextureSwimmingClothesUpUnderwear=TextureSwimmingRedBra; -// break; - -// default: -// TextureWalkingClothesUpUnderwear=null; -// TextureStaticClothesUpUnderwear=null; -// TextureSwimmingClothesUpUnderwear=null; -// break; -// } - -// switch (InventoryClothes[4].X) { -// case (int)Items.ArmyTrousers: -// TextureWalkingClothesLegs=TextureWalkingArmyTrousers; -// TextureStaticClothesLegs=TextureStaticArmyTrousers; -// TextureSwimmingClothesLegs=TextureSwimmingArmyTrousers; -// break; - -// case (int)Items.BlackSkirt: -// TextureWalkingClothesLegs=TextureWalkingBlackSkirt; -// TextureStaticClothesLegs=TextureStaticBlackSkirt; -// TextureSwimmingClothesLegs=TextureSwimmingBlackSkirt; -// break; - -// case (int)Items.Jeans: -// TextureWalkingClothesLegs=TextureWalkingJeans; -// TextureStaticClothesLegs=TextureStaticJeans; -// TextureSwimmingClothesLegs=TextureSwimmingJeans; -// break; - -// case (int)Items.PinkSkirt: -// TextureWalkingClothesLegs=TextureWalkingPinkSkirt; -// TextureStaticClothesLegs=TextureStaticPinkSkirt; -// TextureSwimmingClothesLegs=TextureSwimmingPinkSkirt; -// break; - -// case (int)Items.Shorts: -// TextureWalkingClothesLegs=TextureWalkingShorts; -// TextureStaticClothesLegs=TextureStaticShorts; -// TextureSwimmingClothesLegs=TextureSwimmingShorts; -// break; - -// case (int)Items.SpaceTrousers: -// TextureWalkingClothesLegs=TextureWalkingSpaceTrousers; -// TextureStaticClothesLegs=TextureStaticSpaceTrousers; -// TextureSwimmingClothesLegs=TextureSwimmingSpaceTrousers; -// break; - -// default: -// TextureWalkingClothesLegs=null; -// TextureStaticClothesLegs=null; -// TextureSwimmingClothesLegs=null; -// break; -// } - -// switch (InventoryClothes[5].X) { -// case (int)Items.BlackBikini: -// TextureWalkingClothesDownUnderwear=TextureWalkingBlackBikini; -// TextureStaticClothesDownUnderwear=TextureStaticBlackBikini; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingBlackBikini; -// break; - -// case (int)Items.BlueBikini: -// TextureWalkingClothesDownUnderwear=TextureWalkingBlueBikini; -// TextureStaticClothesDownUnderwear=TextureStaticBlueBikini; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingBlueBikini; -// break; - -// case (int)Items.BlueUnderpants: -// TextureWalkingClothesDownUnderwear=TextureWalkingBlueUnderpants; -// TextureStaticClothesDownUnderwear=TextureStaticBlueUnderpants; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingBlueUnderpants; -// break; - -// case (int)Items.BoxerShorts: -// TextureWalkingClothesDownUnderwear=TextureWalkingBoxerShorts; -// TextureStaticClothesDownUnderwear=TextureStaticBoxerShorts; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingBoxerShorts; -// break; - -// case (int)Items.Shorts: -// TextureWalkingClothesDownUnderwear=TextureWalkingShorts; -// TextureStaticClothesDownUnderwear=TextureStaticShorts; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingShorts; -// break; - -// case (int)Items.GrayUnderpants: -// TextureWalkingClothesDownUnderwear=TextureWalkingGrayUnderpants; -// TextureStaticClothesDownUnderwear=TextureStaticGrayUnderpants; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingGrayUnderpants; -// break; - -// case (int)Items.PantiesLightBlue: -// TextureWalkingClothesDownUnderwear=TextureWalkingPantiesLightBlue; -// TextureStaticClothesDownUnderwear=TextureStaticPantiesLightBlue; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingPantiesLightBlue; -// break; - -// case (int)Items.PantiesRed: -// TextureWalkingClothesDownUnderwear=TextureWalkingPantiesRed; -// TextureStaticClothesDownUnderwear=TextureStaticPantiesRed; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingPantiesRed; -// break; - -// case (int)Items.Swimsuit: -// TextureWalkingClothesDownUnderwear=TextureWalkingSwimsuit; -// TextureStaticClothesDownUnderwear=TextureStaticSwimsuit; -// TextureSwimmingClothesDownUnderwear=TextureSwimmingSwimsuit; -// break; - -// default: -// TextureWalkingClothesDownUnderwear=null; -// TextureStaticClothesDownUnderwear=null; -// TextureSwimmingClothesDownUnderwear=null; -// break; -// } - -// switch (InventoryClothes[6].X) { -// case (int)Items.FormalShoes: -// TextureWalkingClothesFeet=TextureWalkingFormalShoes; -// TextureStaticClothesFeet=TextureStaticFormalShoes; -// TextureSwimmingClothesFeet=TextureSwimmingFormalShoes; -// break; - -// case (int)Items.Pumps: -// TextureWalkingClothesFeet=TextureWalkingPumps; -// TextureStaticClothesFeet=TextureStaticPumps; -// TextureSwimmingClothesFeet=TextureSwimmingPumps; -// break; - -// case (int)Items.Sneakers: -// TextureWalkingClothesFeet=TextureWalkingSneakers; -// TextureStaticClothesFeet=TextureStaticSneakers; -// TextureSwimmingClothesFeet=TextureSwimmingSneakers; -// break; - -// case (int)Items.SpaceBoots: -// TextureWalkingClothesFeet=TextureWalkingSpaceBoots; -// TextureStaticClothesFeet=TextureStaticSpaceBoots; -// TextureSwimmingClothesFeet=TextureSwimmingSpaceBoots; -// break; - -// default: -// TextureWalkingClothesFeet=null; -// TextureStaticClothesFeet=null; -// TextureSwimmingClothesFeet=null; -// break; -// } - -// if (InventoryClothes[7].X==(int)Items.Backpack) { -// maxInvCount=45+49; -// } else { -// if (maxInvCount>49) { -// for (int i = 49; i=items[i].Y; -// if (In40(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20)) { -// if (mouseLeftDown) { -// displayPopUpWindow=false; -// PopUpWindowSelectedItem=i; -// slots[PopUpWindowChoosingPotencialdItem].SelectedItem=slots[PopUpWindowChoosingPotencialdItem].TmpSelected=i; -// slots[PopUpWindowChoosingPotencialdItem].Texture=ItemIdToTexture(items[i].X); -// slots[PopUpWindowChoosingPotencialdItem].HaveItemInInventory=hasItem; -// return; -// } -// if (hasItem) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.DarkGray); -// else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.Red); -// } else { -// if (hasItem) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.White); -// else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), new Color(255, 150, 150)); -// } - -// GameDraw.DrawItemInInventory(ItemIdToTexture(items[i].X), items[i], Global.WindowWidthHalf-150+10+x*40+4, Global.WindowHeightHalf-100+y*40+20+4); - -// i++; -// } -// } - -// //i=0; -// //for (int y=0; y<4; y++) { -// // for (int x=0; x<7; x++) { - -// // GameDraw.DrawItemInInventory(ItemIdToTexture(items[i].X), items[i], Global.WindowWidthHalf-150+10+x*40+4, Global.WindowHeightHalf-100+y*40+20+4); -// // i++; -// // } -// //} -// // buttonOK.ButtonDraw(spriteBatch,mouseLeftDown,mouseRealPos); - -// //DrawInventoryWithDIntMoving(); -// //InventoryDrawClothes(); -// //#region Crafting -// //{ -// // if (inventoryScrollbarValueCraftingMax>6*4) { -// // int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); -// // int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / inventoryScrollbarValueCraftingMax*(160-size2) )*8; -// // if (size2>20) { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); -// // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); -// // } else { -// // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); -// // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); -// // } -// // } - -// // int xx =0; -// // int yh=0; - -// // for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; - -// // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YGlobal.WindowWidthHalf-140+x*40 -// // && newMouseState.Y>Global.WindowHeightHalf-60+y*40 -// // && newMouseState.XinventoryScrollbarValueCraftingMax) break; - -// // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YmaxInvCount) break; -// spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); - -// if (Inventory[i].X!=0) { -// if (!invMove||(invMove&&invStart!=i)) { -// Texture2D tex = ItemIdToTexture(Inventory[i].X); -// if (tex!=null) GameDraw.DrawItemInInventory(tex, Inventory[i], Global.WindowWidthHalf-300+4+200+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); -// } -// } -// xx+=40; - -// if (xx==9*40) { -// xx=0; -// yh+=40; -// } -// } -// if (maxInvCount>45) { -// int size = (int)(1f/(((int)(maxInvCount/9f)+1)*40/200f)*200); -// int pos = (int)(inventoryScrollbarValue*9/40f/maxInvCount*(200-size))*4; -// if (size>20) { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); -// spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1, 20, size-20), Color.White); -// spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), Color.White); -// } else { -// spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); -// Rabcr.spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), Color.White); -// } -// } -// } - -// void DrawRightInventoryNormal() { -// for (int i = 0; i<5; i++) { -// if (boxSelected==i) Rabcr.spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.LightBlue); -// else Rabcr.spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.White); - -// if (Inventory[i].X!=0) { -// if (!invMove||(invMove&&invStart!=i)) { -// Texture2D tex = ItemIdToTexture(Inventory[i].X); -// if (tex!=null) GameDraw.DrawItemInInventory(tex, Inventory[i], Global.WindowWidth-36, Global.WindowHeightHalf-80+i*40+4); -// } -// } -// } -// } - -// void DrawInventoryWithDIntMoving() { -// if (Global.WorldDifficulty==2) return; -// int xx = 0, yh = 0; -// for (int i = inventoryScrollbarValue+5; imaxInvCount) break; -// Rabcr.spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); - -// if (Inventory[i].X!=0) { -// if (!invMove||(invMove&&invStartDInt!=Inventory[i])) { -// Texture2D tex = ItemIdToTexture(Inventory[i].X); -// if (tex!=null) GameDraw.DrawItemInInventory(tex, Inventory[i], Global.WindowWidthHalf-300+4+200+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); -// } -// } -// xx+=40; - -// if (xx==9*40) { -// xx=0; -// yh+=40; -// } -// } -// if (maxInvCount>45) { -// int size = (int)(1f/(((int)(maxInvCount/9f)+1)*40/200f)*200); -// int pos = (int)(inventoryScrollbarValue*9/40f/maxInvCount*(200-size))*4; -// if (size>20) { -// Rabcr.spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); -// Rabcr.spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1, 20, size-20), Color.White); -// Rabcr.spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), Color.White); -// } else { -// Rabcr.spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); -// Rabcr.spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), Color.White); -// } -// } -// } - -// void CreateGradientTexture() { -// TextureSunGradient?.Dispose(); - -// int height=Global.WindowHeight; - -// int start=0; -// Color[] colors=new Color[height]; -// Color ColorBef; - -// for (int p=1; p (F1 skrýt)"+Environment.NewLine+"----------------------------------"+Environment.NewLine+ + "[Pozice hráče] X: "+PlayerX+", Y: "+PlayerY+Environment.NewLine+ + "[Pozice myše] X: "+(int)mousePos.X+", Y: "+(int)mousePos.Y+Environment.NewLine+ + Environment.NewLine+ + "[Velikost světa]: "+TerrainLenght+Environment.NewLine+ + "[Vykreslovací plocha] "+((terrainStartIndexW-terrainStartIndexX)*(terrainStartIndexH-terrainStartIndexY))+Environment.NewLine+ + "[Svět]: "+world+Environment.NewLine+ + "[Gravitační zrychlení]: "+(gravity*20)+Environment.NewLine+ + Environment.NewLine+ + "[Počet Itemů]: "+DroppedItems.Count+Environment.NewLine+ + "[Energie]: "+energy.Count+Environment.NewLine+ + "[Čas]: "+time/hour+":"+((int)((time-(time/hour*hour))*(60f/hour))).ToString("00")+Environment.NewLine+ + "[Světlo]: "+dayAlpha+Environment.NewLine+ + "[Moon]: "+(moonSpeed/46)+Environment.NewLine+ + Environment.NewLine+ + "[Fps]: "+(int)Math.Round(fps, 2)+Environment.NewLine+ + "[CPU] Proces: "+(usageCpuProcess/Environment.ProcessorCount).ToString("0.00")+"%, Volné cpu: "+(100-usageCpu).ToString("0.00")+"%"+Environment.NewLine+ + "[RAM] Proces: "+(usageRamProcess/1048576).ToString("0.00")+"MB, Volná ram: "+usageRam.ToString("0.00")+"MB"+Environment.NewLine, Color.White); + } else if (Setting.Fps) { + fpss+=1000f/(float)gameTime.ElapsedGameTime.TotalMilliseconds; + timerDraw60--; + if (timerDraw60<0) { + timerDraw60=59; + fps=fpss/60f; + + fpss=0; + } + if (gameTime.ElapsedGameTime.TotalMilliseconds!=0) GameDraw.DrawTextShadowMin(5, 5, "Fps: "+(int)Math.Round(fps, 2), new Color(dayAlpha, dayAlpha, dayAlpha)); + } + #endregion + + spriteBatch.End(); + #endregion + + + // DrawPlayer(spriteBatch); + // spriteBatch.End(); + + // spriteBatch.Begin(SpriteSortMode.Deferred, null, Setting.SamplerState, null, null, null); + + // if (show) { + + // #region Draw Bars + // if (Global.WorldDifficulty!=2) { + // // Energy bar + // spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8),new Rectangle(0,0,32,(int)barEnergy),Color.Gray); + // spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8+(int)barEnergy),new Rectangle(0,(int)barEnergy,32,32-(int)barEnergy),Color.White); + + // // Oxygen bar + // spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8),new Rectangle(0,0,32,(int)barOxygen),Color.Gray); + // spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8+(int)barOxygen),new Rectangle(0,(int)barOxygen,32,32-(int)barOxygen),Color.White); + + // // Water bar + // spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8),new Rectangle(0,0,32,(int)barWater),Color.Gray); + // spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8+(int)barWater),new Rectangle(0,(int)barWater,32,32-(int)barWater),Color.White); + + // // Eat bar + // spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8),new Rectangle(0,0,32,(int)barEat),Color.Gray); + // spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8+(int)barEat),new Rectangle(0,(int)barEat,32,32-(int)barEat),Color.White); + + // // Heart bar + // spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8),new Rectangle(0,0,32,(int)barHeart),Color.Gray); + // spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8+(int)barHeart),new Rectangle(0,(int)barHeart,32,32-(int)barHeart),Color.White); + // } + // #endregion + + // buttonInv.ButtonDraw(spriteBatch,newMouseState.X,newMouseState.Y,Global.WindowWidth-32,Global.WindowHeight-32); + + // if (buttonInv.Click) ChangeInventoryState(false); + + //#region Draw Inventory + // switch (inventory) { + // #region Normal + // case 0: + // if (diserpeard==0) { + // gedo=null; + // text=""; + // } else { + // if (gedo!=null) { + // if (gedo.Text!="") { + // float alphaC; + // if (diserpeard>100) alphaC=1f; + // else alphaC=diserpeard/100f; + // Color alphaCC=new Color(alphaC,alphaC,alphaC,alphaC); + + // spriteBatch.Draw(messageLeft,new Vector2(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(gedo.Text).X/2),Global.WindowHeightHalf-55), alphaCC); + // spriteBatch.Draw(messageCenter,new Rectangle(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(gedo.Text).X/2)+19,Global.WindowHeightHalf-55,(int)spriteFont_small.MeasureString(gedo.Text).X,57), alphaCC); + // spriteBatch.Draw(messageRight,new Vector2(Global.WindowWidthHalf+(int)(spriteFont_small.MeasureString(gedo.Text).X/2)+19,Global.WindowHeightHalf-55), alphaCC); + + // gedo.DrawGedo(spriteBatch,true,Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(gedo.Text).X/2)+20,Global.WindowHeightHalf-40,(int)(alphaC*255)); + // } + // } + // } + + // // Basic right inventory + // for (int i=0; i<5; i++) { + // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),Color.LightBlue); + // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),null); + + // if (!invMove || (invMove && invStart!=i)) { + // Texture2D tex=ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80+i*40+4); + // } + // } + // break; + // #endregion + + // #region Writing message + // case 1: + // text =TextEdit(text); + // while (text.Length*13>750) text=text.Substring(0,text.Length-1); + // text =text.Replace("€","#"); + + // spriteBatch.Draw(messageLeft,new Vector2(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(text).X/2),Global.WindowHeightHalf-55), Color.White); + // spriteBatch.Draw(messageCenter,new Rectangle(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(text).X/2)+19,Global.WindowHeightHalf-55,(int)spriteFont_small.MeasureString(text).X,57), Color.White); + // spriteBatch.Draw(messageRight,new Vector2(Global.WindowWidthHalf+(int)(spriteFont_small.MeasureString(text).X/2)+19,Global.WindowHeightHalf-55), Color.White); + + // DrawTextShadowMin(Global.WindowWidthHalf-(int)(spriteFont_small.MeasureString(text).X/2)+20,Global.WindowHeightHalf-40,text); + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf+(int)(spriteFont_small.MeasureString(text).X/2)+20,Global.WindowHeightHalf-40,1,15),Color.Black); + + // // ChangeInventory(); + + // // Basic right inventory + // for (int i=0; i<5; i++) { + // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+4+i*40),Color.LightBlue); + // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+4+i*40),null); + + // if (!invMove || (invMove && invStart!=i)) { + // Texture2D tex=ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80-4+i*40); + // } + // } + // break; + // #endregion + + // #region Basic inventory - clothes, inventory and basic crafting + // case 2: + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,100)); + + // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, new Color(0,0,0,100)); + // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, new Color(0,0,0,200)); + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), new Color(10,140,255)); + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); + + // buttonClose.ButtonDraw(spriteBatch,newMouseState.X,newMouseState.Y,Global.WindowWidthHalf+300-32,Global.WindowHeightHalf-232+1); + + // spriteBatch.Draw(ItemBackpackTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); + // if (Setting.czechLanguage)DrawTextShadowMin(spriteFont_small,Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Baťůžek"); + // else DrawTextShadowMin(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, "Backpack"); + // #region Inventory + // { + // int xx =0; + // int yh=0; + // for (int i=inventoryScrollbarValue+5; imaxInvCount) break; + // spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); + + // if (!invMove || (invMove && invStart!=i)) { + // Texture2D tex=ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex,Inventory[i].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); + // } + // xx+=40; + + // if (xx==9*40) { + // xx=0; + // yh+=40; + // } + // } + // if (maxInvCount>45) { + // int size=(int)( (1f/((( (int)(maxInvCount/9f)+1 )*40)/200f))*200 ); + // int pos=(int)( ( ((inventoryScrollbarValue*9)/40f) / maxInvCount)*(200-size) )*4; + // if (size>20) { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); + // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1,20,size-20), Color.White); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), null); + // } else { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), null); + // } + // } + // } + // #endregion + + // #region Crafting + // { + // if (inventoryScrollbarValueCraftingMax>6*4) { + // int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); + // int pos2=(int)( ( ((inventoryScrollbarValueCrafting*5)/40f) / inventoryScrollbarValueCraftingMax)*(160-size2) )*8; + // if (size2>20) { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); + // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), null); + // } else { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), null); + // } + // } + + // //spriteBatch.Draw(inventoryChooseTexture,new Vector2(Global.WindowWidthHalf-300+4+40, Global.WindowHeightHalf-200+2+4+200+8), null); + // int xx =0; + // int yh=0; + + // for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.Yl.Length-1) craftingType=0; + // Need=l[craftingType].List1; + // } + // } + + // if (buttonPrev.Click) { + // craftingType--; + // DListInt[] l=Craft(Crafting[selectedCraftingItem].X); + // if (l!=null) { + // if (craftingType<0) craftingType=l.Length-1; + // Need=l[craftingType].List1; + // } + // } + + // buttonCraft1x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10,Global.WindowHeightHalf+160-30+8+16)); + // buttonCraft10x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+80+8+10+10,Global.WindowHeightHalf+160-30+8+16)); + // buttonCraft100x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+170+8,Global.WindowHeightHalf+160-30+8+16)); + + // buttonPrev.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); + // buttonNext.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); + + // #region Craft new item + // if (buttonCraft1x.Click) { + // bool ok=true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); + // } + // } + // } + + // if (buttonCraft10x.Click) { + // for (int mm=0; mm<10; mm++) { + // bool ok=true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); + // } + // } + // } + // } + + // if (buttonCraft100x.Click) { + // for (int mm=0; mm<100; mm++) { + // bool ok=true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); + // } + // } + // } + // } + // #endregion + + // // Basic right inventory + // for (int i=0; i<5; i++) { + // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),Color.LightBlue); + // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),null); + + // if (!invMove || (invMove && invStart!=i)) { + // Texture2D tex=ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80+i*40+4); + // } + // } + // ChangeInventoryBasic(); + // text=""; + // break; + // #endregion + + // #region Basic inventory - clothes, inventory and full crafting + // case 3: + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight),new Color(0,0,0,100)); + + // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, new Color(0,0,0,100)); + // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, new Color(0,0,0,200)); + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), new Color(10,140,255)); + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); + + // buttonClose.ButtonDraw(spriteBatch,newMouseState.X,newMouseState.Y,Global.WindowWidthHalf+300-32,Global.WindowHeightHalf-232+1); + + // // spriteBatch.Draw(inventoryClothesTexture,new Vector2(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4), null); + + // spriteBatch.Draw(deskTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); + // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Stůl"); + // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Desk"); + // #region Inventory + // { + // int xx =0; + // int yh=0; + // for (int i=inventoryScrollbarValue+5; imaxInvCount) break; + // spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); + + // if (!invMove || (invMove && invStart!=i)) { + // Texture2D tex=ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex,Inventory[i].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); + // } + // xx+=40; + + // if (xx==9*40) { + // xx=0; + // yh+=40; + // } + // } + // if (maxInvCount>45) { + // int size=(int)( (1f/((( (int)(maxInvCount/9f)+1 )*40)/200f))*200 ); + // int pos=(int)( ( ((inventoryScrollbarValue*9)/40f) / maxInvCount)*(200-size) )*4; + // if (size>20) { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); + // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1,20,size-20), Color.White); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), null); + // } else { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), null); + // } + // } + // } + // #endregion + + // #region Crafting + // { + // if (inventoryScrollbarValueCraftingMax>6*4) { + // int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); + // int pos2=(int)( ( ((inventoryScrollbarValueCrafting*5)/40f) / inventoryScrollbarValueCraftingMax)*(160-size2) )*8; + // if (size2>20) { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); + // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), null); + // } else { + // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); + // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), null); + // } + // } + + // //spriteBatch.Draw(inventoryChooseTexture,new Vector2(Global.WindowWidthHalf-300+4+40, Global.WindowHeightHalf-200+2+4+200+8), null); + // int xx =0; + // int yh=0; + + // for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.Yl.Length-1) craftingType=0; + // Need=l[craftingType].List1; + // } + // } + + // if (buttonPrev.Click) { + // craftingType--; + // DListInt[] l= Craft(Crafting[selectedCraftingItem].X); + // if (l!=null) { + // if (craftingType<0) craftingType=l.Length-1; + // Need=l[craftingType].List1; + // } + // } + + // buttonCraft1x.ButtonDraw(spriteBatch,newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10,Global.WindowHeightHalf+160-30+8+16)); + // buttonCraft10x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+80+8+10+10,Global.WindowHeightHalf+160-30+8+16)); + // buttonCraft100x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+10+170+8,Global.WindowHeightHalf+160-30+8+16)); + + // buttonPrev.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); + // buttonNext.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X,newMouseState.Y),new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4,Global.WindowHeightHalf+160-30+8+16-20-30+5)); + + // #region Craft new item + // if (buttonCraft1x.Click) { + // bool ok=true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); + // } + // } + // } + + // if (buttonCraft10x.Click) { + // for (int mm=0; mm<10; mm++) { + // bool ok=true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); + // } + // } + // } + // } + + // if (buttonCraft100x.Click) { + // for (int mm=0; mm<100; mm++) { + // bool ok=true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X,d.Y,new DInt(PlayerX,(int)PlayerY)); + // } + // } + // } + // } + // #endregion + + // // Basic right inventory + // for (int i=0; i<5; i++) { + // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),Color.LightBlue); + // else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidth-40,Global.WindowHeightHalf-80+i*40),null); + + // if (!invMove || (invMove && invStart!=i)) { + // Texture2D tex=ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y,Global.WindowWidth-36,Global.WindowHeightHalf-80+i*40+4); + // } + // } + // ChangeInventoryBasic(); + // text=""; + // break; + // #endregion + + // #region Furnace + // case 4: + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0, 0, 0, 100)); + + // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, new Color(0, 0, 0, 100)); + // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, new Color(0, 0, 0, 200)); + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), new Color(10, 140, 255)); + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); + + // buttonClose.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf+300-32, Global.WindowHeightHalf-232+1); + + // // spriteBatch.Draw(inventoryClothesTexture,new Vector2(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4), null); + + // spriteBatch.Draw(furnaceElectricOneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); + // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Pec"); + // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Furnace"); + + // #region Inventory + // { + // int xx = 0; + // int yh = 0; + // for (int i = inventoryScrollbarValue+5; imaxInvCount) break; + // spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); + + // if (!invMove||(invMove&&invStart!=i)) { + // Texture2D tex = ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidthHalf-300+4+200+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); + // } + // xx+=40; + + // if (xx==9*40) { + // xx=0; + // yh+=40; + // } + // } + // if (maxInvCount>45) { + // int size = (int)((1f/((((int)(maxInvCount/9f)+1)*40)/200f))*200); + // int pos = (int)((((inventoryScrollbarValue*9)/40f)/maxInvCount)*(200-size))*4; + // if (size>20) { + // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); + // spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1, 20, size-20), Color.White); + // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), null); + // } else { + // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), null); + // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), null); + // } + // } + // } + // #endregion + + // #region Bake + // { + // if (inventoryScrollbarValueCraftingMax>6*4) { + // int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); + // int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; + // if (size2>20) { + // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); + // spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), Color.White); + // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), null); + // } else { + // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), null); + // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), null); + // } + // } + + // //spriteBatch.Draw(inventoryChooseTexture,new Vector2(Global.WindowWidthHalf-300+4+40, Global.WindowHeightHalf-200+2+4+200+8), null); + // int xx = 0; + // int yh = 0; + + // for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8&&newMouseState.Yl.Length-1) craftingType=0; + // Need=l[craftingType].List1; + // } + // } + + // if (buttonPrev.Click) { + // craftingType--; + // DListInt[] l = Bake(Crafting[selectedCraftingItem].X); + // if (l!=null) { + // if (craftingType<0) craftingType=l.Length-1; + // Need=l[craftingType].List1; + // } + // } + + // buttonCraft1x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10, Global.WindowHeightHalf+160-30+8+16)); + // buttonCraft10x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+10+80+8+10+10, Global.WindowHeightHalf+160-30+8+16)); + // buttonCraft100x.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+10+170+8, Global.WindowHeightHalf+160-30+8+16)); + + // buttonPrev.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); + // buttonNext.ButtonDraw(spriteBatch, newMouseState, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); + + // #region Craft new item + // if (buttonCraft1x.Click) { + // bool ok = true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X, d.Y, new DInt(PlayerX, (int)PlayerY)); + // } + // } + // } + + // if (buttonCraft10x.Click) { + // for (int mm = 0; mm<10; mm++) { + // bool ok = true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X, d.Y, new DInt(PlayerX, (int)PlayerY)); + // } + // } + // } + // } + + // if (buttonCraft100x.Click) { + // for (int mm = 0; mm<100; mm++) { + // bool ok = true; + // foreach (DInt n in Need) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (n.X==ii.X) { + // inInv+=ii.Y; + // } + // } + // if (inInvcount) { + // Inventory[i].Y-=count; + // break; + // } else { + // count-=Inventory[i].Y; + // Inventory[i]=new DInt(); + // } + // } + // } + // } + + + // foreach (DInt d in craft.List2) { + // ItemDrop(d.X, d.Y, new DInt(PlayerX, (int)PlayerY)); + // } + // } + // } + // } + // #endregion + + // // Basic right inventory + // for (int i = 0; i<5; i++) { + // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.LightBlue); + // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), null); + + // if (!invMove||(invMove&&invStart!=i)) { + // Texture2D tex = ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidth-36, Global.WindowHeightHalf-80+i*40+4); + // } + // } + // ChangeInventoryBasic(); + // text=""; + // break; + // #endregion + + // #region Macerator + // case 5: + // spriteBatch.Draw(Rabcr.Pixel,new Rectangle(PlayerX-424,(int)PlayerY-280,848,560),new Color(0,0,0,100)); + // //spriteBatch.Draw(boxSelectedTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2+boxSelected*32),Color.White); + // //spriteBatch.Draw(boxInventoryTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2),Color.White); + // //spriteBatch.Draw(maceratorInventoryTexture,new Vector2(PlayerX-240,PlayerY-108),Color.White); + // //if (macerator[selectMacerator].Energy>5) { + // // if (furnaceM1==0) { + // // //TDust(64); + + // // } + // //} + // spriteBatch.Draw(ItemBackpackTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); + // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Drtič"); + // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Macerator"); + // InventoryDrawItems(); + // //InventoryDrawDIntsMacerator(); + // //ChangeInventoryMacerator(); + // InventoryDrawItems(); + // text =""; + // break; + // #endregion + + // #region creative + // case 7: + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight), new Color(0, 0, 0, 100)); + + // DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, new Color(0, 0, 0, 100)); + // DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, new Color(0, 0, 0, 200)); + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), new Color(10, 140, 255)); + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); + + // buttonClose.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf+300-32, Global.WindowHeightHalf-232+1); + // // spriteBatch.Draw(ItemBackpackTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); + // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Itemy"); + // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Items"); { + // int xx = 0; + // int yh = 0; + // for (int i = inventoryScrollbarValue+5; imaxInvCount) break; + // spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+32+8+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); + + // if (!invMove||(invMove&&invStart!=i)) { + // Texture2D tex = ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidthHalf-300+32+8+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); + // } + // xx+=40; + + // if (xx==13*40) { + // xx=0; + // yh+=40; + // } + // } + // } + + // if (buttonClose.Click) inventory=0; + + // buttonInvTabBlocks.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-200+20-2-8); + // buttonInvTabMashines.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+2-2); + // buttonInvTabTools.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+32+4-2); + // buttonInvTabPlants.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+32+32+6-2); + // buttonInvTabItems.ButtonDraw(spriteBatch, newMouseState.X, newMouseState.Y, Global.WindowWidthHalf-300+10, Global.WindowHeightHalf-208+20+32+64+32+8-2); + + // if (buttonInvTabBlocks.Click) SetInvCreativeBlocks(); + // if (buttonInvTabMashines.Click) SetInvCreativeMashines(); + // if (buttonInvTabTools.Click) SetInvCreativeTools(); + // if (buttonInvTabPlants.Click) SetInvCreativePlants(); + // if (buttonInvTabItems.Click) SetInvCreativeItems(); + + // //buttonPrev.ButtonDraw(spriteBatch,<1>ew Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); + // ////buttonNext.ButtonDraw(spriteBatch, new Vector2(newMouseState.X, newMouseState.Y), new Vector2(Global.WindowWidthHalf+20+8+10+10+40+70-4, Global.WindowHeightHalf+160-30+8+16-20-30+5)); + + // // Basic right inventory + // for (int i = 0; i<5; i++) { + // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.LightBlue); + // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), null); + + // if (!invMove||(invMove&&invStart!=i)) { + // Texture2D tex = ItemIdToTexture(Inventory[i].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[i].Y, Global.WindowWidth-36, Global.WindowHeightHalf-80+i*40+4); + // } + // } + // ChangeInventoryCreative(); + // text=""; + + + // break; + // #endregion + + // #region Shelf + // case 8: + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(PlayerX-424, (int)PlayerY-280, 848, 560), new Color(0, 0, 0, 100)); + // //spriteBatch.Draw(boxSelectedTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2+boxSelected*32),Color.White); + // //spriteBatch.Draw(boxInventoryTexture,new Vector2(PlayerX+424-32,PlayerY-boxInventoryTexture.Height/2),Color.White); + // //spriteBatch.Draw(maceratorInventoryTexture,new Vector2(PlayerX-240,PlayerY-108),Color.White); + // //if (macerator[selectMacerator].Energy>5) { + // // if (furnaceM1==0) { + // // //TDust(64); + + // // } + // //} + // spriteBatch.Draw(ItemBackpackTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); + // if (Setting.czechLanguage) DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Polička"); + // else DrawTextShadowMin(Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10, "Shelf"); + // InventoryDrawItems(); + // //InventoryDrawDIntsMacerator(); + // //ChangeInventoryMacerator(); + // InventoryDrawItems(); + // text=""; + // break; + // #endregion + // } + // #endregion + + // #region Draw debug + // if (gameTime.ElapsedGameTime.TotalMilliseconds!=0) { + // if (debug) DrawTextShadowMin(spriteFont_small,5, 5, " Informace (F1 skrýt)" + Environment.NewLine +"----------------------------------"+Environment.NewLine + + // "[Pozice hráče] X: " + PlayerX + ", Y: " + PlayerY + Environment.NewLine + + // "[Pozice myše] X: " + (int)mousePos.X + ", Y: " + (int)mousePos.Y + Environment.NewLine + + // "[počet instancí]: " + ( + //grassPlains.Count + + //grassHills.Count + + //grassJungle.Count + + //grassForest.Count + + //grassDesert.Count + + + //grassPlainsBlock.Count + + //grassForestBlock.Count + + //grassJungleBlock.Count + + //grassDesertBlock.Count + + //grassHillsBlock.Count + + + //dirt.Count + + ////stone.Count + + + // dolomite.Count+ + // rhyolite.Count+ + // limestone.Count+ + // gneiss.Count+ + // schist.Count+ + // sandstone.Count+ + // basalt.Count+ + // gabbro.Count+ + // diorit.Count+ + + //sand.Count + + //gravel.Count+ + //cobblestone.Count+ + //ice.Count+ + //snow.Count+ + //waterBlock.Count+ + //snowTop.Count+ + + //plantDandelion.Count + + //plantOrchid.Count + + //plantViolet.Count + + //plantRose.Count + + + //ironOre.Count + + //goldOre.Count + + //aluminiumOre.Count + + //silverOre.Count + + //tinOre.Count + + //copperOre.Count + + //coalOre.Count+ + //oil.Count+ + + //cactusBig.Count + + //cactusLittle.Count + + //plantAlore.Count+ + //rocks.Count+ + //liana.Count+ + + //appleLeaves.Count+ + //appleWood.Count+ + //plumLeaves.Count+ + //plumWood.Count+ + //cherryLeaves.Count+ + //cherryWood.Count+ + //oakLeaves.Count+ + //oakWood.Count+ + //lindenWood.Count+ + //lindenLeaves.Count+ + //spruceLeaves.Count+ + //spruceWood.Count+ + //pineLeaves.Count+ + //pineWood.Count+ + // desk.Count+ + //cherrySapling.Count+ + //oakSapling.Count+ + //appleSapling.Count+ + //plumSapling.Count) + Environment.NewLine + + // "[Počet Itemů]: "+(DIntBlockLeaves.Count+DIntBricks.Count+DIntDirt.Count+DIntGlass.Count+DIntGravel.Count+DIntHayBlock.Count+DIntSand.Count+DIntAluminiumDust.Count+DIntBronzeDust.Count+DIntCoalDust.Count+DIntCopperDust.Count+DIntGoldDust.Count+DIntIronDust.Count+DIntSilverDust.Count+DIntStoneDust.Count + // +DIntDustSulfid.Count+DIntTinDust.Count+DIntUranDust.Count+DIntWoodDust.Count+DIntBattery.Count+DIntBigCircuit.Count+DIntBulb.Count+DIntCircuit.Count+DIntRubber.Count+DIntApple.Count+DIntBanana.Count+DIntCherry.Count+DIntOnion.Count+DIntPlum.Count+/*DIntPotatoes.Count+*/DIntRabbtCookedMeat.Count+DIntRabbitMeat.Count + // +DIntRashberry.Count+DIntStrawberry.Count+DIntAluminiumIngot.Count+DIntBronzeIngot.Count+DIntCopperIngot.Count+DIntGoldIngot.Count+DIntIronIngot.Count+DIntSilverIngot.Count+DIntTinIngot.Count+DIntUranIngot.Count+DIntDesk.Count+DIntDoor.Count+DIntFlag.Count+DIntFurnaceElectric.Count+DIntFurnaceStone.Count + // +DIntLabel.Count+DIntLadder.Count+DIntLamp.Count+DIntMacerator.Count+DIntMiner.Count+DIntRadio.Count+DIntRocket.Count+DIntSolarPanel.Count+DIntTorch.Count+DIntWaterMill.Count+DIntWindMill.Count+DIntCactus.Count+DIntDandelion.Count+DIntHay.Count+DIntLeather.Count+DIntLeave.Count+DIntOrchid.Count+DIntRose.Count + // +DIntSeeds.Count+DIntStick.Count+DIntSticks.Count+DIntViolet.Count+DIntWheatSeeds.Count+DIntWheatStraw.Count+DIntOakSapling.Count+DIntPineSapling.Count+DIntLindenSapling.Count+DIntPlumSapling.Count+DIntCherrySapling.Count+DIntAppleSapling.Count+DIntSpruceSapling.Count+DIntStrawberryPlant.Count+DIntRashberryPlant.Count + // +/*DIntPotatoesPlant.Count+*/DIntCoal.Count+DIntCopper.Count+DIntDiamond.Count+DIntGold.Count+DIntIron.Count+DIntPyrit.Count+DIntRuby.Count+DIntSaphirite.Count+DIntSilver.Count+DIntSmaragd.Count+DIntBigStone.Count+DIntMediumStone.Count+DIntSmallStone.Count+DIntTin.Count+/*DIntUran.Count+*/DIntBackpack.Count+DIntBucket.Count + // +DIntBucketWater.Count+DIntRope.Count+DIntLindenPlanks.Count+DIntLindenWood.Count+DIntSprucePlanks.Count+DIntSpruceWood.Count+DIntOakPlanks.Count+DIntOakWood.Count+DIntPinePlanks.Count+DIntPineWood.Count+DIntCherryPlanks.Count+DIntCherryWood.Count+DIntPlumPlanks.Count+DIntPlumWood.Count+DIntApplePlanks.Count+DIntAppleWood.Count)+Environment.NewLine+ + // "[Počet animací]: "+ (waterSquirt.Count + backgroundDirt.Count+ backgroundStone.Count+ backgroundGravel.Count+ backgroundSand.Count)+Environment.NewLine+ + // "[Zvířata] Ryba(y):" + fish.Count + ", Zajíc(i): "+rabbit.Count+", Kur "+chicken.Count+Environment.NewLine + + // "[Energie]: "+energy.Count+Environment.NewLine+ + // "[Čas]: hodina(y): " + (time/3000)+" minuta(y): " + ((time- (time/3000)*3000)/50)+Environment.NewLine+ + //"[Den]: "+day+Environment.NewLine,Color.DarkGray); + // else { + // if (Setting.Fps) { + // if (show) DrawTextShadowMin(spriteFont_small,5, 5, "Fps: " + Math.Round(1000 / gameTime.ElapsedGameTime.TotalMilliseconds),Color.DarkGray); + // } + // } + //} + //#endregion + // } + + //#region Draw debug + //// if (gameTime.ElapsedGameTime.TotalMilliseconds!=0) { + //if (debug) DrawTextShadowMin(spriteFont_small, 5, 5, " Informace (F1 skrýt)"+Environment.NewLine+"----------------------------------"+Environment.NewLine+ + // "[Pozice hráče] X: "+PlayerX+", Y: "+PlayerY+Environment.NewLine+ + // "[Pozice myše] X: "+(int)mousePos.X+", Y: "+(int)mousePos.Y+Environment.NewLine+ + // "[počet instancí]: "+( + // grassPlains.Count+ + // grassHills.Count+ + // grassJungle.Count+ + // grassForest.Count+ + // grassDesert.Count+ + + // grassPlainsBlock.Count+ + // grassForestBlock.Count+ + // grassJungleBlock.Count+ + // grassDesertBlock.Count+ + // grassHillsBlock.Count+ + + // dirt.Count+ + // //stone.Count+ + // sand.Count+ + // gravel.Count+ + // cobblestone.Count+ + // ice.Count+ + // snow.Count+ + // waterBlock.Count+ + // snowTop.Count+ + + // plantDandelion.Count+ + // plantOrchid.Count+ + // plantViolet.Count+ + // plantRose.Count+ + + // ironOre.Count+ + // goldOre.Count+ + // aluminiumOre.Count+ + // silverOre.Count+ + // tinOre.Count+ + // copperOre.Count+ + // coalOre.Count+ + // oil.Count+ + + // cactusBig.Count+ + // cactusLittle.Count+ + // plantAlore.Count+ + // rocks.Count+ + // liana.Count+ + + // appleLeaves.Count+ + // appleWood.Count+ + // plumLeaves.Count+ + // plumWood.Count+ + // cherryLeaves.Count+ + // cherryWood.Count+ + // oakLeaves.Count+ + // oakWood.Count+ + // lindenWood.Count+ + // lindenLeaves.Count+ + // spruceLeaves.Count+ + // spruceWood.Count+ + // pineLeaves.Count+ + // pineWood.Count+ + // desk.Count+ + // cherrySapling.Count+ + // oakSapling.Count+ + // appleSapling.Count+ + // plumSapling.Count)+Environment.NewLine+ + // // "[Počet DIntů]: "+(DIntBlockLeaves.Count+DIntBricks.Count+DIntDirt.Count+DIntGlass.Count+DIntGravel.Count+DIntHayBlock.Count+DIntSand.Count+DIntAluminiumDust.Count+DIntBronzeDust.Count+DIntCoalDust.Count+DIntCopperDust.Count+DIntGoldDust.Count+DIntIronDust.Count+DIntSilverDust.Count+DIntStoneDust.Count + // // +DIntDustSulfid.Count+DIntTinDust.Count+DIntUranDust.Count+DIntWoodDust.Count+DIntBattery.Count+DIntBigCircuit.Count+DIntBulb.Count+DIntCircuit.Count+DIntRubber.Count+DIntApple.Count+DIntBanana.Count+DIntCherry.Count+DIntOnion.Count+DIntPlum.Count+/*DIntPotatoes.Count+*/DIntRabbtCookedMeat.Count+DIntRabbitMeat.Count + // // +DIntRashberry.Count+DIntStrawberry.Count+DIntAluminiumIngot.Count+DIntBronzeIngot.Count+DIntCopperIngot.Count+DIntGoldIngot.Count+DIntIronIngot.Count+DIntSilverIngot.Count+DIntTinIngot.Count+DIntUranIngot.Count+DIntDesk.Count+DIntDoor.Count+DIntFlag.Count+DIntFurnaceElectric.Count+DIntFurnaceStone.Count + // // +DIntLabel.Count+DIntLadder.Count+DIntLamp.Count+DIntMacerator.Count+DIntMiner.Count+DIntRadio.Count+DIntRocket.Count+DIntSolarPanel.Count+DIntTorch.Count+DIntWaterMill.Count+DIntWindMill.Count+DIntCactus.Count+DIntDandelion.Count+DIntHay.Count+DIntLeather.Count+DIntLeave.Count+DIntOrchid.Count+DIntRose.Count + // // +DIntSeeds.Count+DIntStick.Count+DIntSticks.Count+DIntViolet.Count+DIntWheatSeeds.Count+DIntWheatStraw.Count+DIntOakSapling.Count+DIntPineSapling.Count+DIntLindenSapling.Count+DIntPlumSapling.Count+DIntCherrySapling.Count+DIntAppleSapling.Count+DIntSpruceSapling.Count+DIntStrawberryPlant.Count+DIntRashberryPlant.Count + // // +/*DIntPotatoesPlant.Count+*/DIntCoal.Count+DIntCopper.Count+DIntDiamond.Count+DIntGold.Count+DIntIron.Count+DIntPyrit.Count+DIntRuby.Count+DIntSaphirite.Count+DIntSilver.Count+DIntSmaragd.Count+DIntBigStone.Count+DIntMediumStone.Count+DIntSmallStone.Count+DIntTin.Count+/*DIntUran.Count+*/DIntBackpack.Count+DIntBucket.Count + // // +DIntBucketWater.Count+DIntRope.Count+DIntLindenPlanks.Count+DIntLindenWood.Count+DIntSprucePlanks.Count+DIntSpruceWood.Count+DIntOakPlanks.Count+DIntOakWood.Count+DIntPinePlanks.Count+DIntPineWood.Count+DIntCherryPlanks.Count+DIntCherryWood.Count+DIntPlumPlanks.Count+DIntPlumWood.Count+DIntApplePlanks.Count+DIntAppleWood.Count)+Environment.NewLine+ + // "[Počet animací]: "+(waterSquirt.Count+backgroundDirt.Count+backgroundStone.Count+backgroundGravel.Count+backgroundSand.Count)+Environment.NewLine+ + // "[Zvířata] Ryba(y):"+fish.Count+", Zajíc(i): "+rabbit.Count+", Kur "+chicken.Count+Environment.NewLine+ + // "[Energie]: "+energy.Count+Environment.NewLine+ + + // "[Čas]: hodina(y): "+((int)time).ToString()+" minuta(y): "+((int)((float)(time-(int)time)*60)).ToString()+" sekunda(y): "+((int)((((time-(int)time)*(float)60)-(int)((time-(int)time)*(float)60))*60)).ToString()+Environment.NewLine+ + // "[Den]: "+day.ToString()+Environment.NewLine+ + // "[Stattum Inv]: "+inventory, Color.DarkGray); + //else { + // if (Setting.Fps) { + // if (show) DrawTextShadowMin(spriteFont_small, 5, 5, "Fps: "+Math.Round(1000/gameTime.ElapsedGameTime.TotalMilliseconds), Color.DarkGray); + // } + // // } + //} + //#endregion + // } else { + // spriteBatch.Begin(); + // Graphics.Clear(Color.White); + + // for (int i=0; i4) { + // // Error=true; + // // ErrorCode="Server se příliš dlouho hledá."; + // // ErrorMessage="Časový limit vypršel"; + // // try { clientSocket.Disconnect(false);}catch {} + // // menu.ButtonDraw(spriteBatch,new Vector2(ms.X,ms.Y),new Vector2(Global.WindowWidth-400,WindowHeight-50)); + // // DrawTextShadowMin(spriteFont_medium,WindowWidth-400+100,WindowHeight-50+5,"Zpět do menu"); + // // } + // //} + + // if (Error) { + // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString(ErrorMessage).X)/2),WindowHeight/2-40,ErrorMessage); + // DrawTextShadowMin(spriteFont_small,(int)((Global.WindowWidth-spriteFont_small.MeasureString(ErrorCode).X)/2),WindowHeight/2+80,ErrorCode); + // } else { + // switch (step) { + // case Step.Checking: + // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Připojování...").X)/2),WindowHeight/2-50,"Připojování..."); + // break; + + // case Step.Logining: + // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Připojování...").X)/2),WindowHeight/2-50,"Připojování..."); + // break; + + // case Step.Terrain: + // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Získávání terénu").X)/2),WindowHeight/2-50,"Získávání terénu"); + // break; + + // case Step.Assets: + // DrawTextShadowMin(spritefontBig,(int)((Global.WindowWidth-spritefontBig.MeasureString("Načítání herních komponent").X)/2),WindowHeight/2-50,"Načítání herních komponent"); + // break; + // } + // } + //spriteBatch.End(); + } + } + } else { + Graphics.SetRenderTarget(null); + Graphics.Clear(Color.White); + spriteBatch.Begin(); + + //Back + for (int i = 0; i125) return; + + MTerrain chunk = terrain[x]; + + if (terrain[x]!=null) { + #region Liquits + if (InventoryNormal[boxSelected].Id==(ushort)Items.Bottle) { + if (chunk.IsTopBlocks[y]) { + switch (chunk.TopBlocks[y].Id) { + case (ushort)BlockId.Oil: + if (Global.WorldDifficulty!=2) { + InventoryRemoveSelectedItem(); + InventoryAdd(new ItemNonInvTool((ushort)Items.BottleOil, 99, 99)); + } + + chunk.TopBlocks[y]=null; + chunk.IsTopBlocks[y]=false; + return; + + case (ushort)BlockId.WaterSalt: + if (Global.WorldDifficulty!=2) { + InventoryRemoveSelectedItem(); + InventoryAdd(new ItemNonInvTool((ushort)Items.BottleWater,99,99)); + } + chunk.TopBlocks[y]=null; + chunk.IsTopBlocks[y]=false; + return; + } + } + } + if (InventoryNormal[boxSelected].Id==(ushort)Items.Bucket) { + if (chunk.IsTopBlocks[y]) { + switch (chunk.TopBlocks[y].Id) { + case (ushort)BlockId.Oil: + if (Global.WorldDifficulty!=2) { + InventoryRemoveSelectedItem(); + InventoryAdd(new ItemNonInvTool((ushort)Items.BottleOil,99,99)); + } + chunk.TopBlocks[y]=null; + chunk.IsTopBlocks[y]=false; + return; + + case (ushort)BlockId.WaterBlock: + if (Global.WorldDifficulty!=2) { + InventoryRemoveSelectedItem(); + InventoryAdd(new ItemNonInvTool((ushort)Items.BottleWater,99,99)); + } + /*((AirSolidBlock)chunk.SolidBlocks[y]).Top=*/chunk.TopBlocks[y]=null; + chunk.IsTopBlocks[y]=false; + return; + + case (ushort)BlockId.WaterSalt: + if (Global.WorldDifficulty!=2) { + InventoryRemoveSelectedItem(); + InventoryAdd(new ItemNonInvTool((ushort)Items.BottleSaltWater,99,99)); + } + /*((AirSolidBlock)chunk.SolidBlocks[y]).Top=*/chunk.TopBlocks[y]=null; + chunk.IsTopBlocks[y]=false; + return; + } + } + + } + #endregion + + #region Get food + if (chunk.IsTopBlocks[y]) { + if (Global.WorldDifficulty!=1 || FastMath.DistanceInt(mousePosDiv16.X,mousePosDiv16.Y,PlayerX,PlayerY) < 8*16){ + switch (chunk.TopBlocks[y].Id) { + case (ushort)BlockId.BucketWithLatex: + DropItemFromLeaves((ushort)BlockId.BucketForRubber, (ushort)Items.Resin,TextureBucketForRubber); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.Resin,1), mousePosRoundX, mousePosRoundY); + + //if (chunk.IsBackground[y]){ + // ((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.BucketForRubber, new Vector2(mousePosRoundX, mousePosRoundY)); + //} else { + // chunk.SolidBlocks[y]=new AirSolidBlock{ + // Top=TopBlockFromId((ushort)BlockId.BucketForRubber, new Vector2(mousePosRoundX, mousePosRoundY)) + // }; + //} + //chunk.IsTopBlocks[y]=true; + + // ((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.BucketForRubber, new Vector2(mousePosRoundX, mousePosRoundY)); + bucketRubber.Add(new ShortAndByte(x, y)); + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.PlumLeavesWithPlums: + DropFoodFromLeaves((ushort)BlockId.PlumLeaves, (ushort)Items.Plum,TexturePlumLeaves); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.Plum,1), mousePosRoundX, mousePosRoundY); + ////((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.PlumLeaves, new Vector2(mousePosRoundX, mousePosRoundY)); + + //if (chunk.IsBackground[y]){ + // ((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.PlumLeaves, new Vector2(mousePosRoundX, mousePosRoundY)); + //} else { + // chunk.SolidBlocks[y]=new AirSolidBlock{ + // Top=TopBlockFromId((ushort)BlockId.PlumLeaves, new Vector2(mousePosRoundX, mousePosRoundY)) + // }; + //} + + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.CherryLeavesWithCherries: + DropFoodFromLeaves((ushort)BlockId.CherryLeaves, (ushort)Items.Cherry,TextureCherryLeaves); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.Cherry,1), mousePosRoundX, mousePosRoundY); + //((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.CherryLeaves, new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.AppleLeavesWithApples: + DropFoodFromLeaves((ushort)BlockId.AppleLeaves, (ushort)Items.Apple,TextureAppleLeaves); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.Apple,1), mousePosRoundX, mousePosRoundY); + //((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.AppleLeaves, new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.LemonLeavesWithLemons: + DropFoodFromLeaves((ushort)BlockId.LemonLeaves, (ushort)Items.Lemon,TextureLemonLeaves); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.Lemon,1),mousePosRoundX, mousePosRoundY); + //((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.LemonLeaves, new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.OrangeLeavesWithOranges: + DropFoodFromLeaves((ushort)BlockId.OrangeLeaves, (ushort)Items.Orange,TextureOrangeLeaves); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.Orange,1),mousePosRoundX, mousePosRoundY); + //((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.OrangeLeaves,new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.OliveLeavesWithOlives: + DropFoodFromLeaves((ushort)BlockId.OliveLeaves, (ushort)Items.Olive,TextureOliveLeaves); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.Olive,1),mousePosRoundX, mousePosRoundY); + //((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.OliveLeaves,new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.KapokLeacesFibre: + DropItemFromLeaves((ushort)BlockId.KapokLeaves, (ushort)Items.KapokFibre, TextureKapokLeaves); + //DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokFibre,1),mousePosRoundX, mousePosRoundY); + //((AirSolidBlock)chunk.SolidBlocks[y]).Top=chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.KapokLeaces,new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //if (barEnergy>32) barEnergy=32; + return; + } + + void DropFoodFromLeaves(ushort newLeavesId, ushort itemId, Texture2D leavesTexture) { + DropItemToPos(new ItemNonInvFood(itemId, 1, GameMethods.FoodMaxDescay(itemId)), mousePosRoundX, mousePosRoundY); + + LeavesBlock leaves=(LeavesBlock)chunk.TopBlocks[y]; + leaves.Id=newLeavesId; + leaves.Texture=leavesTexture; + + barEnergy+=0.02f; + if (barEnergy>32) barEnergy=32; + } + void DropItemFromLeaves(ushort newLeavesId, ushort itemId, Texture2D leavesTexture) { + DropItemToPos(new ItemNonInvBasic(itemId), mousePosRoundX, mousePosRoundY); + + LeavesBlock leaves=(LeavesBlock)chunk.TopBlocks[y]; + leaves.Id=newLeavesId; + leaves.Texture=leavesTexture; + + barEnergy+=0.02f; + if (barEnergy>32) barEnergy=32; + } + } + } + + + foreach (Plant m in chunk.Plants) { + if (m.Height==y) { + if (!m.Growing) { + switch (m.Id) { + case (ushort)BlockId.Blueberry: + DropItemToPos(new ItemNonInvFood((ushort)Items.Blueberries,1,GameMethods.FoodMaxCount((ushort)Items.Blueberries),0,GameMethods.FoodMaxDescay((ushort)Items.Blueberries)), mousePosRoundX, mousePosRoundY); + m.Grow=125; + m.Growing=true; + m.Update(); + barEnergy+=0.02f; + if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.Strawberry: + DropItemToPos(new ItemNonInvFood((ushort)Items.Strawberry,1,GameMethods.FoodMaxCount((ushort)Items.Strawberry),0,GameMethods.FoodMaxDescay((ushort)Items.Strawberry)), mousePosRoundX, mousePosRoundY); + m.Grow=125; + m.Growing=true; + m.Update(); + barEnergy+=0.02f; + if (barEnergy>32) barEnergy=32; + return; + + case (ushort)BlockId.Rashberry: + DropItemToPos(new ItemNonInvFood((ushort)Items.Rashberry,1,GameMethods.FoodMaxCount((ushort)Items.Rashberry),0,GameMethods.FoodMaxDescay((ushort)Items.Rashberry)), mousePosRoundX, mousePosRoundY); + m.Grow=125; + m.Growing=true; + m.Update(); + barEnergy+=0.02f; + if (barEnergy>32) barEnergy=32; + return; + } + } + } + } + #endregion + + #region Drink Water + if (chunk.IsTopBlocks[y]) { + if (chunk.TopBlocks[y].Id==(ushort)BlockId.WaterBlock) { + barWater--; + if (barWater<0)barWater=0; + return; + } + } + #endregion + + #region Hoe + if (chunk.IsSolidBlocks[y]) { + if (InventoryNormal[boxSelected].Id==(ushort)Items.HoeBronze + || InventoryNormal[boxSelected].Id==(ushort)Items.HoeCopper + || InventoryNormal[boxSelected].Id==(ushort)Items.HoeIron + || InventoryNormal[boxSelected].Id==(ushort)Items.HoeStone) { + + if (chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockDesert + || chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockForest + || chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockHills + || chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockJungle + || chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockPlains) { + //chunk.SolidBlocks[y]=SolidBlockFromId((ushort)BlockId.Dirt, new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //barWater+=0.02f; + //if (barEnergy>32) barEnergy=32; + //if (barWater>32) barWater=32; + SendHoeAction(x,y); + //RemovePartTool(); + return; + } else if (chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockClay) { + // chunk.SolidBlocks[y]=SolidBlockFromId((ushort)BlockId.Clay, new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //barWater+=0.02f; + //if (barEnergy>32) barEnergy=32; + //if (barWater>32) barWater=32; + SendHoeAction(x,y); + //RemovePartTool(); + return; + } else if (chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockCompost) { + SendHoeAction(x,y); + // chunk.SolidBlocks[y]=SolidBlockFromId((ushort)BlockId.Compost, new Vector2(mousePosRoundX, mousePosRoundY)); + //barEnergy+=0.02f; + //barWater+=0.02f; + //if (barEnergy>32) barEnergy=32; + //if (barWater>32) barWater=32; + //RemovePartTool(); + return; + } + } + } + #endregion + + #region Inventory + //if (Inventory[boxSelected].X==(int)Items.Mobile) { + // MobileON(); + // inventory=InventoryType.Mobile; + // return; + //} + + if (FastMath.Distance(mousePosRoundX, mousePosRoundY, PlayerX, PlayerY)<5*16) { + if (terrain[x].IsTopBlocks[y]) { + switch ((BlockId)terrain[x].TopBlocks[y].Id) { + case BlockId.Desk: + inventory=InventoryType.Desk; + selectedMashine=mousePosDiv16.Clone(); + SetInvCraftingBlocks(); + if (lastMashineType!=inventory) SetUpInvToNew(); + + SetNeed(); + return; + + case BlockId.Shelf: + inventory=InventoryType.Shelf; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + + case BlockId.BoxWooden: + inventory=InventoryType.BoxWooden; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + + case BlockId.BoxAdv: + inventory=InventoryType.BoxAdv; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + + case BlockId.Radio: + inventory=InventoryType.Radio; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + //PrepareRadioDialog(); + return; + + case BlockId.FurnaceStone: + inventory=InventoryType.FurnaceStone; + selectedMashine=mousePosDiv16.Clone(); + SetInvBakeIngots(); + if (lastMashineType!=inventory) SetUpInvToNew(); + SetNeed(); + return; + + case BlockId.FurnaceElectric: + inventory=InventoryType.FurnaceElectric; + selectedMashine=mousePosDiv16.Clone(); + SetInvBakeIngots(); + if (lastMashineType!=inventory) SetUpInvToNew(); + SetNeed(); + return; + + case BlockId.Macerator: + inventory=InventoryType.Macerator; + selectedMashine=mousePosDiv16.Clone(); + SetInvToDustDusts(); + if (lastMashineType!=inventory) SetUpInvToNew(); + SetNeed(); + return; + + case BlockId.Charger: + inventory=InventoryType.Charger; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + + + case BlockId.SewingMachine: + inventory=InventoryType.SewingMachine; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + SetNeed(); + return; + + case BlockId.Miner: + inventory=InventoryType.Miner; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + + case BlockId.Composter: + inventory=InventoryType.Composter; + selectedMashine=mousePosDiv16.Clone(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + } + } + + for (int potencialRocketY = y; potencialRocketY>y-5; potencialRocketY--) { + if (potencialRocketY<0) break; + + if (terrain[x].IsTopBlocks[potencialRocketY]) { + if (terrain[x].TopBlocks[potencialRocketY].Id==(byte)BlockId.Rocket) { + inventory=InventoryType.Rocket; + selectedMashine=new DInt(x, potencialRocketY); + //PrepareRocketDialog(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + } + } + if (terrain[x-1].IsTopBlocks[potencialRocketY]) { + if (terrain[x-1].TopBlocks[potencialRocketY].Id==(byte)BlockId.Rocket) { + inventory=InventoryType.Rocket; + selectedMashine=new DInt(x-1, potencialRocketY); + //PrepareRocketDialog(); + if (lastMashineType!=inventory) SetUpInvToNew(); + return; + } + } + } + } + #endregion + + #region Place block + if (FastMath.DistanceInt(mousePosRoundX,mousePosRoundY,(int)PlayerX, (int)PlayerY)y) terrain[x].StartSomething=(byte)y; + SendAddedBlock(x,y,blockId,BlockType.Solid); + // terrain[x].SolidBlocks[y]=block; + // terrain[x].IsSolidBlocks[y]=MBlockState.TmpAdded; + + // RefreshLighting(x); + + // Inventory[boxSelected].Y--; + // if (Inventory[boxSelected].Y==0) Inventory[boxSelected].X=0; + return; + } + + } + + if (y!=0) { + if (y+1<=125) + if (chunk.IsSolidBlocks[y+1]) { + if (chunk.SolidBlocks[y+1].Id==(ushort)BlockId.Dirt || chunk.SolidBlocks[y+1].Id==(ushort)BlockId.Compost) { + if (!chunk.IsTopBlocks[y]) { + + bool isNotPlant=true; + foreach (Plant p in chunk.Plants) { + if (p.Height==y) { + isNotPlant=false; + break; + } + } + if (isNotPlant) { + switch (id) { + case (ushort)Items.Seeds: + switch (FastRandom.Int(10)) { + default: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Dandelion,new Vector2(mousePosRoundX,mousePosRoundY)); break; + case 1: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Orchid, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 2: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Rose, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 3: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Heather, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 4: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Violet, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 5: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassDesert, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 6: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassForest, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 7: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassHills, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 8: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassJungle, new Vector2(mousePosRoundX, mousePosRoundY)); break; + case 9: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassPlains, new Vector2(mousePosRoundX, mousePosRoundY)); break; + } + chunk.IsTopBlocks[y]=true; + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.WheatSeeds: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Wheat, (byte)y,0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.FlaxSeeds: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Flax, (byte)y, 0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.Carrot: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Carrot, (byte)y, 0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.Onion: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Onion, (byte)y, 0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.Peas: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Peas, (byte)y, 0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.PlantRashberry: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Rashberry, (byte)y, 0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.PlantStrawberry: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Strawberry, (byte)y, 0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + + case (ushort)Items.PlantBlueberry: + chunk.Plants.Add(GetPlantFromId((ushort)BlockId.Blueberry, (byte)y, 0, (short)x)); + RegisterPlant(x); + if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; + InventoryRemoveSelectedItem(); + return; + } + } + } + } + + ushort mobId = GameMethods.MobFromItem(id); + if (mobId!=(ushort)BlockId.None) { + bool NotExists = true; + foreach (MMob mob in terrain[x].Mobs) { + if (mob.Height==y) { + NotExists=false; + break; + } + } + + if (NotExists) { + // MMob m = GetMobFromId(mobId, (byte)y, FastRandom.Bool(), x); + // if (m!=null) { + SendAddedBlock(x,y,mobId,BlockType.Mob); + // terrain[x].Mobs.Add(m); + // } + } + } + } + } + } + + if (!terrain[x].IsBackground[y]) { + Block block = BackBlockFromId((byte)GameMethods.BackBlockFromItem(id), new Vector2(mousePosRoundX, mousePosRoundY)); + + if (block!=null) { + SendAddedBlock(x,y,id,BlockType.Back); + //if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; + //terrain[x].Background[y]=block; + //terrain[x].IsBackground[y]=MBlockState.TmpAdded; + + //Inventory[boxSelected].Y--; + //if (Inventory[boxSelected].Y==0) Inventory[boxSelected].X=0; + return; + } + } + + if (!terrain[x].IsTopBlocks[y]) { + ushort blockId=GameMethods.TopBlockFromItem(id); + Block block = TopBlockFromId(blockId, new Vector2(mousePosRoundX,mousePosRoundY)); + + if (block!=null) { + if (!GameMethods.IsDirtPlaceable(block.Id)) { + if (terrain[x].IsSolidBlocks[y+1]) { + if (terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.Dirt + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.Compost + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.Clay + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.GrassBlockClay + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.GrassBlockDesert + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.GrassBlockForest + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.GrassBlockHills + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.GrassBlockJungle + ||terrain[x].SolidBlocks[y+1].Id==(ushort)BlockId.GrassBlockPlains) { + SendAddedBlock(x,y,id,BlockType.Top); + // terrain[x].TopBlocks[y]=block; + // terrain[x].IsTopBlocks[y]=true; + // if (terrain[x].StartSomething>y) terrain[x].StartSomething=(byte)y; + + // Inventory[boxSelected].Y--; + // if (Inventory[boxSelected].Y==0) Inventory[boxSelected].X=0; + return; + } else return; + } else return; + } else { + if (id==(ushort)Items.BucketForRubber) { + if (!terrain[x].IsBackground[y]) return; + if (terrain[x].Background[y].Id!=(int)BlockId.RubberTreeWood) return; + } + + if (id==(ushort)Items.ChristmasStar) { + if (chunk.IsTopBlocks[y+1]) { + if (chunk.TopBlocks[y+1].Id==(ushort)BlockId.SpruceLeaves) { + LeavesBlock leavesBlock=(LeavesBlock)block; + (leavesBlock.tree=((LeavesBlock)chunk.TopBlocks[y+1]).tree).TitlesLeaves.Add(new UShortAndByte((ushort)x, (byte)y)); + leavesBlock.SetOrigin(); + + chunk.TopBlocks[y]=block; + chunk.IsTopBlocks[y]=true; + // chunk.RefreshLightingAddTop(y,(ushort)BlockId.SpruceLeaves); + if (chunk.StartSomething>y) chunk.StartSomething=y; + } + } + + return; + } + + chunk.TopBlocks[y]=block; + chunk.IsTopBlocks[y]=true; + if (chunk.StartSomething>y) chunk.StartSomething=y; + terrain[x].RefreshLightingAddTop(y, id: blockId); + + if (blockId<(ushort)BlockId._MoreInLoad) { + switch (blockId) { + case (ushort)BlockId.FurnaceStone: + ((MashineBlockBasic)block).Inv=new ItemInv[InvMaxFurnaceStone]{ + itemBlank, + itemBlank, + itemBlank, + itemBlank + }; + FurnaceStone.Add(new ShortAndByte(x, y)); + break; + + case (ushort)BlockId.Charger: + ((MashineBlockBasic)block).Inv=new ItemInv[1]{ itemBlank }; + Chargers.Add(new ShortAndByte((short)x, (byte)y)); + RefreshAroundLabels(x, y); + break; + + case (ushort)BlockId.OxygenMachine: + ((MashineBlockBasic)block).Inv=new ItemInv[1]{ itemBlank }; + OxygenMachines.Add(new ShortAndByte((short)x, (byte)y)); + break; + + case (ushort)BlockId.Miner: + { + MashineBlockBasic m=(MashineBlockBasic)block; + m.Inv=new ItemInv[InvMaxMiner]; + for (int i = 0; i<12*2; i++) m.Inv[i]=itemBlank; + Miners.Add(new ShortAndByte((short)x, (byte)y)); + RefreshAroundLabels(x, y); + } + break; + + case (ushort)BlockId.Composter: + ((ShelfBlock)block).Inv=new ItemInv[InvMaxComposter]{ + itemBlank, itemBlank, itemBlank, + itemBlank, itemBlank, itemBlank, + itemBlank, itemBlank, itemBlank + }; + Composters.Add(new ShortAndByte((short)x, (byte)y)); + break; + + case (ushort)BlockId.BucketForRubber: + if (chunk.IsBackground[y]) { + if (chunk.Background[y].Id==(ushort)BlockId.RubberTreeWood) { + bucketRubber.Add(new ShortAndByte((short)x, (byte)y)); + }else { + ItemDrop(new ItemNonInvBasic((ushort)Items.BucketForRubber,1),x,y); + chunk.IsBackground[y]=false; + /*((AirSolidBlock)chunk.SolidBlocks[y]).Back=*/chunk.Background[y]=null; + } + } else { + ItemDrop(new ItemNonInvBasic((ushort)Items.BucketForRubber,1),x,y); + chunk.IsBackground[y]=false; + /*((AirSolidBlock)chunk.SolidBlocks[y]).Back=*/chunk.Background[y]=null; + } + break; + + case (ushort)BlockId.Lamp: + RefreshAroundLabels(x, y); + break; + + case (ushort)BlockId.Radio: + RefreshAroundLabels(x, y); + break; + + case (ushort)BlockId.Label: + SetIndexLabel(x,y); + RefreshAroundLabels(x, y); + break; + + case (ushort)BlockId.Shelf: + ((ShelfBlock)block).Inv=new ItemInv[InvMaxShelf]{ + itemBlank, itemBlank, itemBlank, + itemBlank, itemBlank, itemBlank, + itemBlank, itemBlank, itemBlank + }; + break; + + case (ushort)BlockId.Barrel: + ((Barrel)block).Inv=new ItemInv[InvMaxBarrel] { + itemBlank, + itemBlank + }; + break; + + case (ushort)BlockId.BoxWooden: + { + ItemInv[] inv=((BoxBlock)block).Inv=new ItemInv[InvMaxBoxWooden]; + for (int i=0; i inv = null; + // int id = terrain[x].TopBlocks[y].Id; + + // if (terrain[x].TopBlocks[y] is BoxBlock) { + // inv=((BoxBlock)terrain[x].TopBlocks[y]).Inv; + // } else if (terrain[x].TopBlocks[y] is MashineBlockBasic) { + // inv=((MashineBlockBasic)terrain[x].TopBlocks[y]).Inv; + // } else if (terrain[x].TopBlocks[y] is ShelfBlock) { + // inv=((ShelfBlock)terrain[x].TopBlocks[y]).Inv; + // } else return; + + // Data data = new Data { + // Cmd=Command.Message, + // To=toServer, + // Message="*inv-machine-set "+x+" "+y+" ", + // }; + + // data.Message+=inv.Count+" "; + + // for (int i = 0; i inv=null; + + + // Data data = new Data { + // Cmd=Command.Message, + // To=toServer, + // Message="*inv-set ", + // }; + + // data.Message+=maxInvCount+" "; + + // for (int i = 0; iDistanceBlockEdit) destrustionSlow=-1; + else if (distance0) { + if (Global.WorldDifficulty==2) { + if (terrain[x].IsSolidBlocks[y]) { + destroingIndex=0; + destroingBlockType=terrain[x].SolidBlocks[y].Id; + destringMaxIndex=10; + destroyBlockX=x; + destroyBlockY=y; + + destroingBlockDepth=BlockType.Solid; + destroing=true; + return; + } + + foreach (Plant p in terrain[x].Plants) { + if (p.Position.Y/16==y) { + destroingIndex=0; + destroingBlockType=p.Id; + destringMaxIndex=10; + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Plant; + destroing=true; + return; + } + } + + foreach (MMob m in terrain[x].Mobs) { + if (m.Height==y) { + destroingIndex=0; + destroingBlockType=m.Id; + destringMaxIndex=10; + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Mob; + destroing=true; + return; + } + } + + if (terrain[x].IsTopBlocks[y]) { + destroingBlockType=terrain[x].TopBlocks[y].Id; + if (GameMethods.CanDestroy(destroingBlockType)) { + destroingIndex=0; + destringMaxIndex=10; + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Top; + destroing=true; + return; + } else destroing=false; + } + + if (terrain[x].IsBackground[y]) { + destroingIndex=0; + destroingBlockType=terrain[x].Background[y].Id; + destringMaxIndex=10; + + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Back; + destroing=true; + return; + } + } else { + if (terrain[x].IsSolidBlocks[y]) { + destroingIndex=0; + destroingBlockType=terrain[x].SolidBlocks[y].Id; + destringMaxIndex=GetSolidBlockDestroingSpeed(destroingBlockType)*destrustionSlow; + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Solid; + destroing=true; + return; + } + + foreach (Plant p in terrain[x].Plants) { + if (p.Height==y) { + destroingIndex=0; + destroingBlockType=p.Id; + destringMaxIndex=GetPlantDestroingSpeed(destroingBlockType)*destrustionSlow; + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Plant; + destroing=true; + return; + } + } + + foreach (MMob m in terrain[x].Mobs) { + if (m.Height==y) { + destroingIndex=0; + destroingBlockType=m.Id; + destringMaxIndex=GetMobDestroingSpeed(destroingBlockType)*destrustionSlow; + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Mob; + destroing=true; + return; + } + } + + if (terrain[x].IsTopBlocks[y]) { + destroingBlockType=terrain[x].TopBlocks[y].Id; + if (GameMethods.CanDestroy(destroingBlockType)) { + destroingIndex=0; + destringMaxIndex=GetTopBlockDestroingSpeed(destroingBlockType)*destrustionSlow; + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Top; + destroing=true; + return; + }else destroing=false; + } + + if (terrain[x].IsBackground[y]) { + destroingIndex=0; + destroingBlockType=terrain[x].Background[y].Id; + destringMaxIndex=GetBackBlockDestroingSpeed(destroingBlockType)*destrustionSlow; + + destroyBlockX=x; + destroyBlockY=y; + destroingBlockDepth=BlockType.Back; + destroing=true; + return; + } + } + } + } + + //void DestroyGrassUp(int x, int y) { + // if (terrain[x].IsTopBlocks[y]) { + // BlockId id = (BlockId)terrain[x].TopBlocks[y].Id; + + // if (id==BlockId.Alore + // ||id==BlockId.Rose + // ||id==BlockId.Orchid + // ||id==BlockId.Dandelion + // ||id==BlockId.Violet + // ||id==BlockId.Heather + // ||id==BlockId.GrassDesert + // ||id==BlockId.GrassForest + // ||id==BlockId.GrassHills + // ||id==BlockId.GrassJungle + // ||id==BlockId.GrassPlains + + // ||id==BlockId.BranchALittle1 + // ||id==BlockId.BranchALittle2 + // ||id==BlockId.BranchFull + // ||id==BlockId.BranchWithout + + // ||id==BlockId.CherrySapling + // ||id==BlockId.AppleSapling + // ||id==BlockId.LemonSapling + // ||id==BlockId.LindenSapling + // ||id==BlockId.OakSapling + // ||id==BlockId.OrangeSapling + // ||id==BlockId.PineSapling + // ||id==BlockId.PlumSapling + // ||id==BlockId.SpruceSapling + + // ||id==BlockId.Rocks + + // ||id==BlockId.Boletus + // ||id==BlockId.Champignon + // ||id==BlockId.Toadstool) { + // destroingBlockDepth=BlockType.Top; + // // GetItemsFromBlock((byte)id, x, y/*,destroingBlockDepth*/); + // terrain[x].IsTopBlocks[y]=false; + + // terrain[x].TopBlocks[y]=null; + // } + // } + + // foreach (Plant p in terrain[x].Plants) { + // if (p.Height==y) { + // destroingBlockDepth=0; + // // GetItemsFromBlock(p.Id, x, y/*,destroingBlockDepth*/); + // terrain[x].Plants.Remove(p); + // RemovePlant(x); + // break; + // } + // } + //} + + //void DestroySandUp(int x, int y) { + // if (terrain[x].IsTopBlocks[y]) { + // BlockId id = (BlockId)terrain[x].TopBlocks[y].Id; + + // if (id==BlockId.Alore + // ||id==BlockId.GrassDesert + // ||id==BlockId.BranchALittle1 + // ||id==BlockId.BranchALittle2 + // ||id==BlockId.BranchFull + // ||id==BlockId.BranchWithout + // ||id==BlockId.Rocks) { + // GetItemsFromBlock((byte)id, x, y/*,BlockType.Top*/); + // terrain[x].IsTopBlocks[y]=false; + // terrain[x].TopBlocks[y]=null; + // } + + // if (id==BlockId.CactusBig) { + + // // current + // GetItemsFromBlock((byte)id, x, y/*,BlockType.Top*/); + // terrain[x].IsTopBlocks[y]=false; + // terrain[x].TopBlocks[y]=null; + + // //if more + // for (int yy = y-1; yy>=0; yy--) { + // if (terrain[x].IsTopBlocks[yy]) { + // BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; + + // if (potencialCactus==BlockId.CactusBig) { + // GetItemsFromBlock((byte)id, x, yy/*,BlockType.Top*/); + // terrain[x].IsTopBlocks[yy]=false; + // terrain[x].TopBlocks[yy]=null; + // } + // } else return; + // } + // } + + // if (id==BlockId.CactusSmall) { + + // // current + // GetItemsFromBlock((byte)id, x, y/*,BlockType.Top*/); + // terrain[x].IsTopBlocks[y]=false; + // terrain[x].TopBlocks[y]=null; + + // //if more + // for (int yy = y-1; yy>=0; yy--) { + // if (terrain[x].IsTopBlocks[yy]) { + // BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; + + // if (potencialCactus==BlockId.CactusSmall) { + // GetItemsFromBlock((byte)id, x, yy/*,BlockType.Top*/); + // terrain[x].IsTopBlocks[yy]=false; + // terrain[x].TopBlocks[yy]=null; + // } + // } else return; + // } + // } + // } + //} + + //void DestroyCactusBig(int x, int y) { + // for (int yy = y-1; yy>=0; yy--) { + // if (terrain[x].IsTopBlocks[yy]) { + // BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; + + // if (potencialCactus==BlockId.CactusBig) { + // GetItemsFromBlock((byte)BlockId.CactusBig, x, yy/*,BlockType.Top*/); + // terrain[x].IsTopBlocks[yy]=false; + // terrain[x].TopBlocks[yy]=null; + // } + // } else return; + // } + //} + + //void DestroyCactusSmall(int x, int y) { + // for (int yy = y-1; yy>=0; yy--) { + // if (terrain[x].IsTopBlocks[yy]) { + // BlockId potencialCactus = (BlockId)terrain[x].TopBlocks[yy].Id; + + // if (potencialCactus==BlockId.CactusSmall) { + // SendRemovedBlock(x,y,) + // GetItemsFromBlock((byte)BlockId.CactusSmall, x, yy/*,BlockType.Top*/); + // terrain[x].IsTopBlocks[yy]=false; + // terrain[x].TopBlocks[yy]=null; + // } + // } else return; + // } + //} + + // void AutoDestroyLeaves(ushort wood, ushort leaves) { + // int Xran=terrainStartIndexX+FastRandom.Int(terrainStartIndexW-terrainStartIndexX), + // Yran=terrainStartIndexY+FastRandom.Int(terrainStartIndexH-terrainStartIndexY); + + // if (terrain[Xran].IsTopBlocks[Yran]) { + // if (terrain[Xran].TopBlocks[Yran].Id==leaves) { + + // //Rectangle + // int startX=Xran-4, startY=Yran-4, endX=Xran+4, endY=Yran+4; + + // //Limit + // if (startX<0) startX=0; + // if (startY<0) startY=0; + + // if (endX>TerrainLength) endX=TerrainLength; + // if (endY>120) endY=120; + + // if (IsNotNearWood(wood, startX, startY, endX, endY)) { + // GetItemsFromBlock(leaves, Xran, Yran); + // Terrain chunk=terrain[Xran]; + + // List listLeaves=((LeavesBlock)chunk.TopBlocks[Yran]).tree.TitlesLeaves; + + // for (int i = 0; iTerrainLength) endX=TerrainLength; + // if (endY>120) endY=120; + + // if (IsNotNearWood(wood, startX, startY, endX, endY)) { + // //GetItemsFromBlock(id, Xran, Yran); + + // Tree tree=((LeavesBlock)chunk.TopBlocks[Yran]).tree; + + // // if not Artifical leaves (created by player) + // if (tree!=null) { + // List listLeaves=((LeavesBlock)chunk.TopBlocks[Yran]).tree.TitlesLeaves; + + // for (int i = 0; iTerrainLength) endX=TerrainLength; + // if (endY>120) endY=120; + + // if (IsNotNearWood(wood, startX, startY, endX, endY)) { + // GetItemsFromBlock(id, Xran, Yran); + + // Tree tree=((LeavesBlock)chunk.TopBlocks[Yran]).tree; + + // // if not Artifical leaves (created by player) + // if (tree!=null) { + // List listLeaves=((LeavesBlock)chunk.TopBlocks[Yran]).tree.TitlesLeaves; + + // for (int i = 0; i backBlocks=new List(); + // List solidBlocks= new List(); + // List topBlocks= new List(); + + // byte backblockzeros=0; + // byte topblockzeros = 0; + // byte solidblockzeros = 0; + + // for (int i=0; i<125; i++) { + + // // Back blocks + // if (terrain[pos].IsBackground[i]) { + + // if (backblockzeros!=0) { + // if (backblockzeros>2){ + // backBlocks.Add(1); + // backBlocks.Add(backblockzeros); + // } else{ + // for (int j=0; j2) { + // solidBlocks.Add(1); + // solidBlocks.Add(solidblockzeros); + // } else { + // for (int j = 0; j2) { + // topBlocks.Add(1); + // topBlocks.Add(topblockzeros); + // }else { + // for (int j = 0; j inv=((ShelfBlock)terrain[pos].TopBlocks[i]).Inv; + + // foreach (DInt d in inv){ + // topBlocks.Add((byte)d.X); + // topBlocks.Add((byte)d.Y); + // } + // } else if (id==(byte)BlockId.BoxWooden) { + // List inv=((BoxBlock)terrain[pos].TopBlocks[i]).Inv; + + + // foreach (DInt d in inv){ + // topBlocks.Add((byte)d.X); + // topBlocks.Add((byte)d.Y); + // } + // } else if (id==(byte)BlockId.BoxAdv) { + // List inv=((BoxBlock)terrain[pos].TopBlocks[i]).Inv; + + // foreach (DInt d in inv){ + // topBlocks.Add((byte)d.X); + // topBlocks.Add((byte)d.Y); + // } + // } + // } else { + // topblockzeros++; + // } + // } + + // if (backblockzeros>2) { + // backBlocks.Add(1); + // backBlocks.Add(backblockzeros); + // }else{ + // for (int j = 0; j2) { + // solidBlocks.Add(1); + // solidBlocks.Add(solidblockzeros); + // } else { + // for (int j = 0; j2) { + // topBlocks.Add(1); + // topBlocks.Add(topblockzeros); + // } else { + // for (int j = 0; j plants=new List(); + // foreach (Plant m in terrain[pos].Plants) { + // plants.Add(m.Id); + // plants.Add(m.Height); + // plants.Add(m.Grow); + // } + + // List mobs = new List(); + // foreach (Mob m in terrain[pos].Mobs) { + // mobs.Add(m.Id); + // mobs.Add((byte)(m.Position.Y/16)); + // mobs.Add(m.Lives); + // mobs.Add(m.Dir ? (byte)1 : (byte)0); + // } + + + // stream.WriteByte(terrain[pos].LightPos); + + // stream.Write(backBlocks.ToArray(),0,backBlocks.ToArray().Length); + // stream.Write(solidBlocks.ToArray(),0,solidBlocks.ToArray().Length); + // stream.Write(topBlocks.ToArray(),0,topBlocks.ToArray().Length); + + // stream.Write(plants.ToArray(),0,plants.ToArray().Length); + // stream.WriteByte(1); + // stream.Write(mobs.ToArray(),0,mobs.ToArray().Length); + // } + //} + + //void Load(int pos) { + // if (File.Exists(playedWorld+ @"Earth\Terrain ["+pos+"].rch")) { + // using (StreamReader sr = new StreamReader(playedWorld+ @"Earth\Terrain ["+pos+"].rch")) { + // BinaryReader br = new BinaryReader(sr.BaseStream); + + // // terrain[pos] + // MTerrain chunk=terrain[pos]=new MTerrain(){ + // LightPos=br.ReadByte(), + // }; + // chunk.LightVec=new Vector2(pos*16-48+8,chunk. LightPos*16-48+8); + // chunk.LightPos16=chunk.LightPos*16; + // int ss=125; + + // //0=nic + // //1=připrav se, další byte o přeskočení + + // //BackBlocks + // for (int lenght=0; lenght<125; lenght++) { + // byte input = br.ReadByte(); + + // if (input>1){ + // Block block=BackBlockFromId(input, new Vector2(pos*16, lenght*16)); + // if (block!=null){ + // if (ss>lenght) ss=lenght; + // chunk.Background[lenght]=block; + // chunk.IsBackground[lenght]=true; + // } + // } else if (input==1) lenght+=br.ReadByte()-1; + // } + + // // SolidBlocks + // for (int lenght=0; lenght<125; lenght++) { + // byte input = br.ReadByte(); + + // if (input>1){ + // Block block=SolidBlockFromId(input, new Vector2(pos*16, lenght*16)); + // if (block!=null){ + // if (ss>lenght) ss=lenght; + // chunk.SolidBlocks[lenght]=block; + // chunk.IsSolidBlocks[lenght]=true; + // } + // } else if (input==1)lenght+=br.ReadByte()-1; + // } + + // // TopBlocks + // for (int lenght=0; lenght<125; lenght++) { + // byte input = br.ReadByte(); + + // if (input>1){ + // Block block=TopBlockFromId(input, new Vector2(pos*16, lenght*16)); + // if (block!=null){ + // if (ss>lenght) ss=lenght; + + // chunk.IsTopBlocks[lenght]=true; + // chunk.TopBlocks[lenght]=block; + + // if (input==(int)BlockId.Label) { + // SetIndexLabel(pos, lenght); + // if (lenght!=0 && lenght!=125) RefreshAroundLabels(pos, lenght); + // } else if (input==(int)BlockId.FurnaceStone) { + // ((MashineBlockBasic)block).Inv=new List(){ + // // Wood + // new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), + + // //Ash + // new DInt(br.ReadByte(),br.ReadByte()), + // }; + + // //Energy + // ((MashineBlockBasic)block).Energy=br.ReadByte()/255f; + // } else if (input==(int)BlockId.Shelf) { + // ((ShelfBlock)block).Inv=new List(){ + // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), + // }; + + // if (((ShelfBlock)block).Inv[4].X!=0){ + // Texture2D tex=ItemIdToTexture(((ShelfBlock)block).Inv[4].X); + // if (text!=null){ + // ((ShelfBlock)block).SmalItemTexture=tex; + // ((ShelfBlock)block).IsSmallItem=true; + // } + // } + // } else if (input==(int)BlockId.BoxWooden) { + // ((BoxBlock)block).Inv=new List(); + // for (int i=0; i<2*12;i++)((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(),br.ReadByte())); + + // }else if (input==(int)BlockId.BoxAdv) { + // ((BoxBlock)block).Inv=new List(); + // for (int i=0; i<4*14;i++)((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(),br.ReadByte())); + // } + // } + // } else if (input==1) lenght+=br.ReadByte()-1; + // } + + // { + // for (int i=0; i<64;i++){ + // if (br.BaseStream.Position==br.BaseStream.Length)break; + // byte input=br.ReadByte(); + // if (input==1)break; + + // Plant plant=GetPlantFromId(input, br.ReadByte(),br.ReadByte(),pos); + // if (plant!=null)chunk.Plants.Add(plant); + + // } + + // for (int i=0; i<64;i++){ + // if (sr.BaseStream.Position==sr.BaseStream.Length)break; + // byte input=br.ReadByte(); + // if (input==1)break; + + // switch ((BlockId)input) { + // case BlockId.Fish: + // chunk.Mobs.Add(new Fish(input,br.ReadByte(), br.ReadByte(), pos,br.ReadByte()==1, fishTexture0, fishTexture1, FastRandom)); + // break; + + // case BlockId.Chicken: + // chunk.Mobs.Add(new Chicken(input, br.ReadByte(),br.ReadByte(), pos, br.ReadByte()==1, chickenWalkTexture, chickenEatTexture, FastRandom)); + // break; + + // case BlockId.Rabbit: + // chunk.Mobs.Add(new Rabbit(input,br.ReadByte(), br.ReadByte(), pos, br.ReadByte()==1, rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture, FastRandom)); + // break; + // } + // } + // } + + // // (byte)sr.ReadByte(); + + // chunk.StartSomething=ss; + // } + // } + //} + + // void LoadFromBytes(byte[] bytes, int pos) { + // using (MemoryStream sr = new MemoryStream(bytes)) { + // BinaryReader br = new BinaryReader(sr); + + // // terrain[pos] + // MTerrain chunk = terrain[pos]; + // chunk.LightPos=br.ReadByte(); + // // Console.WriteLine("v "+chunk.LightPos); + // chunk.LightVec=new Vector2(pos*16-48+8, chunk.LightPos*16-48+8+48); + // chunk.LightPos16=chunk.LightPos*16; + + // int ss = 125; + + // //0=nic + // //1=připrav se, další byte o přeskočení + + // //BackBlocks + // for (int lenght = 0; lenght<125; lenght++) { + // byte input = br.ReadByte(); + + // if (input>1) { + // Block block = BackBlockFromId(input, new Vector2(pos*16, lenght*16)); + // if (block!=null) { + // if (ss>lenght) ss=lenght; + // chunk.Background[lenght]=block; + // chunk.IsBackground[lenght]=true; + // } + // } else if (input==1) lenght+=br.ReadByte()-1; + // } + + // // SolidBlocks + // for (int lenght = 0; lenght<125; lenght++) { + // byte input = br.ReadByte(); + + // if (input>1) { + // Block block = SolidBlockFromId(input, new Vector2(pos*16, lenght*16)); + // if (block!=null) { + // if (ss>lenght) ss=lenght; + // chunk.SolidBlocks[lenght]=block; + // chunk.IsSolidBlocks[lenght]=true; + // } + // } else if (input==1) lenght+=br.ReadByte()-1; + // } + + // // TopBlocks + // for (int lenght = 0; lenght<125; lenght++) { + // byte input = br.ReadByte(); + + // if (input>1) { + // Block block = TopBlockFromId(input, new Vector2(pos*16, lenght*16)); + // if (block!=null) { + // if (ss>lenght) ss=lenght; + + // chunk.IsTopBlocks[lenght]=true; + // chunk.TopBlocks[lenght]=block; + + // if (input==(int)BlockId.Label) { + // SetIndexLabel(pos, lenght); + // if (lenght!=0&&lenght!=125) RefreshAroundLabels(pos, lenght); + // } else if (input==(int)BlockId.FurnaceStone) { + // ((MashineBlockBasic)block).Inv=new List(){ + // // Wood + // new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), + + // //Ash + // new DInt(br.ReadByte(),br.ReadByte()), + // }; + + // //Energy + // ((MashineBlockBasic)block).Energy=br.ReadByte()/255f; + // } else if (input==(int)BlockId.Shelf) { + // ((ShelfBlock)block).Inv=new List(){ + // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), + // new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), new DInt(br.ReadByte(),br.ReadByte()), + // }; + + // if (((ShelfBlock)block).Inv[4].X!=0) { + // Texture2D tex = ItemIdToTexture(((ShelfBlock)block).Inv[4].X); + // if (text!=null) { + // ((ShelfBlock)block).SmalItemTexture=tex; + // ((ShelfBlock)block).IsSmallItem=true; + // } + // } + // } else if (input==(int)BlockId.BoxWooden) { + // ((BoxBlock)block).Inv=new List(); + // for (int i = 0; i<2*12; i++) ((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(), br.ReadByte())); + + // } else if (input==(int)BlockId.BoxAdv) { + // ((BoxBlock)block).Inv=new List(); + // for (int i = 0; i<4*14; i++) ((BoxBlock)block).Inv.Add(new DInt(br.ReadByte(), br.ReadByte())); + // } + // } + // } else if (input==1) lenght+=br.ReadByte()-1; + // } + + // { + // for (int i = 0; i<64; i++) { + // if (br.BaseStream.Position==br.BaseStream.Length) break; + // byte input = br.ReadByte(); + // if (input==1) break; + + // Plant plant = GetPlantFromId(input, br.ReadByte(), br.ReadByte(), (short)pos); + // if (plant!=null) chunk.Plants.Add(plant); + + // } + + // for (int i = 0; i<64; i++) { + // if (sr.Position==sr.Length) break; + // byte input = br.ReadByte(); + // if (input==1) break; + + // switch ((ushort)input) { + // case (ushort)BlockId.Fish: + // chunk.Mobs.Add(new Fish(/*mobId,*/ y, x,FastRandom.Bool(), fishTexture0, fishTexture1)); + // break; + + //case (ushort)BlockId.Chicken: + // chunk.Mobs.Add(new Chicken(y, x, FastRandom.Bool(), chickenWalkTexture, chickenEatTexture)); + // break; + + //case (ushort)BlockId.Rabbit: + // chunk.Mobs.Add(new Rabbit(y, x, FastRandom.Bool(), rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture)); + // break; + + //case (ushort)BlockId.MobParrot: + // chunk.Mobs.Add(new Parrot(y, x, FastRandom.Bool(), false, TextureParrotStill, TextureParrotFly)); + // break; + // } + // } + // } + + // chunk.StartSomething=(byte)ss; + // chunk.state=MChunkState.Downloaded; + // // terrain[pos]=chunk; + // } + // } + + unsafe void Load(int pos, byte[] bytes) { + List labels=new(); + + fixed (byte* pointer = &bytes[0]) { + byte* current=pointer; + + #if DEBUG + SaveType lastSaveType=SaveType.Unknown; + #endif + + MTerrain chunk=terrain[pos]=new MTerrain { + LightPosFull=*current++, + LightPosHalf=*current++, + }; + + int pos16=pos*16; + chunk.LightPosHalf16=chunk.LightPosHalf*16; + chunk.LightPosFull16=chunk.LightPosFull*16; + chunk.LightVec=new Vector2(pos16-48+8,chunk.LightPosFull16-48+8+48); + + int StartSomething=0; + bool startingSomething=true; + + for (int length=0; length<125;) { + byte way = *current++; + + switch (way) { + // 0: 1× air (nothing) + case (byte)SaveType.Air: + length++; + break; + + // 1: ?× air (nothing) + case (byte)SaveType.AirMultiple: + length+=*current++; + break; + + // 1× solid block + case (byte)SaveType.SolidBlock: + { + #if DEBUG + ushort id=(ushort)(*current++ | (*current++ << 8)); + Block block=SolidBlockFromId(id, new Vector2(pos16, length*16)); + chunk.SolidBlocks[length]=block ?? throw new Exception("Solid block "+id+" is null"); + #else + chunk.SolidBlocks[length]=SolidBlockFromId((ushort)(*current++ | (*current++ << 8)), new Vector2(pos16, length*16)); + #endif + + chunk.IsSolidBlocks[length]=true; + + if (startingSomething) { + startingSomething=false; + StartSomething=length; + } + + length++; + } + break; + + // 1× solid block + case (byte)SaveType.SolidBlockWithLowId: + { + #if DEBUG + ushort id=(ushort)*current++; + Block block=SolidBlockFromId(id, new Vector2(pos16, length*16)); + chunk.SolidBlocks[length]=block ?? throw new Exception("Solid block "+id+" is null"); + #else + chunk.SolidBlocks[length]=SolidBlockFromId((ushort)*current++, new Vector2(pos16, length*16)); + #endif + // ushort id=*current++; + + //chunk.SolidBlocks[length]=SolidBlockFromId(/*id*/(ushort)*current++, new Vector2(pos16, length*16)) + // #if DEBUG + // ??throw new Exception("Solid block is null") + // #endif + // ; + + chunk.IsSolidBlocks[length]=true; + + if (startingSomething) { + startingSomething=false; + StartSomething=length; + } + + length++; + } + break; + + // ?× solid block + case (byte)SaveType.SolidBlockMultiple: + { + ushort id=(ushort)(*current++ | (*current++ << 8)); + + int to=length+*current++; + + if (startingSomething) { + startingSomething=false; + StartSomething=length; + } + + Block block=SolidBlockFromId(id, new Vector2(pos16, length*16)); + + chunk.SolidBlocks[length]=block + #if DEBUG + ??throw new Exception("Solid block is null") + #endif + ; + + chunk.IsSolidBlocks[length]=true; + length++; + + for (; length>8) | (*current++>>16); + // if (treeIndex>8) | (*current++>>16); + // if (index>treeIndex) + // } + // break; + + case (ushort)BlockId.Barrel: + { + Barrel barrel=(Barrel)block; + + barrel.LiquidId=*current++; + barrel.LiquidAmount=*current++ /*| (*current++ << 8)*/; + + LoadInventoryMashine(barrel.Inv=new ItemInv[InvMaxBarrel], InvMaxBarrel); + + // Barrels.Add(new ShortAndByte(pos, length)); + } + break; + } + } + + #if DEBUG + lastSaveType=(SaveType)way; + #endif + } + + void LoadInventoryMashine(ItemInv[] a, int max) { + for (int i = 0; i i.Root.X).ToArray(); + //} + + //if (world=="Earth"){ + // if (File.Exists(pathToWorld+world+"Biomes.ter")){ + // byte[] arrayBiomes=File.ReadAllBytes(pathToWorld+world+"Biomes.ter"); + + // fixed (byte* pointer = &arrayBiomes[0]) { + // byte* current=pointer; + + // int count=*current++; + // Biomes=new BiomeData[count]; + // for (int i = 0; i \"; y je číslo"); + // } + // } else { + // if (int.TryParse(word[2], out int y)) { + // DisplayText("Použití: \"*tp \"; x je číslo"); + // } else { + // DisplayText("Použití: \"*tp \"; x a y je číslo"); + // } + // } + // } + // } else { + // DisplayText("Na tento příkaz namáte oprávnění"); + // } + // return; + + // case "*warp-set": + // if (word.Length==2) { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*warp-set "+word[1]+" "+PlayerX+" "+PlayerY, + // }.ToByte(), + // Importance=Importance.Middle + // }); + // DisplayText("Nastavuji warp "+word[1]); + // } + // break; + + // case "*warp": + // if (word.Length==2) { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*warp "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + // }); + // } + // break; + + // case "*kick": + // if (word.Length==2) { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*kick "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + // }); + // } + // break; + + // case "*ban": + // if (word.Length==2) { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*ban "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + // }); + // } + // break; + + // case "*unban": + // if (word.Length==2) { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*unban "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + // }); + // } + // break; + + // case "*warp-remove": + // if (word.Length==2) { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*warp-remove "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + // }); + // } + // break; + + // case "*group-set": + // if (word.Length==3) { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*group-set "+word[1]+" "+word[2], + // }.ToByte(), + // Importance=Importance.Middle + // }); + // } + // break; + + // case "*itemsclear": + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*itemsclear", + // }.ToByte(), + // Importance=Importance.Middle + // }); + // break; + + // case "*server-backup": + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*server-backup", + // }.ToByte(), + // Importance=Importance.Middle + // }); + // break; + + // case "*server-reset": + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*server-reset", + // }.ToByte(), + // Importance=Importance.Middle + // }); + // break; + + // case "*server-end": + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*server-end", + // }.ToByte(), + // Importance=Importance.Middle + // }); + // break; + + // case "*changepassword": + // password=new Password(); + // password.Show(); + // break; + + // case "*spawn-set": + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*spawn-set "+PlayerX+" "+PlayerY, + // }.ToByte(), + // Importance=Importance.Middle + // }); + // break; + + // case "*gamemode": + // if (word.Length==2) { + // if (word[1]=="Dobrodružná"||word[1]=="Výzkum"||word[1]=="Kreativní" + // ||word[1]=="0"||word[1]=="1"||word[1]=="2" + // ||word[1]=="d"||word[1]=="v"||word[1]=="k") { + // Queue.Add(new DataToSend { + // Bytes=new Data { + // Cmd=Command.Message, + // // From=Setting.Name, + // To=toServer, + // Message="*gamemode "+word[1], + // }.ToByte(), + // Importance=Importance.Middle + // }); + // } else DisplayText("Neplatný příkaz, zkus \"*help\""); + // } + // break; + + // default: + // DisplayText("Neplatný příkaz, zkus \"*help\""); + // return; + // } + //} + + //void OnCheck(IAsyncResult ar) { + // try { + // state++; + // clientSocket.EndConnect(ar); + + // Data msgToSend = new Data { + // Cmd=Command.Check, + // // From=Setting.Name, + // To=toServer, + // Message="" + // }; + + // byteData=msgToSend.ToByte(); + + // clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + + // byteData=new byte[1024]; + + // clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null); + + // //current=Current.EndChecking; + // state++; + // } catch (SocketException ex) { + + // //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl + // if (10061==ex.ErrorCode) { + // ShowError("Nelze se připojit k serveru", "Žádný server není spuštěn na adrese "+ip+":"+port); + // } else { + // //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel + // if (10060==ex.ErrorCode) { + // ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho."); + // } else if (10013==ex.ErrorCode) { + // ShowError("Nelze se připojit k serveru", "Pravděpodobně Váš firewall blokuje připojení (Zkuste ho vypnout)"); + // } else ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnCheck: "+ex.Message+"; Kód: "+ex.ErrorCode); + // } + // } + + // //if (!Global.OnlineAccount){ + // // string url="https://geftgames.ga/System/rabcr/ifplayerexists.php?username="+Setting.Name; + // // MyWebClient wc=new MyWebClient { + // // Encoding=Encoding.UTF8, + // // }; + // // try{ + // // string get=wc.DownloadString(new Uri(url)); + // // Console.WriteLine(6); + // // if (string.IsNullOrEmpty(get)) { + // // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); + // // } else { + // // string[]g=get.Split('|'); + + // // if (g.Length>1){ + // // switch (g[0]) { + // // case "E": + + // // break; + + // // case "O": + // // //ok + // // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá"); + // // break; + + // // default: + // // // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá"); + // // break; + // // } + // // } else { + // // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); + // // } + // // } + // // }catch{ + // // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje"); + // // } + // //} + + //} + + //void OnConnectDuringGameError(IAsyncResult ar) { + + // try { + + // clientSocket.EndConnect(ar); + + // Data msgToSend = new Data { + // Cmd=Command.ConnectDuringGame, + // // From=Setting.Name, + // To=toServer, + // Message="" + // }; + + // byteData=msgToSend.ToByte(); + // clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + + // byteData=new byte[1024]; + // clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null); + + // //current=Current.EndChecking; + // state++; + // } catch (SocketException ex) { + + // //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl + // if (10061==ex.ErrorCode) { + // ShowError("Nelze se připojit k serveru", "Pravděpodobně není spuštěn server."); + // } else { + // //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel + // if (10060==ex.ErrorCode) { + // ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho."); + // } else { + // ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnConnectDuringGameError: "+ex.Message); + // } + // } + // } + //} + + //void OnSend(IAsyncResult ar) { + // try { + // // clientSocket.Connected + // //Process=0.55f; + // clientSocket.EndSend(ar); + // //Process=1f; + // //ready=true; + // //Loading=false; + // } catch (SocketException ex) { + // //Console.WriteLine(ex.ErrorCode+" 2 "+ex.Message); + // ////Process=1f; + // //ready=true; + // //Error=true; + // //ErrorCode=ex.Message; + // if (!exit) ShowError("Nelze odeslat sáček", ""+ex.Message); + // } + // // Console.WriteLine("send"); + //} + + //void SendEveryone(string text) { + // try { + // //Fill the info for the message to be send + // Data msgToSend = new Data { + // //Console.WriteLine(text); + // // From=Setting.Name, + // To=toEveryone, + // Message=text, + // Cmd=Command.Message + // }; + + // //byte[] byteData = + // Queue.Add(new DataToSend { + // Bytes=msgToSend.ToByte(), + // Importance=Importance.High + // }); + // //Send it to the server + // //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSendAfter), null); + // // Console.WriteLine("sending: "+System.Text.Encoding.UTF8.GetString(byteData)); + // // txtMessage.Text = null; + // } catch (Exception) { + // //Console.WriteLine("Unable to send message to the server."); + // } + //} + + //void OnSendAfter(IAsyncResult ar) { + // try { + // clientSocket.EndSend(ar); + // } catch (ObjectDisposedException) { + + + // } catch/* (Exception ex)*/ { + // //Console.WriteLine(ex.Message); + // } + //} + + //void OnReceive(IAsyncResult ar) { + // // Console.WriteLine("rec"); + // try { + // clientSocket.EndReceive(ar); + // } catch (Exception ex) { + // if (ex.HResult==10054) { + // //ShowError("Spojení bylo přerušeno", ex.Message); + // //clientSocket.Shutdown(new SocketShutdown()); + // //clientSocket.Close(); + // //clientSocket.Dispose(); + // if (!exit) SolveErrorDuringGame(ex.HResult, "", ""); + // return; + // } else { + // Console.WriteLine(ex.Message+" rec1"); + // } + // } + + // Data msgReceived = new Data(byteData); + // msgReceived.Talk(); + + // switch (msgReceived.Cmd) { + // case Command.SendingWorldData: { + // if (msgReceived.terrain!=null) { + // if (msgReceived.terrain.Length>2) { + // LoadFromBytes(msgReceived.terrain, msgReceived.pos); + + // if (current==Current.GettingSpawn) { + // if (downloadedSpawnArea bytes = new List(); + // if (strs.Length==5) { + // if (strs[4]!="") { + // foreach (string s in strs[4].Split(',')) { + // bytes.Add(byte.Parse(s)); + // } + // } + // } + // if (strs[0]=="+") { + // int x = int.Parse(strs[1]), + // y = int.Parse(strs[2]); + // if (terrain[x]==null) break; + // byte id = byte.Parse(strs[3]); + // bool stay = true; + + // { + // Block b = SolidBlockFromId(id, new Vector2(x, y)); + // if (b!=null) { + // if (terrain[x].IsSolidBlocks[y]) GetItemsFromBlock(id, x, y); + // terrain[x].IsSolidBlocks[y]=true; + // terrain[x].SolidBlocks[y]=b; + // stay=false; + // } + // } + // if (stay) { + // Block b = TopBlockFromId(id, new Vector2(x, y)); + // if (b!=null) { + // if (terrain[x].IsTopBlocks[y]) GetItemsFromBlock(id, x, y); + // terrain[x].IsTopBlocks[y]=true; + // terrain[x].TopBlocks[y]=b; + // stay=false; + // } + // } + // if (stay) { + // Block b = BackBlockFromId(id, new Vector2(x, y)); + // if (b!=null) { + // if (terrain[x].IsBackground[y]) GetItemsFromBlock(id, x, y); + // terrain[x].IsBackground[y]=true; + // terrain[x].Background[y]=null; + // stay=false; + // } + // } + + // if (stay) { + // Plant p = GetPlantFromId(id, (byte)y,/*?*/255, (short)x); + // if (p!=null) { + // foreach (Plant px in terrain[x].Plants) { + // if (px.Height==y) { + // GetItemsFromPlant(id, new DInt(x, y), px.Grow==255); + // terrain[x].Plants.Remove(px); + // break; + // } + // } + // stay=false; + // terrain[x].Plants.Add(p); + // } + // } + + + // //if (stay) { + // // Block b=ani(id,new Vector2(x,y)); + // // if (b!=null) { + // // foreach (Mob m in terrain[x].Mobs) { + // // if (m.Height==y) { + // // if (m.Id==id) {GetItemsFromBlock(id,new DInt(x,y)); + // // terrain[x].Mobs.Remove(m); + // // stay=false; + // // break; + // // } + // // } + // // } + // //} + // } else { + // int x = int.Parse(strs[1]), + // y = int.Parse(strs[2]); + // if (terrain[x]==null) break; + // byte id = byte.Parse(strs[3]); + // bool stay = true; + + // if (terrain[x].IsSolidBlocks[y]) { + // if (terrain[x].SolidBlocks[y].Id==id) { + // terrain[x].IsSolidBlocks[y]=false; + // terrain[x].SolidBlocks[y]=null; + // stay=false; + // } + // } + // if (stay) { + // if (terrain[x].IsTopBlocks[y]) { + // if (terrain[x].TopBlocks[y].Id==id) { + // terrain[x].IsTopBlocks[y]=false; + // terrain[x].TopBlocks[y]=null; + // stay=false; + // } + // } + // } + // if (stay) { + // if (terrain[x].IsBackground[y]) { + // if (terrain[x].Background[y].Id==id) { + // terrain[x].IsBackground[y]=false; + // terrain[x].Background[y]=null; + // stay=false; + // } + // } + // } + + // if (stay) { + // foreach (Plant p in terrain[x].Plants) { + // if (p.Height==y) { + // if (p.Id==id) { + // terrain[x].Plants.Remove(p); + // stay=false; + // break; + // } + // } + // } + // } + // if (stay) { + // foreach (Mob m in terrain[x].Mobs) { + // if (m.Height==y) { + // if (m.Id==id) { + // terrain[x].Mobs.Remove(m); + // stay=false; + // break; + // } + // } + // } + // } + // } + // } + // } + // } + // break; + + // case Command.PostLogin: { + // if (msgReceived.Message!=null) { + // string[] strs = msgReceived.Message.Split('|'); + // if (strs.Length>0) { + // if (strs[0]=="0") { + // // Console.WriteLine("Wrong password!"); + // System.Windows.Forms.MessageBox.Show("Špatné heslo", "Pro připojení k serveru je potřeba zadat správné heslo"); + // // System.Windows.Forms.MessageBox.Show("Zadali jste špatné heslo","Špatné heslo"); + // clientSocket.Disconnect(false); + // // Rabcr.GoTo(new MenuMultiplayer()); + // } else if (strs[0]=="1") { + // //Console.WriteLine("Setting vars"); + + // TerrainLenght=int.Parse(strs[1]); + // terrain=new MTerrain[TerrainLenght]; + // Console.WriteLine(TerrainLenght+" len"); + + // for (int c = 0; c0) { + // // switch (strs[0]) { + // // case "0": + // // if (strs.Length==3) { + // // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]+Environment.NewLine+"zkuste tento web: "+strs[2]); + // // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // // break; + + // // case "1": + // // if (strs.Length==2) { + // // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]); + // // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // // break; + + // // case "2": + // // if (strs.Length==4) { + // // int x = int.Parse(strs[0]); + // // int y = int.Parse(strs[1]); + // // string password = strs[2]; + // // int type = int.Parse(strs[3]); + + // // if (password!="") { + // // chp=new CheckPassword(); + // // chp.Show(); + // // waitingPassword=true; + // // this.password=password; + // // } + // // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]); + // // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // // break; + + // // case "3": + // // if (strs.Length==2) { + // // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství"+Environment.NewLine+strs[1]); + // // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // // break; + + // // case "4": + // // if (strs.Length==1) { + // // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství"); + // // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení"); + // // break; + + // // case "5": + + // // break; + // // } + // //} + + // //int.TryParse(strs[1], out spawnX); + // //int.TryParse(strs[2], out spawnY); + // //int.TryParse(strs[3], out safeSpawn); + + // //PlayerX=spawnX; + // //PlayerY=spawnY; + + // //SendMsgTerrain(); + // state++; + // } + // break; + + // //case Command.Logout: + // // clientSocket.Disconnect(false); + // // break; + + // case Command.PlayersTeleportMessageToSource: { + // if (!string.IsNullOrEmpty(msgReceived.Message)) { + // string[] strs = msgReceived.Message.Split('|'); + + // if (int.TryParse(strs[0], out int num)) { + // if (num==1) { + // //DisplayText("Vaše žádost byla zamítnuta"); + // } + // if (num==2) { + // if ((DateTime.Now-tpPlayerTime.Date).TotalMinutes<=2) { + // foreach (Player p in players) { + // if (tpPlayerMsgWaiting==p.name) { + // // DisplayText("Teleportuji..."); + // text="Teleportuji..."; + // PlayerX=p.x; + // PlayerY=p.y; + // break; + // } + // } + // } + // } + // if (num==3) { + // if (strs[1]==Setting.Name) { + // //SomeoneWantTeleportToYou=true; + // SomeoneWantTeleportToYouName=msgReceived.From; + // gedo.BuildString("Hráč "+SomeoneWantTeleportToYouName+" se chce k vám teleportovat.\r\nPoužij \"*tp-allow\" pro přijení nebo \"*tp-deny\" pro zamítnutí."); + // diserpeard=255; + // } + // } + // } + // } + // } + // break; + + // case Command.Message: + // if (msgReceived.Message!=null||msgReceived.Message!="") { + // if (msgReceived.Message.StartsWith("*")) { + // string[] word = msgReceived.Message.Split(' '); + // switch (word[0]) { + // case "*setplayerpos": + // if (word.Length==3) { + // PlayerX=int.Parse(word[1]); + // PlayerY=int.Parse(word[2]); + // DisplayText("Teleportuji..."); + // SetPlayerPos(PlayerX, PlayerY); + // } + // break; + + // case "*spawnwaschanged": + // spawnX=int.Parse(word[1]); + // spawnY=int.Parse(word[2]); + // break; + + // case "*int-set": { + // int count = int.Parse(word[1]); + + // List tmpInv = new List(); + + // for (int i = 0; i tmpInv = new List(); + + // for (int i = 0; i"+msgReceived.cmdCommand.ToString()+"<>"+msgReceived.strMessage); + // //} else Console.WriteLine("!jméno "+msgReceived.strName); + // break; + + // case Command.Request: { + // Data msg = new Data { + // Cmd=Command.Request, + // // From=Setting.Name, + // To=toServer, + // Message="" + // }; + // //byteData=new byte[1024]; + // //byteData=msg.ToByte(); + + // //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + // Queue.Add(new DataToSend { + // Bytes=msg.ToByte(), + // Importance=Importance.VeryImportant + // }); + // } + // break; + + // case Command.Check: { + // state++; + // string[] get = msgReceived.Message.Split('|'); + + // if (get.Length>0) { + // maxplayers=int.Parse(get[1]); + // joinedPlayers=int.Parse(get[2]); + // string version = get[3]; + // //smd=true; + // if (version==Version.This) { + // Data msg = new Data { + // Cmd=Command.Login, + // // From=Setting.Name, + // To=toServer, + // //Message=Setting.Name + // }; + // //byteData=msg.ToByte(); + // current=Current.EndChecking; + // //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + // Queue.Add(new DataToSend { + // Bytes=msg.ToByte(), + // Importance=Importance.VeryImportant + // }); + // } else { + // ShowError("Jiná verze serveru", "Verze serveru ("+version+") je rozdílná od verze hry."); + // } + // } else { + // ShowError("Chyba sáčku", "Hra obdržela od serveru prázdný soubor s informacemi."); + // } + // // Console.WriteLine(msgReceived.strMessage); + // //string _new =msgReceived.strMessage; + // //string version=_new.Substring(_new.LastIndexOf("|")+1); + // //_new=_new.Substring(0,_new.LastIndexOf("|")); + // //int.TryParse(_new.Substring(_new.LastIndexOf("|")+1),out maxplayers); + // //_new=_new.Substring(0,_new.LastIndexOf("|")); + // //int.TryParse(_new.Substring(_new.LastIndexOf("|")+1),out joinedPlayers); + // //_new=_new.Substring(0,_new.LastIndexOf("|")); + // //Console.WriteLine("sdfgdfgfdf"); + // //if + // // if (joinedPlayersJejda tento příkaz není povolen (zkus *help)"); + } + + //void ShowError(string main, string toShow) { + // Error=true; + // ErrorHeader=main; + // ErrorText=toShow; + // current=Current.ErrorDuringGame; + + //} + + void DisplayText(string s) { + diserpeard=250; + if (gedo==null) gedo=new GeDo(0,0/*spriteFont_small,*//*spriteFont_small_italic,s,false*/); + else gedo.BuildString(text); + text=""; + + } + + string TextEdit(string editText) { + string newKey = Add(); + + string add; + + if (newKeyboardState.IsKeyDown(Keys.RightAlt)||newKeyboardState.IsKeyDown(Keys.LeftAlt)) add=ConvertNormalToAtls(newKey); + else if (newKeyboardState.IsKeyDown(Keys.LeftShift)||newKeyboardState.IsKeyDown(Keys.RightShift)) add=ConvertNormalToUpper(newKey); + else if (newKeyboardState.IsKeyDown(Keys.LeftControl)||newKeyboardState.IsKeyDown(Keys.RightControl)) add=ConvertNormalToCtrls(newKey); + else add=newKey; + + if (newKey=="") { + hold=false; + timeHold=30; + } else { + if (hold) { + switch (add) { + //case "Delete": + // if (editText.Length > 4) editText = editText.Substring(0, editText.Length - 5); else editText = ""; + // break; + + case "Delete": + if (editText.Length>0) editText=editText.Substring(0, editText.Length-1); /*else editText = "";*/ + break; + + case "Copy": + if (editText!=""&&editText!=null) System.Windows.Forms.Clipboard.SetText(editText); + break; + + case "Paste": + if (System.Windows.Forms.Clipboard.ContainsText()) editText+=System.Windows.Forms.Clipboard.GetText(); + break; + + //case "§": + // break; + + //case "Remove": + // editText = ""; + // break; + + // case "Double": + // editText += editText; + // break; + // case "Quick": + // editText += "RabigonCraft The most of my World"; + // break; + + //case "Alt": + // olderKey = "Alt"; + // break; + + default: + editText+=add; + break; + } + } else { + if (timeHold==0) hold=true; + else { + if (lastKey==newKey) { + if (timeHold==30) { + switch (add) { + //case "Delete": + // if (editText.Length>4) editText=editText.Substring(0,editText.Length-5); else editText=""; + // break; + + case "Delete": + if (editText.Length>0) editText=editText.Substring(0, editText.Length-1); /*else editText="";*/ + break; + + case "Copy": + if (editText!="") System.Windows.Forms.Clipboard.SetText(editText); + break; + + case "Paste": + if (System.Windows.Forms.Clipboard.ContainsText()) editText+=System.Windows.Forms.Clipboard.GetText(); + break; + + //case "Remove": + // editText = ""; + // break; + + //case "Double": + // editText += editText; + // break; + + //case "§": + // break; + + //case "Quick": + // editText += "RabigonCraft The most of my World"; + // break; + + //case "Alt": + // olderKey = "Alt"; + // break; + + default: + editText+=add; + //editText =editText.Replace("<,", "<"); + //editText =editText.Replace(",<", "<"); + + //editText =editText.Replace(">.", ">"); + //editText =editText.Replace(".>", ">"); + + //editText =editText.Replace("/ú", "/"); + //editText =editText.Replace("ú/", "/"); + break; + } + } + timeHold--; + } else { + hold=false; + timeHold=30; + } + } + } + } + // olderKey = lastKey; + lastKey=newKey; + + return editText; + } + + string Add() { + if (newKeyboardState.IsKeyDown(Keys.Space)) return " "; + + if (newKeyboardState.IsKeyDown(Keys.Q)) return "g"; + if (newKeyboardState.IsKeyDown(Keys.W)) return "w"; + if (newKeyboardState.IsKeyDown(Keys.E)) return "e"; + if (newKeyboardState.IsKeyDown(Keys.R)) return "r"; + if (newKeyboardState.IsKeyDown(Keys.T)) return "t"; + if (newKeyboardState.IsKeyDown(Keys.Z)) return "z"; + if (newKeyboardState.IsKeyDown(Keys.U)) return "u"; + if (newKeyboardState.IsKeyDown(Keys.I)) return "i"; + if (newKeyboardState.IsKeyDown(Keys.O)) return "o"; + if (newKeyboardState.IsKeyDown(Keys.P)) return "p"; + if (newKeyboardState.IsKeyDown(Keys.A)) return "a"; + if (newKeyboardState.IsKeyDown(Keys.S)) return "s"; + if (newKeyboardState.IsKeyDown(Keys.D)) return "d"; + if (newKeyboardState.IsKeyDown(Keys.F)) return "f"; + if (newKeyboardState.IsKeyDown(Keys.G)) return "g"; + if (newKeyboardState.IsKeyDown(Keys.H)) return "h"; + if (newKeyboardState.IsKeyDown(Keys.J)) return "j"; + if (newKeyboardState.IsKeyDown(Keys.K)) return "k"; + if (newKeyboardState.IsKeyDown(Keys.L)) return "l"; + if (newKeyboardState.IsKeyDown(Keys.Y)) return "y"; + if (newKeyboardState.IsKeyDown(Keys.X)) return "x"; + if (newKeyboardState.IsKeyDown(Keys.C)) return "c"; + if (newKeyboardState.IsKeyDown(Keys.V)) return "v"; + if (newKeyboardState.IsKeyDown(Keys.B)) return "b"; + if (newKeyboardState.IsKeyDown(Keys.N)) return "n"; + if (newKeyboardState.IsKeyDown(Keys.M)) return "m"; + + if (newKeyboardState.IsKeyDown(Keys.D1)) return "ó"; + if (newKeyboardState.IsKeyDown(Keys.D2)) return "ě"; + if (newKeyboardState.IsKeyDown(Keys.D3)) return "š"; + if (newKeyboardState.IsKeyDown(Keys.D4)) return "č"; + if (newKeyboardState.IsKeyDown(Keys.D5)) return "ř"; + if (newKeyboardState.IsKeyDown(Keys.D6)) return "ž"; + if (newKeyboardState.IsKeyDown(Keys.D7)) return "ý"; + if (newKeyboardState.IsKeyDown(Keys.D8)) return "á"; + if (newKeyboardState.IsKeyDown(Keys.D9)) return "í"; + if (newKeyboardState.IsKeyDown(Keys.D0)) return "é"; + + if (newKeyboardState.IsKeyDown(Keys.NumPad0)) return "0"; + if (newKeyboardState.IsKeyDown(Keys.NumPad1)) return "1"; + if (newKeyboardState.IsKeyDown(Keys.NumPad2)) return "2"; + if (newKeyboardState.IsKeyDown(Keys.NumPad3)) return "3"; + if (newKeyboardState.IsKeyDown(Keys.NumPad4)) return "4"; + if (newKeyboardState.IsKeyDown(Keys.NumPad5)) return "5"; + if (newKeyboardState.IsKeyDown(Keys.NumPad6)) return "6"; + if (newKeyboardState.IsKeyDown(Keys.NumPad7)) return "7"; + if (newKeyboardState.IsKeyDown(Keys.NumPad8)) return "8"; + if (newKeyboardState.IsKeyDown(Keys.NumPad9)) return "9"; + if (newKeyboardState.IsKeyDown(Keys.NumPad9)) return "9"; + + if (newKeyboardState.IsKeyDown(Keys.Back)) return "Delete"; + if (newKeyboardState.IsKeyDown(Keys.Delete)) return "Delete"; + + if (newKeyboardState.IsKeyDown(Keys.OemComma)) return ","; + if (newKeyboardState.IsKeyDown(Keys.OemPeriod)) return "."; + if (newKeyboardState.IsKeyDown(Keys.OemMinus)) return "-"; + if (newKeyboardState.IsKeyDown(Keys.OemQuestion)) return "'"; + if (newKeyboardState.IsKeyDown(Keys.OemPlus)) return "="; + if (newKeyboardState.IsKeyDown(Keys.OemCloseBrackets)) return ")"; + if (newKeyboardState.IsKeyDown(Keys.OemSemicolon)) return "ů"; + if (newKeyboardState.IsKeyDown(Keys.OemOpenBrackets)) return "ú"; + if (newKeyboardState.IsKeyDown(Keys.Divide)) return "/"; + if (newKeyboardState.IsKeyDown(Keys.Add)) return "+"; + if (newKeyboardState.IsKeyDown(Keys.Divide)) return "/"; + if (newKeyboardState.IsKeyDown(Keys.Decimal)) return ","; + if (newKeyboardState.IsKeyDown(Keys.Subtract)) return "-"; + if (newKeyboardState.IsKeyDown(Keys.Multiply)) return "*"; + if (newKeyboardState.IsKeyDown(Keys.OemQuotes)) return "§"; + + return ""; + } + + string ConvertNormalToUpper(string key) { + switch (key) { + case "q": return "Q"; + case "w": return "W"; + case "e": return "E"; + case "r": return "R"; + case "t": return "T"; + case "z": return "Z"; + case "u": return "U"; + case "i": return "I"; + case "o": return "O"; + case "p": return "P"; + case "a": return "A"; + case "s": return "S"; + case "d": return "D"; + case "f": return "F"; + case "g": return "G"; + case "h": return "H"; + case "j": return "J"; + case "k": return "K"; + case "l": return "L"; + case "y": return "Y"; + case "x": return "X"; + case "c": return "C"; + case "v": return "V"; + case "b": return "B"; + case "n": return "N"; + case "m": return "M"; + case "ú": return "/"; + case ")": return "("; + case ",": return "?"; + case ".": return ":"; + case "-": return "_"; + case "¨": return "'"; + case "´": return "ˇ"; + case "=": return "%"; + } + return ""; + } + + string ConvertNormalToCtrls(string key) { + switch (key) { + case "x": return "Delete"; + case "c": return "Copy"; + case "v": return "Paste"; + } + return ""; + } + + string ConvertNormalToAtls(string key) { + switch (key) { + case "q": return "\""; + case "w": return "|"; + case "f": return "["; + case "g": return "]"; + case "x": return "#"; + case "c": return "&"; + case "v": return "@"; + case "b": return "{"; + case "n": return "}"; + case "ú": return "÷"; + case ")": return "×"; + case ",": return "<"; + case ".": return ">"; + case "-": return "*"; + case "+": return "~"; + case "š": return "^"; + case "ř": return "°"; + } + return ""; + } + + #endregion + + #region New blocks + Block BackBlockFromId(ushort type, Vector2 position) { + return type switch { + // Backs + (ushort)BlockId.BackDirt => new NormalBlock(backgroundDirtTexture, type, position), + (ushort)BlockId.BackSand => new NormalBlock(backgroundSandTexture, type, position), + (ushort)BlockId.BackCobblestone => new NormalBlock(backgroundCobblestoneTexture, type, position), + (ushort)BlockId.BackClay => new NormalBlock(backgroundClayTexture, type, position), + (ushort)BlockId.BackRedSand => new NormalBlock(backgroundRedSandTexture, type, position), + (ushort)BlockId.BackRegolite => new NormalBlock(backgroundRegoliteTexture, type, position), + (ushort)BlockId.BackGravel => new NormalBlock(backgroundGravelTexture, type, position), + (ushort)BlockId.BackAnorthosite => new NormalBlock(backgroundAnorthositeTexture, type, position), + (ushort)BlockId.BackBasalt => new NormalBlock(backgroundBasaltTexture, type, position), + (ushort)BlockId.BackDiorit => new NormalBlock(backgroundDioritTexture, type, position), + (ushort)BlockId.BackDolomite => new NormalBlock(backgroundDolomiteTexture, type, position), + (ushort)BlockId.BackFlint => new NormalBlock(backgroundFlintTexture, type, position), + (ushort)BlockId.BackGabbro => new NormalBlock(backgroundGabbroTexture, type, position), + (ushort)BlockId.BackGneiss => new NormalBlock(backgroundGneissTexture, type, position), + (ushort)BlockId.BackLimestone => new NormalBlock(backgroundLimestoneTexture, type, position), + (ushort)BlockId.BackMudstone => new NormalBlock(backgroundMudstoneTexture, type, position), + (ushort)BlockId.BackRhyolite => new NormalBlock(backgroundRhyoliteTexture, type, position), + (ushort)BlockId.BackSandstone => new NormalBlock(backgroundSandstoneTexture, type, position), + (ushort)BlockId.BackSchist => new NormalBlock(backgroundSchistTexture, type, position), + (ushort)BlockId.BackCoal => new NormalBlock(backgroundCoalTexture, type, position), + (ushort)BlockId.BackCopper => new NormalBlock(backgroundCopperTexture, type, position), + (ushort)BlockId.BackTin => new NormalBlock(backgroundTinTexture, type, position), + (ushort)BlockId.BackIron => new NormalBlock(backgroundIronTexture, type, position), + (ushort)BlockId.BackAluminium => new NormalBlock(backgroundAluminiumTexture, type, position), + (ushort)BlockId.BackSilver => new NormalBlock(backgroundSilverTexture, type, position), + (ushort)BlockId.BackGold => new NormalBlock(backgroundGoldTexture, type, position), + (ushort)BlockId.BackSulfur => new NormalBlock(TextureBackSulfurOre, type, position), + (ushort)BlockId.BackSaltpeter => new NormalBlock(TextureBackSaltpeterOre, type, position), + // Wood + (ushort)BlockId.AppleWood => new WoodBlock { Texture = TextureAppleWood, Id = type, Position = position }, + (ushort)BlockId.CherryWood => new WoodBlock { Texture = cherryWoodTexture, Id = type, Position = position }, + (ushort)BlockId.LemonWood => new WoodBlock { Texture = TextureLemonWood, Id = type, Position = position }, + (ushort)BlockId.LindenWood => new WoodBlock { Texture = TextureLindenWood, Id = type, Position = position }, + (ushort)BlockId.OakWood => new WoodBlock { Texture = TextureOakWood, Id = type, Position = position }, + (ushort)BlockId.OrangeWood => new WoodBlock { Texture = TextureOrangeWood, Id = type, Position = position }, + (ushort)BlockId.PineWood => new WoodBlock { Texture = pineWoodTexture, Id = type, Position = position }, + (ushort)BlockId.PlumWood => new WoodBlock { Texture = TexturePlumWood, Id = type, Position = position }, + (ushort)BlockId.SpruceWood => new WoodBlock { Texture = spruceWoodTexture, Id = type, Position = position }, + (ushort)BlockId.WillowWood => new WoodBlock { Texture = TextureWillowWood, Id = type, Position = position }, + (ushort)BlockId.MangroveWood => new WoodBlock { Texture = TextureMangroveWood, Id = type, Position = position }, + (ushort)BlockId.EucalyptusWood => new WoodBlock { Texture = TextureEucalyptusWood, Id = type, Position = position }, + (ushort)BlockId.OliveWood => new WoodBlock { Texture = TextureOliveWood, Id = type, Position = position }, + (ushort)BlockId.RubberTreeWood => new WoodBlock { Texture = TextureRubberTreeWood, Id = type, Position = position }, + (ushort)BlockId.AcaciaWood => new WoodBlock { Texture = TextureAcaciaWood, Id = type, Position = position }, + (ushort)BlockId.KapokWood => new WoodBlock { Texture = TextureKapokWood, Id = type, Position = position }, + // Artifical + (ushort)BlockId.AdvancedSpaceBack => new NormalBlock(advancedSpaceBackTexture, type, position), + (ushort)BlockId.AdvancedSpaceWindow => new NormalBlock(advancedSpaceWindowTexture, type, position), + (ushort)BlockId.Glass => new NormalBlock(glassTexture, type, position), + (ushort)BlockId.Coral => new NormalBlock(coralTexture, type, position), + (ushort)BlockId.Seaweed => new NormalBlock(seaweedTexture, type, position), + _ => null, + }; + } + + Block SolidBlockFromId(ushort type, Vector2 position) { + return type switch { + // Stone + (ushort)BlockId.StoneBasalt => new NormalBlock { Texture = basaltTexture, Id = type, Position = position }, + (ushort)BlockId.StoneDiorit => new NormalBlock { Texture = dioritTexture, Id = type, Position = position }, + (ushort)BlockId.StoneDolomite => new NormalBlock { Texture = dolomiteTexture, Id = type, Position = position }, + (ushort)BlockId.StoneGabbro => new NormalBlock { Texture = gabbroTexture, Id = type, Position = position }, + (ushort)BlockId.StoneGneiss => new NormalBlock { Texture = gneissTexture, Id = type, Position = position }, + (ushort)BlockId.StoneLimestone => new NormalBlock { Texture = limestoneTexture, Id = type, Position = position }, + (ushort)BlockId.StoneRhyolite => new NormalBlock { Texture = rhyoliteTexture, Id = type, Position = position }, + (ushort)BlockId.StoneSandstone => new NormalBlock { Texture = sandstoneTexture, Id = type, Position = position }, + (ushort)BlockId.StoneSchist => new NormalBlock { Texture = schistTexture, Id = type, Position = position }, + (ushort)BlockId.Anorthosite => new NormalBlock { Texture = anorthositeTexture, Id = type, Position = position }, + (ushort)BlockId.MudStone => new NormalBlock { Texture = mudstoneTexture, Id = type, Position = position }, + (ushort)BlockId.Regolite => new NormalBlock { Texture = regoliteTexture, Id = type, Position = position }, + (ushort)BlockId.RedSand => new NormalBlock { Texture = TextureRedSand, Id = type, Position = position }, + (ushort)BlockId.Compost => new NormalBlock { Texture = CompostTexture, Id = type, Position = position }, + // Ore + (ushort)BlockId.OreAluminium => new NormalBlock { Texture = TextureOreAluminium, Id = type, Position = position }, + (ushort)BlockId.OreCopper => new NormalBlock { Texture = TextureOreCopper, Id = type, Position = position }, + (ushort)BlockId.OreGold => new NormalBlock { Texture = TextureOreGold, Id = type, Position = position }, + (ushort)BlockId.OreIron => new NormalBlock { Texture = TextureOreIron, Id = type, Position = position }, + (ushort)BlockId.OreSilver => new NormalBlock { Texture = TextureOreSilver, Id = type, Position = position }, + (ushort)BlockId.OreTin => new NormalBlock { Texture = TextureOreTin, Id = type, Position = position }, + (ushort)BlockId.OreCoal => new NormalBlock { Texture = TextureOreCoal, Id = type, Position = position }, + (ushort)BlockId.OreSulfur => new NormalBlock { Texture = TextureOreSulfur, Id = type, Position = position }, + (ushort)BlockId.OreSaltpeter => new NormalBlock { Texture = TextureOreSaltpeter, Id = type, Position = position }, + // Blocks + (ushort)BlockId.Cobblestone => new NormalBlock { Texture = cobblestoneTexture, Id = type, Position = position }, + (ushort)BlockId.Gravel => new NormalBlock { Texture = gravelTexture, Id = type, Position = position }, + (ushort)BlockId.Sand => new NormalBlock { Texture = sandTexture, Id = type, Position = position }, + (ushort)BlockId.Dirt => new NormalBlock { Texture = TextureDirt, Id = type, Position = position }, + (ushort)BlockId.Ice => new NormalBlock { Texture = iceTexture, Id = type, Position = position }, + (ushort)BlockId.Clay => new NormalBlock { Texture = clayTexture, Id = type, Position = position }, + // Grass + (ushort)BlockId.GrassBlockDesert => new NormalBlock { Texture = TextureGrassBlockDesert, Id = type, Position = position }, + (ushort)BlockId.GrassBlockForest => new NormalBlock { Texture = TextureGrassBlockForest, Id = type, Position = position }, + (ushort)BlockId.GrassBlockHills => new NormalBlock { Texture = TextureGrassBlockHills, Id = type, Position = position }, + (ushort)BlockId.GrassBlockJungle => new NormalBlock { Texture = TextureGrassBlockJungle, Id = type, Position = position }, + (ushort)BlockId.GrassBlockPlains => new NormalBlock { Texture = TextureGrassBlockPlains, Id = type, Position = position }, + (ushort)BlockId.GrassBlockClay => new NormalBlock { Texture = TextureGrassBlockClay, Id = type, Position = position }, + (ushort)BlockId.GrassBlockCompost => new NormalBlock { Texture = TextureGrassBlockCompost, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowDesert => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowForest => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowHills => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowJungle => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowPlains => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowClay => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowCompost => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + // Artifical + (ushort)BlockId.Roof1 => new NormalBlock { Texture = roof1Texture, Id = type, Position = position }, + (ushort)BlockId.Roof2 => new NormalBlock { Texture = roof2Texture, Id = type, Position = position }, + (ushort)BlockId.Bricks => new NormalBlock { Texture = bricksTexture, Id = type, Position = position }, + (ushort)BlockId.DoorClose => new NormalBlock { Texture = doorCloseTexture, Id = type, Position = position }, + (ushort)BlockId.Planks => new NormalBlock { Texture = planksTexture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpaceBlock => new NormalBlock { Texture = advancedSpaceBlockTexture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpaceFloor => new NormalBlock { Texture = advancedSpaceFloorTexture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart1 => new NormalBlock { Texture = advancedSpacePart1Texture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart2 => new NormalBlock { Texture = advancedSpacePart2Texture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart3 => new NormalBlock { Texture = advancedSpacePart3Texture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart4 => new NormalBlock { Texture = advancedSpacePart4Texture, Id = type, Position = position }, + (ushort)BlockId.Snow => new NormalBlock { Texture = snowTexture, Id = type, Position = position }, + _ => null, + }; + } + + Block TopBlockFromId(ushort type, Vector2 position) { + switch (type) { + case (ushort)BlockId.BucketForRubber: return new NormalBlock(TextureBucketForRubber,type, position); + + // Blocks + case (ushort)BlockId.Lava: return new NormalBlock(lavaTexture,type, position); + + // Leaves + case (ushort)BlockId.AppleLeaves: return new LeavesBlock(TextureAppleLeaves,type, position); + case (ushort)BlockId.AppleLeavesWithApples: return new LeavesBlock(TextureAppleLeavesWithApples,type, position); + case (ushort)BlockId.AppleBranches: return new LeavesBlock(TextureBranches,type, position); + case (ushort)BlockId.AppleLeavesBlossom: return new LeavesBlock(TextureBranches,type, position); + + case (ushort)BlockId.CherryLeaves: return new LeavesBlock(TextureCherryLeaves,type, position); + case (ushort)BlockId.CherryLeavesWithCherries: return new LeavesBlock(TextureCherryLeavesWithCherries,type, position); + case (ushort)BlockId.CherryBranches: return new LeavesBlock(TextureBranches,type, position); + case (ushort)BlockId.WillowBranches: return new LeavesBlock(TextureBranches,type, position); + case (ushort)BlockId.CherryLeavesBlossom: return new LeavesBlock(TextureBranches,type, position); + + case (ushort)BlockId.PlumLeaves: return new LeavesBlock(TexturePlumLeaves,type, position); + case (ushort)BlockId.PlumLeavesBlossom: return new LeavesBlock(TextureBranches,type, position); + case (ushort)BlockId.PlumBranches: return new LeavesBlock(TextureBranches,type, position); + + case (ushort)BlockId.OakBranches: return new LeavesBlock(TextureBranches,type, position); + case (ushort)BlockId.LindenBranches: return new LeavesBlock(TextureBranches,type, position); + case (ushort)BlockId.LemonLeavesWithLemons: return new LeavesBlock(lemonLeavesWithLemonsTexture,type, position); + case (ushort)BlockId.LindenLeaves: return new LeavesBlock(TextureLindenLeaves,type, position); + case (ushort)BlockId.OakLeaves: return new LeavesBlock(TextureOakLeaves, type, position); + case (ushort)BlockId.OrangeLeaves: return new LeavesBlock(TextureOrangeLeaves,type, position); + case (ushort)BlockId.SpruceLeaves: return new LeavesBlock(spruceLeavesTexture,type, position); + case (ushort)BlockId.PlumLeavesWithPlums: return new LeavesBlock(TexturePlumLeavesWithPlums,type, position); + case (ushort)BlockId.PineLeaves: return new LeavesBlock(pineLeavesTexture,type, position); + case (ushort)BlockId.OrangeLeavesWithOranges: return new LeavesBlock(TextureOrangeLeavesWithOranges,type, position); + case (ushort)BlockId.LemonLeaves: return new LeavesBlock(TextureLemonLeaves,type, position); + case (ushort)BlockId.WillowLeaves: return new LeavesBlock(TextureWillowLeaves,type, position); + case (ushort)BlockId.MangroveLeaves:return new LeavesBlock(TextureMangroveLeaves,type, position); + case (ushort)BlockId.EucalyptusLeaves: return new LeavesBlock(TextureEucalyptusLeaves,type, position); + case (ushort)BlockId.OliveLeavesWithOlives:return new LeavesBlock(TextureOliveLeavesWithOlives,type, position); + case (ushort)BlockId.OliveLeaves: return new LeavesBlock(TextureOliveLeaves,type, position); + case (ushort)BlockId.RubberTreeLeaves: return new LeavesBlock(TextureRubberTreeLeaves,type, position); + case (ushort)BlockId.AcaciaLeaves: return new LeavesBlock(TextureAcaciaLeaves,type, position); + case (ushort)BlockId.KapokLeacesFlowering: return new LeavesBlock(TextureKapokBlossom,type, position); + case (ushort)BlockId.KapokLeacesFibre: return new LeavesBlock(TextureKapokLeavesFibre,type, position); + case (ushort)BlockId.KapokLeaves: return new LeavesBlock(TextureKapokLeaves,type, position); + + case (ushort)BlockId.EggDrop: + //if (easter) return new NormalBlock{Texture=, Id=type, Position=position}; + // else + return new NormalBlock{Texture=(easter ? TextureEggDropE[FastRandom.Int4()] : TextureEggDrop), Id=type, Position=position}; + + case (ushort)BlockId.WillowSapling: return new NormalBlock{Texture=TextureWillowSapling, Id=type, Position=position}; + case (ushort)BlockId.MangroveSapling: return new NormalBlock{Texture=TextureMangroveSapling, Id=type, Position=position}; + case (ushort)BlockId.EucalyptusSapling:return new NormalBlock{Texture=TextureEucalyptusSapling, Id=type, Position=position}; + case (ushort)BlockId.OliveSapling: return new NormalBlock{Texture=TextureOliveSapling, Id=type, Position=position}; + case (ushort)BlockId.RubberTreeSapling: return new NormalBlock{Texture=TextureRubberTreeSapling, Id=type, Position=position}; + case (ushort)BlockId.AcaciaSapling: return new NormalBlock{Texture=TextureAcaciaSapling, Id=type, Position=position}; + case (ushort)BlockId.KapokSapling: return new NormalBlock{Texture=TextureKapokSapling, Id=type, Position=position}; + + // Blocks + case (ushort)BlockId.SnowTop: return new NormalBlock{Texture=snowTopTexture, Id=type, Position=position }; + case (ushort)BlockId.Glass: return new NormalBlock{Texture=glassTexture, Id=type, Position=position }; + case (ushort)BlockId.ChristmasStar: return new LeavesBlock(TextureChristmasStar, type, position); + case (ushort)BlockId.Oil: return new NormalBlock{Texture=oilTexture, Id=type, Position=position }; + case (ushort)BlockId.WaterBlock: return new Water(waterTexture,type, position); + case (ushort)BlockId.WaterSalt: return new Water(waterTexture,type, position); + case (ushort)BlockId.Rocks: return new NormalBlock{Texture=TextureRocks[FastRandom.Int4()], Id=type, Position=position }; + + // Saplings + case (ushort)BlockId.AppleSapling: return new NormalBlock{Texture=TextureAppleSapling, Id=type, Position=position }; + case (ushort)BlockId.CherrySapling: return new NormalBlock{Texture=cherrySaplingTexture, Id=type, Position=position }; + case (ushort)BlockId.LemonSapling: return new NormalBlock{Texture=lemonSaplingTexture, Id=type, Position=position }; + case (ushort)BlockId.LindenSapling: return new NormalBlock{Texture=TextureLindenSapling, Id=type, Position=position }; + case (ushort)BlockId.OakSapling: return new NormalBlock{Texture=oakSaplingTexture, Id=type, Position=position }; + case (ushort)BlockId.OrangeSapling: return new NormalBlock{Texture=orangeSaplingTexture, Id=type, Position=position }; + case (ushort)BlockId.PineSapling: return new NormalBlock{Texture=pineSaplingTexture, Id=type, Position=position }; + case (ushort)BlockId.PlumSapling: return new NormalBlock{Texture=plumSaplingTexture, Id=type, Position=position }; + case (ushort)BlockId.SpruceSapling: return new NormalBlock{Texture=spruceSaplingTexture, Id=type, Position=position}; + + // Flowers + case (ushort)BlockId.Violet: return new NormalBlock{Texture=plantVioletTexture, Id=type, Position=position}; + case (ushort)BlockId.Dandelion: return new NormalBlock{Texture=plantDandelionTexture, Id=type, Position=position}; + case (ushort)BlockId.Heather: return new NormalBlock{Texture=heatherTexture, Id=type, Position=position}; + case (ushort)BlockId.Alore: return new NormalBlock{Texture=plantAloreTexture, Id=type, Position=position}; + case (ushort)BlockId.Rose: return new NormalBlock{Texture=plantRoseTexture, Id=type, Position=position}; + case (ushort)BlockId.Orchid: return new NormalBlock{Texture=plantOrchidTexture, Id=type, Position=position}; + + case (ushort)BlockId.CactusBig: return new CactusBlock{Texture=cactusBigTexture, Id=type, Position=position }; + case (ushort)BlockId.CactusSmall: return new CactusBlock{Texture=cactusLittleTexture, Id=type, Position=position }; + + // case (ushort)BlockId.Liana: return new NormalBlock(lianaTexture,type, position); + case (ushort)BlockId.SugarCane: return new NormalBlock{Texture=sugarCaneTexture, Id=type, Position=position }; + + case (ushort)BlockId.Toadstool: return new NormalBlock{Texture=toadstoolTexture, Id=type, Position=position}; + case (ushort)BlockId.Boletus: return new NormalBlock{Texture=boletusTexture, Id=type, Position=position}; + case (ushort)BlockId.Champignon: return new NormalBlock{Texture=champignonTexture, Id=type, Position=position}; + + case (ushort)BlockId.BranchALittle1: return new NormalBlock{Texture=branchALittle1Texture, Id=type, Position=position}; + case (ushort)BlockId.BranchALittle2: return new NormalBlock{Texture=branchALittle2Texture, Id=type, Position=position}; + case (ushort)BlockId.BranchFull: return new NormalBlock{Texture=branchFullTexture, Id=type, Position=position}; + case (ushort)BlockId.BranchWithout: return new NormalBlock{Texture=branchWithoutTexture, Id=type, Position=position}; + + // Grass + case (ushort)BlockId.GrassDesert: return new NormalBlock{Texture=grassDesertTexture, Id=type, Position=position}; + case (ushort)BlockId.GrassForest: return new NormalBlock{Texture=grassForestTexture, Id=type, Position=position}; + case (ushort)BlockId.GrassHills: return new NormalBlock{Texture=grassHillsTexture, Id=type, Position=position}; + case (ushort)BlockId.GrassJungle: return new NormalBlock{Texture=grassJungleTexture, Id=type, Position=position}; + case (ushort)BlockId.GrassPlains: return new NormalBlock{Texture=grassPlainsTexture, Id=type, Position=position}; + + // Artifical Blocks + case (ushort)BlockId.DoorOpen: return new NormalBlock{Texture=doorOpenTexture, Id=type, Position=position}; + + // Mechanical + case (ushort)BlockId.Flag: return new AnimatedBlock(flagTexture, position,25,35,type); + case (ushort)BlockId.Desk: return new NormalBlock{Texture=deskTexture, Id=type, Position=position}; + case (ushort)BlockId.Ladder: return new NormalBlock{Texture=ladderTexture, Id=type, Position=position}; + case (ushort)BlockId.BoxAdv: return new BoxBlock(boxAdvTexture, type, position,InvMaxBoxAdv); + case (ushort)BlockId.BoxWooden: return new BoxBlock(boxWoodenTexture, type, position,InvMaxBoxWooden); + case (ushort)BlockId.Shelf: return new ShelfBlock(shelfTexture, type, position, InvMaxShelf); + case (ushort)BlockId.BurningTorch: return new AnimatedBlock(torchTexture, position,16,16, type); + case (ushort)BlockId.NotBurningTorch: return new NormalBlock{Texture=torchTexture, Id=type, Position=position}; + case (ushort)BlockId.Barrel: return new Barrel(TextureBarrel, type, position); + + // Electric mashines + case (ushort)BlockId.Lamp: + MashineBlockBasic m=new(lampTexture,type, position,0); + lightsLamp.Add(m); + return m; + + case (ushort)BlockId.Radio: return new MashineBlockBasic(radioTexture, type, position,0); + case (ushort)BlockId.Rocket: return new NormalBlock{Texture=rocketTexture, Id=type, Position=position }; + + // Generating energy + case (ushort)BlockId.Windmill: return new AnimatedBlockOffset(windMillTexture, position,26,45,type,-5,-29); + case (ushort)BlockId.SewingMachine: return new MashineBlockBasic(sewingMachineTexture,type, position,0); + case (ushort)BlockId.FurnaceStone: return new MashineBlockBasic(furnaceStoneTexture,type, position, InvMaxFurnaceStone); + case (ushort)BlockId.Miner: return new MashineBlockBasic(minerTexture,type, position, InvMaxMiner); + case (ushort)BlockId.Macerator: return new MashineBlockBasic(maceratorTexture,type, position, 0); + case (ushort)BlockId.FurnaceElectric: return new MashineBlockBasic(furnaceElectricTexture,type, position,0); + case (ushort)BlockId.Charger: return new MashineBlockBasic(chargerTexture,type, position, 1); + case (ushort)BlockId.OxygenMachine: return new MashineBlockBasic(TextureOxygenMachine,type, position, 1); + case (ushort)BlockId.Composter: return new ShelfBlock(ComposterTexture,type, position, InvMaxComposter); + case (ushort)BlockId.SolarPanel: return new NormalBlock{Texture=solarPanelTexture, Id=type, Position=position}; + case (ushort)BlockId.Label: return new ScreenBlock(labelTexture, position,16,16,type); + case (ushort)BlockId.AngelHair: return new LeavesBlock(TextureAngelHairWithSpruceLeaves, type, position); + case (ushort)BlockId.ChristmasBall: return new LeavesBlock(TextureChristmasBallGrayWithLeaves, type, position); + case (ushort)BlockId.ChristmasBallBlue: return new LeavesBlock(TextureChristmasBallBlueWithLeaves, type, position); + case (ushort)BlockId.ChristmasBallYellow: return new LeavesBlock(TextureChristmasBallYellowWithLeaves, type, position); + case (ushort)BlockId.ChristmasBallLightGreen: return new LeavesBlock(TextureChristmasBallLightGreenWithLeaves, type, position); + case (ushort)BlockId.ChristmasBallOrange: return new LeavesBlock(TextureChristmasBallOrangeWithLeaves, type, position); + case (ushort)BlockId.ChristmasBallRed: return new LeavesBlock(TextureChristmasBallRedWithLeaves, type, position); + case (ushort)BlockId.ChristmasBallPink: return new LeavesBlock(TextureChristmasBallPinkWithLeaves, type, position); + case (ushort)BlockId.ChristmasBallPurple: return new LeavesBlock(TextureChristmasBallPurpleWithLeaves, type, position); + + + default: return null; + } + } + + Plant GetPlantFromId(ushort input, byte height, byte grow, short x) { + return input switch { + (ushort)BlockId.Wheat => new Plant(input, height, grow, x, wheatTexture), + (ushort)BlockId.Onion => new Plant(input, height, grow, x, plantOnionTexture), + (ushort)BlockId.Peas => new Plant(input, height, grow, x, plantPeasTexture), + (ushort)BlockId.Carrot => new Plant(input, height, grow, x, plantCarrotTexture), + (ushort)BlockId.Flax => new Plant(input, height, grow, x, flaxTexture), + (ushort)BlockId.Strawberry => new Plant(input, height, grow, x, strawberryPlantTexture), + (ushort)BlockId.Rashberry => new Plant(input, height, grow, x, rashberryPlantTexture), + (ushort)BlockId.Blueberry => new Plant(input, height, grow, x, blueberryPlantTexture), + _ => null, + }; + } + + + //MMob GetMobFromId(BlockId input, byte height, bool dir, int x) { + // switch (input) { + // case BlockId.Fish: return new Fish((byte)input, height, x, dir, fishTexture0, fishTexture1); + // case BlockId.Chicken: return new Chicken((byte)input, height, x, dir, chickenWalkTexture, chickenEatTexture); + // case BlockId.Rabbit: return new Rabbit((byte)input, height, x, dir, rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture); + + // default: return null; + // } + //} + #endregion + + #region Labels + void RefreshAroundLabels(int x, int y) { + if (terrain[x].TopBlocks[y+1]!=null) { if (terrain[x].TopBlocks[y+1].Id==(int)BlockId.Label) SetIndexLabel(x, y+1); } + if (terrain[x].TopBlocks[y-1]!=null) { if (terrain[x].TopBlocks[y-1].Id==(int)BlockId.Label) SetIndexLabel(x, y-1); } + + if (terrain[x+1]!=null) { + if (terrain[x+1].TopBlocks[y]!=null) { + if (terrain[x+1].TopBlocks[y].Id==(int)BlockId.Label) SetIndexLabel(x+1, y); + } + } + if (terrain[x-1]!=null) { + if (terrain[x-1].TopBlocks[y]!=null) { + if (terrain[x-1].TopBlocks[y].Id==(int)BlockId.Label) SetIndexLabel(x-1, y); + } + } + } + + void SetIndexLabel(int x, int y) { + bool up = false, down = false, left = false, right = false; + + if (terrain[x].TopBlocks[y-1]!=null) + up=terrain[x].TopBlocks[y-1].Id==(int)BlockId.Label + ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Lamp + ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Radio + ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.FurnaceElectric + ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Macerator + ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.SolarPanel + ||terrain[x].TopBlocks[y-1].Id==(int)BlockId.Windmill; + + if (terrain[x].TopBlocks[y+1]!=null) + down=terrain[x].TopBlocks[y+1].Id==(int)BlockId.Label + ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Lamp + ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Radio + ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.FurnaceElectric + ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Macerator + ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Watermill + ||terrain[x].TopBlocks[y+1].Id==(int)BlockId.Windmill; + + if (terrain[x-1]!=null) { + if (terrain[x-1].TopBlocks[y]!=null) + left=terrain[x-1].TopBlocks[y].Id==(int)BlockId.Label + ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Lamp + ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Radio + ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.FurnaceElectric + ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Macerator + ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.SolarPanel + ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Watermill + ||terrain[x-1].TopBlocks[y].Id==(int)BlockId.Windmill; + } + + if (terrain[x+1]!=null) { + if (terrain[x+1].TopBlocks[y]!=null) + right=terrain[x+1].TopBlocks[y].Id==(int)BlockId.Label + ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Lamp + ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.FurnaceElectric + ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Macerator + ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Radio + ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.SolarPanel + ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Watermill + ||terrain[x+1].TopBlocks[y].Id==(int)BlockId.Windmill; + } + + if (up&&down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=15; return; } + if (!up&&down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=14; return; } + if (up&&down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=13; return; } + if (up&&!down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=12; return; } + if (up&&down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=11; return; } + if (up&&down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=10; return; } + if (!up&&!down&&left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=9; return; } + if (up&&!down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=8; return; } + if (!up&&down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=7; return; } + if (!up&&down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=6; return; } + if (up&&!down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=5; return; } + if (!up&&!down&&left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=4; return; } + if (!up&&down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=3; return; } + if (!up&&!down&&!left&&right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=2; return; } + if (up&&!down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=1; return; } + if (!up&&!down&&!left&&!right) { ((ScreenBlock)terrain[x].TopBlocks[y]).Screen=0; return; } + } + #endregion + + #region Draw Inventory + Texture2D ItemIdToTexture(ushort id) { + switch (id) { + case (ushort)Items.ChristmasBallGray: return TextureChristmasBall; + case (ushort)Items.ChristmasBallYellow: return TextureChristmasBallYellow; + case (ushort)Items.ChristmasBallOrange: return TextureChristmasBallOrange; + case (ushort)Items.ChristmasBallRed: return TextureChristmasBallRed; + case (ushort)Items.ChristmasBallPurple: return TextureChristmasBallPurple; + case (ushort)Items.ChristmasBallPink: return TextureChristmasBallPink; + case (ushort)Items.ChristmasBallLightGreen: return TextureChristmasBallLightGreen; + case (ushort)Items.ChristmasBallBlue: return TextureChristmasBallBlue; + case (ushort)Items.ChristmasBallTeal: return TextureChristmasBallTeal; + case (ushort)Items.AngelHair: return TextureAngelHair; + + case (ushort)Items.ChristmasStar:return TextureChristmasStar; + case (ushort)Items.AirTank:return TextureAirTank; + case (ushort)Items.AirTank2:return TextureAirTank2; + case (ushort)Items.OxygenMachine:return TextureOxygenMachine; + case (ushort)Items.BackSulfur:return TextureBackSulfurOre; + case (ushort)Items.BackSaltpeter:return TextureBackSaltpeterOre; + case (ushort)Items.Ammo:return TextureAmmo; + case (ushort)Items.Gun:return TextureGun; + case (ushort)Items.Saltpeter:return TextureSaltpeter; + case (ushort)Items.SulfurDust:return TextureSulfur; + case (ushort)Items.OreSaltpeter:return TextureOreSaltpeter; + case (ushort)Items.OreSulfur:return TextureOreSulfur; + case (ushort)Items.Gunpowder:return TextureGunpowder; + + case (ushort)Items.BucketForRubber:return TextureBucketForRubber; + case (ushort)Items.Resin:return TextureResin; + case (ushort)Items.Aluminium:return ItemAluminiumTexture; + case (ushort)Items.TorchOFF:return TextureTorchOff; + //case (ushort)Items.BronzeHeadHoe:return TextureHoeHeadBronze; + //case (ushort)Items.CopperHeadHoe:return TextureHoeHeadCopper; + //case (ushort)Items.HoeHeadIron:return TextureHoeHeadIron; + case (ushort)Items.HoeCopper:return TextureHoeCopper; + + case (ushort)Items.Mobile:return mobileTexture; + case (ushort)Items.SewingMachine:return sewingMachineTexture; + case (ushort)Items.BucketOil:return bucketOilTexture; + case (ushort)Items.TorchON:return torchInvTexture; + + case (ushort)Items.BottleOil:return bottleOilTexture; + case (ushort)Items.BoxAdv:return boxAdvTexture; + case (ushort)Items.BoxWooden:return boxWoodenTexture; + case (ushort)Items.Shelf:return shelfTexture; + case (ushort)Items.Heater:return heatherTexture; + case (ushort)Items.WoodDust:return ItemWoodDustTexture; + case (ushort)Items.AluminiumDust:return ItemAluminiumDustTexture; + case (ushort)Items.FlaxSeeds:return flaxSeedsTexture; + case (ushort)Items.MudIngot:return oneMudBrickTexture; + case (ushort)Items.AluminiumIngot:return ItemAluminiumIngotTexture; + case (ushort)Items.Nail:return nailTexture; + case (ushort)Items.Silicium:return siliciumTexture; + case (ushort)Items.StoneBasalt: return basaltTexture; + case (ushort)Items.StoneLimestone: return limestoneTexture; + case (ushort)Items.StoneRhyolite: return rhyoliteTexture; + case (ushort)Items.StoneGneiss: return gneissTexture; + case (ushort)Items.StoneSandstone: return sandstoneTexture; + case (ushort)Items.StoneSchist: return schistTexture; + case (ushort)Items.StoneGabbro: return gabbroTexture; + case (ushort)Items.StoneDiorit: return dioritTexture; + case (ushort)Items.StoneDolomite: return dolomiteTexture; + case (ushort)Items.Flax: return flaxInvTexture; + case (ushort)Items.Dirt: return TextureDirt; + case (ushort)Items.Sand: return sandTexture; + case (ushort)Items.Lava: return lavaTexture; + case (ushort)Items.Stonerubble: return cobblestoneTexture; + case (ushort)Items.Gravel: return gravelTexture; + + case (ushort)Items.WoodOak: return TextureOakWood; + case (ushort)Items.WoodSpruce: return spruceWoodTexture; + case (ushort)Items.WoodLinden: return TextureLindenWood; + case (ushort)Items.WoodPine: return pineWoodTexture; + case (ushort)Items.WoodApple: return TextureAppleWood; + case (ushort)Items.WoodCherry: return cherryWoodTexture; + case (ushort)Items.WoodPlum: return TexturePlumWood; + case (ushort)Items.WoodLemon: return TextureLemonWood; + case (ushort)Items.WoodOrange: return TextureOrangeWood; + + case (ushort)Items.OakLeaves: return TextureOakLeaves; + + case (ushort)Items.GrassBlockDesert: return TextureGrassBlockDesert; + case (ushort)Items.GrassBlockForest: return TextureGrassBlockForest; + case (ushort)Items.GrassBlockHills: return TextureGrassBlockHills; + case (ushort)Items.GrassBlockJungle: return TextureGrassBlockJungle; + case (ushort)Items.GrassBlockPlains: return TextureGrassBlockPlains; + case (ushort)Items.GrassBlockCompost: return TextureGrassBlockCompost; + + //Crafted + case (ushort)Items.Glass: return glassTexture; + case (ushort)Items.Bricks: return bricksTexture; + + case (ushort)Items.Planks: return planksTexture; + + case (ushort)Items.Desk: return deskTexture; + case (ushort)Items.Door: return ItemDoorTexture; + case (ushort)Items.Ladder: return ladderTexture; + case (ushort)Items.Flag: return ItemFlagTexture; + + case (ushort)Items.Rope: return ItemRopeTexture; + + case (ushort)Items.HayBlock: return hayBlockTexture; + + case (ushort)Items.Roof1: return roof1Texture; + case (ushort)Items.Roof2: return roof2Texture; + + //Mashines + case (ushort)Items.AdvancedSpaceBack: return advancedSpaceBackTexture; + case (ushort)Items.AdvancedSpaceWindow: return advancedSpaceWindowTexture; + case (ushort)Items.AdvancedSpaceBlock: return advancedSpaceBlockTexture; + case (ushort)Items.AdvancedSpaceFloor: return advancedSpaceFloorTexture; + case (ushort)Items.AdvancedSpacePart1: return advancedSpacePart1Texture; + case (ushort)Items.AdvancedSpacePart2: return advancedSpacePart2Texture; + case (ushort)Items.AdvancedSpacePart3: return advancedSpacePart3Texture; + case (ushort)Items.AdvancedSpacePart4: return advancedSpacePart4Texture; + + case (ushort)Items.WindMill: return ItemWindMillTexture; + case (ushort)Items.WaterMill: return ItemWaterMillTexture; + case (ushort)Items.SolarPanel: return solarPanelTexture; + + case (ushort)Items.Miner: return minerTexture; + case (ushort)Items.Macerator: return maceratorOneTexture; + case (ushort)Items.Lamp: return lampTexture; + case (ushort)Items.Radio: return radioInvTexture; + case (ushort)Items.Label: return labelOneTexture; + case (ushort)Items.Rocket: return ItemRocketTexture; + case (ushort)Items.FurnaceElectric: return furnaceElectricOneTexture; + case (ushort)Items.FurnaceStone: return furnaceStoneOneTexture; + case (ushort)Items.Barrel: return TextureBarrel; + + //Food + case (ushort)Items.Banana: return ItemBananaTexture; + case (ushort)Items.Cherry: return ItemCherryTexture; + case (ushort)Items.Lemon: return ItemLemonTexture; + case (ushort)Items.Orange: return ItemOrangeTexture; + case (ushort)Items.Plum: return ItemPlumTexture; + case (ushort)Items.Apple: return ItemAppleTexture; + case (ushort)Items.Rashberry: return rashberryTexture; + case (ushort)Items.Strawberry: return strawberryTexture; + case (ushort)Items.Blueberries: return blueberryTexture; + + case (ushort)Items.RabbitMeatCooked: return ItemRabbtCookedMeatTexture; + case (ushort)Items.RabbitMeat: return ItemRabbitMeatTexture; + + case (ushort)Items.AnimalFish: return fishTexture0; + case (ushort)Items.FishMeatCooked: return fishCookedTexture; + + case (ushort)Items.Egg: return TextureItemEgg; + case (ushort)Items.boiledEgg: return TextureItemBoiledEgg; + + //Clothes + case (ushort)Items.Backpack: return ItemBackpackTexture; + + //Items + case (ushort)Items.CoalDust: return ItemCoalDustTexture; + case (ushort)Items.BronzeDust: return ItemBronzeDustTexture; + case (ushort)Items.GoldDust: return ItemGoldDustTexture; + case (ushort)Items.IronDust: return ItemIronDustTexture; + case (ushort)Items.SilverDust: return ItemSilverDustTexture; + case (ushort)Items.CopperDust: return ItemCopperDustTexture; + case (ushort)Items.TinDust: return ItemTinDustTexture; + + case (ushort)Items.BronzeIngot: return ItemBronzeIngotTexture; + case (ushort)Items.SteelIngot: return TextureIngotSteel; + case (ushort)Items.GoldIngot: return ItemGoldIngotTexture; + case (ushort)Items.IronIngot: return ItemIronIngotTexture; + case (ushort)Items.TinIngot: return ItemTinIngotTexture; + case (ushort)Items.SilverIngot: return ItemSilverIngotTexture; + case (ushort)Items.CopperIngot: return ItemCopperIngotTexture; + + case (ushort)Items.PlateIron: return plateIronTexture; + case (ushort)Items.PlateBronze: return plateBronzeTexture; + case (ushort)Items.plateAluminium: return plateAluminiumTexture; + case (ushort)Items.PlateCopper: return plateCopperTexture; + case (ushort)Items.PlateGold: return plateGoldTexture; + + case (ushort)Items.OreCoal: return TextureOreCoal; + case (ushort)Items.ItemCoal: return ItemCoalTexture; + case (ushort)Items.ItemGold: return ItemGoldTexture; + case (ushort)Items.ItemTin: return ItemTinTexture; + case (ushort)Items.ItemSilver: return ItemSilverTexture; + case (ushort)Items.ItemIron: return ItemIronTexture; + case (ushort)Items.ItemCopper: return ItemCopperTexture; + case (ushort)Items.Ash: return ashTexture; + case (ushort)Items.CoalWood: return coalWoodTexture; + + case (ushort)Items.Saphirite: return ItemSaphiriteTexture; + case (ushort)Items.Diamond: return ItemDiamondTexture; + case (ushort)Items.Smaragd: return ItemSmaragdTexture; + case (ushort)Items.Ruby: return ItemRubyTexture; + case (ushort)Items.SmallStone: return ItemSmallStoneTexture; + case (ushort)Items.BigStone: return ItemBigStoneTexture; + case (ushort)Items.MediumStone: return ItemMediumStoneTexture; + + case (ushort)Items.Bulb: return ItemBulbTexture; + case (ushort)Items.Circuit: return ItemCircuitTexture; + case (ushort)Items.ItemBattery: return ItemBatteryTexture; + case (ushort)Items.BigCircuit: return ItemBigCircuitTexture; + case (ushort)Items.OneBrick: return oneBrickTexture; + + case (ushort)Items.Cloth: return clothTexture; + case (ushort)Items.Yarn: return yarnTexture; + + case (ushort)Items.Condenser: return condenserTexture; + case (ushort)Items.Diode: return diodeTexture; + case (ushort)Items.Tranzistor: return tranzistorTexture; + case (ushort)Items.Rezistance: return resistanceTexture; + case (ushort)Items.Motor: return motorTexture; + case (ushort)Items.BareLabel: return bareLabelTexture; + + //Plants + case (ushort)Items.OakSapling: return oakSaplingTexture; + case (ushort)Items.LindenSapling: return TextureLindenSapling; + case (ushort)Items.PineSapling: return pineSaplingTexture; + case (ushort)Items.AppleSapling: return TextureAppleSapling; + case (ushort)Items.LemonSapling: return lemonSaplingTexture; + case (ushort)Items.CherrySapling: return cherrySaplingTexture; + case (ushort)Items.PlumSapling: return plumSaplingTexture; + case (ushort)Items.SpruceSapling: return spruceSaplingTexture; + case (ushort)Items.OrangeSapling: return orangeSaplingTexture; + + case (ushort)Items.Dandelion: return plantDandelionTexture; + case (ushort)Items.PlantRose: return plantRoseTexture; + case (ushort)Items.PlantOrchid: return plantOrchidTexture; + case (ushort)Items.PlantViolet: return plantVioletTexture; + + case (ushort)Items.PlantStrawberry: return invStrawberryTexture; + case (ushort)Items.PlantRashberry: return invRashberryTexture; + case (ushort)Items.PlantBlueberry: return invBlueberryTexture; + + case (ushort)Items.CactusBig: return cactusBigTexture; + case (ushort)Items.CactusSmall: return cactusLittleTexture; + + case (ushort)Items.SugarCane: return sugarCaneTexture; + case (ushort)Items.Onion: return ItemOnionTexture; + + case (ushort)Items.Toadstool: return toadstoolTexture; + case (ushort)Items.Boletus: return boletusTexture; + case (ushort)Items.Champignon: return champignonTexture; + + case (ushort)Items.Coral: return coralTexture; + case (ushort)Items.Seaweed: return seaweedTexture; + case (ushort)Items.PlantSeaweed: return seaweedTexture; + case (ushort)Items.PlantOnion: return plantOnionTexture; + + //Nature + case (ushort)Items.WheatSeeds: return ItemWheatSeedsTexture; + case (ushort)Items.Seeds: return ItemSeedsTexture; + + case (ushort)Items.WheatStraw: return ItemWheatStrawTexture; + case (ushort)Items.Hay: return ItemHayTexture; + + case (ushort)Items.Leave: return ItemLeaveTexture; + case (ushort)Items.Stick: return ItemStickTexture; + case (ushort)Items.Sticks: return ItemSticksTexture; + case (ushort)Items.Rubber: return ItemRubberTexture; + + //Tools + case (ushort)Items.Bucket: return ItemBucketTexture; + case (ushort)Items.BucketWater: return ItemBucketWaterTexture; + + case (ushort)Items.StoneHead: return stoneHeadTexture; + + //case (ushort)Items.AxeHeadIron: return TextureHeadAxeIron; + //case (ushort)Items.ShovelHeadIron: return TextureHeadShovelIron; + //case (ushort)Items.PickaxeHeadIron: return TextureHeadPickaxeIron; + + //Shovel + case (ushort)Items.ShovelStone: return TextureShovelStone; + case (ushort)Items.ShovelCopper: return TextureShovelCopper; + case (ushort)Items.ShovelBronze: return TextureShovelBronze; + case (ushort)Items.ShovelGold: return TextureShovelGold; + case (ushort)Items.ShovelIron: return TextureShovelIron; + case (ushort)Items.ShovelSteel: return TextureShovelSteel; + case (ushort)Items.ShovelAluminium: return TextureShovelAluminium; + + // Pickaxe + case (ushort)Items.PickaxeStone: return TexturePickaxeStone; + case (ushort)Items.PickaxeCopper: return TexturePickaxeCopper; + case (ushort)Items.PickaxeBronze: return TexturePickaxeBronze; + case (ushort)Items.PickaxeGold: return TexturePickaxeGold; + case (ushort)Items.PickaxeIron: return TexturePickaxeIron; + case (ushort)Items.PickaxeSteel: return TexturePickaxeSteel; + case (ushort)Items.PickaxeAluminium: return TexturePickaxeAluminium; + + // Axe + case (ushort)Items.AxeStone: return TextureAxeStone; + case (ushort)Items.AxeCopper: return TextureAxeCopper; + case (ushort)Items.AxeBronze: return TextureAxeBronze; + case (ushort)Items.AxeGold: return TextureAxeGold; + case (ushort)Items.AxeIron: return TextureAxeIron; + case (ushort)Items.AxeSteel: return TextureAxeSteel; + case (ushort)Items.AxeAluminium: return TextureAxeAluminium; + + // Hammers + case (ushort)Items.HammerCopper: return TextureHammerCopper; + case (ushort)Items.HammerBronze: return TextureHammerBronze; + case (ushort)Items.HammerIron: return TextureHammerIron; + case (ushort)Items.HammerGold: return TextureHammerGold; + case (ushort)Items.HammerSteel: return TextureHammerSteel; + case (ushort)Items.HammerAluminium: return TextureHammerAluminium; + + // Shears + case (ushort)Items.ShearsCopper: return TextureShearsCopper; + case (ushort)Items.ShearsBronze: return TextureShearsBronze; + case (ushort)Items.ShearsGold: return TextureShearsGold; + case (ushort)Items.ShearsIron: return TextureShearsIron; + case (ushort)Items.ShearsSteel: return TextureShearsSteel; + case (ushort)Items.ShearsAluminium: return TextureShearsAluminium; + + // Saw + case (ushort)Items.SawCopper: return TextureSawCopper; + case (ushort)Items.SawBronze: return TextureSawBronze; + case (ushort)Items.SawGold: return TextureSawGold; + case (ushort)Items.SawIron: return TextureSawIron; + case (ushort)Items.SawSteel: return TextureSawSteel; + case (ushort)Items.SawAluminium: return TextureSawAluminium; + + case (ushort)Items.ElectricDrill: return TextureDrillElectric; + case (ushort)Items.ElectricSaw: return electricSawTexture; + + case (ushort)Items.OreAluminium: return TextureOreAluminium; + case (ushort)Items.OreCopper: return TextureOreCopper; + case (ushort)Items.OreGold: return TextureOreGold; + case (ushort)Items.OreIron: return TextureOreIron; + case (ushort)Items.OreSilver: return TextureOreSilver; + case (ushort)Items.OreTin: return TextureOreTin; + + case (ushort)Items.AppleLeaves: return TextureAppleLeaves; + case (ushort)Items.AppleLeavesWithApples: return TextureAppleLeavesWithApples; + case (ushort)Items.OrangeLeaves: return TextureOrangeLeaves; + case (ushort)Items.OrangeLeavesWithOranges: return TextureOrangeLeavesWithOranges; + case (ushort)Items.PlumLeaves: return TexturePlumLeaves; + case (ushort)Items.PlumLeavesWithPlums: return TexturePlumLeavesWithPlums; + case (ushort)Items.CherryLeaves: return TextureCherryLeaves; + case (ushort)Items.CherryLeavesWithCherries: return TextureCherryLeavesWithCherries; + case (ushort)Items.LemonLeaves: return TextureLemonLeaves; + case (ushort)Items.LemonLeavesWithLemons: return lemonLeavesWithLemonsTexture; + case (ushort)Items.LindenLeaves: return TextureLindenLeaves; + case (ushort)Items.SpruceLeaves: return spruceLeavesTexture; + case (ushort)Items.PineLeaves: return pineLeavesTexture; + + case (ushort)Items.Snow: return snowTexture; + case (ushort)Items.SnowTop: return snowTopTexture; + case (ushort)Items.Ice: return iceTexture; + + case (ushort)Items.GrassDesert: return grassDesertTexture; + case (ushort)Items.GrassForest: return grassForestTexture; + case (ushort)Items.GrassHills: return grassHillsTexture; + case (ushort)Items.GrassJungle: return grassJungleTexture; + case (ushort)Items.GrassPlains: return grassPlainsTexture; + + case (ushort)Items.Alore: return plantAloreTexture; + case (ushort)Items.Plastic: return ItemPlasticTexture; + + case (ushort)Items.Carrot: return ItemCarrotTexture; + case (ushort)Items.PlantCarrot: return plantCarrotTexture; + case (ushort)Items.Peas: return ItemPeasTexture; + case (ushort)Items.PlantPeas: return plantPeasTexture; + + case (ushort)Items.Battery: return ItemBatteryTexture; + + case (ushort)Items.BottleWater: return bottleWaterTexture; + case (ushort)Items.Bottle: return bottleEmptyTexture; + case (ushort)Items.BowlEmpty: return bowlEmptyTexture; + case (ushort)Items.BowlWithMushrooms: return bowlMushroomsTexture; + case (ushort)Items.BowlWithVegetables: return bowlVegetablesTexture; + + case (ushort)Items.ElectricDrillOff: return TextureDrillElectric; + case (ushort)Items.ElectricSawOff: return electricSawTexture; + + case (ushort)Items.HoeStone: return TextureHoeStone; + case (ushort)Items.HoeBronze: return TextureHoeBronze; + case (ushort)Items.HoeIron: return TextureHoeIron; + + case (ushort)Items.Charger: return chargerTexture; + + case (ushort)Items.Clay: return clayTexture; + case (ushort)Items.GrassBlockClay: return TextureGrassBlockClay; + case (ushort)Items.BackDirt: return backgroundDirtTexture; + case (ushort)Items.BackSand: return backgroundSandTexture; + case (ushort)Items.BackClay: return backgroundClayTexture; + case (ushort)Items.BackCobblestone: return backgroundCobblestoneTexture; + case (ushort)Items.BackGravel: return backgroundGravelTexture; + case (ushort)Items.BackRedSand: return backgroundRedSandTexture; + case (ushort)Items.BackRegolite: return backgroundRegoliteTexture; + + case (ushort)Items.BackCoal: return backgroundCoalTexture; + case (ushort)Items.BackAluminium: return backgroundAluminiumTexture; + case (ushort)Items.BackCopper: return backgroundCopperTexture; + case (ushort)Items.BackGold: return backgroundGoldTexture; + case (ushort)Items.BackIron: return backgroundIronTexture; + case (ushort)Items.BackTin: return backgroundTinTexture; + case (ushort)Items.BackSilver: return backgroundSilverTexture; + + + case (ushort)Items.BackAnorthosite: return backgroundAnorthositeTexture; + case (ushort)Items.BackBasalt: return backgroundBasaltTexture; + case (ushort)Items.BackDiorit: return backgroundDioritTexture; + case (ushort)Items.BackDolomite: return backgroundDolomiteTexture; + case (ushort)Items.BackFlint: return backgroundFlintTexture; + case (ushort)Items.BackGabbro: return backgroundGabbroTexture; + case (ushort)Items.BackGneiss: return backgroundGneissTexture; + case (ushort)Items.BackLimestone: return backgroundLimestoneTexture; + case (ushort)Items.BackMudstone: return backgroundMudstoneTexture; + case (ushort)Items.BackSandstone: return backgroundSandstoneTexture; + case (ushort)Items.BackSchist: return backgroundSchistTexture; + case (ushort)Items.BackRhyolite: return backgroundRhyoliteTexture; + + case (ushort)Items.StoneFlint: return flintTexture; + case (ushort)Items.StoneMudstone: return mudstoneTexture; + case (ushort)Items.StoneAnorthosite: return anorthositeTexture; + case (ushort)Items.AnimalRabbit: return rabbitStillTexture; + case (ushort)Items.AnimalParrot: return TextureParrotStill; + case (ushort)Items.AnimalChicken: return chickenStillTexture; + case (ushort)Items.Rod: return RodTexture; + case (ushort)Items.TorchElectricOFF: return LightElectricTexture; + case (ushort)Items.TorchElectricON: return LightElectricTexture; + case (ushort)Items.Compost: return CompostTexture; + case (ushort)Items.Composter: return ComposterTexture; + + case (ushort)Items.FormalShoes: return TextureItemFormalShoes; + case (ushort)Items.Pumps: return TextureItemPumps; + case (ushort)Items.Sneakers: return TextureItemSneakers; + case (ushort)Items.SpaceBoots: return TextureItemSpaceBoots; + + case (ushort)Items.Jeans: return TextureItemJeans; + case (ushort)Items.Shorts: return TextureItemShorts; + case (ushort)Items.SpaceTrousers: return TextureItemSpaceTrousers; + case (ushort)Items.ArmyTrousers: return TextureItemArmyTrousers; + case (ushort)Items.Skirt: return TextureItemSkirt; + + case (ushort)Items.TShirt: return TextureItemTShirt; + case (ushort)Items.SpaceSuit: return TextureItemSpaceSuit; + case (ushort)Items.Dress: return TextureItemDress; + case (ushort)Items.Shirt: return TextureItemShirt; + + case (ushort)Items.Cap: return TextureItemCap; + case (ushort)Items.Hat: return TextureItemHat; + case (ushort)Items.Crown: return TextureItemCrown; + case (ushort)Items.SpaceHelmet: return TextureItemSpaceHelmet; + + case (ushort)Items.Underpants: return TextureItemUnderpants; + case (ushort)Items.BoxerShorts: return TextureItemBoxerShorts; + case (ushort)Items.Panties: return TextureItemPanties; + case (ushort)Items.Swimsuit: return TextureItemSwimsuit; + case (ushort)Items.BikiniDown: return TextureItemBikiniDown; + + case (ushort)Items.Bra: return TextureItemBra; + case (ushort)Items.BikiniTop: return TextureItemBikiniTop; + + case (ushort)Items.CoatArmy: return TextureItemCoatArmy; + case (ushort)Items.Coat: return TextureItemCoat; + case (ushort)Items.JacketDenim: return ItemJacketDenimTexture; + case (ushort)Items.JacketFormal: return ItemJacketFormalTexture; + case (ushort)Items.JacketShort: return TextureItemJacketShort; + + case (ushort)Items.AcaciaLeaves: return TextureAcaciaLeaves; + case (ushort)Items.AcaciaWood: return TextureAcaciaWood; + case (ushort)Items.AcaciaSapling: return TextureAcaciaSapling; + case (ushort)Items.MangroveLeaves: return TextureMangroveLeaves; + case (ushort)Items.MangroveWood: return TextureMangroveWood; + case (ushort)Items.MangroveSapling: return TextureMangroveSapling; + case (ushort)Items.WillowLeaves: return TextureWillowLeaves; + case (ushort)Items.WillowWood: return TextureWillowWood; + case (ushort)Items.WillowSapling: return TextureWillowSapling; + case (ushort)Items.Olive: return ItemOliveTexture; + case (ushort)Items.OliveLeaves: return TextureOliveLeaves; + case (ushort)Items.OliveLeavesWithOlives:return TextureOliveLeavesWithOlives; + case (ushort)Items.OliveWood: return TextureOliveWood; + case (ushort)Items.OliveSapling: return TextureOliveSapling; + case (ushort)Items.EucalyptusLeaves: return TextureEucalyptusLeaves; + case (ushort)Items.EucalyptusSapling: return TextureEucalyptusSapling; + case (ushort)Items.EucalyptusWood: return TextureEucalyptusWood; + case (ushort)Items.RubberTreeLeaves: return TextureRubberTreeLeaves; + case (ushort)Items.RubberTreeSapling: return TextureRubberTreeSapling; + case (ushort)Items.RubberTreeWood: return TextureRubberTreeWood; + case (ushort)Items.KapokLeaves: return TextureKapokLeaves; + case (ushort)Items.KapokLeavesFibre: return TextureKapokLeavesFibre; + case (ushort)Items.KapokLeacesFlowering: return TextureKapokBlossom; + case (ushort)Items.KapokSapling: return TextureKapokSapling; + case (ushort)Items.KapokWood: return TextureKapokWood; + case (ushort)Items.KapokFibre: return ItemKapokFibreTexture; + case (ushort)Items.KnifeCopper: return TextureKnifeCopper; + case (ushort)Items.KnifeBronze: return TextureKnifeBronze; + case (ushort)Items.KnifeGold: return TextureKnifeGold; + case (ushort)Items.KnifeIron: return TextureKnifeIron; + case (ushort)Items.KnifeSteel: return TextureKnifeSteel; + case (ushort)Items.KnifeAluminium: return TextureKnifeAluminium; + + case (ushort)Items.HoeGold: return TextureHoeGold; + case (ushort)Items.HoeSteel: return TextureHoeSteel; + case (ushort)Items.HoeAluminium: return TextureHoeAluminium; + case (ushort)Items.DyeGold: return TextureDyeGold; + case (ushort)Items.DyeWhite: return TextureDyeWhite; + case (ushort)Items.DyeYellow: return TextureDyeYellow; + case (ushort)Items.DyeOrange: return TextureDyeOrange; + case (ushort)Items.DyeRed: return TextureDyeRed; + case (ushort)Items.DyeDarkRed: return TextureDyeDarkRed; + case (ushort)Items.DyeOlive: return TextureDyeOlive; + case (ushort)Items.DyePurple: return TextureDyePurple; + case (ushort)Items.DyePink: return TextureDyePink; + case (ushort)Items.DyeTeal: return TextureDyeTeal; + case (ushort)Items.DyeLightBlue: return TextureDyeLightBlue; + case (ushort)Items.DyeBlue: return TextureDyeBlue; + case (ushort)Items.DyeMagenta: return TextureDyeMagenta; + case (ushort)Items.DyeDarkBlue: return TextureDyeDarkBlue; + case (ushort)Items.DyeBlack: return TextureDyeBlack; + case (ushort)Items.DyeBrown: return TextureDyeBrown; + case (ushort)Items.DyeLightGray: return TextureDyeLightGray; + case (ushort)Items.DyeGray: return TextureDyeGray; + case (ushort)Items.DyeDarkGray: return TextureDyeDarkGray; + case (ushort)Items.DyeViolet: return TextureDyeViolet; + case (ushort)Items.DyeSpringGreen: return TextureDyeSpringGreen; + case (ushort)Items.DyeRoseQuartz: return TextureDyeRoseQuartz; + case (ushort)Items.TestTube: return TextureTestTube; + case (ushort)Items.DyeLightGreen: return TextureDyeLightGreen; + case (ushort)Items.DyeGreen: return TextureDyeGreen; + case (ushort)Items.DyeArmy: return TextureDyeArmy; + case (ushort)Items.DyeDarkGreen: return TextureDyeDarkGreen; + + //Shovel + case (ushort)Items.ShovelHeadCopper: return TextureShovelHeadCopper; + case (ushort)Items.ShovelHeadBronze: return TextureShovelHeadBronze; + case (ushort)Items.ShovelHeadGold: return TextureShovelHeadGold; + case (ushort)Items.ShovelHeadIron: return TextureShovelHeadIron; + case (ushort)Items.ShovelHeadSteel: return TextureShovelHeadSteel; + case (ushort)Items.ShovelHeadAluminium: return TextureShovelHeadAluminium; + + // Pickaxe + case (ushort)Items.PickaxeHeadCopper: return TexturePickaxeHeadCopper; + case (ushort)Items.PickaxeHeadBronze: return TexturePickaxeHeadBronze; + case (ushort)Items.PickaxeHeadGold: return TexturePickaxeHeadGold; + case (ushort)Items.PickaxeHeadIron: return TexturePickaxeHeadIron; + case (ushort)Items.PickaxeHeadSteel: return TexturePickaxeHeadSteel; + case (ushort)Items.PickaxeHeadAluminium: return TexturePickaxeHeadAluminium; + + // Axe + case (ushort)Items.AxeHeadCopper: return TextureAxeHeadCopper; + case (ushort)Items.AxeHeadBronze: return TextureAxeHeadBronze; + case (ushort)Items.AxeHeadGold: return TextureAxeHeadGold; + case (ushort)Items.AxeHeadIron: return TextureAxeHeadIron; + case (ushort)Items.AxeHeadSteel: return TextureAxeHeadSteel; + case (ushort)Items.AxeHeadAluminium: return TextureAxeHeadAluminium; + + // Shears + case (ushort)Items.ShearsHeadCopper: return TextureShearsHeadCopper; + case (ushort)Items.ShearsHeadBronze: return TextureShearsHeadBronze; + case (ushort)Items.ShearsHeadGold: return TextureShearsHeadGold; + case (ushort)Items.ShearsHeadIron: return TextureShearsHeadIron; + case (ushort)Items.ShearsHeadSteel: return TextureShearsHeadSteel; + case (ushort)Items.ShearsHeadAluminium: return TextureShearsHeadAluminium; + + case (ushort)Items.KnifeHeadCopper: return TextureKnifeHeadCopper; + case (ushort)Items.KnifeHeadBronze: return TextureKnifeHeadBronze; + case (ushort)Items.KnifeHeadGold: return TextureKnifeHeadGold; + case (ushort)Items.KnifeHeadIron: return TextureKnifeHeadIron; + case (ushort)Items.KnifeHeadSteel: return TextureKnifeHeadSteel; + case (ushort)Items.KnifeHeadAluminium: return TextureKnifeHeadAluminium; + + case (ushort)Items.HoeHeadCopper: return TextureHoeHeadCopper; + case (ushort)Items.HoeHeadBronze: return TextureHoeHeadBronze; + case (ushort)Items.HoeHeadGold: return TextureHoeHeadGold; + case (ushort)Items.HoeHeadIron: return TextureHoeHeadIron; + case (ushort)Items.HoeHeadSteel: return TextureHoeHeadSteel; + case (ushort)Items.HoeHeadAluminium: return TextureHoeHeadAluminium; + + case (ushort)Items.RedSand: return TextureRedSand; + case (ushort)Items.FishMeat: return fishTexture0; + + default: + #if DEBUG + throw new Exception("Missing texture for item "+(Items)id); + #else + return null; + #endif + } + } + //void DrawItemInInventory(Texture2D texture, DInt inv, int x, int y) { + // if (texture.Width==16&&texture.Height==16) spriteBatch.Draw(texture, new Rectangle(x, y, texture.Width*2, texture.Height*2), Color.White); + // else if (texture.Width==32&&texture.Height==32) spriteBatch.Draw(texture, new Vector2(x, y), Color.White); + // else spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height), texture.Width*2, texture.Height*2), Color.White); + + // if (inv.X<(short)Items._SystemMaxTools) { + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black); + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(inv.Y*0.3f), 3), Color.Green); + // spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(inv.Y*0.3f), y+29, 28-(int)(inv.Y*0.3), 3), Color.Red); + // } else if (inv.Y!=1) DrawTextShadowMin(x, y+20, inv.Y.ToString()); + //} + + //void DrawItemInInventory(Texture2D texture, int count, int x, int y) { + // if (texture.Width==16&&texture.Height==16) spriteBatch.Draw(texture, new Rectangle(x, y, texture.Width*2, texture.Height*2), Color.White); + // else if (texture.Width==32&&texture.Height==32) spriteBatch.Draw(texture, new Vector2(x, y), Color.White); + // else spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height), texture.Width*2, texture.Height*2), Color.White); + + // if (count!=1) DrawTextShadowMin(x, y+20, count.ToString()); + //} + + //void InvMouseDraw(int item) { + // Texture2D tex = ItemIdToTexture(Inventory[item].X); + // if (tex!=null) DrawItemInInventory(tex, Inventory[item], newMouseState.X, newMouseState.Y); + //} + + //void InvMouseDraw(DInt item) { + + // Texture2D tex = ItemIdToTexture(item.X); + // if (tex!=null) DrawItemInInventory(tex, item, newMouseState.X, newMouseState.Y); + //} + #endregion + + #region Inventory change + //void InventoryRemoveDInt(int inventory) { + // Inventory[inventory].Y--; + // if (Inventory[inventory].Y==0) Inventory[inventory].X=0; + //} + + //void ChangeInventoryBasic() { + // // Move from ... + // if (!invMove) { + // mouseDraw=false; + // if (mouseLeftPress) { + // // Basic right inventory + // for (int i = 0; i<5; i++) { + // if (newMouseState.X>Global.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+32+8+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+yh&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // //DrawItemInInventory(tex,Inventory[i+5].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60&&newMouseState.YGlobal.WindowWidthHalf-300+4+1+40+40&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+60+40+8&&newMouseState.Y100) { + // int to_ = Inventory[to].Y; + // int from_ = Inventory[from].Y; + // int ss_ = to_+from_; + // Inventory[to].Y=99; + // Inventory[from].Y=ss_-99; + // } else { + // Inventory[to].Y+=Inventory[from].Y; + // Inventory[from].Y=0; + // Inventory[from].X=0; + // } + // } else { + // int xx = Inventory[from].X; + // int yy = Inventory[from].Y; + + // Inventory[from].X=Inventory[to].X; + // Inventory[from].Y=Inventory[to].Y; + + // Inventory[to].X=xx; + // Inventory[to].Y=yy; + // } + // } + // } + // invMove=false; + //} + + //void InvMoveOne(int from, int to) { + // if (Inventory[from].Y!=0) { + // if (Inventory[to].Y==0) { + // Inventory[to].X=Inventory[from].X; + // Inventory[to].Y++; + // Inventory[from].Y--; + // if (Inventory[from].Y==0) Inventory[from].X=0; + // inventoryChanged=true; + // } else invMove=false; + // } else invMove=false; + //} + + //void InvMoveDouble(int from, int to) { + // if (Inventory[from].X!=0&&Inventory[to].X==0) { + // if (Inventory[from].Y>1) { + // int half = (int)((float)Inventory[from].Y/2); + // int fromY = Inventory[from].Y-half; + + // Inventory[to].Y=half; + // Inventory[from].Y=fromY; + + // Inventory[to].X=Inventory[from].X; + // inventoryChanged=true; + // } else invMove=false; + // } else invMove=false; + //} + + //void InvMove(DInt from, DInt to) { + // if (from!=to) { + // if (from.X!=0) { + // if (from.X==to.X) { + // if (to.Y+from.Y>100) { + // int to_ = to.Y; + // int from_ = from.Y; + // int ss_ = to_+from_; + // to.Y=99; + // from.Y=ss_-99; + // inventoryChanged=true; + // } else { + // to.Y+=from.Y; + // from.Y=0; + // from.X=0; + // inventoryChanged=true; + // } + // } else { + // int xx = from.X; + // int yy = from.Y; + + // from.X=to.X; + // from.Y=to.Y; + + // to.X=xx; + // to.Y=yy; + // inventoryChanged=true; + // } + // } + // } + // invMove=false; + //} + + //void InvMoveOne(DInt from, DInt to) { + // if (from.Y!=0) { + // if (to.Y==0) { + // to.X=from.X; + // to.Y++; + // from.Y--; + // if (from.Y==0) from.X=0; + // inventoryChanged=true; + // } else invMove=false; + // } else invMove=false; + //} + + //void InvMoveDouble(DInt from, DInt to) { + // if (from.X!=0&&to.X==0) { + // if (from.Y>1) { + // int half = (int)((float)from.Y/2); + // int fromY = from.Y-half; + + // to.Y=half; + // from.Y=fromY; + + // to.X=from.X; + // inventoryChanged=true; + // } else invMove=false; + // } else invMove=false; + //} + + ItemNonInv InventoryAdd(ItemNonInv it) { + + switch (it) { + #region Nonstackable + case ItemNonInvNonStackable item: + if (GameMethods.IsItemInvNonStackable32(it.Id)) { + for (int i=0; iremain) { + item2.SetCount=item2.GetCount+remain; + return null; + } else if (needToAdd==remain) { + item2.SetCount=item2.GetCount+remain; + return null; + } else { + item2.SetCount=99; + remain-=needToAdd; + } + } + } + } + + for (int i=0; iremain) { + item2.SetCount=item2.GetCount+remain; + return null; + } else if (needToAdd==remain) { + item2.SetCount=item2.GetCount+remain; + return null; + } else { + item2.SetCount=99; + remain-=needToAdd; + } + } + } + } + } + + for (int i=0; iremain) { + // item2.SetCount=item2.GetCount+remain; + // return null; + // } else if (needToAdd==remain) { + // item2.SetCount=item2.GetCount+remain; + // return null; + // } else { + // item2.SetCount=item2.CountMaximum; + // remain-=needToAdd; + // } + // } + // } + // } + //} + + for (int i=0; iremain) { + // item2.SetCount=item2.GetCount+remain; + // return null; + // } else if (needToAdd==remain) { + // item2.SetCount=item2.GetCount+remain; + // return null; + // } else { + // item2.SetCount=item2.CountMaximum; + // remain-=needToAdd; + // } + // } + // } + //} } + + for (int i=0; iGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+x&&newMouseState.XGlobal.WindowHeightHalf+20-2+y+20+3+2&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // //DrawItemInInventory(tex,Inventory[i+5].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+53+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // //DrawItemInInventory(tex,Inventory[i+5].Y,Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+10+5+5+x&&newMouseState.XGlobal.WindowHeightHalf+23+y&&newMouseState.Y0&&y<125&&x>0&&x0&&y<125&&x>0&&x0&&y<125&&x>0&&x0&&y<125&&x>0&&x0&&y<125&&x>0&&xscreenScaleW) { + mousePos=new Vector2((int)((newMouseState.X-Global.WindowWidthHalf)/screenScaleW/Setting.Zoom+(Global.WindowWidth-(int)(screenScaleW*848f))/2)+WindowCenterX, (int)((newMouseState.Y-Global.WindowHeightHalf)/screenScaleW/Setting.Zoom)+WindowCenterY); + return; + } else { + mousePos=new Vector2((int)((newMouseState.X-Global.WindowWidthHalf)/screenScaleH/Setting.Zoom)+WindowCenterX, (int)((newMouseState.Y-Global.WindowHeightHalf)/screenScaleH/Setting.Zoom)+WindowCenterX+(Global.WindowHeight-(int)(screenScaleH*560f))/2); + return; + } + } + + mousePos=new Vector2((newMouseState.X-Global.WindowWidthHalf)/(Global.WindowWidth/848f)/Setting.Zoom+WindowCenterX, (newMouseState.Y-Global.WindowHeightHalf)/((float)Global.WindowHeight/560f)/Setting.Zoom+WindowCenterY); + } + + void PlayerGravity() { + distanceToGround=100000; + + for (int y = (PlayerY+20-16)/16; y<(PlayerY+20-16)/16+6; y++) { + + for (int x = (PlayerX-11)/16; x<(PlayerX+11+16)/16; x++) { + if (terrain[x]!=null) { + if (y>124) break; + if (terrain[x].IsSolidBlocks[y]) { + if (/*y*16-PlayerY-39/2>0 &&*/ y*16-PlayerY-200) { + PlayerY+=distanceToGround; + gravitySpeed=0; + // return false; + } else { + gravitySpeed+=.4905f; + if (gravitySpeed>6) gravitySpeed=6; + PlayerY+=(int)gravitySpeed; + + + } + + } + + void CameraMatrix() { + if (Setting.Scale.Without==Setting.currentScale) { + camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))*Translation; + return; + } + + if (Setting.Scale.Proportions==Setting.currentScale) { + float _screenScaleW = Global.WindowWidth/848f; + float _screenScaleH = Global.WindowHeight/560f; + + if (_screenScaleH>_screenScaleW) { + camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))* + Matrix.CreateScale(_screenScaleW, _screenScaleW, 0)*Translation; + return; + } else { + camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))* + Matrix.CreateScale(_screenScaleH, _screenScaleH, 0)*Translation; + return; + } + } + + camera=Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0))* + Matrix.CreateScale(new Vector3(Global.WindowWidth/848f, Global.WindowHeight/560f, 0))*Translation; + } + + void SetPlayerPos(int x, int y) { + PlayerX=x; + PlayerY=y; + + WindowXPlayer+=(PlayerX-WindowCenterX)/*/16f*/; + WindowYPlayer+=(PlayerY-WindowCenterY)/*/16f*/; + + WindowX=x-Global.WindowWidthHalf; + WindowY=y-Global.WindowHeightHalf; + + WindowCenterX=(int)WindowXPlayer; + WindowCenterY=(int)WindowYPlayer; + } + #endregion + + #region Destruction + //void GetItemsFromBlock(byte type, int X, int Y/*, BlockType bt*/) { + // int X16 = X*16, Y16 = Y*16; + + // // switch (bt) { + // // case BlockType.Top: + + // switch ((BlockId)type) { + // case BlockId.Macerator: + + // DropItemToPos(X16, Y16, Items.Macerator); + // RefreshAroundLabels(X, Y); + // return; + + // case BlockId.Miner: + + // DropItemToPos(X16, Y16, Items.Miner); + // RefreshAroundLabels(X, Y); + // RemovefromMiners(X16, Y16); + // return; + + // case BlockId.Composter: + // DropItemToPos(X16, Y16, Items.Composter); + // RefreshAroundLabels(X, Y); + // RemovefromComposters(X16, Y16); + // return; + + // case BlockId.FurnaceElectric: + // DropItemToPos(X16, Y16, Items.FurnaceElectric); + // RefreshAroundLabels(X16, Y16); + // return; + + // case BlockId.FurnaceStone: + // DropItemToPos(X16, Y16, Items.FurnaceStone); + // RemovefromFurnaceStone(X16, Y16); + // return; + + // case BlockId.Rocket: + // DropItemToPos(X16, Y16, Items.Rocket); + // return; + + // case BlockId.Desk: + // DropItemToPos(X16, Y16, Items.Desk); + // return; + + // case BlockId.Ladder: + // DropItemToPos(X16, Y16, Items.Ladder); + // return; + + // case BlockId.Lamp: + // DropItemToPos(X16, Y16, Items.Lamp); + // RefreshAroundLabels(X16, Y16); + // foreach (MashineBlockBasic m in lightsLamp) { + // if (m.Position.X==X16) { + // if (m.Position.Y==Y16) { + // lightsLamp.Remove(m); + // return; + // } + // } + // } + // return; + + // case BlockId.Windmill: + // DropItemToPos(X16, Y16, Items.WindMill); + // RefreshAroundLabels(X16, Y16); + // return; + + // case BlockId.Flag: + // DropItemToPos(X16, Y16, Items.Flag); + // return; + + // case BlockId.Label: + // DropItemToPos(X16, Y16, Items.Label); + // RefreshAroundLabels(X16, Y16); + // return; + + // case BlockId.AppleLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.AppleSapling); + // return; + // } + // } + // return; + + // case BlockId.EucalyptusLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.EucalyptusLeaves); + // return; + // } + // } + // return; + + // case BlockId.AcaciaLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.AcaciaSapling); + // return; + // } + // } + // return; + + // case BlockId.WillowLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.WillowSapling); + // return; + // } + // } + // return; + + // case BlockId.OliveLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.OliveSapling); + // return; + // } + // } + // return; + + // case BlockId.RubberTreeLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.RubberTreeSapling); + // return; + // } + // } + // return; + + // case BlockId.KapokLeaces: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.KapokSapling); + // return; + // } + // } + // return; + + // case BlockId.KapokLeacesFlowering: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.KapokLeacesFlowering); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.KapokLeacesFlowering); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.KapokSapling); + // return; + // } + // } + // return; + + // case BlockId.KapokLeacesFibre: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.KapokLeacesFibre); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.KapokLeacesFibre); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.KapokSapling); + // return; + // } + // } + // return; + + // case BlockId.OliveLeavesWithOlives: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Olive); + // return; + + // case 4: + // DropItemToPos(X16, Y16, Items.Olive); + // return; + + // case 5: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.OliveSapling); + // return; + // } + // } + // return; + + // case BlockId.LemonLeavesWithLemons: + // DropItemToPos(X16, Y16, Items.Lemon); + + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.LemonSapling); + // return; + // } + // } + // return; + + // case BlockId.LindenLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.LindenSapling); + // return; + // } + // } + // return; + + // case BlockId.OakLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.OakSapling); + // return; + // } + // } + // return; + + // case BlockId.OrangeLeaves: + // DropItemToPos(X16, Y16, Items.Orange); + + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.OrangeSapling); + // return; + // } + // } + // return; + + // case BlockId.SpruceLeaves: + // if (FastRandom.Int(2)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Stick); + // else if (FastRandom.Int(4)==1) DropItemToPos(X16, Y16, Items.SpruceSapling); + // } + // return; + + // case BlockId.PlumLeavesWithPlums: + // DropItemToPos(X16, Y16, Items.Plum); + + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.PlumSapling); + // return; + // } + // } + // return; + + // case BlockId.PlumLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.PlumSapling); + // return; + // } + // } + // return; + + // case BlockId.PineLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.PineSapling); + // else DropItemToPos(X16, Y16, Items.Banana); + // return; + // } + // } + // return; + + // case BlockId.OrangeLeavesWithOranges: + // DropItemToPos(X16, Y16, Items.Orange); + + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(6)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.OrangeSapling); + // return; + // } + // } + // return; + + // case BlockId.AppleLeavesWithApples: + // DropItemToPos(X16, Y16, Items.Apple); + + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.AppleSapling); + // return; + // } + // } + // return; + + // case BlockId.CherryLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CherrySapling); + // return; + // } + // } + // return; + + // case BlockId.CherryLeavesWithCherries: + // DropItemToPos(X16, Y16, Items.Cherry); + + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CherrySapling); + // return; + // } + // } + // return; + + // case BlockId.LemonLeaves: + // if (FastRandom.Int(4)==1) { + // switch (FastRandom.Int(5)) { + // case 1: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case 2: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case 3: + // DropItemToPos(X16, Y16, Items.Leave); + // return; + + // case 4: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.LemonSapling); + // return; + // } + // } + // return; + + // case BlockId.Violet: + // DropItemToPos(X16, Y16, Items.PlantViolet); + // return; + + // case BlockId.Dandelion: + // DropItemToPos(X16, Y16, Items.Dandelion); + // return; + + // case BlockId.Heather: + // DropItemToPos(X16, Y16, Items.Heater); + // return; + + // case BlockId.Alore: + // DropItemToPos(X16, Y16, Items.Alore); + // return; + + // case BlockId.CactusBig: + // DropItemToPos(X16, Y16, Items.CactusBig); + // return; + + // case BlockId.CactusSmall: + // DropItemToPos(X16, Y16, Items.CactusSmall); + // return; + + // case BlockId.AppleSapling: + // DropItemToPos(X16, Y16, Items.AppleSapling); + // return; + + // case BlockId.CherrySapling: + // DropItemToPos(X16, Y16, Items.CherrySapling); + // return; + + // case BlockId.LemonSapling: + // DropItemToPos(X16, Y16, Items.LemonSapling); + // return; + + // case BlockId.LindenSapling: + // DropItemToPos(X16, Y16, Items.LindenSapling); + // return; + + // case BlockId.OakSapling: + // DropItemToPos(X16, Y16, Items.OakSapling); + // return; + + // case BlockId.OrangeSapling: + // DropItemToPos(X16, Y16, Items.OrangeSapling); + // return; + + // case BlockId.PineSapling: + // DropItemToPos(X16, Y16, Items.PineSapling); + // return; + + // case BlockId.PlumSapling: + // DropItemToPos(X16, Y16, Items.PlumSapling); + // return; + + // case BlockId.SpruceSapling: + // DropItemToPos(X16, Y16, Items.SpruceSapling); + // return; + + // case BlockId.GrassDesert: + // if (FastRandom.Int(6)==1) DropItemToPos(X16, Y16, Items.Seeds); + // else if (FastRandom.Int(3)==1) DropItemToPos(X16, Y16, Items.Hay); + // return; + + // case BlockId.GrassForest: + // if (FastRandom.Int(5)==1) DropItemToPos(X16, Y16, Items.Seeds); + // else if (FastRandom.Int(4)==1) DropItemToPos(X16, Y16, Items.Hay); + // else if (FastRandom.Int(10)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); + // return; + + // case BlockId.GrassHills: + // if (FastRandom.Int(7)==1) DropItemToPos(X16, Y16, Items.Seeds); + // else if (FastRandom.Int(5)==1) DropItemToPos(X16, Y16, Items.Hay); + // else if (FastRandom.Int(10)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); + // return; + + // case BlockId.GrassJungle: + // if (FastRandom.Int(5)==1) DropItemToPos(X16, Y16, Items.Seeds); + // else if (FastRandom.Int(5)==1) DropItemToPos(X16, Y16, Items.Hay); + // else if (FastRandom.Int(20)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); + // return; + + // case BlockId.GrassPlains: + // if (FastRandom.Int(5)==1) DropItemToPos(X16, Y16, Items.Seeds); + // else if (FastRandom.Int(3)==1) DropItemToPos(X16, Y16, Items.Hay); + // else if (FastRandom.Int(10)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); + // return; + + + + // case BlockId.Glass: + // DropItemToPos(X16, Y16, Items.Glass); + // return; + + // case BlockId.Orchid: + // DropItemToPos(X16, Y16, Items.PlantOrchid); + // return; + + // case BlockId.Radio: + // DropItemToPos(X16, Y16, Items.Radio); + // RefreshAroundLabels(X16, Y16); + // return; + + // case BlockId.Rose: + // DropItemToPos(X16, Y16, Items.PlantRose); + // return; + + // case BlockId.Toadstool: + // DropItemToPos(X16, Y16, Items.Toadstool); + // return; + + // case BlockId.Boletus: + // DropItemToPos(X16, Y16, Items.Boletus); + // return; + + // case BlockId.BranchALittle1: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Stick); + // else DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case BlockId.BranchALittle2: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Stick); + // else DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case BlockId.BranchFull: + // DropItemToPos(X16, Y16, Items.Sticks); + // return; + + // case BlockId.BranchWithout: + // DropItemToPos(X16, Y16, Items.Stick); + // return; + + // case BlockId.Champignon: + // DropItemToPos(X16, Y16, Items.Champignon); + // return; + + // case BlockId.DoorOpen: + // DropItemToPos(X16, Y16, Items.Door); + // return; + + // case BlockId.Charger: + // DropItemToPos(X16, Y16, Items.Charger); + // RefreshAroundLabels(X16, Y16); + // RemovefromChargers(X16, Y16); + // return; + + // case BlockId.SolarPanel: + // DropItemToPos(X16, Y16, Items.SolarPanel); + // RefreshAroundLabels(X16, Y16); + // return; + + // case BlockId.Watermill: + // DropItemToPos(X16, Y16, Items.WaterMill); + // RefreshAroundLabels(X16, Y16); + // return; + + // case BlockId.Rocks: + // switch (FastRandom.Int(100)) { + // case 0: DropItemToPos(X16, Y16, Items.Ruby); return; + // case 1: DropItemToPos(X16, Y16, Items.Smaragd); return; + // case 2: DropItemToPos(X16, Y16, Items.Saphirite); return; + // case 3: DropItemToPos(X16, Y16, Items.Diamond); return; + // case 4: DropItemToPos(X16, Y16, Items.ItemGold); return; + // case 5: DropItemToPos(X16, Y16, Items.ItemSilver); return; + // case 6: DropItemToPos(X16, Y16, Items.ItemIron); return; + // case 7: DropItemToPos(X16, Y16, Items.ItemIron); return; + // case 8: DropItemToPos(X16, Y16, Items.ItemIron); return; + // case 9: DropItemToPos(X16, Y16, Items.ItemCopper); return; + // case 10: DropItemToPos(X16, Y16, Items.ItemCopper); return; + // case 11: DropItemToPos(X16, Y16, Items.ItemCopper); return; + // case 12: DropItemToPos(X16, Y16, Items.ItemTin); return; + // case 13: DropItemToPos(X16, Y16, Items.ItemTin); return; + // case 14: DropItemToPos(X16, Y16, Items.ItemTin); return; + // case 15: DropItemToPos(X16, Y16, Items.CoalWood); return; + // case 16: DropItemToPos(X16, Y16, Items.ItemCoal); return; + // case 17: DropItemToPos(X16, Y16, Items.ItemCoal); return; + // case 18: DropItemToPos(X16, Y16, Items.ItemCoal); return; + // case 19: DropItemToPos(X16, Y16, Items.StoneHead); return; + // case 20: DropItemToPos(X16, Y16, Items.StoneHead); return; + // case 21: DropItemToPos(X16, Y16, Items.StoneHead); return; + // case 22: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 23: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 24: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 25: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 26: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 27: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 28: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 29: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 30: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 31: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 32: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 33: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 34: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 35: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 36: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 37: DropItemToPos(X16, Y16, Items.BigStone); return; + // case 38: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 39: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 40: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 41: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 42: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 43: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 44: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 45: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 46: DropItemToPos(X16, Y16, Items.SmallStone); return; + // case 47: DropItemToPos(X16, Y16, Items.Gravel); return; + // case 48: DropItemToPos(X16, Y16, Items.Silicium); return; + // default: DropItemToPos(X16, Y16, Items.MediumStone); return; + // } + // // break; + // // } + // // break; + + // // case BlockType.Solid: + // // switch ((BlockId)type) { + // case BlockId.Compost: + // DropItemToPos(X16, Y16, Items.Compost); + // return; + + // case BlockId.Snow: + // DropItemToPos(X16, Y16, Items.Snow); + // return; + + // case BlockId.Roof1: + // DropItemToPos(X16, Y16, Items.Roof1); + // return; + + // case BlockId.Roof2: + // DropItemToPos(X16, Y16, Items.Roof2); + // return; + + // case BlockId.DoorClose: + // DropItemToPos(X16, Y16, Items.Door); + // return; + + // case BlockId.StoneBasalt: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackBasalt, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneDiorit: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDiorit, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneDolomite: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDolomite, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneGabbro: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackGabbro, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneGneiss: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=new Block(backgroundGneissTexture, (int)BlockId.BackGneiss, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneLimestone: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackLimestone, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneRhyolite: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackRhyolite, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneSandstone: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSandstone, new Vector2(X16, Y16)); + // return; + + // case BlockId.StoneSchist: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(50)==1) { + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Smaragd); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Ruby); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Saphirite); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Diamond); + // } + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSchist, new Vector2(X16, Y16)); + // return; + + // case BlockId.Coal: + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.ItemCoal); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CoalWood); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackCoal, new Vector2(X16, Y16)); + // return; + + // case BlockId.OreAluminium: + // if (FastRandom.Int(4)!=1) DropItemToPos(X16, Y16, Items.Aluminium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackAluminium, new Vector2(X16, Y16)); + // return; + + // case BlockId.OreCopper: + // if (FastRandom.Int(4)!=1) DropItemToPos(X16, Y16, Items.ItemCopper); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.CopperDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackCopper, new Vector2(X16, Y16)); + // return; + + // case BlockId.OreGold: + // if (FastRandom.Int(4)!=1) DropItemToPos(X16, Y16, Items.ItemGold); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.GoldDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackGold, new Vector2(X16, Y16)); + // return; + + // case BlockId.OreIron: + // if (FastRandom.Int(4)!=1) DropItemToPos(X16, Y16, Items.ItemIron); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.IronDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackIron, new Vector2(X16, Y16)); + // return; + + // case BlockId.OreSilver: + // if (FastRandom.Int(4)!=1) DropItemToPos(X16, Y16, Items.ItemSilver); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SilverDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Silicium); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSilver, new Vector2(X16, Y16)); + // return; + + // case BlockId.OreTin: + // if (FastRandom.Int(4)!=1) DropItemToPos(X16, Y16, Items.ItemTin); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.TinDust); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackTin, new Vector2(X16, Y16)); + // return; + + // case BlockId.Cobblestone: + // DropItemToPos(X16, Y16, Items.BigStone); + // if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.MediumStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.SmallStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Gravel); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.BigStone); + // else if (FastRandom.Int(2)==1) DropItemToPos(X16, Y16, Items.Sand); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackCobblestone, new Vector2(X16, Y16)); + // return; + + // case BlockId.Gravel: + // DropItemToPos(X16, Y16, Items.Gravel); + // DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackGravel, new Vector2(X16, Y16)); + // return; + + // case BlockId.Sand: + // DropItemToPos(X16, Y16, Items.Sand); + // DestroySandUp(destroyBlock.X, destroyBlock.Y-1); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackSand, new Vector2(X16, Y16)); + // return; + + // case BlockId.Dirt: + // DropItemToPos(X16, Y16, Items.Dirt); + // DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); + // return; + + // case BlockId.GrassBlockDesert: + // DropItemToPos(X16, Y16, Items.Dirt); + // DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); + // return; + + // case BlockId.GrassBlockForest: + // DropItemToPos(X16, Y16, Items.Dirt); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); + // return; + + // case BlockId.GrassBlockHills: + // DropItemToPos(X16, Y16, Items.Dirt); + // DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); + // return; + + // case BlockId.GrassBlockJungle: + // DropItemToPos(X16, Y16, Items.Dirt); + // DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); + // return; + + // case BlockId.GrassBlockPlains: + // DropItemToPos(X16, Y16, Items.Dirt); + // DestroyGrassUp(destroyBlock.X, destroyBlock.Y-1); + // terrain[X].IsBackground[Y]=true; + // terrain[X].Background[Y]=BackBlockFromId((int)BlockId.BackDirt, new Vector2(X16, Y16)); + // return; + + // case BlockId.Planks: + // DropItemToPos(X16, Y16, Items.Planks); + // return; + + // case BlockId.Bricks: + // DropItemToPos(X16, Y16, Items.Bricks); + // return; + + // case BlockId.AdvancedSpacePart1: + // DropItemToPos(X16, Y16, Items.AdvancedSpacePart1); + // return; + + // case BlockId.AdvancedSpacePart2: + // DropItemToPos(X16, Y16, Items.AdvancedSpacePart2); + // return; + + // case BlockId.AdvancedSpacePart3: + // DropItemToPos(X16, Y16, Items.AdvancedSpacePart3); + // return; + + // case BlockId.AdvancedSpacePart4: + // DropItemToPos(X16, Y16, Items.AdvancedSpacePart4); + // return; + + // case BlockId.Clay: + // DropItemToPos(X16, Y16, Items.Clay); + // return; + + // case BlockId.GrassBlockClay: + // DropItemToPos(X16, Y16, Items.Clay); + // return; + + // // } + // // break; + + // // case BlockType.Back: + // // switch ((BlockId)type) { + // case BlockId.AppleWood: + // DropItemToPos(X16, Y16, Items.WoodApple); + // return; + + // case BlockId.CherryWood: + // DropItemToPos(X16, Y16, Items.WoodCherry); + // return; + + // case BlockId.LemonWood: + // DropItemToPos(X16, Y16, Items.WoodLemon); + // return; + + // case BlockId.LindenWood: + // DropItemToPos(X16, Y16, Items.WoodLinden); + // return; + + // case BlockId.OakWood: + // DropItemToPos(X16, Y16, Items.WoodOak); + // return; + + // case BlockId.OrangeWood: + // DropItemToPos(X16, Y16, Items.WoodOrange); + // return; + + // case BlockId.PineWood: + // DropItemToPos(X16, Y16, Items.WoodPine); + // return; + + // case BlockId.PlumWood: + // DropItemToPos(X16, Y16, Items.WoodPlum); + // return; + + // case BlockId.SpruceWood: + // DropItemToPos(X16, Y16, Items.WoodSpruce); + // return; + + // case BlockId.MangroveWood: + // DropItemToPos(X16, Y16, Items.MangroveWood); + // return; + + // case BlockId.WillowWood: + // DropItemToPos(X16, Y16, Items.WillowWood); + // return; + + // case BlockId.OliveWood: + // DropItemToPos(X16, Y16, Items.OliveWood); + // return; + + // case BlockId.RubberTreeWood: + // DropItemToPos(X16, Y16, Items.RubberTreeWood); + // return; + + // case BlockId.KapokWood: + // DropItemToPos(X16, Y16, Items.KapokWood); + // return; + + // case BlockId.EucalyptusWood: + // DropItemToPos(X16, Y16, Items.EucalyptusWood); + // return; + + // case BlockId.AcaciaWood: + // DropItemToPos(X16, Y16, Items.AcaciaWood); + // return; + // } + // // break; + + // //case BlockType.Plant: + // // switch ((BlockId)type) { + // // case BlockId.Wheat: + // // DropItemToPos(X16, Y16, Items.WheatStraw); + // // DropItemToPos(X16, Y16, Items.WheatSeeds); + // // if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.WheatSeeds); + // // return; + + // // case BlockId.Onion: + // // DropItemToPos(X16, Y16, Items.Onion); + // // return; + + // // case BlockId.Flax: + // // DropItemToPos(X16, Y16, Items.Flax); + // // DropItemToPos(X16, Y16, Items.FlaxSeeds); + // // if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); + // // return; + + // // case BlockId.Strawberry: + // // DropItemToPos(X16, Y16, Items.PlantStrawberry); + // // if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.PlantStrawberry); + // // return; + + // // case BlockId.Rashberry: + // // DropItemToPos(X16, Y16, Items.PlantRashberry); + // // if (FastRandom.Int(8)==1)DropItemToPos(X16, Y16, Items.PlantRashberry); + // // return; + + // // case BlockId.Blueberry: + // // DropItemToPos(X16, Y16, Items.PlantBlueberry); + // // if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.PlantBlueberry); + // // return; + // // } + // // break; + + // //case BlockType.Mob: + // // switch ((BlockId)type) { + // // case BlockId.Chicken: + // // if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.WheatStraw); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.WheatSeeds); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.Seeds); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.Hay); + // // DropItemToPos(X16, Y16, Items.RabbitMeat); + // // return; + + // // case BlockId.Rabbit: + // // if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.WheatStraw); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.WheatSeeds); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.FlaxSeeds); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.Seeds); + // // else if (FastRandom.Int(8)==1) DropItemToPos(X16, Y16, Items.Hay); + // // DropItemToPos(X16, Y16, Items.RabbitMeat); + // // return; + + // // case BlockId.Fish: + // // DropItemToPos(X16, Y16, Items.Fish); + // // return; + // // } + // // break; + // // } + //} + + float GetBackBlockDestroingSpeed(ushort type) { + switch (type) { + case (ushort)BlockId.AdvancedSpaceBack: return 400*DestroyPickaxe(); + + case (ushort)BlockId.AppleWood: return 300*DestroyAxe(); + case (ushort)BlockId.CherryWood: return 300*DestroyAxe(); + case (ushort)BlockId.LemonWood: return 300*DestroyAxe(); + case (ushort)BlockId.LindenWood: return 320*DestroyAxe(); + case (ushort)BlockId.OakWood: return 320*DestroyAxe(); + case (ushort)BlockId.OrangeWood: return 300*DestroyAxe(); + case (ushort)BlockId.PineWood: return 300*DestroyAxe(); + case (ushort)BlockId.PlumWood: return 300*DestroyAxe(); + case (ushort)BlockId.SpruceWood: return 280*DestroyAxe(); + + case (ushort)BlockId.KapokWood: return 280*DestroyAxe(); + + case (ushort)BlockId.OliveWood: return 280*DestroyAxe(); + + case (ushort)BlockId.MangroveWood: return 280*DestroyAxe(); + case (ushort)BlockId.WillowWood: return 280*DestroyAxe(); + case (ushort)BlockId.RubberTreeWood: return 280*DestroyAxe(); + case (ushort)BlockId.EucalyptusWood: return 280*DestroyAxe(); + case (ushort)BlockId.AcaciaWood: return 280*DestroyAxe(); + + + case (ushort)BlockId.BackCobblestone: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackGravel: return 300*DestroyShovel(); + case (ushort)BlockId.BackDirt: return 300*DestroyShovel(); + case (ushort)BlockId.BackRedSand: return 300*DestroyShovel(); + case (ushort)BlockId.BackRegolite: return 300*DestroyShovel(); + case (ushort)BlockId.BackSand: return 300*DestroyShovel(); + + case (ushort)BlockId.BackCoal: return 290*DestroyPickaxe(); + case (ushort)BlockId.BackCopper: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackTin: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackIron: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackAluminium: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackSilver: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackGold: return 300*DestroyPickaxe(); + + case (ushort)BlockId.BackSulfur: return 250*DestroyPickaxe(); + case (ushort)BlockId.BackSaltpeter: return 250*DestroyPickaxe(); + + case (ushort)BlockId.BackAnorthosite: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackBasalt: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackClay: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackDiorit: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackDolomite: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackFlint: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackGabbro: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackGneiss: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackLimestone: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackMudstone: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackRhyolite: return 300*DestroyPickaxe(); + case (ushort)BlockId.BackSandstone: return 300*DestroyPickaxe(); + } + + return 0; + } + + float GetSolidBlockDestroingSpeed(ushort type) { + switch (type) { + case (ushort)BlockId.Windmill: return 45; + case (ushort)BlockId.FurnaceStone: return 45; + case (ushort)BlockId.FurnaceElectric: return 45; + case (ushort)BlockId.Macerator: return 45; + case (ushort)BlockId.Miner: return 45; + case (ushort)BlockId.SolarPanel: return 45; + + case (ushort)BlockId.Clay: return 110*DestroyShovel(); + case (ushort)BlockId.GrassBlockClay: return 120*DestroyShovel(); + case (ushort)BlockId.GrassBlockSnowPlains: return 250*DestroyShovel(); + case (ushort)BlockId.GrassBlockSnowDesert: return 250*DestroyShovel(); + case (ushort)BlockId.GrassBlockSnowForest: return 250*DestroyShovel(); + case (ushort)BlockId.GrassBlockSnowHills: return 250*DestroyShovel(); + case (ushort)BlockId.GrassBlockSnowJungle: return 250*DestroyShovel(); + case (ushort)BlockId.GrassBlockSnowCompost: return 250*DestroyShovel(); + case (ushort)BlockId.GrassBlockSnowClay: return 250*DestroyShovel(); + + case (ushort)BlockId.GrassBlockDesert: return 100*DestroyShovel(); + case (ushort)BlockId.GrassBlockForest: return 100*DestroyShovel(); + case (ushort)BlockId.GrassBlockHills: return 105*DestroyShovel(); + case (ushort)BlockId.GrassBlockJungle: return 105*DestroyShovel(); + case (ushort)BlockId.GrassBlockPlains: return 95*DestroyShovel(); + case (ushort)BlockId.GrassBlockCompost: return 100*DestroyShovel(); + case (ushort)BlockId.Dirt: return 90*DestroyShovel(); + case (ushort)BlockId.Gravel: return 120*DestroyShovel(); + + case (ushort)BlockId.Sand: return 60*DestroyShovel(); + case (ushort)BlockId.Compost: return 70*DestroyShovel(); + case (ushort)BlockId.Cobblestone: return 280*DestroyPickaxe(); + + case (ushort)BlockId.Roof1: return 120*DestroyPickaxe(); + case (ushort)BlockId.Roof2: return 120*DestroyPickaxe(); + case (ushort)BlockId.DoorClose: return 280*DestroyPickaxe(); + + case (ushort)BlockId.StoneBasalt: return 320*DestroyPickaxe(); + case (ushort)BlockId.StoneDiorit: return 300*DestroyPickaxe(); + case (ushort)BlockId.StoneDolomite: return 280*DestroyPickaxe(); + case (ushort)BlockId.StoneGabbro: return 320*DestroyPickaxe(); + case (ushort)BlockId.StoneGneiss: return 320*DestroyPickaxe(); + case (ushort)BlockId.StoneLimestone: return 280*DestroyPickaxe(); + case (ushort)BlockId.StoneRhyolite: return 300*DestroyPickaxe(); + case (ushort)BlockId.StoneSandstone: return 260*DestroyPickaxe(); + case (ushort)BlockId.StoneSchist: return 300*DestroyPickaxe(); + + case (ushort)BlockId.OreCoal: return 260*DestroyPickaxe(); + case (ushort)BlockId.OreAluminium: return 320*DestroyPickaxe(); + case (ushort)BlockId.OreCopper: return 320*DestroyPickaxe(); + case (ushort)BlockId.OreGold: return 300*DestroyPickaxe(); + case (ushort)BlockId.OreIron: return 320*DestroyPickaxe(); + + case (ushort)BlockId.OreSilver: return 300*DestroyPickaxe(); + + case (ushort)BlockId.OreTin: return 300*DestroyPickaxe(); + + case (ushort)BlockId.OreSaltpeter: return 250*DestroyPickaxe(); + case (ushort)BlockId.OreSulfur: return 250*DestroyPickaxe(); + + case (ushort)BlockId.Ice: return 120*DestroyAxe(); + + case (ushort)BlockId.AdvancedSpaceBlock: return 100*DestroyPickaxe(); + case (ushort)BlockId.AdvancedSpaceFloor: return 100*DestroyPickaxe(); + case (ushort)BlockId.AdvancedSpaceWindow: return 100*DestroyPickaxe(); + + case (ushort)BlockId.Planks: return 100*DestroyAxe(); + case (ushort)BlockId.Bricks: return 160*DestroyPickaxe(); + + case (ushort)BlockId.AdvancedSpacePart1: return 90*DestroyPickaxe(); + case (ushort)BlockId.AdvancedSpacePart2: return 90*DestroyPickaxe(); + case (ushort)BlockId.AdvancedSpacePart3: return 90*DestroyPickaxe(); + case (ushort)BlockId.AdvancedSpacePart4: return 90*DestroyPickaxe(); + } + + return 0; + } + + float GetTopBlockDestroingSpeed(ushort type) { + switch (type) { + case (ushort)BlockId.Desk: return 45; + case (ushort)BlockId.Rocket: return 45; + + case (ushort)BlockId.EggDrop: return 20; + + case (ushort)BlockId.Ladder: return 90*DestroyAxe(); + case (ushort)BlockId.Lamp: return 45; + + case (ushort)BlockId.Watermill: return 45; + case (ushort)BlockId.Flag: return 45; + + case (ushort)BlockId.Label: return 30; + + case (ushort)BlockId.Snow: return 100*DestroyShovel(); + + case (ushort)BlockId.AppleLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.LemonLeavesWithLemons: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.LindenLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.OakLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.OrangeLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.SpruceLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.PlumLeavesWithPlums: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.PlumLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.PineLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.OrangeLeavesWithOranges: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.AppleLeavesWithApples: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.CherryLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.CherryLeavesWithCherries: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.LemonLeaves: return 15*DestroyKnife()*DestroyShears(); + + case (ushort)BlockId.AcaciaLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.EucalyptusLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.KapokLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.KapokLeacesFibre: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.KapokLeacesFlowering: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.MangroveLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.OliveLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.OliveLeavesWithOlives: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.RubberTreeLeaves: return 15*DestroyKnife()*DestroyShears(); + case (ushort)BlockId.WillowLeaves: return 15*DestroyKnife()*DestroyShears(); + + case (ushort)BlockId.Violet: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); + case (ushort)BlockId.Dandelion: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); + case (ushort)BlockId.Heather: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); + case (ushort)BlockId.Alore: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); + case (ushort)BlockId.CactusBig: return 60; + case (ushort)BlockId.CactusSmall: return 60; + + case (ushort)BlockId.AppleSapling: return 30*DestroyKnife(); + case (ushort)BlockId.CherrySapling: return 30*DestroyKnife(); + case (ushort)BlockId.LemonSapling: return 30*DestroyKnife(); + case (ushort)BlockId.LindenSapling: return 30*DestroyKnife(); + case (ushort)BlockId.OakSapling: return 30*DestroyKnife(); + case (ushort)BlockId.OrangeSapling: return 30*DestroyKnife(); + case (ushort)BlockId.PineSapling: return 30*DestroyKnife(); + case (ushort)BlockId.PlumSapling: return 30*DestroyKnife(); + case (ushort)BlockId.SpruceSapling: return 30*DestroyKnife(); + + case (ushort)BlockId.GrassDesert: return 30*DestroyKnife(); + case (ushort)BlockId.GrassForest: return 30*DestroyKnife(); + case (ushort)BlockId.GrassHills: return 30*DestroyKnife(); + case (ushort)BlockId.GrassJungle: return 30*DestroyKnife(); + case (ushort)BlockId.GrassPlains: return 30*DestroyKnife(); + + // case (ushort)BlockId.Liana: return 30*DestroyAxe(); + + case (ushort)BlockId.Wheat: return 30f*DestroyKnife(); + case (ushort)BlockId.Onion: return 30f*DestroyShovel(); + case (ushort)BlockId.Flax: return 30f*DestroyKnife(); + case (ushort)BlockId.Glass: return 30f; + case (ushort)BlockId.ChristmasStar: return 30f; + case (ushort)BlockId.Orchid: return 30*DestroyShovel(); + case (ushort)BlockId.Radio: return 45f; + case (ushort)BlockId.Rose: return 30f*DestroyShovel(); + case (ushort)BlockId.Seaweed: return 30f*DestroyKnife(); + case (ushort)BlockId.SugarCane: return 30f*DestroyKnife(); + case (ushort)BlockId.Toadstool: return 30f*DestroyKnife(); + case (ushort)BlockId.Strawberry: return 30f*DestroyShovel(); + case (ushort)BlockId.Rashberry: return 30f*DestroyShovel(); + case (ushort)BlockId.Blueberry: return 30f*DestroyShovel(); + case (ushort)BlockId.Boletus: return 30*DestroyKnife(); + case (ushort)BlockId.SnowTop: return 45*DestroyShovel(); + case (ushort)BlockId.Roof1: return 90f; + case (ushort)BlockId.Coral: return 60f*DestroyKnife(); + case (ushort)BlockId.BranchALittle1: return 30f; + case (ushort)BlockId.BranchALittle2: return 30f; + case (ushort)BlockId.BranchFull: return 30f; + case (ushort)BlockId.BranchWithout: return 30f; + case (ushort)BlockId.Champignon: return 30f*DestroyKnife(); + case (ushort)BlockId.DoorOpen: return 45f; + } + + return 0f; + } + + float GetPlantDestroingSpeed(ushort type) { + switch (type) { + case (ushort)BlockId.Wheat: return 30f; + case (ushort)BlockId.Onion: return 30f; + case (ushort)BlockId.Carrot: return 30f; + case (ushort)BlockId.Peas: return 30f; + case (ushort)BlockId.Flax: return 30f; + + case (ushort)BlockId.Strawberry: return 30f; + case (ushort)BlockId.Rashberry: return 30f; + case (ushort)BlockId.Blueberry: return 30f; + } + + return 0f; + } + + float GetMobDestroingSpeed(ushort type) { + switch (type) { + case (ushort)BlockId.Rabbit: return 30*DestroyKnife(); + case (ushort)BlockId.Chicken: return 30*DestroyKnife(); + case (ushort)BlockId.Fish: return 30*DestroyKnife(); + case (ushort)BlockId.MobParrot: return 30*DestroyKnife(); + } + + return 0; + } + + float DestroyPickaxe() { + switch (InventoryNormal[boxSelected].Id) { + case (ushort)Items.PickaxeStone: return 0.4f; + case (ushort)Items.PickaxeGold: return 0.5f; + case (ushort)Items.PickaxeCopper: return 0.3f; + case (ushort)Items.PickaxeBronze: return 0.25f; + case (ushort)Items.PickaxeAluminium: return 0.45f; + case (ushort)Items.PickaxeIron: return 0.2f; + case (ushort)Items.PickaxeSteel: return 0.19f; + + case (ushort)Items.ElectricDrill: return 0.1f; + case (ushort)Items.MediumStone: return 0.93f; + case (ushort)Items.SmallStone: return 0.96f; + case (ushort)Items.BigStone: return 0.90f; + case (ushort)Items.PickaxeHeadIron: return 0.80f; + case (ushort)Items.StoneHead: return 0.80f; + } + + return 1; + } + + float DestroyAxe() { + switch (InventoryNormal[boxSelected].Id) { + case (ushort)Items.AxeStone: return 0.4f; + case (ushort)Items.AxeIron: return 0.2f; + case (ushort)Items.AxeGold: return 0.5f; + case (ushort)Items.AxeCopper: return 0.3f; + case (ushort)Items.AxeBronze: return 0.25f; + case (ushort)Items.AxeAluminium: return 0.35f; + case (ushort)Items.AxeSteel: return 0.19f; + + case (ushort)Items.ElectricSaw: return 0.1f; + case (ushort)Items.AxeHeadIron: return 0.87f; + case (ushort)Items.SawCopper: return 0.4f; + case (ushort)Items.SawBronze: return 0.15f; + case (ushort)Items.SawIron: return 0.08f; + case (ushort)Items.BigStone: return 0.90f; + case (ushort)Items.StoneHead: return 0.80f; + case (ushort)Items.MediumStone: return 0.93f; + case (ushort)Items.SmallStone: return 0.96f; + } + + return 1; + } + + float DestroyKnife() { + switch (InventoryNormal[boxSelected].Id) { + case (ushort)Items.KnifeCopper: return 0.35f; + case (ushort)Items.KnifeBronze: return 0.3f; + case (ushort)Items.KnifeGold: return 0.5f; + case (ushort)Items.KnifeIron: return 0.25f; + case (ushort)Items.KnifeSteel: return 0.2f; + case (ushort)Items.KnifeAluminium: return 0.3f; + } + return 1; + } + + float DestroyShears() { + switch (InventoryNormal[boxSelected].Id) { + case (ushort)Items.ShearsCopper: return 0.35f; + case (ushort)Items.ShearsBronze: return 0.3f; + case (ushort)Items.ShearsGold: return 0.5f; + case (ushort)Items.ShearsIron: return 0.25f; + case (ushort)Items.ShearsSteel: return 0.2f; + case (ushort)Items.ShearsAluminium: return 0.3f; + } + return 1; + } + + float DestroyShovel() { + switch (InventoryNormal[boxSelected].Id) { + case (ushort)Items.ShovelStone: return 0.4f; + case (ushort)Items.ShovelGold: return 0.3f; + case (ushort)Items.ShovelCopper: return 0.25f; + case (ushort)Items.ShovelBronze: return 0.25f; + case (ushort)Items.ShovelIron: return 0.2f; + + case (ushort)Items.ShovelAluminium: return 0.19f; + case (ushort)Items.ShovelSteel: return 0.2f; + + case (ushort)Items.ElectricDrill: return 0.1f; + case (ushort)Items.ShovelHeadIron: return 0.87f; + case (ushort)Items.StoneHead: return 0.80f; + case (ushort)Items.MediumStone: return 0.86f; + case (ushort)Items.SmallStone: return 0.88f; + case (ushort)Items.BigStone: return 0.84f; + } + + return 1; + } + + //void GetItemsFromPlant(byte type, DInt _pos, bool grow) { + // DInt pos = new DInt(_pos.X*16, _pos.Y*16); + // if (grow) { + // switch ((BlockId)type) { + // case BlockId.Wheat: + // DropItemToPos(pos, Items.WheatStraw); + // DropItemToPos(pos, Items.WheatSeeds); + // if (FastRandom.Int(8)==1) DropItemToPos(pos, Items.WheatSeeds); + // break; + + // case BlockId.Onion: + // if (FastRandom.Int(2)==1) DropItemToPos(pos, Items.Onion); + // if (FastRandom.Int(2)==1) DropItemToPos(pos, Items.Onion); + // if (FastRandom.Int(2)==1) DropItemToPos(pos, Items.Onion); + // break; + + // case BlockId.Flax: + // DropItemToPos(pos, Items.Flax); + // DropItemToPos(pos, Items.FlaxSeeds); + // if (FastRandom.Int(8)==1) DropItemToPos(pos, Items.FlaxSeeds); + // break; + + // case BlockId.Strawberry: + // DropItemToPos(pos, Items.PlantStrawberry); + // if (FastRandom.Int(8)==1) DropItemToPos(pos, Items.PlantStrawberry); + // break; + + // case BlockId.Rashberry: + // DropItemToPos(pos, Items.PlantRashberry); + // if (FastRandom.Int(8)==1) DropItemToPos(pos, Items.PlantRashberry); + // break; + + // case BlockId.Blueberry: + // DropItemToPos(pos, Items.PlantBlueberry); + // if (FastRandom.Int(8)==1) DropItemToPos(pos, Items.PlantBlueberry); + // break; + // } + // } else { + // switch ((BlockId)type) { + // case BlockId.Wheat: + // // DropItemToPos(pos,Items.WheatStraw); + // // DropItemToPos(pos,Items.WheatSeeds); + // if (FastRandom.Int(8)==1) DropItemToPos(pos, Items.WheatSeeds); + // break; + + // case BlockId.Onion: + // DropItemToPos(pos, Items.Onion); + // break; + + // case BlockId.Flax: + // // DropItemToPos(pos,Items.Flax); + // // DropItemToPos(pos,Items.FlaxSeeds); + // if (FastRandom.Int(8)==1) DropItemToPos(pos, Items.FlaxSeeds); + // break; + + // case BlockId.Strawberry: + // DropItemToPos(pos, Items.PlantStrawberry); + // // if (FastRandom.Int(8)==1)DropItemToPos(pos,Items.StrawberryPlant); + // break; + + // case BlockId.Rashberry: + // DropItemToPos(pos, Items.PlantRashberry); + // // if (FastRandom.Int(8)==1)DropItemToPos(pos,Items.RashberryPlant); + // break; + + // case BlockId.Blueberry: + // DropItemToPos(pos, Items.PlantBlueberry); + // // if (FastRandom.Int(8)==1)DropItemToPos(pos,Items.PlantBlueberry); + // break; + // } + // } + //} + + #endregion + + #region Energy + void EnergySystem() { + for (int i = 0; i5) { + // foreach (Item item in DroppedItems) { + // if (item.X==ch.X*16) { + // if (item.Y>ch.Y*16) { + // if (MinerAddItem((int)item.Id, miner)) { + // DroppedItems.Remove(item); + // return; + // } + // } + // } + // } + // for (int y = ch.Y+1; y<100; y++) { + // if (terrain[ch.X].IsSolidBlocks[y]) { + // destroyBlock=new DInt(ch.X, y); + // // GetItemsFromBlock(terrain[ch.X].SolidBlocks[y].Id, ch.X, y/*,BlockType.Solid*/); + // terrain[ch.X].SolidBlocks[y]=null; + // terrain[ch.X].IsSolidBlocks[y]=false; + // return; + // } + // } + // } + //} + + //void ChargerJob(ShortAndByte ch) { + // MashineBlockBasic charger = (MashineBlockBasic)terrain[ch.X].TopBlocks[ch.Y]; + // if (charger.Inv[0].X!=0) { + // if (charger.Energy>5) { + // if (charger.Inv[0].Y==1) { + // switch ((Items)charger.Inv[0].X) { + // case Items.ElectricDrillOff: + // charger.Inv[0].X=(int)Items.ElectricDrill; + // return; + + // case Items.ElectricSawOff: + // charger.Inv[0].X=(int)Items.ElectricSaw; + // return; + + // case Items.TorchElectricOFF: + // charger.Inv[0].X=(int)Items.TorchElectricON; + // return; + // } + // } + + // if (charger.Inv[0].Y<99) { + // switch ((Items)charger.Inv[0].X) { + // case Items.ElectricDrill: + // charger.Inv[0].Y++; + // charger.Energy-=5; + // return; + + // case Items.ElectricSaw: + // charger.Inv[0].Y++; + // charger.Energy-=5; + // return; + + // case Items.TorchElectricON: + // charger.Inv[0].Y++; + // charger.Energy-=5; + // return; + // } + // } + // } + // } + //} + + #endregion + + #region Prepare dialogs + void MobileON() => (mobileOS=new Mobile.System() { Content=Rabcr.content }).Init(); + + //void PrepareRocketDialog() { + // if (buttonRocket==null) + // buttonRocket=new GameButton(Textures.ButtonCenter,spriteFont_small,spriteFont_medium){ + // Text="Odletět", + // // center=true + // }; + //} + + //void PrepareRadioDialog() { + // if (buttonRocket==null) + // buttonRocket=new GameButton(Textures.ButtonCenter,spriteFont_small,spriteFont_medium) { + // Text="Otevřít", + // // center=true + // }; + //} + + #endregion + + #region Inventory + void ItemEat() { + if (barEat>1) { + if (InventoryNormal[boxSelected] is ItemInvFood16) { + SendEatItem(); + return; + } + + if (InventoryNormal[boxSelected] is ItemInvFood32) { + SendEatItem(); + return; + } + } + } + + //void RemovePartTool() { + // int id = Inventory[boxSelected].X; + // int count = Inventory[boxSelected].Y; + + // if (id<(int)Items._SystemMaxTools) { + // //if (count==1) { + // // Items newId=GameMethods.ToolToBasic((Items)id); + // // if (newId!=Items.None) { + // // Inventory[boxSelected].X=(int)newId; + // // return; + // // } + // float i = GameMethods.ToolMaxUses((Items)id); + + // if (count>1) { + // if (i!=-1) { + // if (i==(int)i) { + // if (i(i-(int)i)*100 ? 1 : 0)+(int)i; + // if (newii*100) { + // if (i list) { + foreach (Item i in list) { + if (i.X>PlayerX-11-16) { + if (i.XPlayerY-20) { + if (i.Y0){ + if (i.Y<124*16) { + if (!terrain[i.X/16].IsSolidBlocks[i.Y/16+1]) { + i.Y+=2; + } + } + } + } + + if (i.Y>5000) { + list.Remove(i); + return; + } + } + } + + void ItemGravity(DInt item) { + distanceToGround=100000; + + for (int y = (item.X+20-16)/16; y<(item.Y+20-16)/16+6; y++) { + for (int x = (item.X-11)/16; x<(item.X+11+16)/16; x++) { + if (terrain[x]!=null) { + if (terrain[x].IsSolidBlocks[y]) { + if (/*y*16-PlayerY-39/2>0 &&*/ y*16-item.Y-200) { + item.Y+=distanceToGround; + gravitySpeed=0; + return; + } else { + gravitySpeed+=.4905f; + if (gravitySpeed>6) gravitySpeed=6; + item.Y+=(int)gravitySpeed; + + + } + // } + + + } + + // Crafting basic + void SetInvCraftingBlocks() { + ushort[] items={ + (ushort)Items.Gravel, + (ushort)Items.HayBlock, + }; + inventoryScrollbarValueCraftingMax=items.Length-1; + + for (int i=0; i=LimitY) Position.Y=LimitY; -// } - -// public void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, Source, Color*(Disepeard/50f)); -// } - -// class ParticleRain { -// public Vector2 Position; - -// public float HSpeed; -// public float VSpeed; -// public Color Color; - -// public float Size; - -// public ParticleRain(float size, float vSpeed) { -// Color=Color.Blue*(Size=size); -// VSpeed=vSpeed*(size*0.5f+0.5f); -// } - -// public void Update() { -// Position.X+=HSpeed*Size; -// Position.Y+=VSpeed; -// } - -// public void Draw(float x, float y) => Rabcr.spriteBatch.Draw( -// texture: Rabcr.Pixel, -// destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), 1, Size<0.5f ? 2 : 3), -// color: Color -// ); -// } - -// class ParticleSnow { -// public Vector2 Position; - -// public float HSpeed; -// public float VSpeed; -// public Color Color; -// int time; -// public float Size; - -// public ParticleSnow(float size, float vSpeed) { -// Color=Color.White*(Size=size); -// VSpeed=vSpeed*size; -// } - -// public void Update() { -// time++; -// Position.X+=HSpeed+((float)Math.Cos(time/10f))*0.25f; -// Position.Y+=VSpeed+((float)Math.Sin(time/10f))*HSpeed*0.5f/*+0.2f*/; -// } - -// public void Draw(float x, float y) => Rabcr.spriteBatch.Draw( -// texture: Rabcr.Pixel, -// destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), Size>0.5f ? 2 : 1, Size>0.5f ? 2 : 1), -// color: Color -// ); - -// } - -// class FallingLeave { -// public Texture2D texture; -// public Vector2 Position; -// public float angle; -// public float time; -// Vector2 vecOrigin; -// public float VSpeed; -// public Rectangle srcrec; -// public Color Color = Color.White; -// public FallingLeave(int x, int y, float size, bool leftWind, bool rain, Rectangle src) { -// Position=new Vector2(x, y); -// vecOrigin=new Vector2(size, size); -// if (rain) { -// if (leftWind) VSpeed=-0.01f; else VSpeed=0.01f; -// } else { -// if (leftWind) VSpeed=-0.09f; else VSpeed=0.09f; -// } -// srcrec=src; -// } - -// public void Update() { -// time+=0.07f; -// Position.X+=VSpeed; -// Position.Y+=(float)Math.Cos(time)*0.1f+0.2f; -// angle=(float)Math.Cos(time)*0.3f+FastMath.PI/2f; -// } - -// public void Draw() { -// Rabcr.spriteBatch.Draw( -// texture: texture, -// destinationRectangle: new Rectangle((int)Position.X, (int)Position.Y, srcrec.Width, srcrec.Height), -// sourceRectangle: srcrec, -// effects: SpriteEffects.None, -// color: Color, -// rotation: angle, -// origin: vecOrigin, -// layerDepth: 1f); -// } -// } -// } -//} \ No newline at end of file + }; + + inventoryScrollbarValueCraftingMax=items.Length-1; + + for (int i=0; i(int)Items._NonStacktable) { + // for (int i = 0; iGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+53+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+x+59&&newMouseState.XGlobal.WindowHeightHalf+59+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh&&newMouseState.YGlobal.WindowWidthHalf-300+38+40&&newMouseState.XGlobal.WindowHeightHalf+20-2+40+25&&newMouseState.YinventoryScrollbarValueCraftingMax) break; + + // if (In40(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx) { + // // if (newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8) { + // // if (newMouseState.YinventoryScrollbarValueCraftingMax) break; + + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + + selectedCraftingItem=i; + + SelectedCraftingRecipe=0; + + ItemInv itemToCraft=InventoryCrafting[i]; + + CurrentDeskCrafting=GameMethods.ToDust(itemToCraft.Id); + + SetNeed(); + return; + } + + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + } + + void SelectItemCraft() { + if (mouseLeftRelease) { + int xx =0, yh=0; + + for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + selectedCraftingItem=i; + ItemInv itemToCraft=InventoryCrafting[i]; + + CurrentDeskCrafting=GameMethods.Craft(itemToCraft.Id); + SelectedCraftingRecipe=0; + SetNeed(); + return; + } + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + } + //void SelectItemBake() { + // if (mouseLeftRelease) { + // int xx = 0, yh = 0; + + // for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + // if (In40(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YinventoryScrollbarValueCraftingMax) break; + + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + selectedCraftingItem=i; + ItemInv itemToCraft=InventoryCrafting[i]; + + CurrentDeskCrafting=GameMethods.Bake(itemToCraft.Id); + SelectedCraftingRecipe=0; + SetNeed(); + return; + } + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + } + + //void SelectItemClothes() { + // if (mouseLeftRelease) { + // int xx = 0, yh = 0; + + // for (int i = inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + // if (In40(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YinventoryScrollbarValueCraftingMax) break; + + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8)) { + selectedCraftingItem=i; + + ItemInv itemToCraft=InventoryCrafting[i]; + SelectedCraftingRecipe=0; + CurrentDeskCrafting=GameMethods.Clothes(itemToCraft.Id); + SetNeed(); + return; + } + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + } + + //void InventoryRemoveDInt(int inventory) { + // DInt i = Inventory[inventory]; + // i.Y--; + + // if (i.Y==0) { + // i.X=0; + // return; + // } + + // if (i.Y==1) { + // if (i.X<(int)Items._SystemMaxTools) { + // Items newId = GameMethods.ToolToBasic((Items)i.X); + // if (newId!=Items.None) i.X=(int)newId; + // } + // } + //} + + //void InventoryRemoveDInt() { + // DInt i = Inventory[boxSelected]; + // i.Y--; + + // if (i.Y==0) { + // i.X=0; + // return; + // } + + // if (i.Y==1) { + // if (i.X<(int)Items._SystemMaxTools) { + // Items newId = GameMethods.ToolToBasic((Items)i.X); + // if (newId!=Items.None) i.X=(int)newId; + // } + // } + //} + + //void InventoryRemoveDInt(DInt i) { + // i.Y--; + // if (i.Y==0) { + // i.X=0; + // return; + // } + + // if (i.Y==1) { + // if (i.X<(int)Items._SystemMaxTools) { + // Items newId = GameMethods.ToolToBasic((Items)i.X); + // if (newId!=Items.None) i.X=(int)newId; + // } + // } + //} + + void InventoryRemoveSelectedItem() { + ItemInv i=InventoryNormal[boxSelected]; + switch (i) { + case ItemInvTool32 s: + // s.SetCount=s.GetCount-1; + if (s.GetCount==1) { + InventoryNormal[boxSelected]=itemBlank; + } else { + s.SetCount=s.GetCount-1; + } + break; + + case ItemInvTool16 s: + if (s.GetCount==1) { + InventoryNormal[boxSelected]=itemBlank; + } else { + s.SetCount=s.GetCount-1; + } + break; + + case ItemInvBasic16 s: + if (s.GetCount==1) { + InventoryNormal[boxSelected]=itemBlank; + } else { + s.SetCount=s.GetCount-1; + } + break; + + case ItemInvBasic32 s: + if (s.GetCount==1) { + InventoryNormal[boxSelected]=itemBlank; + } else { + s.SetCount=s.GetCount-1; + } + break; + + //case ItemInvBasicColoritzed32NonStackable s: + // InventoryNormal[boxSelected]=itemBlank; + // break; + + //case ItemInvNonStackable16 s: + // InventoryNormal[boxSelected]=itemBlank; + // break; + + //case ItemInvNonStackable32 s: + // InventoryNormal[boxSelected]=itemBlank; + // break; + + case ItemInvFood16 s: + if (s.GetCount==1) { + InventoryNormal[boxSelected]=itemBlank; + } else { + s.SetCount=s.GetCount-1; + } + break; + + default: + InventoryNormal[boxSelected]=itemBlank; + break; + + } + } + + + //int TotalItemsInInventory(int id) { + // int inInv = 0; + // foreach (DInt ii in Inventory) { + // if (id==ii.X) inInv+=ii.Y; + // } + // return inInv; + //} + + #endregion + + //void ChangeInventoryClothes() { + // // Move from ... + // if (!invMove) { + // mouseDraw=false; + // if (mouseLeftPress) { + + // // Basic right inventory + // for (int i = 0; i<5; i++) { + // if (newMouseState.X>Global.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + // if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) { + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + // if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) { + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + // if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + // if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + // if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.YGlobal.WindowWidth-40&&newMouseState.XGlobal.WindowHeightHalf-80+i*40&&newMouseState.YmaxInvCount) break; + // if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) + // //if (newMouseState.X>Global.WindowWidthHalf-300+4+200+4+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+yh && newMouseState.YGlobal.WindowWidthHalf-300+4+60+x&&newMouseState.XGlobal.WindowHeightHalf-200+2+4+y&&newMouseState.Y x + 39) return false; + if (mouseRealPosY > y + 39) return false; + return true; + } + + static bool In(int x, int y, int x2, int y2) { + if (mouseRealPosY < y) return false; + if (mouseRealPosX < x) return false; + if (mouseRealPosX > x2) return false; + if (mouseRealPosY > y2) return false; + return true; + } + + void CraftingEventsCraft() { + + if (buttonCraft1x.Update()) { + MakeCrafting(1); + return; + } + + if (buttonCraft10x.Update()) { + MakeCrafting(10); + return; + } + + if (buttonCraft100x.Update()) { + MakeCrafting(100); + return; + } + } + + void CraftingEvents() { + if (SelectedCraftingRecipe!=-1) { + #if DEBUG + if (CurrentDeskCrafting==null) throw new Exception("Pravděpodobně chybí recept - doplň v GameMethods ("+((Items)InventoryCrafting[selectedCraftingItem].Id)+")"); + #endif + + CraftingIn[] slots=CurrentDeskCrafting[SelectedCraftingRecipe].Input; + if (CurrentDeskCrafting!=null) { + if (CurrentDeskCrafting.Length!=1) { + if (buttonNext.Update()) { + SelectedCraftingRecipe++; + if (SelectedCraftingRecipe==CurrentDeskCrafting.Length)SelectedCraftingRecipe=0; + SetNeed(); + } + + if (buttonPrev.Update()) { + SelectedCraftingRecipe--; + if (SelectedCraftingRecipe==-1)SelectedCraftingRecipe=CurrentDeskCrafting.Length-1; + SetNeed(); + } + } + } + + int i = 0; + for (int y = 0; y<2; y++) { + for (int x = 0; x<6; x++) { + if (slots.Length==i) break; + CraftingIn slot=slots[i]; + ItemNonInv[] item=slot.ItemSlot; + if (item.Length>1) { + if (mouseLeftDown) { + if (In40(Global.WindowWidthHalf-300+4+200+80+40+8+x*40,y*40+Global.WindowHeightHalf-200+2+4+200+8+8)) { + displayPopUpWindow=true; + PopUpWindowChoosingPotencialdItem=i; + PopUpWindowSelectedItem=-1; + ShowPopUpWindow(); + } + } + } + i++; + } + } + } + } + + void MakeCrafting(int c) { + if (CanCraft(c)) { + for (int g=0; gcount) { + // InventoryNormal[i].Y-=count; + // break; + // } else { + // count-=InventoryNormal[i].Y; + // if (item.X>(ushort)Items._SystemMaxTools) { + // InventoryNormal[i].X=0; + // InventoryNormal[i].Y=0; + // } else { + // Items expec=GameMethods.ToolToBasic((Items)InventoryNormal[i].X); + // if (expec==Items.None) { + // InventoryNormal[i].X=0; + // InventoryNormal[i].Y=0; + // } else { + // InventoryNormal[i].Y=1; + // InventoryNormal[i].X=(int)expec; + // } + // } + // } + // } + //} + } + + foreach (CraftingOut d in CurrentDeskCrafting[SelectedCraftingRecipe].Output){//selectedCraftingItem + if (d.EveryTime) AddItemToPlayer(d.Item); + else{ + if (FastRandom.Double()=slot.ItemSlot[0].Y; + // } else { + // slot.Texture=ItemIdToTexture(item[slot.SelectedItem].X); + // } + + + // } + + // i++; + + + // } + // } + //} + void SetNeed() { + if (SelectedCraftingRecipe==-1)return; + if (CurrentDeskCrafting==null)return; + CraftingIn[] slots=CurrentDeskCrafting[SelectedCraftingRecipe].Input; + + int i = 0; + for (int y = 0; y<2; y++) { + for (int x = 0; x<6; x++) { + if (slots.Length==i) break; + CraftingIn slot=slots[i]; + ItemNonInv[] item=slot.ItemSlot; + + if (slot.SelectedItem==-1) { + slot.TmpSelected=FastRandom.Int(item.Length); + slot.Texture=ItemIdToTexture(item[slot.TmpSelected].Id); + }else{ + // ItemNonInv selectedSlot=item[slot.SelectedItem]; + if (item.Length==1) { + switch (slot.ItemSlot[0]) { + case ItemNonInvTool t: + slot.Texture=ItemIdToTexture(item[0].Id); + if (t.Count==-1){ + slot.HaveItemInInventory=TotalItemsInInventoryForAllTypes(slot.ItemSlot[0].Id)>0; + }else{ + slot.HaveItemInInventory=TotalItemsInInventoryForAllTypes(slot.ItemSlot[0].Id)>=t.Count; + } + break; + + case ItemNonInvBasic t: + slot.Texture=ItemIdToTexture(item[0].Id); + slot.HaveItemInInventory=TotalItemsInInventoryForAllTypes(slot.ItemSlot[0].Id)>=t.Count; + break; + + //case ItemNonInvNonStackable f: + // slot.Texture=ItemIdToTexture(item[0].Id); + // slot.HaveItemInInventory=TotalItemsInInventoryForAllTypes(slot.ItemSlot[0].Id)>=1; + // break; + + //case ItemNonInvBasicColoritzedNonStackable f: + // slot.Texture=ItemIdToTexture(item[0].Id); + // slot.HaveItemInInventory=TotalItemsInInventoryForAllTypes(slot.ItemSlot[0].Id)>=1; + // break; + + default: + slot.Texture=ItemIdToTexture(item[0].Id); + slot.HaveItemInInventory=TotalItemsInInventoryForAllTypes(slot.ItemSlot[0].Id)>=1; + break; + } + + }else{ + slot.Texture=ItemIdToTexture(item[slot.SelectedItem].Id); + } + } + + i++; + + + } + } + } + + //void SetPlayerClothes() { + // switch (InventoryClothes[0].X) { + // case (int)Items.Cap: + // TextureWalkingClothesHead=TextureWalkingCap; + // TextureStaticClothesHead=TextureStaticCap; + // break; + + // case (int)Items.Hat: + // TextureWalkingClothesHead=TextureWalkingHad; + // TextureStaticClothesHead=TextureStaticHad; + // break; + + // case (int)Items.Crown: + // TextureWalkingClothesHead=TextureWalkingCrown; + // TextureStaticClothesHead=TextureStaticCrown; + // break; + + // case (int)Items.SpaceHelmet: + // TextureWalkingClothesHead=TextureWalkingSpaceHelmet; + // TextureStaticClothesHead=TextureStaticSpaceHelmet; + // break; + + // default: + // TextureWalkingClothesHead=null; + // TextureStaticClothesHead=null; + // break; + // } + + // switch (InventoryClothes[1].X) { + // case (int)Items.CoatArmy: + // TextureWalkingClothesChestTop=TextureWalkingCoatArmy; + // TextureStaticClothesChestTop=TextureStaticCoatArmy; + // TextureSwimmingClothesChestTop=TextureSwimmingCoatArmy; + // break; + + // case (int)Items.CoatGray: + // TextureWalkingClothesChestTop=TextureWalkingCoatGray; + // TextureStaticClothesChestTop=TextureStaticCoatGray; + // TextureSwimmingClothesChestTop=TextureSwimmingCoatGray; + // break; + + // case (int)Items.JacketDenim: + // TextureWalkingClothesChestTop=TextureWalkingJacketDenim; + // TextureStaticClothesChestTop=TextureStaticJacketDenim; + // TextureSwimmingClothesChestTop=TextureSwimmingJacketDenim; + // break; + + // case (int)Items.JacketFormal: + // TextureWalkingClothesChestTop=TextureWalkingJacketFormal; + // TextureStaticClothesChestTop=TextureStaticJacketFormal; + // TextureSwimmingClothesChestTop=TextureSwimmingJacketFormal; + // break; + + // case (int)Items.JacketRed: + // TextureWalkingClothesChestTop=TextureWalkingJacketRed; + // TextureStaticClothesChestTop=TextureStaticJacketRed; + // TextureSwimmingClothesChestTop=TextureSwimmingJacketRed; + // break; + + // case (int)Items.JacketShort: + // TextureWalkingClothesChestTop=TextureWalkingJacketShort; + // TextureStaticClothesChestTop=TextureStaticJacketShort; + // TextureSwimmingClothesChestTop=TextureSwimmingJacketShort; + // break; + + // case (int)Items.SpaceSuit: + // TextureWalkingClothesChestTop=TextureWalkingSpaceSuit; + // TextureStaticClothesChestTop=TextureStaticSpaceSuit; + // TextureSwimmingClothesChestTop=TextureSwimmingSpaceSuit; + // break; + + // default: + // TextureWalkingClothesChestTop=null; + // TextureStaticClothesChestTop=null; + // TextureSwimmingClothesChestTop=null; + // break; + // } + + // switch (InventoryClothes[2].X) { + // case (int)Items.BlueDress: + // TextureWalkingClothesChest=TextureWalkingBlueDress; + // TextureStaticClothesChest=TextureStaticBlueDress; + // TextureSwimmingClothesChest=TextureSwimmingBlueDress; + // break; + + // case (int)Items.GreenTShirt: + // TextureWalkingClothesChest=TextureWalkingGreenTShirt; + // TextureStaticClothesChest=TextureStaticGreenTShirt; + // TextureSwimmingClothesChest=TextureSwimmingGreenTShirt; + // break; + + // case (int)Items.LightBlueTShirt: + // TextureWalkingClothesChest=TextureWalkingLightBlueTShirt; + // TextureStaticClothesChest=TextureStaticLightBlueTShirt; + // TextureSwimmingClothesChest=TextureSwimmingLightBlueTShirt; + // break; + + // case (int)Items.Shirt: + // TextureWalkingClothesChest=TextureWalkingShirt; + // TextureStaticClothesChest=TextureStaticShirt; + // TextureSwimmingClothesChest=TextureSwimmingShirt; + // break; + + // case (int)Items.WhiteDress: + // TextureWalkingClothesChest=TextureWalkingWhiteDress; + // TextureStaticClothesChest=TextureStaticWhiteDress; + // TextureSwimmingClothesChest=TextureSwimmingWhiteDress; + // break; + + // default: + // TextureWalkingClothesChest=null; + // TextureStaticClothesChest=null; + // TextureSwimmingClothesChest=null; + // break; + // } + + // switch (InventoryClothes[3].X) { + // case (int)Items.TopBlackBikini: + // TextureWalkingClothesUpUnderwear=TextureWalkingTopBlackBikini; + // TextureStaticClothesUpUnderwear=TextureStaticTopBlackBikini; + // TextureSwimmingClothesUpUnderwear=TextureSwimmingTopBlackBikini; + // break; + + // case (int)Items.TopBlueBikini: + // TextureWalkingClothesUpUnderwear=TextureWalkingTopBlueBikini; + // TextureStaticClothesUpUnderwear=TextureStaticTopBlueBikini; + // TextureSwimmingClothesUpUnderwear=TextureSwimmingTopBlueBikini; + // break; + + // case (int)Items.GrayBra: + // TextureWalkingClothesUpUnderwear=TextureWalkingGrayBra; + // TextureStaticClothesUpUnderwear=TextureStaticGrayBra; + // TextureSwimmingClothesUpUnderwear=TextureSwimmingGrayBra; + // break; + + // case (int)Items.PurpleBra: + // TextureWalkingClothesUpUnderwear=TextureWalkingPurpleBra; + // TextureStaticClothesUpUnderwear=TextureStaticPurpleBra; + // TextureSwimmingClothesUpUnderwear=TextureSwimmingPurpleBra; + // break; + + // case (int)Items.RedBra: + // TextureWalkingClothesUpUnderwear=TextureWalkingRedBra; + // TextureStaticClothesUpUnderwear=TextureStaticRedBra; + // TextureSwimmingClothesUpUnderwear=TextureSwimmingRedBra; + // break; + + // default: + // TextureWalkingClothesUpUnderwear=null; + // TextureStaticClothesUpUnderwear=null; + // TextureSwimmingClothesUpUnderwear=null; + // break; + // } + + // switch (InventoryClothes[4].X) { + // case (int)Items.ArmyTrousers: + // TextureWalkingClothesLegs=TextureWalkingArmyTrousers; + // TextureStaticClothesLegs=TextureStaticArmyTrousers; + // TextureSwimmingClothesLegs=TextureSwimmingArmyTrousers; + // break; + + // case (int)Items.BlackSkirt: + // TextureWalkingClothesLegs=TextureWalkingBlackSkirt; + // TextureStaticClothesLegs=TextureStaticBlackSkirt; + // TextureSwimmingClothesLegs=TextureSwimmingBlackSkirt; + // break; + + // case (int)Items.Jeans: + // TextureWalkingClothesLegs=TextureWalkingJeans; + // TextureStaticClothesLegs=TextureStaticJeans; + // TextureSwimmingClothesLegs=TextureSwimmingJeans; + // break; + + // case (int)Items.PinkSkirt: + // TextureWalkingClothesLegs=TextureWalkingPinkSkirt; + // TextureStaticClothesLegs=TextureStaticPinkSkirt; + // TextureSwimmingClothesLegs=TextureSwimmingPinkSkirt; + // break; + + // case (int)Items.Shorts: + // TextureWalkingClothesLegs=TextureWalkingShorts; + // TextureStaticClothesLegs=TextureStaticShorts; + // TextureSwimmingClothesLegs=TextureSwimmingShorts; + // break; + + // case (int)Items.SpaceTrousers: + // TextureWalkingClothesLegs=TextureWalkingSpaceTrousers; + // TextureStaticClothesLegs=TextureStaticSpaceTrousers; + // TextureSwimmingClothesLegs=TextureSwimmingSpaceTrousers; + // break; + + // default: + // TextureWalkingClothesLegs=null; + // TextureStaticClothesLegs=null; + // TextureSwimmingClothesLegs=null; + // break; + // } + + // switch (InventoryClothes[5].X) { + // case (int)Items.BlackBikini: + // TextureWalkingClothesDownUnderwear=TextureWalkingBlackBikini; + // TextureStaticClothesDownUnderwear=TextureStaticBlackBikini; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingBlackBikini; + // break; + + // case (int)Items.BlueBikini: + // TextureWalkingClothesDownUnderwear=TextureWalkingBlueBikini; + // TextureStaticClothesDownUnderwear=TextureStaticBlueBikini; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingBlueBikini; + // break; + + // case (int)Items.BlueUnderpants: + // TextureWalkingClothesDownUnderwear=TextureWalkingBlueUnderpants; + // TextureStaticClothesDownUnderwear=TextureStaticBlueUnderpants; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingBlueUnderpants; + // break; + + // case (int)Items.BoxerShorts: + // TextureWalkingClothesDownUnderwear=TextureWalkingBoxerShorts; + // TextureStaticClothesDownUnderwear=TextureStaticBoxerShorts; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingBoxerShorts; + // break; + + // case (int)Items.Shorts: + // TextureWalkingClothesDownUnderwear=TextureWalkingShorts; + // TextureStaticClothesDownUnderwear=TextureStaticShorts; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingShorts; + // break; + + // case (int)Items.GrayUnderpants: + // TextureWalkingClothesDownUnderwear=TextureWalkingGrayUnderpants; + // TextureStaticClothesDownUnderwear=TextureStaticGrayUnderpants; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingGrayUnderpants; + // break; + + // case (int)Items.PantiesLightBlue: + // TextureWalkingClothesDownUnderwear=TextureWalkingPantiesLightBlue; + // TextureStaticClothesDownUnderwear=TextureStaticPantiesLightBlue; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingPantiesLightBlue; + // break; + + // case (int)Items.PantiesRed: + // TextureWalkingClothesDownUnderwear=TextureWalkingPantiesRed; + // TextureStaticClothesDownUnderwear=TextureStaticPantiesRed; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingPantiesRed; + // break; + + // case (int)Items.Swimsuit: + // TextureWalkingClothesDownUnderwear=TextureWalkingSwimsuit; + // TextureStaticClothesDownUnderwear=TextureStaticSwimsuit; + // TextureSwimmingClothesDownUnderwear=TextureSwimmingSwimsuit; + // break; + + // default: + // TextureWalkingClothesDownUnderwear=null; + // TextureStaticClothesDownUnderwear=null; + // TextureSwimmingClothesDownUnderwear=null; + // break; + // } + + // switch (InventoryClothes[6].X) { + // case (int)Items.FormalShoes: + // TextureWalkingClothesFeet=TextureWalkingFormalShoes; + // TextureStaticClothesFeet=TextureStaticFormalShoes; + // TextureSwimmingClothesFeet=TextureSwimmingFormalShoes; + // break; + + // case (int)Items.Pumps: + // TextureWalkingClothesFeet=TextureWalkingPumps; + // TextureStaticClothesFeet=TextureStaticPumps; + // TextureSwimmingClothesFeet=TextureSwimmingPumps; + // break; + + // case (int)Items.Sneakers: + // TextureWalkingClothesFeet=TextureWalkingSneakers; + // TextureStaticClothesFeet=TextureStaticSneakers; + // TextureSwimmingClothesFeet=TextureSwimmingSneakers; + // break; + + // case (int)Items.SpaceBoots: + // TextureWalkingClothesFeet=TextureWalkingSpaceBoots; + // TextureStaticClothesFeet=TextureStaticSpaceBoots; + // TextureSwimmingClothesFeet=TextureSwimmingSpaceBoots; + // break; + + // default: + // TextureWalkingClothesFeet=null; + // TextureStaticClothesFeet=null; + // TextureSwimmingClothesFeet=null; + // break; + // } + + // if (InventoryClothes[7].X==(int)Items.Backpack) { + // maxInvCount=45+49; + // } else { + // if (maxInvCount>49) { + // for (int i = 49; i49) { + for (int i=49; i=items[i].Y; + // if (In40(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20)) { + // if (mouseLeftDown) { + // displayPopUpWindow=false; + // PopUpWindowSelectedItem=i; + // slots[PopUpWindowChoosingPotencialdItem].SelectedItem=slots[PopUpWindowChoosingPotencialdItem].TmpSelected=i; + // slots[PopUpWindowChoosingPotencialdItem].Texture=ItemIdToTexture(items[i].X); + // slots[PopUpWindowChoosingPotencialdItem].HaveItemInInventory=hasItem; + // return; + // } + // if (hasItem) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.DarkGray); + // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.Red); + // } else { + // if (hasItem) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.White); + // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), new Color(255, 150, 150)); + // } + + // GameDraw.DrawItemInInventory(ItemIdToTexture(items[i].X), items[i], Global.WindowWidthHalf-150+10+x*40+4, Global.WindowHeightHalf-100+y*40+20+4); + + // i++; + // } + // } + + // //i=0; + // //for (int y=0; y<4; y++) { + // // for (int x=0; x<7; x++) { + + // // GameDraw.DrawItemInInventory(ItemIdToTexture(items[i].X), items[i], Global.WindowWidthHalf-150+10+x*40+4, Global.WindowHeightHalf-100+y*40+20+4); + // // i++; + // // } + // //} + // // buttonOK.ButtonDraw(spriteBatch,mouseLeftDown,mouseRealPos); + + // //DrawInventoryWithDIntMoving(); + // //InventoryDrawClothes(); + // //#region Crafting + // //{ + // // if (inventoryScrollbarValueCraftingMax>6*4) { + // // int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); + // // int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / inventoryScrollbarValueCraftingMax*(160-size2) )*8; + // // if (size2>20) { + // // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + // // spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); + // // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); + // // } else { + // // spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + // // spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); + // // } + // // } + + // // int xx =0; + // // int yh=0; + + // // for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + // // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.Y=t.Count; + case ItemNonInvTool t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=t.Count; + case ItemNonInvFood t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=t.Count; + //case ItemNonInvNonStackable t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; + //case ItemNonInvBasicColoritzedNonStackable t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; + default:return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; + } + //return false; + } + + if (In40(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20)) { + if (mouseLeftDown) { + displayPopUpWindow=false; + PopUpWindowSelectedItem=i; + CraftingIn slot=slots[PopUpWindowChoosingPotencialdItem]; + slot.SelectedItem=slot.TmpSelected=i; + slot.Texture=ItemIdToTexture(items[i].Id); + slot.HaveItemInInventory=hasItem; + return; + } + if (hasItem) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.DarkGray); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.Red); + } else { + if (hasItem) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), new Color(255,150,150)); + } + + /*GameDraw.DrawItemInInventory*/DrawItem(/*ItemIdToTexture(items[i].Id),*/ items[i], Global.WindowWidthHalf-150+10+x*40+4, Global.WindowHeightHalf-100+y*40+20+4); + + i++; + } + } + + } + + + void EventsChooseItemWindow() { + + // i=0; + //for (int y=0; y<4; y++) { + // for (int x=0; x<7; x++) { + // if (items.Length==i)break; + // GameDraw.DrawItemInInventory(ItemIdToTexture(items[i].X), items[i], Global.WindowWidthHalf-150+10+x*40+4, Global.WindowHeightHalf-100+y*40+20+4); + // i++; + // } + //} + //int i=0; + //for (int x=0; x<7; x++) { + // for (int y=0; y<5; y++) { + // spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x, Global.WindowHeightHalf-100+y+10), Color.White); + // i++; + // } + //} + //if (newMouseState.X>Global.WindowWidthHalf-140+x*40 + // && newMouseState.Y>Global.WindowHeightHalf-60+y*40 + // && newMouseState.XinventoryScrollbarValueCraftingMax) break; + + // if (newMouseState.X>Global.WindowWidthHalf-300+4+40+4+xx && newMouseState.XGlobal.WindowHeightHalf-200+2+4+200+8+yh+8 && newMouseState.YmaxInvCount) break; + // spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); + + // if (Inventory[i].X!=0) { + // if (!invMove||(invMove&&invStart!=i)) { + // Texture2D tex = ItemIdToTexture(Inventory[i].X); + // if (tex!=null) GameDraw.DrawItemInInventory(tex, Inventory[i], Global.WindowWidthHalf-300+4+200+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); + // } + // } + // xx+=40; + + // if (xx==9*40) { + // xx=0; + // yh+=40; + // } + // } + // if (maxInvCount>45) { + // int size = (int)(1f/(((int)(maxInvCount/9f)+1)*40/200f)*200); + // int pos = (int)(inventoryScrollbarValue*9/40f/maxInvCount*(200-size))*4; + // if (size>20) { + // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); + // spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1, 20, size-20), Color.White); + // spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), Color.White); + // } else { + // spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); + // Rabcr.spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), Color.White); + // } + // } + //} + void DrawInventoryNormal() { + int xx=0, yh=0; + + //Slots + for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { + if (i>maxInvCount) break; + spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), ColorWhite); + + //if (InventoryNormal[i].X!=0) { + // if (!invMove || (invMove && invStartInventory,invStartId!=i)) { + // Texture2D tex=ItemIdToTexture(InventoryNormal[i].X); + // if (tex!=null) GameDraw.DrawItemInInventory(tex,InventoryNormal[i],Global.WindowWidthHalf-300+4+200+4+4+xx+4,Global.WindowHeightHalf-200+2+4+yh+4); + // } + //} + xx+=40; + + if (xx==9*40) { + xx=0; + yh+=40; + } + } + + xx=0; + + for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { + if (i>maxInvCount) break; + if (InventoryNormal[i].Id!=0) { + InventoryNormal[i].Draw(); + } + xx+=40; + + if (xx==9*40) { + xx=0; + } + } + + if (maxInvCount>49) { + inventoryScrollbar.maxheight=((maxInvCount-5)/9)*40; + inventoryScrollbar.height=5*40; + inventoryScrollbar.ButtonDraw(/*newMouseState.X,newMouseState.Y,mouseLeftDown,*/Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4); + } + } + + //void DrawRightInventoryNormal() { + // for (int i = 0; i<5; i++) { + // if (boxSelected==i) Rabcr.spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.LightBlue); + // else Rabcr.spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.White); + + // if (Inventory[i].X!=0) { + // if (!invMove||(invMove&&invStart!=i)) { + // Texture2D tex = ItemIdToTexture(Inventory[i].X); + // if (tex!=null) GameDraw.DrawItemInInventory(tex, Inventory[i], Global.WindowWidth-36, Global.WindowHeightHalf-80+i*40+4); + // } + // } + // } + //} + + //void DrawInventoryWithDIntMoving() { + // if (Global.WorldDifficulty==2) return; + // int xx = 0, yh = 0; + // for (int i = inventoryScrollbarValue+5; imaxInvCount) break; + // Rabcr.spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); + + // if (Inventory[i].X!=0) { + // if (!invMove||(invMove&&invStartDInt!=Inventory[i])) { + // Texture2D tex = ItemIdToTexture(Inventory[i].X); + // if (tex!=null) GameDraw.DrawItemInInventory(tex, Inventory[i], Global.WindowWidthHalf-300+4+200+4+4+xx+4, Global.WindowHeightHalf-200+2+4+yh+4); + // } + // } + // xx+=40; + + // if (xx==9*40) { + // xx=0; + // yh+=40; + // } + // } + // if (maxInvCount>45) { + // int size = (int)(1f/(((int)(maxInvCount/9f)+1)*40/200f)*200); + // int pos = (int)(inventoryScrollbarValue*9/40f/maxInvCount*(200-size))*4; + // if (size>20) { + // Rabcr.spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); + // Rabcr.spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+10-1, 20, size-20), Color.White); + // Rabcr.spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11+size-20-2), Color.White); + // } else { + // Rabcr.spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos), Color.White); + // Rabcr.spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4+pos+11-2), Color.White); + // } + // } + //} + void DrawInventoryWithMoving() { + int xx=0, yh=0; + for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { + if (i>maxInvCount) break; + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), ColorWhite); + + xx+=40; + + if (xx==9*40) { + xx=0; + yh+=40; + } + } + xx=0; + yh=0; + + for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { + if (i>maxInvCount) break; + + if (InventoryNormal[i].Id!=0) { + InventoryNormal[i].Draw(); + + if (In40(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh)) MouseItemNameEvent(InventoryNormal[i]/*.Id*/); + } + xx+=40; + + if (xx==9*40) { + xx=0; + yh+=40; + } + } + + if (maxInvCount>49) { + inventoryScrollbar.maxheight=((maxInvCount-5)/9)*40; + inventoryScrollbar.height=5*40; + inventoryScrollbar.ButtonDraw(Global.WindowWidthHalf+300-20-4, Global.WindowHeightHalf-200+2+4); + } + + if (inventory==InventoryType.BoxAdv + || inventory==InventoryType.BoxWooden + || inventory==InventoryType.Charger + || inventory==InventoryType.Composter + || inventory==InventoryType.Creative + || inventory==InventoryType.Miner + || inventory==InventoryType.Shelf) { + spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+8*40, Global.WindowHeightHalf-200+2+4+40*5), ColorWhite); + spriteBatch.Draw(TextureBin,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+8*40+4, Global.WindowHeightHalf-200+2+4+40*5+4), ColorWhite); + } + } + + void ChangeInventory() { + if (invMove) { + if (leftMove) { + if (mouseRightRelease) { + int i; + + // Basic right inventory + if ((i=InvSideMoveId())>=0) { + InvMoveOne(InventoryNormal,i); + return; + } + + // Inventory + if ((i=InvMoveId())>=0) { + InvMoveOne(InventoryNormal,i); + return; + } + + // Clothes + if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { + if ((i=InvClothesMoveId())>=0) { + InvMoveOne(InventoryClothes, i); + return; + } + } + + // Shelf + if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { + if ((i=InvShelfMoveId())>=0) { + InvMoveOne(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // FurnaceStone + if (inventory==InventoryType.FurnaceStone) { + if ((i=InvFurnaceStoneMoveId())>=0) { + InvMoveOne(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // BoxWooden + if (inventory==InventoryType.BoxWooden) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMoveOne(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Adv box + if (inventory==InventoryType.BoxAdv) { + if ((i=InvAdvBoxMoveId())>=0) { + InvMoveOne(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + + // Miner + if (inventory==InventoryType.Miner) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMoveOne(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Charger || OxygenMachine + if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { + if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { + InvMoveOne(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + } + + if (inventory==InventoryType.Barrel) { + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { + InvMoveOne(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { + InvMoveOne(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 1); + return; + } + } + + InvDrop(); + + } else if (mouseLeftRelease) { + int i; + + // Basic right inventory + if ((i=InvSideMoveId())>=0) { + InvMove(InventoryNormal,i); + return; + } + + // Inventory + if ((i=InvMoveId())>=0) { + InvMove(InventoryNormal,i); + return; + } + + // Clothes + if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { + if ((i=InvClothesMoveId())>=0) { + InvMove(InventoryClothes,i); + return; + } + } + + // Shelf + if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { + if ((i=InvShelfMoveId())>=0) { + InvMove(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // FurnaceStone + if (inventory==InventoryType.FurnaceStone) { + if ((i=InvFurnaceStoneMoveId())>=0) { + InvMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // BoxWooden + if (inventory==InventoryType.BoxWooden) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMove(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Adv box + if (inventory==InventoryType.BoxAdv) { + if ((i=InvAdvBoxMoveId())>=0) { + InvMove(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Miner + if (inventory==InventoryType.Miner) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Charger || OxygenMachine + if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { + if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { + InvMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + } + + if (inventory==InventoryType.Barrel) { + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { + InvMove(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { + InvMove(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 1); + return; + } + } + + //delete + if (inventory==InventoryType.Creative) { + if (In40(Global.WindowWidthHalf-300+4+200+4+4+8*40, Global.WindowHeightHalf-200+2+4+40*5)) { + InvRemove(); + return; + } + } + + InvDrop(); + + } + } else { + if (mouseLeftRelease) { + int i; + + // Basic right inventory + if ((i=InvSideMoveId())>=0) { + InvMoveHalf(InventoryNormal,i); + return; + } + + // Inventory + if ((i=InvMoveId())>=0) { + InvMoveHalf(InventoryNormal,i); + return; + } + + // Clothes + if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { + if ((i=InvClothesMoveId())>=0) { + InvMoveHalf(InventoryClothes,i); + return; + } + } + + // FurnaceStone + if (inventory==InventoryType.FurnaceStone) { + if ((i=InvFurnaceStoneMoveId())>=0) { + InvMoveHalf(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Shelf + if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { + if ((i=InvShelfMoveId())>=0) { + InvMoveHalf(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // BoxWooden + if (inventory==InventoryType.BoxWooden) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMoveHalf(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Adv box + if (inventory==InventoryType.BoxAdv) { + if ((i=InvAdvBoxMoveId())>=0) { + InvMoveHalf(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Miner + if (inventory==InventoryType.Miner) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMoveHalf(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Charger || OxygenMachine + if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { + if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { + InvMoveHalf(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + } + + if (inventory==InventoryType.Barrel) { + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { + InvMoveHalf(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { + InvMoveHalf(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 1); + return; + } + } + + //delete + if (inventory==InventoryType.Creative) { + if (In40(Global.WindowWidthHalf-300+4+200+4+4+8*40, Global.WindowHeightHalf-200+2+4+40*5)) { + InvRemove(); + return; + } + } + + InvDrop(); + + } else { + if (mouseRightRelease) { + int i; + + // Basic right inventory + if ((i=InvSideMoveId())>=0) { + InvMove(InventoryNormal,i); + return; + } + + // Inventory + if ((i=InvMoveId())>=0) { + InvMove(InventoryNormal,i); + return; + } + + // Clothes + if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { + if ((i=InvClothesMoveId())>=0) { + InvMove(InventoryClothes,i); + return; + } + } + + // Shelf + if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { + if ((i=InvShelfMoveId())>=0) { + InvMove(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // FurnaceStone + if (inventory==InventoryType.FurnaceStone) { + if ((i=InvFurnaceStoneMoveId())>=0) { + InvMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // BoxWooden + if (inventory==InventoryType.BoxWooden) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMove(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Adv box + if (inventory==InventoryType.BoxAdv) { + if ((i=InvAdvBoxMoveId())>=0) { + InvMove(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Miner + if (inventory==InventoryType.Miner) { + if ((i=InvWoodenBoxMoveId())>=0) { + InvMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // Charger || OxygenMachine + if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { + if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { + InvMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + } + + if (inventory==InventoryType.Barrel) { + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { + InvMove(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + return; + } + + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { + InvMove(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 1); + return; + } + } + + //delete + if (inventory==InventoryType.Creative) { + if (In40(Global.WindowWidthHalf-300+4+200+4+4+8*40, Global.WindowHeightHalf-200+2+4+40*5)) { + InvRemove(); + return; + } + } + + InvDrop(); + } + } + } + } else { + if (mouseLeftPress) { + int i; + + // Basic right inventory + if ((i=InvSideMoveId())>=0) { + StartItemMove(InventoryNormal, i); + leftMove = true; + return; + } + + // Inventory + if ((i=InvMoveId())>=0) { + StartItemMove(InventoryNormal, i); + leftMove = true; + return; + } + + // Clothes + if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { + if ((i=InvClothesMoveId())>=0) { + StartItemMove(InventoryClothes, i); + leftMove = true; + return; + } + } + + // Shelf + if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { + if ((i=InvShelfMoveId())>=0) { + StartItemMove(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = true; + return; + } + } + + // FurnaceStone + if (inventory==InventoryType.FurnaceStone) { + if ((i=InvFurnaceStoneMoveId())>=0) { + StartItemMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // BoxWooden + if (inventory==InventoryType.BoxWooden) { + if ((i=InvWoodenBoxMoveId())>=0) { + StartItemMove(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = true; + return; + } + } + + // Adv box + if (inventory==InventoryType.BoxAdv) { + if ((i=InvAdvBoxMoveId())>=0) { + StartItemMove(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = true; + return; + } + } + + // Miner + if (inventory==InventoryType.Miner) { + if ((i=InvWoodenBoxMoveId())>=0) { + StartItemMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = true; + return; + } + } + + // Charger || OxygenMachine + if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { + if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { + StartItemMove(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + leftMove = true; + return; + } + } + + if (inventory==InventoryType.Barrel) { + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { + StartItemMove(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + leftMove = true; + return; + } + + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { + StartItemMove(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 1); + leftMove = true; + return; + } + } + + } else { + if (mouseRightPress) { + int i; + + // Basic right inventory + if ((i=InvSideMoveId())>=0) { + StartItemMoveHalf(InventoryNormal, i); + leftMove = false; + return; + } + + // Inventory + if ((i=InvMoveId())>=0) { + StartItemMoveHalf(InventoryNormal, i); + leftMove = false; + return; + } + + // Clothes + if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { + if ((i=InvClothesMoveId())>=0) { + if (i<8){ + StartItemMoveHalf(InventoryClothes, i); + leftMove = false; + return; + } + } + } + + // Shelf + if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { + if ((i=InvShelfMoveId())>=0) { + StartItemMoveHalf(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = false; + return; + } + } + + // FurnaceStone + if (inventory==InventoryType.FurnaceStone) { + if ((i=InvFurnaceStoneMoveId())>=0) { + StartItemMoveHalf(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + return; + } + } + + // BoxWooden + if (inventory==InventoryType.BoxWooden) { + if ((i=InvWoodenBoxMoveId())>=0) { + StartItemMoveHalf(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = false; + return; + } + } + + // Adv box + if (inventory==InventoryType.BoxAdv) { + if ((i=InvAdvBoxMoveId())>=0) { + StartItemMoveHalf(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = false; + return; + } + } + + // Miner + if (inventory==InventoryType.Miner) { + if ((i=InvWoodenBoxMoveId())>=0) { + StartItemMoveHalf(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, i); + leftMove = false; + return; + } + } + + // Charger || OxygenMachine + if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { + if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { + StartItemMoveHalf(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + leftMove = false; + return; + } + } + + if (inventory==InventoryType.Barrel) { + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { + StartItemMoveHalf(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 0); + leftMove = false; + return; + } + + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { + StartItemMoveHalf(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv, 1); + leftMove = false; + return; + } + } + }else{ + if (mousePosChanged) { + int i; + mouseDrawItemTextInfo=false; + // Basic right inventory + if ((i=InvSideMoveId())>=0) { + MouseItemNameEvent(InventoryNormal[i]); + return; + } + + // Inventory + if ((i=InvMoveId())>=0) { + MouseItemNameEvent(InventoryNormal[i]); + return; + } + + // Clothes + if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { + if ((i=InvClothesMoveId())>=0) { + if (i<8) MouseItemNameEvent(InventoryClothes[i]/*.Id*/); + return; + } + } + + // Shelf + if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { + if ((i=InvShelfMoveId())>=0) { + MouseItemNameEvent(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + return; + } + } + + // FurnaceStone + if (inventory==InventoryType.FurnaceStone) { + if ((i=InvFurnaceStoneMoveId())>=0) { + MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*, i*/); + return; + } + } + + // BoxWooden + if (inventory==InventoryType.BoxWooden) { + if ((i=InvWoodenBoxMoveId())>=0) { + MouseItemNameEvent(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + return; + } + } + + // Adv box + if (inventory==InventoryType.BoxAdv) { + if ((i=InvAdvBoxMoveId())>=0) { + MouseItemNameEvent(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + return; + } + } + + // Miner + if (inventory==InventoryType.Miner) { + if ((i=InvWoodenBoxMoveId())>=0) { + MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + return; + } + } + + // Charger || OxygenMachine + if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { + if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { + MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[0]/*.Id*/); + return; + } + } + + if (inventory==InventoryType.Barrel) { + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { + MouseItemNameEvent(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[0]/*.Id*/); + return; + } + + if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { + MouseItemNameEvent(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[1]/*.Id*/); + return; + } + } + + // Creative + if (inventory==InventoryType.Creative) { + if (!creativeTabCrafting){ + if ((i=GetInventoryIdCreative())>=0) { + MouseItemNameEvent(InventoryCreative[i]/*.Id*/); + return; + } + } + } + + // crafting + if (inventory==InventoryType.BasicInv + || (inventory==InventoryType.Creative && creativeTabCrafting) + || inventory==InventoryType.Desk + || inventory==InventoryType.SewingMachine + || inventory==InventoryType.Macerator + || inventory==InventoryType.FurnaceStone + || inventory==InventoryType.FurnaceElectric) { + if ((i=GetCraftingInventoryId())>=0) { + MouseItemNameEvent(InventoryCrafting[i]/*.Id*/); + return; + } + } + + mouseDrawItemTextInfo=false; + } + } + } + } + } + + void CreateGradientTexture() { + TextureSunGradient?.Dispose(); + + int height=Global.WindowHeight; + + int start=0; + Color[] colors=new Color[height]; + Color ColorBef; + + for (int p=1; pinventoryScrollbarValueCraftingMax) return; + + InventoryCrafting[i].SetPos(Global.WindowWidthHalf-300+4+40+xx+4+4, Global.WindowHeightHalf-200+2+4+200+8+yh+4+8); + + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + + void CreativeGetItems() { + creativeScrollbar.maxheight=(inventoryScrollbarValueCraftingMax/13+1)*40; + creativeScrollbar.height=4*40; + + if (mouseLeftRelease) { + // int max=((inventoryScrollbarValueCraftingMax+1)/13)*40; + + int i=((int)(creativeScrollbar.scale*(inventoryScrollbarValueCraftingMax-13*3))/13)*13; + + for (int y=0; y<4*40; y+=40) { + for (int x=0; x<13*40; x+=40) { + if (inventoryScrollbarValueCraftingMax1) { + if (mouseLeftDown) { + if (In40(Global.WindowWidthHalf-300+4+200+80+40+8+x*40,y*40+Global.WindowHeightHalf-200+2+4+200+8+8+AddH)) { + displayPopUpWindow=true; + PopUpWindowChoosingPotencialdItem=i; + PopUpWindowSelectedItem=-1; + ShowPopUpWindow(); + } + } + } + i++; + } + } + } + } + + void SelectItemCraftPlus() { + int AddH=35; + if (mouseLeftRelease) { + int xx =0, yh=0; + + for (int i=inventoryScrollbarValueCrafting; iinventoryScrollbarValueCraftingMax) break; + + if (In40(Global.WindowWidthHalf-300+4+40+4+xx,Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH)) { + + selectedCraftingItem=i; + + ItemInv itemToCraft=InventoryCrafting[i]; + + CurrentDeskCrafting=GameMethods.Craft(itemToCraft.Id); + SelectedCraftingRecipe=0; + SetNeed(); + return; + } + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + } + } + + void DropItemToPos(ItemNonInv i, DInt d) { + DroppedItems.Add(new Item{ + X=d.X, + Y=d.Y, + item=i, + Texture=ItemIdToTexture(i.Id) + }); + } + + void DropItemToPos(ItemNonInv i, int x, int y) { + DroppedItems.Add(new Item { + X=x, + Y=y, + item=i, + Texture=ItemIdToTexture(i.Id) + }); + } + + void DropItemToPos(ItemNonInv i, float x, float y) { + DroppedItems.Add(new Item { + X=(int)x, + Y=(int)y, + item=i, + Texture=ItemIdToTexture(i.Id) + }); + } + void ReSetInventoryCreativePositions() { + + int i=((int)(creativeScrollbar.scale*(inventoryScrollbarValueCraftingMax-13*3))/13)*13; + + for (int y=0; y<4*40; y+=40) { + for (int x=0; x<13*40; x+=40) { + if (inventoryScrollbarValueCraftingMax<=i)return; + //if (In40(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243)) { + // if (mouseLeftDown) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), Color.LightGray); + // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), ColorSmokeWhite); + //} else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), ColorWhite); + + // if (!invMove || (invMove && invStartInventory[invStartId]!=InventoryCreative[i])) { + InventoryCreative[i].SetPos(Global.WindowWidthHalf-300+4+60+x+4-16+4, Global.WindowHeightHalf-200+2+4+y+4+243+4); + // } + i++; + } + } + } + + bool InventoryAddOne(ushort index) { + + #region Nonstackable + if (GameMethods.IsItemInvNonStackable32(index)) { + for (int i=0; i new DInt{ X=Global.WindowWidth-36, Y=Global.WindowHeightHalf-80+ix*40+4 }; + + static Vector2 InventoryGetPosNormal5Vector2(int ix) => new Vector2{ X=Global.WindowWidth-36, Y=Global.WindowHeightHalf-80+ix*40+4 }; + + static DInt InventoryGetPosAdvBox(int i) { + int row=i/12; + return new DInt{ X=Global.WindowWidthHalf-300+10+5+5+row*40+4, Y=Global.WindowHeightHalf+23+(i-row*3)*40+4 }; + } + + static DInt InventoryGetPosBoxWooden(int i) { + int row=i/12; + return new DInt{ X=Global.WindowWidthHalf-300+59+row*40+4, Y=Global.WindowHeightHalf+59+(i-row*12)*40+4 }; + } + + static DInt InventoryGetPosShelf(int i) { + int row=i/3; + return new DInt{X=Global.WindowWidthHalf-300+38+(i-row*3)*40+4, Y=Global.WindowHeightHalf+20-2+25+row*40+4 }; + } + + static DInt InventoryGetPosBarrel(int i) { + if (i==0) return new DInt{ X=Global.WindowWidthHalf-300+119+4, Y=Global.WindowHeightHalf-198+250+4 }; + else return new DInt{ X=Global.WindowWidthHalf-300+119+4, Y=Global.WindowHeightHalf-198+250+64+4 }; + } + + static Vector2 InventoryGetPosBarrelVector2(int i) { + if (i==0) return new Vector2{ X=Global.WindowWidthHalf-300+119+4, Y=Global.WindowHeightHalf-198+250+4 }; + else return new Vector2{ X=Global.WindowWidthHalf-300+119+4, Y=Global.WindowHeightHalf-198+250+64+4 }; + } + + DInt InventoryGetPosNormal(int ix) { + if (ix<5) return InventoryGetPosNormal5(ix); + return InventoryGetPosNormalInv(ix); + } + + Vector2 InventoryGetPosNormalVector2(int ix) { + if (ix<5) return InventoryGetPosNormal5Vector2(ix); + return InventoryGetPosNormalInvVector2(ix); + } + + void ChangeLeavesForceEverything() { + + // Spring: branches -> flowering leaves or leaves + if (day>=80 && day<=100) { + for (int x=0; x Blossom + case (ushort)BlockId.AppleBranches: + leaves.Id=(ushort)BlockId.AppleLeavesBlossom; + leaves.Texture=TextureAppleBlossom; + leaves.Color=ColorWhite; + continue; + + case (ushort)BlockId.AppleLeaves: + leaves.Id=(ushort)BlockId.AppleLeavesBlossom; + leaves.Texture=TextureAppleBlossom; + leaves.Color=ColorWhite; + continue; + + case (ushort)BlockId.AppleLeavesWithApples: + leaves.Id=(ushort)BlockId.AppleLeavesBlossom; + leaves.Texture=TextureAppleBlossom; + leaves.Color=ColorWhite; + continue; + #endregion + + #region Plum -> Blossom + case (ushort)BlockId.PlumBranches: + leaves.Id=(ushort)BlockId.PlumLeavesBlossom; + leaves.Texture=TexturePlumBlossom; + leaves.Color=ColorWhite; + continue; + + case (ushort)BlockId.PlumLeaves: + leaves.Id=(ushort)BlockId.PlumLeavesBlossom; + leaves.Texture=TexturePlumBlossom; + leaves.Color=ColorWhite; + continue; + + case (ushort)BlockId.PlumLeavesWithPlums: + leaves.Id=(ushort)BlockId.PlumLeaves; + leaves.Texture=TexturePlumBlossom; + leaves.Color=ColorWhite; + continue; + #endregion + + #region Cherry -> Blossom + case (ushort)BlockId.CherryBranches: + leaves.Id=(ushort)BlockId.CherryLeavesBlossom; + leaves.Texture=TextureCherryBlossom; + leaves.Color=ColorWhite; + continue; + + case (ushort)BlockId.CherryLeaves: + leaves.Id=(ushort)BlockId.CherryLeavesBlossom; + leaves.Texture=TextureCherryBlossom; + continue; + + case (ushort)BlockId.CherryLeavesWithCherries: + leaves.Id=(ushort)BlockId.CherryLeavesBlossom; + leaves.Texture=TextureCherryBlossom; + leaves.Color=ColorWhite; + continue; + #endregion + + #region Oak, linden branches -> leaves + case (ushort)BlockId.OakBranches: + leaves.Id=(ushort)BlockId.OakLeaves; + leaves.Texture=TextureOakLeaves; + leaves.Color=ColorWhite; + continue; + + case (ushort)BlockId.LindenBranches: + leaves.Id=(ushort)BlockId.LindenLeaves; + leaves.Texture=TextureLindenLeaves; + leaves.Color=ColorWhite; + continue; + + case (ushort)BlockId.WillowBranches: + leaves.Id=(ushort)BlockId.WillowLeaves; + leaves.Texture=TextureWillowLeaves; + leaves.Color=ColorWhite; + continue; + #endregion + } + } + } + } + } + return; + } + + // Summer: set leaves + if (day>=100 && day<=280) { + for (int x=0; x Colorful + if (day>=280 && day<=340) { + Color[] colors=new Color[]{ + + new Color(144, 170, 6), + new Color(162, 163, 3), + new Color(212, 103, 25), + new Color(218, 120, 27), + new Color(254, 255, 74), + }; + + for (int x=0; x Branches + if (day<=80 || day>=340) { + for (int x=0; x100) { + t.SetCount=99; + f.SetCount=total-99; + invStartInventory[invStartId]=mouseItem; + } else { + t.SetCount=total; + } + } + return; + + case ItemInvBasic32 f: + { + ItemInvBasic32 t=(ItemInvBasic32)toA[toI]; + int total=f.GetCount+t.GetCount; + + if (total>100) { + t.SetCount=99; + f.SetCount=total-99; + invStartInventory[invStartId]=mouseItem; + } else { + t.SetCount=total; + } + } + return; + + case ItemInvFood16 f: + { + ItemInvFood16 t=(ItemInvFood16)toA[toI]; + int max=f.CountMaximum; + int total=f.GetCount+t.GetCount; + + if (total>max) { + t.SetCount=max; + f.SetCount=total-max; + invStartInventory[invStartId]=mouseItem; + } else { + t.SetCount=total; + } + } + return; + + //case ItemInvNonStackable16 f: + // { + // ItemInv t=toA[toI]; + // toA[toI]=mouseItem; + // invStartInventory[invStartId]=t; + // } + // return; + + //case ItemInvNonStackable32 f: + // { + // ItemInv t=toA[toI]; + // toA[toI]=mouseItem; + // invStartInventory[invStartId]=t; + // } + // return; + + //case ItemInvBasicColoritzed32NonStackable f: + // { + // ItemInv t=toA[toI]; + // toA[toI]=mouseItem; + // invStartInventory[invStartId]=t; + // } + // return; + + //case ItemInvTool32 f: + // { + // ItemInv t=toA[toI]; + // toA[toI]=mouseItem; + // invStartInventory[invStartId]=t; + // } + // return; + + default: + { + ItemInv t=toA[toI]; + toA[toI]=mouseItem; + invStartInventory[invStartId]=t; + } + return; + } + } else { + if (toA[toI].Id==0) { + + //invStartInventory[invStartId]=itemBlank; + //DInt p=new DInt(int.MinValue,int.MinValue); + //if (toA==InventoryNormal) { + // p=InventoryGetPosNormal(toI); + //} + //if (inventory==InventoryType.BasicInv) { + // if (toA==InventoryClothes) { + // p=InventoryGetPosClothes(toI); + // } + //} + //if (inventory==InventoryType.BoxWooden) { + // p=InventoryGetPosBoxWooden(); + //} + //if (inventory==InventoryType.BoxAdv) { + // p=InventoryGetPosAdvBox(); + //} + //#if DEBUG + //if (p.X==int.MinValue) throw new Exception("Unknown move to position"); + //#endif + DInt p=GetPosOfItemInInventories(toA,toI); + toA[toI]=mouseItem; + toA[toI].SetPos(p.X, p.Y); + mouseItem=itemBlank; + return; + } else { + ItemInv t=toA[toI]; + DInt destinationPos=t.GetPos(); + // Vector2 sourcePos=invStartInventory[invStartId].GetPosVector2(); + + toA[toI]=mouseItem; + mouseItem.SetPos(destinationPos.X, destinationPos.Y); + invStartInventory[invStartId]=t; + t.SetPos(startMovePos.X, startMovePos.Y); + // DInt p=null; + //// if (invStartInventory==InventoryNormal) { + // p=InventoryGetPosNormal(invStartId); + // // } + // if (inventory==InventoryType.BasicInv) { + // if (toA==InventoryClothes) { + // p=InventoryGetPosClothes(toI); + // } + // } + // if (inventory==InventoryType.BoxWooden) { + // p=InventoryGetPosBoxWooden(); + // } + // if (inventory==InventoryType.BoxAdv) { + // p=InventoryGetPosAdvBox(); + // } + // #if DEBUG + // if (p==null) throw new Exception("Unknown move to position"); + // #endif + // DInt p=GetPosOfItemInInventories(toA,toI); + mouseItem=itemBlank; + return; + } + } + } + + void InvMoveOne(ItemInv[] toA, int toI) { + Debug.WriteLine("InvMoveOne"); + if (mouseItem.Id==toA[toI].Id) { + switch (mouseItem) { + case ItemInvBasic16 f: + { + ItemInvBasic16 t=(ItemInvBasic16)toA[toI]; + if (t.GetCount==99) return; + + if (f.GetCount==1) { + t.SetCount=t.GetCount+1; + invStartInventory[invStartId]=itemBlank; + } else { + t.SetCount=t.GetCount+1; + // t.SetCount=t.GetCount-1; + } + return; + } + + + case ItemInvBasic32 f: + { + ItemInvBasic32 t=(ItemInvBasic32)toA[toI]; + if (t.GetCount==99) return; + + if (f.GetCount==1) { + t.SetCount=t.GetCount+1; + invStartInventory[invStartId]=itemBlank; + } else { + t.SetCount=t.GetCount+1; + //t.SetCount=t.GetCount-1; + } + return; + } + + case ItemInvFood16 f: + { + ItemInvFood16 t=(ItemInvFood16)toA[toI]; + int max=t.CountMaximum; + if (t.GetCount==max) return; + + if (f.GetCount==1) { + t.SetCount=t.GetCount+1; + invStartInventory[invStartId]=itemBlank; + } else { + t.SetCount=t.GetCount+1; + t.SetCount=t.GetCount-1; + } + return; + } + } + } else if (toA[toI].Id==(ushort)BlockId.None) { + switch (mouseItem) { + case ItemInvBasic16 f: + { + if (f.GetCount==1) { + DInt p=GetPosOfItemInInventories(toA, toI); + toA[toI]=new ItemInvBasic16(f.Texture, f.Id, 1, p.X, p.Y); + mouseItem=itemBlank; + } else { + int half=f.GetCount/2; + DInt p=GetPosOfItemInInventories(toA, toI); + toA[toI]=new ItemInvBasic16(f.Texture, f.Id, f.GetCount-half, p.X, p.Y); + f.SetCount=half; + } + return; + } + + case ItemInvBasic32 f: + { + if (f.GetCount==1) { + DInt p=GetPosOfItemInInventories(toA, toI); + toA[toI]=new ItemInvBasic32(f.Texture, f.Id, 1, p.X, p.Y); + mouseItem=itemBlank; + } else { + int half=f.GetCount/2; + DInt p=GetPosOfItemInInventories(toA, toI); + toA[toI]=new ItemInvBasic32(f.Texture, f.Id, f.GetCount-half, p.X, p.Y); + f.SetCount=half; + } + return; + } + + #if DEBUG + default: throw new Exception("Missing ItemInv category in switch"); + #endif + } + }else{ + switch (mouseItem) { + case ItemInvBasicColoritzed32NonStackable f: + invMove=false; + Vector2 toPos=toA[toI].GetPosVector2(); + invStartInventory[invStartId]=toA[toI]; + toA[toI]=mouseItem; + f.SetPos(toPos); + mouseItem=null; + invStartInventory[invStartId].SetPos(startMovePos); + mouseDrawItemTextInfo=true; + showMouseItemWhileMooving=false; + return; + + #if DEBUG + default: throw new Exception("Missing ItemInv category in switch"); + #endif + } + } + + invMove=false; + } + + void InvMoveHalf(ItemInv[] toA, int toI) { + Debug.WriteLine("InvMoveHalf"); + //if (fromA[fromI].Id!=0 && toA[toI].Id==0) { + switch (invStartInventory[invStartId]) { + case ItemInvBasic16 item: + { + if (item.GetCount>1) { + int half=(int)((float)item.GetCount/2); + int fromY=item.GetCount-half; + // DInt p=GetPosOfItemInInventories(invStartInventory,invStartId); + // InventoryGetPosNormal(toI); + toA[toI]=new ItemInvBasic16(item.Texture,item.Id,half, startMovePos.X, startMovePos.Y); + ((ItemInvBasic16)invStartInventory[invStartId]).SetCount=fromY; + return; + } + } + break; + + case ItemInvBasic32 item: + { + if (item.GetCount>1) { + int half=(int)((float)item.GetCount/2); + int fromY=item.GetCount-half; + DInt p=InventoryGetPosNormal(toI); + toA[toI]=new ItemInvBasic32(item.Texture,item.Id,half, p.X, p.Y); + ((ItemInvBasic32)invStartInventory[invStartId]).SetCount=fromY; + return; + } + } + break; + } + // } + invMove=false; + } + int InvWoodenBoxMoveId() { + // Wooden box + if (In(Global.WindowWidthHalf-300+59, Global.WindowHeightHalf+59, Global.WindowWidthHalf-300+59+(12*40), Global.WindowHeightHalf+59+40*2)) { + int row=(mouseRealPosX-(Global.WindowWidthHalf-300+59))/40; + int col=(mouseRealPosY-(Global.WindowHeightHalf+59))/40; + //Debug.WriteLine("[wooden] row: "+row+", col:"+col+", id: "+(row+col*12)); + return row+col*12; + } + + return -1; + } + int InvFurnaceStoneMoveId() { + if (In40(Global.WindowWidthHalf-300+4+1+40, Global.WindowHeightHalf-200+2+4+60)) return 0; + if (In40(Global.WindowWidthHalf-300+4+1+40+40, Global.WindowHeightHalf-200+2+4+60)) return 1; + if (In40(Global.WindowWidthHalf-300+4+1+40*2+40, Global.WindowHeightHalf-200+2+4+60)) return 2; + if (In40(Global.WindowWidthHalf-300+4+1+40+40, Global.WindowHeightHalf-200+2+4+60+40+8)) return 3; + + return -1; + } + int InvShelfMoveId() { + // Shelf + if (In(Global.WindowWidthHalf-300+38, Global.WindowHeightHalf+20-2+25, Global.WindowWidthHalf-300+38+40*3-1, Global.WindowHeightHalf+20-2+3*40+25-1)) { + int row=(mouseRealPosX-(Global.WindowWidthHalf-300+38))/40; + int col=(mouseRealPosY-(Global.WindowHeightHalf+20-2+25))/40; + return row+col*3; + } + + return -1; + } + + int InvAdvBoxMoveId() { + // Adv box + if (In(Global.WindowWidthHalf-300+20, Global.WindowHeightHalf+23, Global.WindowWidthHalf-300+20+12*40, Global.WindowHeightHalf+23+40*4)) { + int row=(mouseRealPosX-(Global.WindowWidthHalf-300+20))/40; + int col=(mouseRealPosY-(Global.WindowHeightHalf+23))/40; + // Debug.WriteLine("[adv] row: "+row+", col:"+col+", id: "+(row+col*12)); + return row+col*12; + } + + return -1; + } + + int InvClothesMoveId() { + // if (ix<4) return new DInt(Global.WindowWidthHalf-300+4+60+4,Global.WindowHeightHalf-200+2+4+4+ix*40); + // else return new DInt(Global.WindowWidthHalf-300+4+60+4+40,Global.WindowHeightHalf-200+2+4+4+40*(ix-4)); + + if (mouseRealPosY>Global.WindowHeightHalf-200+2+4+4+(4*40)) return -1; + if (mouseRealPosYGlobal.WindowWidthHalf-300+4+60+4){ + + if (mouseRealPosX textChooseItemWindow=new Text(Lang.Texts[160], Global.WindowWidthHalf-150-2+10, Global.WindowHeightHalf-134+10,BitmapFont.bitmapFont18); + + bool CanCraft(int c) { + foreach (CraftingIn n in CurrentDeskCrafting[SelectedCraftingRecipe].Input) { + if (n.SelectedItem==-1) return false; + ItemNonInv item=n.ItemSlot[n.SelectedItem]; + switch (item) { + case ItemNonInvTool t: + if (TotalItemsInInventoryForAllTypes(item.Id)maxInvCount) break; + + if (ix==i) return new Vector2{ X=Global.WindowWidthHalf-300+4+200+4+4+xx+4, Y=Global.WindowHeightHalf-200+2+4+yh+4 }; + + xx+=40; + + if (xx==9*40) { + xx=0; + yh+=40; + } + } + return Vector2.Zero; + } + + DInt InventoryGetPosNormalInv(int ix) { + int xx=0, yh=0; + + for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { + if (i>maxInvCount) break; + + if (ix==i) return new DInt{X= Global.WindowWidthHalf-300+4+200+4+4+xx+4,Y=Global.WindowHeightHalf-200+2+4+yh+4 }; + + xx+=40; + + if (xx==9*40) { + xx=0; + yh+=40; + } + } + return null/*DInt.NotDefined*/; + } + + static bool IsSameArray(ItemInv[] a1, ItemInv[] a2) { + if (a1==a2) return true; + if (a1.Length!=a2.Length) return false; + + int a1Len=a1.Length; + for (int i=0; iinventoryScrollbarValueCraftingMax) return -1; + if (In40(Global.WindowWidthHalf-300+4+40+xx+4+4, Global.WindowHeightHalf-200+2+4+200+8+yh+4+8)) return i; + + xx+=40; + + if (xx==6*40) { + xx=0; + yh+=40; + } + } + return -1; + } + void StartItemMove(ItemInv[] inv, int id) { + Debug.WriteLine("StartItemMove"); + if (inv[id].Id!=0) { + invMove = true; + startMovePos=inv[id].GetPos(); + mouseItem=inv[id]; + inv[id]=itemBlank; + invStartId=id; + invStartInventory=inv; + showMouseItemWhileMooving=true; + mouseDrawItemTextInfo=false; + + //Console.WriteLine("start: "+id); + } + } + void StartItemMoveHalf(ItemInv[] inv, int id) { + Debug.WriteLine("StartItemMoveHalf"); + if (id!=0) { + invMove = true; + invStartId=id; + invStartInventory=inv; + + startMovePos=inv[id].GetPos(); + + showMouseItemWhileMooving=true; + mouseDrawItemTextInfo=false; + + switch (inv[id]) { + case ItemInvBasic16 i: + { + int c=i.GetCount; + if (c==1) { + mouseItem=new ItemInvBasic16(i.Texture, i.Id, 1, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } else { + int stay=c/2; + DInt z=GetPosOfItemInInventories(inv,id); + inv[id]=new ItemInvBasic16(i.Texture, i.Id, stay, z.X, z.Y); + mouseItem=new ItemInvBasic16(i.Texture, i.Id, c-stay, mouseRealPosX, mouseRealPosY); + } + } + return; + + case ItemInvBasic32 i: + { + int c=i.GetCount; + if (c==1) { + mouseItem=new ItemInvBasic32(i.Texture, i.Id, 1, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } else { + int stay=c/2; + ((ItemInvBasic32)inv[id]).SetCount=stay; + // inv[id]=new ItemInvBasic32(i.Texture, i.Id, stay, mouseRealPosX, mouseRealPosY); + mouseItem=new ItemInvBasic32(i.Texture, i.Id, c-stay, mouseRealPosX, mouseRealPosY); + } + } + return; + + case ItemInvFood16 i: + { + int c=i.GetCount; + if (c==1) { + mouseItem=new ItemInvFood16(i.Texture, i.Id, 1, i.CountMaximum, i.GetDescay, i.DescayMaximum, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } else { + int stay=c/2; + inv[id]=new ItemInvFood16(i.Texture, i.Id, stay, i.CountMaximum, i.GetDescay, i.DescayMaximum, mouseRealPosX, mouseRealPosY); + mouseItem=new ItemInvFood16(i.Texture, i.Id, c-stay, i.CountMaximum, i.GetDescay, i.DescayMaximum, mouseRealPosX, mouseRealPosY); + } + } + return; + + case ItemInvTool16 i: + { + mouseItem=new ItemInvTool16(i.Texture, i.Id, 1, i.Maximum, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } + return; + + case ItemInvTool32 i: + { + mouseItem=new ItemInvTool32(i.Texture, i.Id, 1, i.Maximum, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } + return; + + case ItemInvNonStackable16 i: + { + mouseItem=new ItemInvNonStackable16(i.Texture, i.Id, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } + return; + + case ItemInvNonStackable32 i: + { + mouseItem=new ItemInvNonStackable32(i.Texture, i.Id, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } + return; + + case ItemInvBasicColoritzed32NonStackable i: + { + mouseItem=new ItemInvBasicColoritzed32NonStackable(i.Texture, i.Id, i.color, mouseRealPosX, mouseRealPosY); + inv[id]=itemBlank; + } + return; + } + } + } + void MouseItemNameEvent(ItemInv item) { + if (item==null) return; + ushort id= item.Id; + if (id!=0) mouseDrawItemTextInfo=true; + + if (mouseItemId!=id) { + if (id==0) { + mouseItemId=id; + mouseDrawItemTextInfo=false; + return; + } + + int langid=GameMethods.GetItemNameId(id); + + if (langid==-1) { + #if DEBUG + mouseDrawItemTextInfo=true; + mouseItemId=id; + mouseItemName=Lang.Texts[999]; + // mouseItemNameWidth=(int)spriteFont_small.MeasureString(mouseItemName).X; + + itemText=new Text(mouseItemName,0,0,BitmapFont.bitmapFont18); + mouseItemNameWidth=(int)itemText.MeasureX(); + #else + mouseDrawItemTextInfo=false; + #endif + } else { + mouseDrawItemTextInfo=true; + mouseItemId=id; + mouseItemName=Lang.Texts[langid]; + // mouseItemNameWidth=(int)spriteFont_small.MeasureString(mouseItemName).X; + if (debug) { + string add=""; + switch (item) { + case ItemInvFood16 food16: + add="ItemInvFood16"; + add+='\n'; + add=food16.GetCount+"/"+food16.CountMaximum; + add+='\n'; + add+=food16.GetDescay+"/"+food16.DescayMaximum; + break; + + case ItemInvFood32 food32: + add="ItemInvFood32"; + add+='\n'; + add=food32.GetCount+"/"+food32.CountMaximum; + add+='\n'; + add+=food32.GetDescay+"/"+food32.DescayMaximum; + break; + } + itemText=new Text(mouseItemName+'\n'+add, 0, 0, BitmapFont.bitmapFont18); + } else { + itemText=new Text(mouseItemName, 0, 0, BitmapFont.bitmapFont18); + } + mouseItemNameWidth=(int)itemText.MeasureX(); + } + } + } + } +} \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/PlanetSystem.cs b/rabcrClient/WindowsAndStates/GameStates/Game/PlanetSystem.cs index a923ecc..8edaf70 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/PlanetSystem.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/PlanetSystem.cs @@ -64,7 +64,7 @@ public class Ellipsoid { } //double[] CalculatePos(double angle, double Inclination, double Aphelion, double Perihelion) { - // return ; + // return; //} double z; public void Draw(SpriteBatch sb, Double2 pos, Color c,double zoom) { @@ -161,7 +161,6 @@ readonly Color // Planet canOrbit, mercur, venus, earth, mars, jupiter, saturn, uran, neptun, pluto, moon, io, callisto, galimedes, europa, titan, triton,station; // ContentManager Content; Texture2D /*pixel,*/ /*SunTexture,*/ /*rocketTexture,*/ buttonCenter, buttonAround; - // Vector2 ; Double2 windowPosition=new Double2(0,0)/*,*//*rocketPos=new Double2(0,0), selectedPos=new Double2(0,0),*/ /*mousePos=new Double2(0,0)*//*, lastPos=new Double2(0,0)*/; SpriteFont spriteFont_medium,spriteFont_small; AstronomicalObject[] sun; @@ -318,9 +317,14 @@ readonly Color Console.WriteLine(pathToWorld+@"\Inventory.txt"); if (File.Exists(pathToWorld+@"\Inventory.txt")) {Console.WriteLine("txt"); using (StreamReader sr = new StreamReader(pathToWorld+@"\Inventory.txt")) { - foreach (DInt x in Inventory) { - x.X= int.Parse(sr.ReadLine()); - x.Y= int.Parse(sr.ReadLine()); + //foreach (DInt x in Inventory) { + // x.X= int.Parse(sr.ReadLine()); + // x.Y= int.Parse(sr.ReadLine()); + //} + for(int i = 0; i < Inventory.Count; i+= 1) // for each file + { + Inventory[i].X= int.Parse(sr.ReadLine()); + Inventory[i].Y= int.Parse(sr.ReadLine()); } } } @@ -643,7 +647,9 @@ readonly Color void InventoryRemove(int x, int y) { int needToRemove=y; - foreach (DInt i in Inventory){ + for (int o = 0; o < Inventory.Count; o++){ + // foreach (DInt i in Inventory){ + DInt i = Inventory[o]; if (i.X==x) { if (i.Y FallingLeaves; @@ -952,7 +962,7 @@ static Color bool windRirectionRight; Effect EffectClouds; // Texture2D TextureClouds; - readonly List<(Color, float)> Gradient=new List<(Color, float)>{ + readonly List<(Color, float)> Gradient=new() { (Color.CornflowerBlue, 0), // (new Color(40, 120, 229), 152/542f), (new Color((byte)103, (byte)160, (byte)209), 268/542f), @@ -963,20 +973,20 @@ static Color }; //Texture2D TextureSunGradient; - readonly Color ColorNightRain=new Color((byte)218, (byte)227, (byte)235/*40,52,63*/); - readonly Color ColorNight=new Color((byte)222, (byte)233, (byte)237/*27,171,236*/); + readonly Color ColorNightRain=new((byte)218, (byte)227, (byte)235/*40,52,63*/); + readonly Color ColorNight=new((byte)222, (byte)233, (byte)237/*27,171,236*/); - readonly Color ColorDayRain=new Color((byte)233, (byte)238, (byte)243);//Color.Lerp(new Color(51,64,77), Color.WhiteSmoke, 0.5f); + readonly Color ColorDayRain=new((byte)233, (byte)238, (byte)243);//Color.Lerp(new Color(51,64,77), Color.WhiteSmoke, 0.5f); readonly Color ColorDay= FastMath.Lerp(new Color((byte)240, (byte)243, (byte)246), Color.White, 0.5f);//Color.Lerp(new Color(96,163,231), Color.White, 0.9f); - readonly Color ColorSun=new Color((byte)246, (byte)241, (byte)229);//Color.Lerp(new Color(244,199,74), Color.White, 0.9f); - readonly Color ColorSunRain=new Color((byte)242, (byte)239, (byte)230);// Color.Lerp(new Color(76,69,50), Color.WhiteSmoke, 0.5f); - Color ColorDayRainBack=new Color((byte)114, (byte)176, (byte)214); + readonly Color ColorSun=new((byte)246, (byte)241, (byte)229);//Color.Lerp(new Color(244,199,74), Color.White, 0.9f); + readonly Color ColorSunRain=new((byte)242, (byte)239, (byte)230);// Color.Lerp(new Color(76,69,50), Color.WhiteSmoke, 0.5f); + Color ColorDayRainBack=new((byte)114, (byte)176, (byte)214); float swimmingTicks; // Texture2D TextureBarBarrel, pixel; - FastRandom random; + // FastRandom FastRandom; float handAngle; - Color ColorLightBlue=Color.LightBlue; + //Color ColorLightBlue=Color.LightBlue; DInt startMovePos; const int HandSize=18; ItemInvBlank itemBlank; @@ -1009,9 +1019,9 @@ const int Vector2 Vector2Zero; Color colorAlpha; List GunShots; - Color - ColorWhite, - ColorSmokeWhite=new Color((byte)240,(byte)240,(byte)240); + static readonly Color + // Color.White, + ColorSmokeWhite=new((byte)240,(byte)240,(byte)240); bool mousePosChanged; bool cameraMove; @@ -1032,7 +1042,7 @@ const int // Texture2D TextureItemEgg, TextureItemBoiledEgg, TextureWaterGraystyle, TextureChristmasStar; // readonly int craftingScrollbarValue; bool easter; - bool radioplaying=false; + bool radioplaying=false; bool creativeTabCrafting=true; float scrollBarCreative; Text textDie, textDieInfo, textRespawnIn, textOpenInventory, textChooseItemWindow; @@ -1140,8 +1150,9 @@ const int float windForce; int dayLenght=4800; const int hour=200; - readonly List lightsFull=new List(); - readonly List lightsHalf=new List(); + readonly List + lightsFull=new(), + lightsHalf=new(); // Rain //int rainDuration; @@ -1212,7 +1223,7 @@ const int buttonCraft1x, buttonCraft10x, buttonCraft100x, - + buttonContinue, buttonExit, buttonUseGiftCode, @@ -1236,7 +1247,7 @@ const int buttonInvChest, buttonInvLegs, buttonInvShoes, - buttonInvUnderwear; + buttonInvUnderwear; #endregion #region Window @@ -1250,7 +1261,7 @@ const int RenderTarget2D sunLightTarget, modificatedLightTarget; - readonly BlendState Multiply = new BlendState { + readonly BlendState Multiply = new() { AlphaSourceBlend=Blend.Zero, AlphaDestinationBlend=Blend.SourceColor, ColorSourceBlend=Blend.Zero, @@ -1276,7 +1287,7 @@ const int Vector2 mousePos; int mousePosRoundX, mousePosRoundY; - readonly DInt mousePosDiv16=new DInt(); + readonly DInt mousePosDiv16=new(); // mousePosRound=new DInt(), // mouseRealPos=new DInt(); public static int mouseRealPosX, mouseRealPosY; @@ -1340,96 +1351,90 @@ const int #region Colors readonly Color - color_r200_g200_b200_a100= new Color((byte)200,(byte)200,(byte)200,(byte)100), - color_r0_g0_b0_a200 = new Color((byte)0,(byte)0,(byte)0,(byte)200), - color_r10_g140_b255 = new Color((byte)10,(byte)140,(byte)255), - color_r128_g128_b128= new Color((byte)128,(byte)128,(byte)128), - color_r128_g128_b128_a128= new Color((byte)128,(byte)128,(byte)128,(byte)128), - color_r150_g150_b150= new Color((byte)150,(byte)150,(byte)150), - color_r0_g0_b0_a100 = new Color((byte)0,(byte)0,(byte)0,(byte)100), - color_r255_g0_b0_a100 = new Color((byte)255, (byte)0, (byte)0, (byte)100), - color_r200_g200_b200=new Color((byte)200, (byte)200, (byte)200), - lampColorLight=new Color((byte)255, (byte)255, (byte)220, (byte)255); + color_r200_g200_b200_a100= new((byte)200,(byte)200,(byte)200,(byte)100), + color_r0_g0_b0_a200 = new((byte)0,(byte)0,(byte)0,(byte)200), + color_r10_g140_b255 = new((byte)10,(byte)140,(byte)255), + color_r128_g128_b128= new((byte)128,(byte)128,(byte)128), + color_r128_g128_b128_a128= new((byte)128,(byte)128,(byte)128,(byte)128), + color_r150_g150_b150= new((byte)150,(byte)150,(byte)150), + color_r0_g0_b0_a100 = new((byte)0,(byte)0,(byte)0,(byte)100), + color_r255_g0_b0_a100 = new((byte)255, (byte)0, (byte)0, (byte)100), + color_r200_g200_b200=new((byte)200, (byte)200, (byte)200), + lampColorLight=new((byte)255, (byte)255, (byte)220, (byte)255); #endregion #region Other int walkingSoundDuration; - // Vector2 vector_x0_y4; - #endregion - #endregion - SoundEffectInstance SoundWind, SoundRain; - bool snowing; - enum Precipitation : byte { - None, - Snowing, - Rain, - // Storm - } - Precipitation CurrentPrecipitation=Precipitation.None; + // Vector2 vector_x0_y4; + #endregion + #endregion - void StopRaining() { + #region Weather changes + void StopRaining() { if (Global.HasSoundGraphics) { - if (SoundRain.IsLooped){ + if (SoundRain.IsLooped){ SoundRain.IsLooped=false; SoundRain.Stop(); } } } - void StartRaining() { + void StartRaining() { if (Global.HasSoundGraphics) { - if (!SoundRain.IsLooped){ + if (!SoundRain.IsLooped){ SoundRain.Play(); SoundRain.IsLooped=true; } } } - void StopSnowing() { - + void StopSnowing() { + } - void StartSnowing() { - + void StartSnowing() { + } - void StopWind() { + void StopWind() { if (Global.HasSoundGraphics) { - if (SoundWind.IsLooped){ + if (SoundWind.IsLooped){ SoundWind.IsLooped=false; SoundWind.Stop(); } } } - void StartWind() { + void StartWind() { if (Global.HasSoundGraphics) { - if (!SoundWind.IsLooped){ + if (!SoundWind.IsLooped){ SoundWind.Play(); SoundWind.IsLooped=true; } } } - - - public SinglePlayer(string dir) => pathToWorld=dir+"\\"; + #endregion + + public SinglePlayer(string dir) => pathToWorld=dir+"\\"; public unsafe override void Init() { - random=Rabcr.random; FallingLeaves=new List(); Particles=new List(); WavingPlants=new List(); + Fullscreen=new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight); - ConstNightAlpha=0.1f+0.4f*Setting.NightBrightness; Vector2_2=new Vector2(2,2); + float m=0.5f+Setting.NightBrightness*0.5f; + ConstNightAlpha=0.1f+0.4f*Setting.NightBrightness; ColorNightColorBack=new Color(m, m, m); ColorNightColorBackRain=new Color(m, m, (int)(m*1.1f+0.5f)); itemBlank=new ItemInvBlank(); - ColorWhite=Color.White; - pixel=Rabcr. Pixel; + //Color.White=Color.White; + pixel=Rabcr.Pixel; Vector2Zero=Vector2.Zero; + EffectClouds=Content.Load(Setting.StyleName+"/Effects/Clouds"); if (File.Exists(pathToWorld+"LastWorld.txt")) world=File.ReadAllText(pathToWorld+"LastWorld.txt"); @@ -1444,7 +1449,7 @@ enum Precipitation : byte { CountGravity(new GeneratePlanetSystem().SunSystem()); easter=IsEaster(); - + SoundWind=SoundEffects.Wind.CreateInstance(); SoundRain=SoundEffects.Rain.CreateInstance(); @@ -1454,9 +1459,9 @@ enum Precipitation : byte { TextureTestTube=GetDataTexture(@"Items\Dye\TestTube"); TextureChristmasBall=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBall"); - TextureChristmasBallYellow=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallYellow"); - TextureChristmasBallOrange=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallOrange"); - TextureChristmasBallRed=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallRed"); + TextureChristmasBallYellow=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallYellow"); + TextureChristmasBallOrange=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallOrange"); + TextureChristmasBallRed=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallRed"); TextureChristmasBallPurple=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallPurple"); TextureChristmasBallPink=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallPink"); TextureChristmasBallLightGreen=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallLightGreen"); @@ -1465,11 +1470,11 @@ enum Precipitation : byte { TextureAngelHair=GetDataTexture(@"Items/Decorations/AngelHair"); TextureAngelHairWithSpruceLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/AngelHair"); - - TextureChristmasBallGrayWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Gray"); - TextureChristmasBallYellowWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Yellow"); - TextureChristmasBallOrangeWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Orange"); - TextureChristmasBallRedWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Red"); + + TextureChristmasBallGrayWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Gray"); + TextureChristmasBallYellowWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Yellow"); + TextureChristmasBallOrangeWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Orange"); + TextureChristmasBallRedWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Red"); TextureChristmasBallPurpleWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Purple"); TextureChristmasBallPinkWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/Pink"); TextureChristmasBallLightGreenWithLeaves=GetDataTexture(@"Blocks/TreeBlocks/Spruce/ChristmasBalls/LightGreen"); @@ -1480,7 +1485,7 @@ enum Precipitation : byte { TextureParrotFly=GetDataTexture(@"Animals/Parrot/Flying"); CreateGradientTexture(); - + #region Imventory TextureBin=GetDataTexture("Inventories/bin"); TextureSelectCrafting=GetDataTexture("Buttons/Other/SelectyCrafting"); @@ -2169,7 +2174,7 @@ enum Precipitation : byte { lightMaskLine2Texture=GetDataTexture("Particles/lightMaskLine2"); lightMaskTexture=GetDataTexture("Particles/lightMask"); lightMask2Texture=GetDataTexture("Particles/lightMask2"); - + lightMaskRoundTexture=GetDataTexture("Particles/lightMaskRound"); solidFuelSmokeTexture=GetDataTexture("Particles/AnimationsRocket/Solid"); @@ -2279,7 +2284,7 @@ enum Precipitation : byte { TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/FormalShoes"), TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/FormalShoes"), TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/FormalShoes"), - Color=ColorWhite, + Color=Color.White, }; ClothesPumps=new ClothesTypeBoots{ @@ -2300,7 +2305,7 @@ enum Precipitation : byte { TextureWalking=GetDataTexture("ClothesAnimations/Walking/Feet/SpaceBoots"), TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Feet/SpaceBoots"), TextureStatic=GetDataTexture("ClothesAnimations/Static/Feet/SpaceBoots"), - Color=ColorWhite, + Color=Color.White, }; #endregion @@ -2336,7 +2341,7 @@ enum Precipitation : byte { TextureWalking=GetDataTexture("ClothesAnimations/Walking/Legs/SpaceTrousers"), TextureSwimming=GetDataTexture("ClothesAnimations/Swimming/Legs/SpaceTrousers"), TextureStatic=GetDataTexture("ClothesAnimations/Static/Legs/SpaceTrousers"), - Color=ColorWhite, + Color=Color.White, }; #endregion @@ -2385,17 +2390,17 @@ enum Precipitation : byte { ClothesHad=new ClothesTypeHelmet{ TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Had"), TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Had"), - Color=ColorWhite, + Color=Color.White, }; ClothesCrown=new ClothesTypeHelmet{ TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/Crown"), TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/Crown"), - Color=ColorWhite, + Color=Color.White, }; ClothesSpaceHelmet=new ClothesTypeHelmet{ TextureWalkingOrSwimming=GetDataTexture("ClothesAnimations/Walking/Head/SpaceHelmet"), TextureStatic=GetDataTexture("ClothesAnimations/Static/Head/SpaceHelmet"), - Color=ColorWhite, + Color=Color.White, }; #endregion @@ -2487,7 +2492,7 @@ enum Precipitation : byte { TextureWalking=GetDataTexture("ClothesAnimations/Walking/ChestTop/"+dirChest+"/SpaceSuit"), TextureStatic=GetDataTexture("ClothesAnimations/Static/ChestTop/"+dirChest+"/SpaceSuit"), Texture2DClothHand=GetDataTexture("ClothesAnimations/Hand/ChestTop/SpaceSuit"), - Color=ColorWhite, + Color=Color.White, handSize=HandClothSize.Full, }; #endregion @@ -2534,7 +2539,7 @@ enum Precipitation : byte { buttonExit=new GameButtonSmall(Textures.ButtonCenter){ Text=Lang.Texts[1478] }; buttonUseGiftCode=new GameButtonSmall(Textures.ButtonCenter){ Text=Lang.Texts[1476] }; buttonAcheavements=new GameButtonSmall(Textures.ButtonCenter){ Text=Lang.Texts[1477] }; - + { Texture2D button=GetDataTexture("Buttons/Other/Craft"); buttonNext=new GameButtonSmall(button) { Text="->" }; @@ -2587,16 +2592,15 @@ enum Precipitation : byte { #region Files if (File.Exists(pathToWorld+@"\Options.txt")) { - using (StreamReader sr = new StreamReader(pathToWorld+@"\Options.txt")) { - Global.WorldDifficulty=int.Parse(sr.ReadLine()); - sr.ReadLine(); - startUpItems=int.Parse(sr.ReadLine()); - } - } + using StreamReader sr = new(pathToWorld + @"\Options.txt"); + Global.WorldDifficulty = int.Parse(sr.ReadLine()); + sr.ReadLine(); + startUpItems = int.Parse(sr.ReadLine()); + } if (File.Exists(pathToWorld+@"\Settings.txt")) { // int x,y; - using (StreamReader sr = new StreamReader(pathToWorld+@"\Settings.txt")) { + using (StreamReader sr = new(pathToWorld+@"\Settings.txt")) { /* string version =*/ sr.ReadLine(); //if (version!=Release.Version){ // System.Windows.Forms.MessageBox.Show(Lang.Texts[344],Lang.Texts[343]); @@ -2641,7 +2645,7 @@ enum Precipitation : byte { fly =bool.Parse(sr.ReadLine()); time =int.Parse(sr.ReadLine()); if (time>dayLenght)time=0; - colorAlpha = ColorWhite; + colorAlpha = Color.White; barWater = float.Parse(sr.ReadLine()); barEat = float.Parse(sr.ReadLine()); barHeart = float.Parse(sr.ReadLine()); @@ -2673,11 +2677,11 @@ enum Precipitation : byte { SetPlayerPos(PlayerX, PlayerY); } else { - SetPlayerPos(random.Int(TerrainLength*16), 600); + SetPlayerPos(FastRandom.Int(TerrainLength*16), 600); time=(int)(6.5f*hour); - precipitation=random.Bool(); - changeRain=random.Int(1250); + precipitation=FastRandom.Bool(); + changeRain=FastRandom.Int(1250); } if (File.Exists(pathToWorld+@"\Clothes.bin")) { @@ -2764,7 +2768,7 @@ enum Precipitation : byte { fixed (byte* pointer=bytes) { byte* current=pointer; - for ( ; i<5; i++) { + for (; i<5; i++) { ushort id = (ushort)(*current++ | (*current++ << 8)); if (id==0) InventoryNormal[i]=itemBlank; else { @@ -2819,7 +2823,7 @@ enum Precipitation : byte { #endif } } - for ( ; i0) { InventoryClothes[InventoryClothesSlotBra]=new ItemInvBasicColoritzed32NonStackable(TextureItemBra, (ushort)Items.Bra, rndColor, InventoryGetPosClothesVector2(InventoryClothesSlotBra)); }else{ InventoryClothes[InventoryClothesSlotBra]=itemBlank; } - switch (random.Int(3)) { + switch (FastRandom.Int(3)) { // Dress type case 0: - InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemDress,(ushort)Items.Dress, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); + InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemDress,(ushort)Items.Dress, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); InventoryClothes[InventoryClothesSlotTrousers]=itemBlank; break; @@ -3097,25 +3101,25 @@ enum Precipitation : byte { default: { // On chest - if (random.Bool()) InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemShirt,(ushort)Items.Shirt, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); - else InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemTShirt,(ushort)Items.TShirt, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); + if (FastRandom.Bool()) InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemShirt,(ushort)Items.Shirt, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); + else InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemTShirt,(ushort)Items.TShirt, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); // on legs - switch (random.Int4()) { + switch (FastRandom.Int4()) { case 0: - InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemSkirt, (ushort)Items.Skirt, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); + InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemSkirt, (ushort)Items.Skirt, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); break; case 1: - InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemShorts, (ushort)Items.Shorts, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); + InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemShorts, (ushort)Items.Shorts, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); break; case 2: - InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemArmyTrousers, (ushort)Items.ArmyTrousers, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); + InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemArmyTrousers, (ushort)Items.ArmyTrousers, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); break; case 3: - InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemJeans, (ushort)Items.Jeans, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); + InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemJeans, (ushort)Items.Jeans, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); break; } @@ -3123,17 +3127,17 @@ enum Precipitation : byte { InventoryClothes[InventoryClothesSlotUnderwear]=new ItemInvBasicColoritzed32NonStackable(TextureItemPanties, (ushort)Items.Panties, rndColor, InventoryGetPosClothesVector2(InventoryClothesSlotUnderwear)); // Shoes - switch (random.Int(3)) { + switch (FastRandom.Int(3)) { case 0: - InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemSneakers, (ushort)Items.Sneakers,Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); + InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemSneakers, (ushort)Items.Sneakers, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); break; case 1: - InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemFormalShoes, (ushort)Items.FormalShoes,Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); + InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemFormalShoes, (ushort)Items.FormalShoes, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); break; case 2: - InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemPumps, (ushort)Items.Pumps,Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); + InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemPumps, (ushort)Items.Pumps, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); break; } } @@ -3146,20 +3150,20 @@ enum Precipitation : byte { } else { // On chest - if (random.Bool()) InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemShirt,(ushort)Items.Shirt,Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); - else InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemTShirt,(ushort)Items.TShirt,Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); + if (FastRandom.Bool()) InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemShirt,(ushort)Items.Shirt,FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); + else InventoryClothes[InventoryClothesSlotTShirt]=new ItemInvBasicColoritzed32NonStackable(TextureItemTShirt,(ushort)Items.TShirt,FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTShirt)); // on legs - if (random.Bool()) InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemArmyTrousers, (ushort)Items.ArmyTrousers, Rabcr.random.ColorMonogame(),InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); - else InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemJeans, (ushort)Items.Jeans,Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); + if (FastRandom.Bool()) InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemArmyTrousers, (ushort)Items.ArmyTrousers, FastRandom.ColorMonogame(),InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); + else InventoryClothes[InventoryClothesSlotTrousers]=new ItemInvBasicColoritzed32NonStackable(TextureItemJeans, (ushort)Items.Jeans,FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotTrousers)); // Underwear - if (random.Bool()) InventoryClothes[InventoryClothesSlotUnderwear]=new ItemInvBasicColoritzed32NonStackable(TextureItemBoxerShorts, (ushort)Items.BoxerShorts, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotUnderwear)); - else InventoryClothes[InventoryClothesSlotUnderwear]=new ItemInvBasicColoritzed32NonStackable(TextureItemUnderpants, (ushort)Items.Underpants, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotUnderwear)); + if (FastRandom.Bool()) InventoryClothes[InventoryClothesSlotUnderwear]=new ItemInvBasicColoritzed32NonStackable(TextureItemBoxerShorts, (ushort)Items.BoxerShorts, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotUnderwear)); + else InventoryClothes[InventoryClothesSlotUnderwear]=new ItemInvBasicColoritzed32NonStackable(TextureItemUnderpants, (ushort)Items.Underpants, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotUnderwear)); // Shoes - if (random.Bool()) InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemSneakers, (ushort)Items.Sneakers, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); - else InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemFormalShoes, (ushort)Items.FormalShoes, Rabcr.random.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); + if (FastRandom.Bool()) InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemSneakers, (ushort)Items.Sneakers, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); + else InventoryClothes[InventoryClothesSlotShoes]=new ItemInvBasicColoritzed32NonStackable(TextureItemFormalShoes, (ushort)Items.FormalShoes, FastRandom.ColorMonogame(), InventoryGetPosClothesVector2(InventoryClothesSlotShoes)); InventoryClothes[InventoryClothesSlotCap]=itemBlank; InventoryClothes[InventoryClothesSlotBra]=itemBlank; @@ -3168,8 +3172,8 @@ enum Precipitation : byte { } } - - BiomePlayer=GetBiomeByPos((int)(PlayerX/16)); + + BiomePlayer=GetBiomeByPos((int)(PlayerX*divider_16)); BiomeCurrent=BiomePlayer.Name; GC.Collect(); @@ -3180,7 +3184,7 @@ enum Precipitation : byte { public override void Shutdown() { if (dontDoGame) return; dontDoGame=true; - + if (MediaPlayer.State==MediaState.Playing) MediaPlayer.Stop(); if (SoundWind.State==SoundState.Playing) SoundWind.Stop(); @@ -3218,7 +3222,7 @@ enum Precipitation : byte { SaveInventory("Inventory",InventoryNormal); { - List bytes=new List(); + List bytes=new(); ushort count=(ushort)DroppedItems.Count; bytes.Add((byte)count); bytes.Add((byte)(count<<8)); @@ -3237,7 +3241,7 @@ enum Precipitation : byte { cpuUsage?.Dispose(); modificatedLightTarget.Dispose(); - sunLightTarget.Dispose(); + sunLightTarget.Dispose(); TextureSunGradient?.Dispose(); } @@ -3390,9 +3394,9 @@ enum Precipitation : byte { if (newKeyboardState.IsKeyDown(Setting.KeyExit)) { if (oldKeyboardState.IsKeyUp(Setting.KeyExit)) { - if (inventory==InventoryType.Normal){ + if (inventory==InventoryType.Normal){ inventory=InventoryType.GameMenu; - + if (Constants.AnimationsControls) animationInvBack=0; else animationInvBack=100; @@ -3403,10 +3407,10 @@ enum Precipitation : byte { // Exit game buttonExit.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60-2+50); - + // Acheavements buttonAcheavements.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60+60-2+50); - + // Use a gift code buttonUseGiftCode.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60+60+60-2+50); @@ -3414,9 +3418,9 @@ enum Precipitation : byte { buttonClose.Position.Y=Global.WindowHeightHalf-232+1+50; } textOpenInventory=new Text(Lang.Texts[114], Global.WindowWidthHalf-300-2+10+100+50, Global.WindowHeightHalf-234+10-3+50,BitmapFont.bitmapFont18); - } else { + } else { // Double Ecs press - if (inventory==InventoryType.GameMenu) { + if (inventory==InventoryType.GameMenu) { Shutdown(); Rabcr.GoTo(new Menu(new MenuSingleplayer())); } else inventory=InventoryType.Normal; @@ -3448,14 +3452,14 @@ enum Precipitation : byte { } #endregion if (precipitation) { - float bef=Temperature; + float bef=Temperature; Temperature=GetTemperature(BiomePlayer.Name); - if (Temperature<0 && bef>=0) { + if (Temperature<0 && bef>=0) { StopRaining(); StartSnowing(); } - if (Temperature>0 && bef<=0) { + if (Temperature>0 && bef<=0) { StartRaining(); StopSnowing(); } @@ -3505,7 +3509,7 @@ enum Precipitation : byte { BiomePlayer=GetBiomeByPos((int)(PlayerX/16)); changePosition=false; - + //swimmingTicks+=0.016f; //if (swimmingTicks>1)swimmingTicks-=1; @@ -3517,7 +3521,7 @@ enum Precipitation : byte { barOxygen--; if (barOxygen<0)barOxygen=0; } else { - + if (barOxygen>32) { barHeart+=.08f; if (barHeart>32) Die(Lang.Texts[161]); @@ -3620,7 +3624,7 @@ enum Precipitation : byte { //Console.WriteLine("a touch Playerx"+PlayerX); speed=0; playerState=0; - } + } changePosition=true; @@ -3646,7 +3650,7 @@ enum Precipitation : byte { speed=0; playerState=0; - } + } changePosition=true; } @@ -3854,8 +3858,8 @@ enum Precipitation : byte { #region Game - destruction + place blocks + drop item bool notshot=true; if (Rabcr.Game.IsActive) { - if (mouseRightDown) MouseRightAction(); - if (mouseRightPress) ItemEat(); + if (mouseRightDown) MouseRightAction(); + if (mouseRightPress) ItemEat(); if (mouseLeftPress) { if (InventoryNormal[boxSelected].Id==(ushort)Items.Gun) { @@ -4223,7 +4227,7 @@ enum Precipitation : byte { case ItemInvBasic16 i1: if (i1.GetCount>1) { i1.SetCount=i1.GetCount-1; - } else { + } else { InventoryNormal[boxSelected]=itemBlank; } if (i1.GetCount>0){ @@ -4390,19 +4394,19 @@ enum Precipitation : byte { for (int i = 0; i0) { for (int i = 0; i0.05f) + if (energy/*((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy*/>0.05f) CraftingEventsCraft(); if (buttonClose.Update()) inventory=0; } @@ -5314,24 +5315,24 @@ enum Precipitation : byte { #region Wheather if (actualRainForce>0f) { - if (Temperature<0) { + if (Temperature<0) { if (wind) { - for (int i=0; i<(weatherWindowWidth+600)/300; i++){ + for (int i=0; i<(weatherWindowWidth+600)/300; i++){ int addSide=Global.WindowHeight/2; if (windRirectionRight) { - if ((actualRainForce*0.25f+0.5f)*rainWaveForce < random.Float()) { + if ((actualRainForce*0.25f+0.5f)*rainWaveForce < FastRandom.Float()) { snowDots.Add( - new ParticleSnow(random.Float()*0.8f+0.2f, gravity+0.2f) { - Position=new Vector2 { X=random.Int(weatherWindowWidth+addSide), Y=-10 }, - HSpeed=windForce*0.5f + new ParticleSnow(FastRandom.Float()*0.8f+0.2f, gravity+0.2f) { + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide), Y=-10 }, + HSpeed=windForce*0.5f }); } - } else { - if ((actualRainForce*0.25f+0.5f)*rainWaveForce < random.Float()) { + } else { + if ((actualRainForce*0.25f+0.5f)*rainWaveForce < FastRandom.Float()) { snowDots.Add( - new ParticleSnow(random.Float()*0.8f+0.2f, gravity+0.2f) { - Position=new Vector2 { X=random.Int(weatherWindowWidth+addSide)-addSide, Y=-10 }, - HSpeed=windForce*0.5f + new ParticleSnow(FastRandom.Float()*0.8f+0.2f, gravity+0.2f) { + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide)-addSide, Y=-10 }, + HSpeed=windForce*0.5f }); } } @@ -5341,24 +5342,24 @@ enum Precipitation : byte { SoundWind.IsLooped=true; } } else { - for (int i=0; i<(weatherWindowWidth+10)/300; i++){ - if ((actualRainForce*0.25f+0.5f)*rainWaveForce < random.Float()) { - snowDots.Add(new ParticleSnow( random.Float()*0.8f+0.2f, gravity+0.2f) { - Position=new Vector2 {X=random.Int(/*Global.WindowWidth*/weatherWindowWidth+10)-5, Y=-10}, - HSpeed=windForce*0.5f - }); + for (int i=0; i<(weatherWindowWidth+10)/300; i++){ + if ((actualRainForce*0.25f+0.5f)*rainWaveForce < FastRandom.Float()) { + snowDots.Add(new ParticleSnow( FastRandom.Float()*0.8f+0.2f, gravity+0.2f) { + Position=new Vector2 {X=FastRandom.Int(/*Global.WindowWidth*/weatherWindowWidth+10)-5, Y=-10}, + HSpeed=windForce*0.5f + }); } - } + } } - - } else { - if ((actualRainForce*0.25f+0.5f)*rainWaveForce < random.Float()) { - for (int i=0; i<(Global.WindowWidth+10)/300; i++){ - rainDots.Add(new ParticleRain(random.Float()*0.8f+0.2f, gravity*20f+0.2f) { Position=new Vector2{X=random.Int(/*848*/weatherWindowWidth+20)-10, Y=-10 },HSpeed=windForce }); + + } else { + if ((actualRainForce*0.25f+0.5f)*rainWaveForce < FastRandom.Float()) { + for (int i=0; i<(Global.WindowWidth+10)/300; i++){ + rainDots.Add(new ParticleRain(FastRandom.Float()*0.8f+0.2f, gravity*20f+0.2f) { Position=new Vector2{X=FastRandom.Int(/*848*/weatherWindowWidth+20)-10, Y=-10 },HSpeed=windForce }); } } if (Global.HasSoundGraphics) { - if (wind) { + if (wind) { SoundWind.Play(); SoundWind.IsLooped=true; } @@ -5378,32 +5379,32 @@ enum Precipitation : byte { lightsHalf.Clear(); int w=(int)WindowY-8, w2=(int)WindowY/*+*/-8; - + for (int x=(terrainStartIndexX>2 ? terrainStartIndexX-2 : terrainStartIndexX); x0f) { for (int i = 0; i1f)rainWaveForce-=0.05f; - //else if (random.Bool()) rainWaveForce+=0.05f; + //else if (FastRandom.Bool()) rainWaveForce+=0.05f; //else rainWaveForce-=0.05f; - if (precipitation || changeRain<5f) { + if (precipitation || changeRain<5f) { if (actualRainForce<1f)actualRainForce+=0.05f; } else if (actualRainForce>0f)actualRainForce-=0.05f; // Create ice if (Temperature<0) { { - int rid=random.Int(BiomePlayer.End-BiomePlayer.Start)+BiomePlayer.Start; + int rid=FastRandom.Int(BiomePlayer.End-BiomePlayer.Start)+BiomePlayer.Start; if (rid0) { - if (chunk.IsSolidBlocks[chunk.LightPosFull]) { + if (chunk.IsSolidBlocks[chunk.LightPosFull]) { switch (chunk.SolidBlocks[chunk.LightPosFull].Id) { case (ushort)BlockId.GrassBlockClay: chunk.SolidBlocks[chunk.LightPosFull]=new NormalBlock(TextureGrassBlockSnow, (ushort)BlockId.GrassBlockSnowClay, new Vector2(rid*16, chunk.LightPosFull*16)); break; - case (ushort)BlockId.GrassBlockCompost: + case (ushort)BlockId.GrassBlockCompost: chunk.SolidBlocks[chunk.LightPosFull]=new NormalBlock(TextureGrassBlockSnow, (ushort)BlockId.GrassBlockSnowCompost, new Vector2(rid*16, chunk.LightPosFull*16)); break; @@ -5541,22 +5542,22 @@ enum Precipitation : byte { case (ushort)BlockId.GrassBlockJungle: chunk.SolidBlocks[chunk.LightPosFull]=new NormalBlock(TextureGrassBlockSnow, (ushort)BlockId.GrassBlockSnowJungle, new Vector2(rid*16, chunk.LightPosFull*16)); break; - } + } } - if (chunk.IsTopBlocks[chunk.StartSomething]) { + if (chunk.IsTopBlocks[chunk.StartSomething]) { if (chunk.TopBlocks[chunk.StartSomething].Id!=(ushort)BlockId.SnowTop) { if (GameMethods.IsLeave(chunk.TopBlocks[chunk.StartSomething].Id)) { - chunk.StartSomething--; + chunk.StartSomething--; chunk.IsTopBlocks[chunk.StartSomething]=true; chunk.TopBlocks[chunk.StartSomething]=new NormalBlock(snowTopTexture, (ushort)BlockId.SnowTop, new Vector2(rid*16, chunk.StartSomething*16)); - } + } + - } } - if (chunk.IsSolidBlocks[chunk.StartSomething]) { - chunk.StartSomething--; + if (chunk.IsSolidBlocks[chunk.StartSomething]) { + chunk.StartSomething--; chunk.IsTopBlocks[chunk.StartSomething]=true; chunk.TopBlocks[chunk.StartSomething]=new NormalBlock(snowTopTexture, (ushort)BlockId.SnowTop, new Vector2(rid*16, chunk.StartSomething*16)); } @@ -5567,17 +5568,17 @@ enum Precipitation : byte { // Remove ice and snow if (Temperature>0.01f) { - int rid=random.Int(BiomePlayer.End-BiomePlayer.Start)+BiomePlayer.Start; + int rid=FastRandom.Int(BiomePlayer.End-BiomePlayer.Start)+BiomePlayer.Start; if (rid bytes=new List(); + List bytes=new(); foreach (ItemInv x in InventoryNormal) x.SaveBytes(bytes); File.WriteAllBytes(pathToWorld+@"\Inventory.bin", bytes.ToArray()); @@ -5685,8 +5686,8 @@ enum Precipitation : byte { case (ushort)BlockId.SolarPanel: if (chunk.LightPosHalf+2>y) { if (dayAlpha>0.8f) NewEnergySolarPanel(x,y); - else if (random.Double() Songs.Happend, + 1 => Songs.Medium, + 2 => Songs.Root, + _ => Songs.Storm, + }; + } else play = Songs.Spacelandia; MediaPlayer.Play(play); } } - + #region Time time++;//1hod=3000x zvýšení @@ -5729,7 +5730,7 @@ enum Precipitation : byte { if (day>daysInYear) { - day=0; + day=0; year++; } @@ -5765,17 +5766,17 @@ enum Precipitation : byte { // if (rain) { - //if (Temperature>0) { + //if (Temperature>0) { float xpler=0; if (Temperature<10f)xpler=-(Temperature-10)/500f; float otp=dayAlpha*(1-rainWaveForce*0.05f*actualRainForce)*(1f-actualRainForce*0.05f/**0.75f*/)*(1f-xpler); // Console.WriteLine("r "+otp); colorAlpha=new Color(otp, otp, otp, otp); - //} else { + //} else { // colorAlpha = new Color(otp, dayAlpha, dayAlpha, dayAlpha); //} - //} else { + //} else { // float otp=dayAlpha*(1f-actualRainForce*0.1f/**0.75f*/); // Console.WriteLine("n "+otp); // colorAlpha=new Color(otp, otp, otp, otp); @@ -5797,11 +5798,11 @@ enum Precipitation : byte { if (block.Inv[0].Id!=0 || block.Inv[1].Id!=0 || block.Inv[2].Id!=0) { if (block.Inv[3].Id==(ushort)Items.None) Do(); - else if (block.Inv[3].Id==(ushort)Items.Ash) { + else if (block.Inv[3].Id==(ushort)Items.Ash) { if (((ItemInvBasic16)block.Inv[3]).GetCount<99) Do(); - } + } - void Do() { + void Do() { for (int i=0; i<3; i++) { //0 float add = GameMethods.FurnaceStoneBurnWood(block.Inv[i].Id); @@ -5820,7 +5821,7 @@ enum Precipitation : byte { AddAsh(); return; } - + void AddAsh() { if (block.Inv[3].Id==(ushort)Items.Ash) { ItemInvBasic16 inv3 = (ItemInvBasic16)block.Inv[3]; @@ -5828,7 +5829,7 @@ enum Precipitation : byte { } else { DInt pos=InventoryGetPosFurnaceStone(3); block.Inv[3]=new ItemInvBasic16(ashTexture, (ushort)Items.Ash, 1, pos.X, pos.Y); - + } } } @@ -5855,7 +5856,7 @@ enum Precipitation : byte { if (windForce>0) { windForce-=.05f; SetWintableSources(); - if (random.Bool())windRirectionRight=!windRirectionRight; + if (FastRandom.Bool())windRirectionRight=!windRirectionRight; } } @@ -5921,7 +5922,7 @@ enum Precipitation : byte { if (d.Id==(ushort)Items.AirTank) { ItemInvTool32 airt=(ItemInvTool32)d; if (airt.GetCount>1) { - if (random.Bool_11_111Percent()) { + if (FastRandom.Bool_11_111Percent()) { airt.SetCount=airt.GetCount-1; } airj=true; @@ -5934,7 +5935,7 @@ enum Precipitation : byte { if (d.Id==(ushort)Items.AirTank2) { ItemInvTool32 airt=(ItemInvTool32)d; if (airt.GetCount>1) { - if (random.Bool_5_555Percent()/* Int(18)==1*/) { + if (FastRandom.Bool_5_555Percent()/* Int(18)==1*/) { airt.SetCount=airt.GetCount-1; } airj=true; @@ -5963,11 +5964,11 @@ enum Precipitation : byte { } Temperature=GetTemperature(BiomePlayer.Name); - + for (int i=0; i31) { - if (random.Bool_33_333Percent()/* Int(3)==1*/) { + if (FastRandom.Bool_33_333Percent()/* Int(3)==1*/) { barHeart+=.01f; if (barHeart>32) Die(Lang.Texts[164]); } @@ -6030,9 +6031,9 @@ enum Precipitation : byte { #region Weather if (changeRain<0) { - changeRain=100+random.Int(50); + changeRain=100+FastRandom.Int(50); if (precipitation) { - precipitation=false; + precipitation=false; if (CurrentPrecipitation==Precipitation.Rain) StopRaining(); if (CurrentPrecipitation==Precipitation.Snowing) StopSnowing(); CurrentPrecipitation=Precipitation.None; @@ -6050,17 +6051,17 @@ enum Precipitation : byte { } else changeRain--; if (timeToChageWind <0) { - timeToChageWind = 2000 + random.Int(1000); + timeToChageWind = 2000 + FastRandom.Int(1000); wind=!wind; - if (!wind){ + if (!wind){ StopWavingTrees(); StopWind(); - }else{ + }else{ StartWind(); } } else timeToChageWind--; - + #endregion #region Optimalize @@ -6106,7 +6107,7 @@ enum Precipitation : byte { SaveSettings(); - List bytes=new List(); + List bytes=new(); foreach (ItemInv x in InventoryNormal) x.SaveBytes(bytes); File.WriteAllBytes(pathToWorld+@"\Inventory.bin", bytes.ToArray()); @@ -6117,7 +6118,7 @@ enum Precipitation : byte { try { if (Directory.Exists(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData\\Default\\Songs\\Radio")) { radioSongs=Directory.GetFiles(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData\\Default\\Songs\\Radio"); - List songs=new List(); + List songs=new(); foreach (string s in radioSongs) { if (s.EndsWith(".wma"))songs.Add(s); } @@ -6158,11 +6159,11 @@ enum Precipitation : byte { int textDieInfom=BitmapFont.bitmapFont18.MeasureTextSingleLineX(diedInfo); textDieInfo=new Text(diedInfo,Global.WindowWidthHalf-textDieInfom/2,Global.WindowHeightHalf,BitmapFont.bitmapFont18); - textDieInfo.Draw(spriteBatch, ColorWhite*a); + textDieInfo.Draw(spriteBatch, Color.White*a); int respawntextm=BitmapFont.bitmapFont18.MeasureTextSingleLineX(respawntext); textRespawnIn=new Text(respawntext,Global.WindowWidthHalf-respawntextm/2,Global.WindowHeightHalf+30,BitmapFont.bitmapFont18); - textRespawnIn.Draw(spriteBatch, ColorWhite*a); + textRespawnIn.Draw(spriteBatch, Color.White*a); spriteBatch.End(); } else { @@ -6175,11 +6176,11 @@ enum Precipitation : byte { Graphics.Clear(black); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, camera); - foreach (Rectangle r in lightsFull) spriteBatch.Draw(lightMaskLineTexture, r, ColorWhite); + foreach (Rectangle r in lightsFull) spriteBatch.Draw(lightMaskLineTexture, r, Color.White); for (int x = terrainStartIndexX>1 ? terrainStartIndexX-2:terrainStartIndexX; x1 ? terrainStartIndexX-2:terrainStartIndexX; x=(dayStart+1)*hour && time<=dayEnd*hour) { - // Graphics.Clear(Color.LightSkyBlue); + // Graphics.Clear(Color.LightSkyBlue); //// Night //} else if (time<=dayStart*hour || time>=(dayEnd+1)*hour) { @@ -6278,7 +6279,7 @@ enum Precipitation : byte { float a = -(dayStart*hour-time)/(hour); // Graphics.Clear(FastMath.Lerp(ColorNightColorBack, Color.LightSkyBlue, a)); spriteBatch.Begin(); - spriteBatch.Draw(TextureSunGradient, Fullscreen, ColorWhite*a); + spriteBatch.Draw(TextureSunGradient, Fullscreen, Color.White*a); spriteBatch.End(); // } else Graphics.Clear(FastMath.Lerp(ColorNightColorBack, Color.LightSkyBlue, -(dayStart*hour-time)/(hour))); @@ -6290,7 +6291,7 @@ enum Precipitation : byte { // Debug.WriteLine(a); // Graphics.Clear(FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, a)); spriteBatch.Begin(); - spriteBatch.Draw(TextureSunGradient, Fullscreen, ColorWhite*a); + spriteBatch.Draw(TextureSunGradient, Fullscreen, Color.White*a); spriteBatch.End(); //} else Graphics.Clear(FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, 0.5f+((dayStart+0.5f)*hour-time)/hour)); @@ -6301,7 +6302,7 @@ enum Precipitation : byte { float a = 0.5f-((dayEnd+0.5f)*hour-time)/(hour*2); // Graphics.Clear(FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, a)); spriteBatch.Begin(); - spriteBatch.Draw(TextureSunGradient, Fullscreen, ColorWhite*a); + spriteBatch.Draw(TextureSunGradient, Fullscreen, Color.White*a); spriteBatch.End(); // } else Graphics.Clear(FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, 0.5f-((dayEnd+0.5f)*hour-time)/(hour*2))); @@ -6312,7 +6313,7 @@ enum Precipitation : byte { float a = ((dayEnd+1)*hour-time)/(hour*2); // Graphics.Clear(FastMath.Lerp(ColorNightColorBack, Color.LightSkyBlue, a)); spriteBatch.Begin(); - spriteBatch.Draw(TextureSunGradient, Fullscreen, ColorWhite*a); + spriteBatch.Draw(TextureSunGradient, Fullscreen, Color.White*a); spriteBatch.End(); // } else Graphics.Clear(FastMath.Lerp(ColorNightColorBack, Color.LightSkyBlue, ((dayEnd+1)*hour-time)/(hour*2))); @@ -6331,7 +6332,7 @@ enum Precipitation : byte { float TextureCloudsSourcePosY=0; // if (time<12) TextureCloudsSourcePosY=((float)time/(12*hour)/*WindowX/(TerrainLength*16f)*/)*(TextureClouds.Height-(int)(CloudsHeight*CloudsSourceScale)); // else TextureCloudsSourcePosY=((float)(24*hour-time)/(12*hour)/*WindowX/(TerrainLength*16f)*/)*(TextureClouds.Height-(int)(CloudsHeight*CloudsSourceScale)); - Color ColorColorize=ColorWhite; + Color ColorColorize=Color.White; // Night if (time<=dayStart*hour || time>=(dayEnd+1)*hour) { @@ -6350,19 +6351,19 @@ enum Precipitation : byte { ColorColorize=FastMath.Lerp(ColorDayRain,ColorDay, changeRain/100f); } else ColorColorize=ColorDayRain; } else { - if (changeRain<100) { + if (changeRain<100) { ColorColorize=FastMath.Lerp(ColorDay, ColorDayRain, changeRain/100f); } else ColorColorize=ColorDay; } // Sun rise - } else if (time>=dayStart*hour && time<=(dayStart+0.5f)*hour){ + } else if (time>=dayStart*hour && time<=(dayStart+0.5f)*hour){ if (precipitation) { ColorColorize=FastMath.Lerp(ColorNightRain, ColorSunRain, (time-dayStart*hour)/(hour*2)); } else { ColorColorize=FastMath.Lerp(ColorNight, ColorSun, (time-dayStart*hour)/(hour*2)); } - } else if (time>=(dayStart+0.5f)*hour && time<=(dayStart+1)*hour){ + } else if (time>=(dayStart+0.5f)*hour && time<=(dayStart+1)*hour){ if (precipitation) { ColorColorize=FastMath.Lerp(ColorDayRain, ColorSunRain, 1-(time-(dayStart+0.5f)*hour)/(hour*2)); } else { @@ -6370,19 +6371,19 @@ enum Precipitation : byte { } // Sun setting - } else if (time>=dayEnd*hour && time<=(dayEnd+0.5f)*hour) { + } else if (time>=dayEnd*hour && time<=(dayEnd+0.5f)*hour) { if (precipitation) { ColorColorize=FastMath.Lerp(ColorDayRain, ColorSunRain, (time-dayEnd*hour)/(hour*2)); } else { ColorColorize=FastMath.Lerp(ColorDay, ColorSun, (time-dayEnd*hour)/(hour*2)); } - } else if (time>=(dayEnd+0.5f)*hour && time<=(dayEnd+1)*hour) { + } else if (time>=(dayEnd+0.5f)*hour && time<=(dayEnd+1)*hour) { if (precipitation) { ColorColorize=FastMath.Lerp(ColorNightRain, ColorSunRain, 1-(time-(dayEnd+0.5f)*hour)/(hour*2)); } else { ColorColorize=FastMath.Lerp(ColorNight, ColorSun, 1-(time-(dayEnd+0.5f)*hour)/(hour*2)); } - } + } float starty=(float)TextureCloudsSourcePosY/TextureClouds.Height/*CloudsHeight*/; EffectClouds.Parameters["StartY"].SetValue(starty); @@ -6440,7 +6441,7 @@ enum Precipitation : byte { (int)TextureCloudsSourcePosY, (int)(Global.WindowWidth*CloudsSourceScale), (int)(CloudsHeight*CloudsSourceScale) - ), + ), ColorBiome ); @@ -6455,7 +6456,7 @@ enum Precipitation : byte { Rabcr.spriteBatch=spriteBatch; if (Temperature<0) { - foreach (ParticleSnow r in snowDots) r.Draw(x, y,actualRainForce); + foreach (ParticleSnow r in snowDots) r.Draw(x, y,actualRainForce); } else { foreach (ParticleRain r in rainDots) r.Draw(x, y,actualRainForce); } @@ -6487,7 +6488,7 @@ enum Precipitation : byte { if (wind) { int x=0; int ms=(int)gameTime.TotalGameTime.TotalMilliseconds; - foreach (LiveObject lo in LiveObjects) { + foreach (LiveObject lo in LiveObjects) { if (lo.Root.X>terrainStartIndexX-10) { if (lo.Root.X>terrainStartIndexW+10) break; @@ -6496,14 +6497,14 @@ enum Precipitation : byte { float a=((ms+x)/1000f)*2*FastMath.PI; float val=((float)Math.Sin(a)+(float)Math.Sin(a*0.5f+(FastMath.PI/4))*0.5f-1.5f)*0.015f; - + if (windRirectionRight) tree.angle=val; else tree.angle=-val; } else if (lo is Cactus cactus) { x+=133; float a=((ms+x)/1000f)*2*FastMath.PI; float val=((float)Math.Sin(a)+(float)Math.Sin(a*0.5f+(FastMath.PI/4))*0.5f-1.5f)*0.015f; - + if (windRirectionRight) cactus.angle=val; else cactus.angle=-val; @@ -6516,7 +6517,7 @@ enum Precipitation : byte { #region Draw blocks int[] starts=new int[terrainStartIndexW]; - + // Back and solid for (int x = terrainStartIndexX; xterrainStartIndexY? chunk.StartSomething: terrainStartIndexY; for (int y = starts[x]/*chunk.StartSomething>terrainStartIndexY? chunk.StartSomething: terrainStartIndexY*/; yterrainStartIndexY? chunk.StartSomething: terrainStartIndexY*/; y0) spriteBatch.Draw(TextureSwimmingUpCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureSwimmingUpCensored, vector, null, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); } } } } } if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureWalking, vectorChest, null, ClothesChestTop.Color, FastMath.PI1_5, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); - if (ClothesChestTop is null) { - if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + if (ClothesChestTop == null) { + if (ClothesChest == null) DrawItemInHandTop(null, Color.White, 0); else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); @@ -6639,7 +6640,7 @@ enum Precipitation : byte { if (InventoryNormal[boxSelected]!=null){ if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new Rectangle( + Rectangle recItem=new( (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), 8, @@ -6648,11 +6649,11 @@ enum Precipitation : byte { switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasicColoritzed32NonStackable i: @@ -6660,27 +6661,27 @@ enum Precipitation : byte { break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; #if DEBUG @@ -6697,43 +6698,43 @@ enum Precipitation : byte { recCloth =new Rectangle(0,0,4,size); spriteBatch.Draw( - TextureHand, - rameno, - recHand, + TextureHand, + rameno, + recHand, new Color( - (byte)(Setting.ColorSkin.R*0.75f), - (byte)(Setting.ColorSkin.G*0.75f), + (byte)(Setting.ColorSkin.R*0.75f), + (byte)(Setting.ColorSkin.G*0.75f), (byte)(Setting.ColorSkin.B*0.75f), (byte)255 - ), - handAngle-FastMath.PI, - vecOrigin, - 1f, + ), + handAngle-FastMath.PI, + vecOrigin, + 1f, SpriteEffects.None, 1f); if (texCloth!=null) spriteBatch.Draw(texCloth, rameno, recCloth, new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f),(byte)255), handAngle-FastMath.PI, Vector2_2, 1, SpriteEffects.None,1f); } } else { //-> - Rectangle curImg=new Rectangle(playerImg/22*39, 0, 39, 20); - Vector2 vector=new Vector2(PlayerX-11-15-3, PlayerY+8); - Vector2 vectorHead=new Vector2(PlayerX-11+46/2, PlayerY+8); - Vector2 vectorChest=new Vector2(PlayerX-11-22+44, PlayerY+8+2-3+2); + Rectangle curImg=new(playerImg/22*39, 0, 39, 20); + Vector2 vector=new(PlayerX-11-15-3, PlayerY+8); + Vector2 vectorHead=new(PlayerX-11+46/2, PlayerY+8); + Vector2 vectorChest=new(PlayerX-11-22+44, PlayerY+8+2-3+2); - Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2+7+20, vector.Y-39/2+12-1+38/2); + Vector2 rameno=new(vector.X-11+2+1+27/2-2+7+20, vector.Y-39/2+12-1+38/2); handAngle=swimmingTicks*2*FastMath.PI; Rectangle recHand, recCloth; Vector2 vecOrigin; - if (ClothesChestTop is null) { - if (ClothesChest is null) DrawItemInHandBack(null, Color.White, 0); + if (ClothesChestTop == null) { + if (ClothesChest == null) DrawItemInHandBack(null, Color.White, 0); else DrawItemInHandBack(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); } else DrawItemInHandBack(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); - + //feet if (ClothesFeet!=null) spriteBatch.Draw(ClothesFeet.TextureSwimming, vector, curImg, ClothesFeet.Color, 0, Vector2Zero, 1,SpriteEffects.FlipHorizontally, 1f); - else spriteBatch.Draw(TexturePlayerSwimmingFeet, vector, curImg, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else spriteBatch.Draw(TexturePlayerSwimmingFeet, vector, curImg, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); // legs if (ClothesLegs!=null) { @@ -6742,24 +6743,24 @@ enum Precipitation : byte { } else { spriteBatch.Draw(TexturePlayerSwimmingLegs, vector, curImg, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); if (ClothesUnderwearDown!=null) { - if (ClothesChest==null) spriteBatch.Draw(ClothesUnderwearDown.TextureSwimming, vector, curImg, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); - else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureSwimming, vector, curImg, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (ClothesChest==null) spriteBatch.Draw(ClothesUnderwearDown.TextureSwimming, vector, curImg, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureSwimming, vector, curImg, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); } else { - if (Global.YoungPlayer) spriteBatch.Draw(TextureSwimmingDownCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (Global.YoungPlayer) spriteBatch.Draw(TextureSwimmingDownCensored, vector, null, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); } } // Head spriteBatch.Draw(TexturePlayerWalkingFace, vectorHead, null, Setting.ColorSkin,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerWalkingMoustage, vectorHead, null, Setting.moustageColor,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); - spriteBatch.Draw(TexturePlayerWalkingMouth, vectorHead, null, ColorWhite,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); + spriteBatch.Draw(TexturePlayerWalkingMouth, vectorHead, null, Color.White,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerWalkingHair, vectorHead, null, Setting.hairColor,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); spriteBatch.Draw(TexturePlayerWalkingEyes, vectorHead, null, Setting.eyesColor,FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureStatic, vectorHead, null, ClothesHead.Color, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); //Chest - if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChestTop == null || ClothesChestTop?.ShowTShirt==true) { if (ClothesChest!=null) spriteBatch.Draw(ClothesChest.TextureWalking, /*vectorChest*/new Vector2(vectorChest.X, vectorChest.Y-2), null, ClothesChest.Color, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); else { spriteBatch.Draw(TexturePlayerWalkingChest, vectorChest, null, Setting.ColorSkin, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); @@ -6774,8 +6775,8 @@ enum Precipitation : byte { } } if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureWalking, vectorChest, null, ClothesChestTop.Color, FastMath.PIHalf, Vector2Zero, 1, SpriteEffects.None, 0); - if (ClothesChestTop is null) { - if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + if (ClothesChestTop == null) { + if (ClothesChest == null) DrawItemInHandTop(null, Color.White, 0); else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); @@ -6785,7 +6786,7 @@ enum Precipitation : byte { if (InventoryNormal[boxSelected]!=null){ if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new Rectangle( + Rectangle recItem=new( (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), 8, @@ -6794,11 +6795,11 @@ enum Precipitation : byte { switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasicColoritzed32NonStackable i: @@ -6806,27 +6807,27 @@ enum Precipitation : byte { break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; #if DEBUG @@ -6850,10 +6851,10 @@ enum Precipitation : byte { switch (playerState) { default: { - Vector2 vector=new Vector2((int)PlayerX-11, (int)PlayerY-(int)(39*0.5f)); + Vector2 vector=new((int)PlayerX-11, (int)PlayerY-(int)(39*0.5f)); - Vector2 pointing=new Vector2(mouseRealPosX-Global.WindowWidthHalf, mouseRealPosY-Global.WindowHeightHalf); - Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2, vector.Y-39/2+12-1+38/2); + Vector2 pointing=new(mouseRealPosX-Global.WindowWidthHalf, mouseRealPosY-Global.WindowHeightHalf); + Vector2 rameno=new(vector.X-11+2+1+27/2-2, vector.Y-39/2+12-1+38/2); Vector2 hand=Vector2.Normalize(pointing)*HandSize; hand.X+=rameno.X; hand.Y+=rameno.Y; @@ -6871,12 +6872,12 @@ enum Precipitation : byte { if (ClothesChest==null)spriteBatch.Draw(ClothesUnderwearDown.TextureStatic, vector, ClothesUnderwearDown.Color); else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureStatic, vector, ClothesUnderwearDown.Color); } else { - if (Global.YoungPlayer) spriteBatch.Draw(TextureStaticDownCensored, vector, ColorWhite); + if (Global.YoungPlayer) spriteBatch.Draw(TextureStaticDownCensored, vector, Color.White); } } // Chest - if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChestTop == null || ClothesChestTop?.ShowTShirt==true) { if (ClothesChest!=null) { spriteBatch.Draw(ClothesChest.TextureStatic, vector, ClothesChest.Color); } else { @@ -6885,7 +6886,7 @@ enum Precipitation : byte { else { if (Setting.sex==Sex.Girl) { if (Global.YoungPlayer) { - if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureStaticUpCensored, vector, ColorWhite); + if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureStaticUpCensored, vector, Color.White); } } } @@ -6901,21 +6902,21 @@ enum Precipitation : byte { // Head spriteBatch.Draw(TexturePlayerStaticFace, vector, Setting.ColorSkin); if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerStaticMoustage, vector, Setting.moustageColor); - spriteBatch.Draw(TexturePlayerStaticMouth, vector, ColorWhite); + spriteBatch.Draw(TexturePlayerStaticMouth, vector, Color.White); if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerStaticHair, vector, Setting.hairColor); spriteBatch.Draw(TexturePlayerStaticEyes, vector, Setting.eyesColor); if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureStatic, vector, ClothesHead.Color); - if (ClothesChestTop is null) { - if (ClothesChest is null)DrawItemInHand(null, Color.White, 0); + if (ClothesChestTop == null) { + if (ClothesChest == null)DrawItemInHand(null, Color.White, 0); else DrawItemInHand(ClothesChest?.Texture2DClothHand, ClothesChest.Color, (int)ClothesChest?.handSize); } else DrawItemInHand(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color, (int)ClothesChestTop.handSize); - + void DrawItemInHand(Texture2D texCloth, Color colorCloth, int size) { - Rectangle recHand= new Rectangle(0,0,4,HandSize-size), recCloth=new Rectangle(0,0,4,size); - Vector2 vecOrigin=new Vector2(2,2-size); - + Rectangle recHand= new(0,0,4,HandSize-size), recCloth=new(0,0,4,size); + Vector2 vecOrigin=new(2,2-size); + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); @@ -6927,7 +6928,7 @@ enum Precipitation : byte { if (InventoryNormal[boxSelected]!=null){ if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new Rectangle( + Rectangle recItem=new( (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), 8, @@ -6936,11 +6937,11 @@ enum Precipitation : byte { switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasicColoritzed32NonStackable i: @@ -6948,27 +6949,27 @@ enum Precipitation : byte { break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; #if DEBUG @@ -6984,10 +6985,10 @@ enum Precipitation : byte { case 2://-> { - Rectangle curImg=new Rectangle((playerImg/20)*20, 0, 20, 39); - Vector2 vector=new Vector2(PlayerX-11, PlayerY-39/2); + Rectangle curImg=new((playerImg/20)*20, 0, 20, 39); + Vector2 vector=new(PlayerX-11, PlayerY-39/2); - Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); + Vector2 rameno=new(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); int ticks=gameTime.TotalGameTime.Milliseconds; Rectangle recHand, recCloth; @@ -6997,8 +6998,8 @@ enum Precipitation : byte { else if (ticks<750) handAngle=((ticks-250)/250f)*WalkingHandMaxAngle-WalkingHandMaxAngle; else handAngle=WalkingHandMaxAngle-((ticks-750)/250f)*WalkingHandMaxAngle; - if (ClothesChestTop is null) { - if (ClothesChest is null) DrawItemInHandBack(null, Color.White, 0); + if (ClothesChestTop == null) { + if (ClothesChest == null) DrawItemInHandBack(null, Color.White, 0); else DrawItemInHandBack(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); } else DrawItemInHandBack(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); @@ -7011,7 +7012,7 @@ enum Precipitation : byte { // Head spriteBatch.Draw(TexturePlayerWalkingFace, new Vector2(vector.X-1, vector.Y), Setting.ColorSkin); spriteBatch.Draw(TexturePlayerWalkingEyes, new Vector2(vector.X-1, vector.Y), Setting.eyesColor); - spriteBatch.Draw(TexturePlayerWalkingMouth, new Vector2(vector.X-1, vector.Y), ColorWhite); + spriteBatch.Draw(TexturePlayerWalkingMouth, new Vector2(vector.X-1, vector.Y), Color.White); if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerWalkingMoustage, new Vector2(vector.X-1, vector.Y), Setting.moustageColor); if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerWalkingHair, new Vector2(vector.X-1, vector.Y), Setting.hairColor); @@ -7025,11 +7026,11 @@ enum Precipitation : byte { if (ClothesChest==null) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color); else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color); } else { - if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, vector, null, ColorWhite); + if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, vector, null, Color.White); } } // Chest - if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChestTop == null || ClothesChestTop?.ShowTShirt==true) { if (ClothesChest!=null) spriteBatch.Draw(ClothesChest.TextureWalking, vector, null, ClothesChest.Color); else { spriteBatch.Draw(TexturePlayerWalkingChest, vector, null, Setting.ColorSkin); @@ -7048,8 +7049,8 @@ enum Precipitation : byte { if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureWalkingOrSwimming, new Vector2(vector.X-1, vector.Y), ClothesHead.Color); - if (ClothesChestTop is null) { - if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + if (ClothesChestTop == null) { + if (ClothesChest == null) DrawItemInHandTop(null, Color.White, 0); else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color, (int)ClothesChest.handSize); } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color, (int)ClothesChestTop.handSize); @@ -7059,7 +7060,7 @@ enum Precipitation : byte { if (InventoryNormal[boxSelected]!=null){ if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new Rectangle( + Rectangle recItem=new( (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), 8, @@ -7068,11 +7069,11 @@ enum Precipitation : byte { switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasicColoritzed32NonStackable i: @@ -7080,27 +7081,27 @@ enum Precipitation : byte { break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; #if DEBUG @@ -7116,23 +7117,23 @@ enum Precipitation : byte { vecOrigin=new Vector2(2,2-size); spriteBatch.Draw(TextureHand, rameno, recHand, new Color((byte)(Setting.ColorSkin.R*0.75f), (byte)(Setting.ColorSkin.G*0.75f), (byte)(Setting.ColorSkin.B*0.75f),(byte)255), -handAngle, vecOrigin, 1, SpriteEffects.None,1f); - + recCloth=new Rectangle(0,0,4,size); if (texCloth!=null) { spriteBatch.Draw(texCloth, rameno, recCloth, new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f),(byte)255), -handAngle, Vector2_2, 1, SpriteEffects.None,1f); - } + } } } break; case 1://<- { - Rectangle curImg=new Rectangle((playerImg/20)*20, 0, 20, 39); + Rectangle curImg=new((playerImg/20)*20, 0, 20, 39); // Rectangle curImg2=new Rectangle((playerImg2/20)*20, 0, 20, 39); - - Vector2 vector=new Vector2(PlayerX-11, PlayerY-39/2); - Vector2 rameno=new Vector2(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); + Vector2 vector=new(PlayerX-11, PlayerY-39/2); + + Vector2 rameno=new(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); int ticks=gameTime.TotalGameTime.Milliseconds; Rectangle recHand, recCloth; @@ -7142,8 +7143,8 @@ enum Precipitation : byte { else if (ticks<750) handAngle=((ticks-250)/250f)*WalkingHandMaxAngle-WalkingHandMaxAngle; else handAngle=WalkingHandMaxAngle-((ticks-750)/250f)*WalkingHandMaxAngle; - if (ClothesChestTop is null) { - if (ClothesChest is null) DrawItemInHandBack(null, Color.White, 0); + if (ClothesChestTop == null) { + if (ClothesChest == null) DrawItemInHandBack(null, Color.White, 0); else DrawItemInHandBack(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); } else DrawItemInHandBack(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); @@ -7156,7 +7157,7 @@ enum Precipitation : byte { spriteBatch.Draw(TexturePlayerWalkingFace, new Vector2(vector.X-1,vector.Y), null, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); spriteBatch.Draw(TexturePlayerWalkingEyes, new Vector2(vector.X-1,vector.Y), null, Setting.eyesColor, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); - spriteBatch.Draw(TexturePlayerWalkingMouth,new Vector2(vector.X-1,vector.Y), null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + spriteBatch.Draw(TexturePlayerWalkingMouth,new Vector2(vector.X-1,vector.Y), null, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); if (Setting.moustageType!=0)spriteBatch.Draw(TexturePlayerWalkingMoustage, new Vector2(vector.X-1,vector.Y), null, Setting.moustageColor, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); if (Setting.hairType!=0)spriteBatch.Draw(TexturePlayerWalkingHair, new Vector2(vector.X-1,vector.Y), null, Setting.hairColor, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); @@ -7172,11 +7173,11 @@ enum Precipitation : byte { if (ClothesChest==null) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); else if (!ClothesChest.IsDress) spriteBatch.Draw(ClothesUnderwearDown.TextureWalking, vector, curImg, ClothesUnderwearDown.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); } else { - if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (Global.YoungPlayer) spriteBatch.Draw(TextureWalkingDownCensored, vector, null, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); } } // Chest - if (ClothesChestTop is null || ClothesChestTop?.ShowTShirt==true) { + if (ClothesChestTop == null || ClothesChestTop?.ShowTShirt==true) { if (ClothesChest!=null) spriteBatch.Draw(ClothesChest.TextureWalking, new Vector2(vector.X-2, vector.Y) , null, ClothesChest.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); else { spriteBatch.Draw(TexturePlayerWalkingChest,new Vector2(vector.X-2, vector.Y)/*vector*//*vector*/, null, Setting.ColorSkin, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); @@ -7184,17 +7185,17 @@ enum Precipitation : byte { else { if (Setting.sex==Sex.Girl) { if (Global.YoungPlayer) { - if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureWalkingUpCensored, vector, null, ColorWhite, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); + if (Setting.MaturePlayer>0) spriteBatch.Draw(TextureWalkingUpCensored, vector, null, Color.White, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); } } } } } if (ClothesChestTop!=null) spriteBatch.Draw(ClothesChestTop.TextureWalking, vector, null, ClothesChestTop.Color, 0, Vector2Zero, 1, SpriteEffects.FlipHorizontally, 0); - - if (ClothesChestTop is null) { - if (ClothesChest is null) DrawItemInHandTop(null, Color.White, 0); + + if (ClothesChestTop == null) { + if (ClothesChest == null) DrawItemInHandTop(null, Color.White, 0); else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); @@ -7204,7 +7205,7 @@ enum Precipitation : byte { if (InventoryNormal[boxSelected]!=null){ if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new Rectangle( + Rectangle recItem=new( (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), 8, @@ -7213,11 +7214,11 @@ enum Precipitation : byte { switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvBasicColoritzed32NonStackable i: @@ -7225,27 +7226,27 @@ enum Precipitation : byte { break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, ColorWhite); + spriteBatch.Draw(i.Texture, recItem, Color.White); break; #if DEBUG @@ -7264,7 +7265,7 @@ enum Precipitation : byte { recCloth = new Rectangle(0,0,4,size); if (texCloth!=null) { spriteBatch.Draw(texCloth, rameno, new Rectangle(0,0,4,size), new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f), (byte)255), -handAngle, Vector2_2, 1, SpriteEffects.None,1f); - } + } } } break; @@ -7284,7 +7285,7 @@ enum Precipitation : byte { // Draw lighting on game spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: Multiply); - spriteBatch.Draw(texture: modificatedLightTarget, position: Vector2Zero, color: ColorWhite); + spriteBatch.Draw(texture: modificatedLightTarget, position: Vector2Zero, color: Color.White); spriteBatch.End(); #endregion @@ -7297,23 +7298,23 @@ enum Precipitation : byte { int barE=(int)barEnergy, barO=(int)barOxygen, barW=(int)barWater, barEa=(int)barEat, barH=(int)barHeart; // Energy bar spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8),new Rectangle(0,0,32,barE),ColorGray); - spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8+barE),new Rectangle(0,barE,32,32-barE),ColorWhite); + spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8+barE),new Rectangle(0,barE,32,32-barE),Color.White); // Oxygen bar spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8),new Rectangle(0,0,32,barO),ColorGray); - spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8+barO),new Rectangle(0,barO,32,32-barO),ColorWhite); + spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8+barO),new Rectangle(0,barO,32,32-barO),Color.White); // Water bar spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8),new Rectangle(0,0,32,barW),ColorGray); - spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8+barW),new Rectangle(0,barW,32,32-barW),ColorWhite); + spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8+barW),new Rectangle(0,barW,32,32-barW),Color.White); // Eat bar spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8),new Rectangle(0,0,32,barEa),ColorGray); - spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8+barEa),new Rectangle(0,barEa,32,32-barEa),ColorWhite); + spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8+barEa),new Rectangle(0,barEa,32,32-barEa),Color.White); // Heart bar spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8), new Rectangle(0,0,32,barH),ColorGray); - spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8+barH), new Rectangle(0,barH,32,32-barH),ColorWhite); + spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8+barH), new Rectangle(0,barH,32,32-barH),Color.White); } #endregion @@ -7326,47 +7327,47 @@ enum Precipitation : byte { if (gedo!=null) { #if DEBUG if (text.StartsWith("*")){ - if (Command()){ + if (Command()){ ///text="";diserpeard=0; - }else{ + }else{ text="Unknown command";diserpeard=255; } } //if (text.StartsWith("*time-set ")) { // if (int.TryParse(text.Substring("*time-set ".Length), out int num)){ - // time=num*hour; + // time=num*hour; // } else if (float.TryParse(text.Substring("*time-set ".Length), out float num2)){ - // time=(int)(num2*hour); + // time=(int)(num2*hour); // } // text=""; // diserpeard=0; - //} + //} //if (text.StartsWith("*day-set ")){ // if (int.TryParse(text.Substring("*day-set ".Length), out int num)){ - // day=num; + // day=num; // ChangeLeavesForceEverything(); // } // text=""; // diserpeard=0; - //} + //} //if (text=="*give-mobile") { // InventoryAddOne((ushort)Items.Mobile); // text=""; // diserpeard=0;text="";diserpeard=0; - //} + //} //if (text=="*wd0") { // Global.WorldDifficulty=0;text="";diserpeard=0; - //} + //} //if (text=="*wd1") { // Global.WorldDifficulty=1;text="";diserpeard=0; - //} + //} //if (text=="*wd2") { // Global.WorldDifficulty=2;text="";diserpeard=0; - //} + //} //if (text=="*rain-change") { // changeRain=1; // text="";diserpeard=0; - //} + //} //if (text=="*wind-change") { // timeToChageWind=1; // text="";diserpeard=0; @@ -7380,14 +7381,14 @@ enum Precipitation : byte { int x=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); gedo.SetPos(x-texts+20-10-5,Global.WindowHeightHalf-40-50-4); if (diserpeard>100) { - spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), ColorWhite); - spriteBatch.Draw(messageCenter,new Rectangle(x-texts+19-10,Global.WindowHeightHalf-55-50,texts*2,57), ColorWhite); - spriteBatch.Draw(messageRight,new Vector2(x+texts+19-10,Global.WindowHeightHalf-55-50), ColorWhite); + spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), Color.White); + spriteBatch.Draw(messageCenter,new Rectangle(x-texts+19-10,Global.WindowHeightHalf-55-50,texts*2,57), Color.White); + spriteBatch.Draw(messageRight,new Vector2(x+texts+19-10,Global.WindowHeightHalf-55-50), Color.White); gedo.DrawGedo(1f,spriteBatch); } else { float alphaC =diserpeard/100f; - Color alphaCC=new Color(alphaC,alphaC,alphaC,alphaC); + Color alphaCC=new(alphaC,alphaC,alphaC,alphaC); spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), alphaCC); spriteBatch.Draw(messageCenter,new Rectangle(x-texts+19-10,Global.WindowHeightHalf-55-50,texts*2,57), alphaCC); @@ -7402,8 +7403,8 @@ enum Precipitation : byte { { int w=Global.WindowWidth-40, h=Global.WindowHeightHalf-80; for (int i = 0; i<5; i++) { - if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), ColorLightBlue); - else spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), ColorWhite); + if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), Color.LightBlue); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(w, h+i*40), Color.White); } } @@ -7418,10 +7419,10 @@ enum Precipitation : byte { { int xx=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); - int half=textWriting.X/2; - spriteBatch.Draw(messageLeft,new Vector2(xx-half-10,Global.WindowHeightHalf-55-50), ColorWhite); - spriteBatch.Draw(messageCenter,new Rectangle(xx-half+19-10,Global.WindowHeightHalf-55-50,textWriting.X,57), ColorWhite); - spriteBatch.Draw(messageRight,new Vector2(xx+half+19-10,Global.WindowHeightHalf-55-50), ColorWhite); + int half=textWriting.MeasureX/2; + spriteBatch.Draw(messageLeft,new Vector2(xx-half-10,Global.WindowHeightHalf-55-50), Color.White); + spriteBatch.Draw(messageCenter,new Rectangle(xx-half+19-10,Global.WindowHeightHalf-55-50,textWriting.MeasureX,57), Color.White); + spriteBatch.Draw(messageRight,new Vector2(xx+half+19-10,Global.WindowHeightHalf-55-50), Color.White); textWriting.Draw(spriteBatch); @@ -7439,11 +7440,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(TextureInventoryClothes,new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), ColorWhite); + spriteBatch.Draw(TextureInventoryClothes,new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), Color.White); textOpenInventory.Draw(spriteBatch); DrawInventoryWithMoving(); @@ -7456,12 +7457,12 @@ enum Precipitation : byte { int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / (inventoryScrollbarValueCraftingMax-6*3)*(160-size2) )*8; if (size2>20) { - spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); } else { - spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); } } @@ -7476,7 +7477,7 @@ enum Precipitation : byte { else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); } else { if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); - else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), Color.White); } InventoryCrafting[i].DrawCreative(); @@ -7492,7 +7493,7 @@ enum Precipitation : byte { } #endregion - DrawNeedNew(); + DrawNeed(); buttonInvTabBlocks.ButtonDraw(); buttonInvTabMashines.ButtonDraw(); @@ -7515,11 +7516,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(deskTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + spriteBatch.Draw(deskTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); textOpenInventory.Draw(spriteBatch); DrawInventoryNormal(); @@ -7531,12 +7532,12 @@ enum Precipitation : byte { int pos2 = (int)(((float)(inventoryScrollbarValueCrafting*5/40f)/(inventoryScrollbarValueCraftingMax-3*6))*(160-size2)); if (size2>20) { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); } else { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); } } @@ -7559,7 +7560,7 @@ enum Precipitation : byte { else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8),color_r200_g200_b200); } else { if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); - else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), Color.White); } InventoryCrafting[i].DrawCreative(); //Texture2D tex=ItemIdToTexture(InventoryCrafting[i].X); @@ -7574,7 +7575,7 @@ enum Precipitation : byte { } #endregion - DrawNeedNew(); + DrawNeed(); buttonInvTabBlocks.ButtonDraw(); buttonInvTabMashines.ButtonDraw(); @@ -7598,14 +7599,14 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255); - spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), ColorLightBlue); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); buttonClose.ButtonDraw(); ItemInv[] inv=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; float energy=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Energy; - spriteBatch.Draw(furnaceStoneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200),new Rectangle(energy>0 ?0 :16,0,16,16), ColorWhite); + spriteBatch.Draw(furnaceStoneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200),new Rectangle(energy>0 ?0 :16,0,16,16), Color.White); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-2, Global.WindowHeightHalf-200+2+4-6,202+2,5),black); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1, Global.WindowHeightHalf-200+2+4-5,(int)(energy*2.02*100),3),Color.Green); @@ -7620,12 +7621,12 @@ enum Precipitation : byte { int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); int pos2 = (int)(((inventoryScrollbarValueCrafting*5/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; if (size2>20) { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); } else { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); } } @@ -7647,7 +7648,7 @@ enum Precipitation : byte { else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); } else { if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); - else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), Color.White); } InventoryCrafting[i].Draw(); //Texture2D tex = ItemIdToTexture(InventoryCrafting[i].X); @@ -7662,13 +7663,13 @@ enum Precipitation : byte { } #endregion - DrawNeedNew(); + DrawNeed(); #region burn wood - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40, Global.WindowHeightHalf-200+2+4+60), ColorWhite*0.5f); - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40+40, Global.WindowHeightHalf-200+2+4+60), ColorWhite*0.5f); - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40*2+40, Global.WindowHeightHalf-200+2+4+60), ColorWhite*0.5f); - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40+40, Global.WindowHeightHalf-200+2+4+60+40+8), ColorWhite*0.5f); - spriteBatch.Draw(ashTexture, new Rectangle(Global.WindowWidthHalf-300+4+1+40+40+4, Global.WindowHeightHalf-200+2+4+60+40+8+4,32,32), ColorWhite*0.25f); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40, Global.WindowHeightHalf-200+2+4+60), Color.White*0.5f); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40+40, Global.WindowHeightHalf-200+2+4+60), Color.White*0.5f); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40*2+40, Global.WindowHeightHalf-200+2+4+60), Color.White*0.5f); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+1+40+40, Global.WindowHeightHalf-200+2+4+60+40+8), Color.White*0.5f); + spriteBatch.Draw(ashTexture, new Rectangle(Global.WindowWidthHalf-300+4+1+40+40+4, Global.WindowHeightHalf-200+2+4+60+40+8+4,32,32), Color.White*0.25f); inv[0].Draw(); inv[1].Draw(); @@ -7699,11 +7700,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255); - spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), ColorLightBlue); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(furnaceElectricOneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + spriteBatch.Draw(furnaceElectricOneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); textOpenInventory.Draw(spriteBatch); DrawInventoryNormal(); @@ -7713,12 +7714,12 @@ enum Precipitation : byte { int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; if (size2>20) { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); } else { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); } } @@ -7734,7 +7735,7 @@ enum Precipitation : byte { else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); } else { if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); - else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), Color.White); } InventoryCrafting[i].Draw(); // Texture2D tex = ItemIdToTexture(InventoryCrafting[i].X); @@ -7749,7 +7750,7 @@ enum Precipitation : byte { } #endregion - DrawNeedNew(); + DrawNeed(); buttonInvTabMaterials.ButtonDraw(); buttonInvTabGlass.ButtonDraw(); @@ -7771,11 +7772,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255 ); - spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), ColorLightBlue); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(maceratorOneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + spriteBatch.Draw(maceratorOneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); textOpenInventory.Draw(spriteBatch); DrawInventoryNormal(); @@ -7786,12 +7787,12 @@ enum Precipitation : byte { int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); int pos2 = (int)(((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax*(160-size2))*8; if (size2>20) { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); } else { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); } } @@ -7806,7 +7807,7 @@ enum Precipitation : byte { else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); } else { if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); - else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), Color.White); } InventoryCrafting[i].Draw(); //Texture2D tex = ItemIdToTexture(InventoryCrafting[i].X); @@ -7821,7 +7822,7 @@ enum Precipitation : byte { } #endregion - DrawNeedNew(); + DrawNeed(); buttonInvTabMaterials.ButtonDraw(); buttonInvTabPlants.ButtonDraw(); @@ -7843,11 +7844,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2+30,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434+30,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2+30), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2+30), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(TextureInventoryClothes, new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), ColorWhite); + spriteBatch.Draw(TextureInventoryClothes, new Vector2(Global.WindowWidthHalf-300+4+60, Global.WindowHeightHalf-200+2+4), Color.White); textOpenInventory.Draw(spriteBatch); @@ -7862,12 +7863,12 @@ enum Precipitation : byte { int size2 =(int)( (1f/((( (int)(inventoryScrollbarValueCraftingMax/5f)+1 )*40)/160f))*160 ); int pos2=(int)( (inventoryScrollbarValueCrafting*5/40f) / (inventoryScrollbarValueCraftingMax-6*3)*(160-size2) )*8+50-15; if (size2>20) { - spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarBetweenTexture,new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8,20,size2-20), Color.White); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); } else { - spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarDownTexture,new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); } } @@ -7882,7 +7883,7 @@ enum Precipitation : byte { else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r200_g200_b200); } else { if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), color_r150_g150_b150); - else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8+AddH), Color.White); } // InventoryCrafting[i].SetPos(xx,yh); InventoryCrafting[i].DrawCreative(); @@ -7932,11 +7933,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(shelfTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + spriteBatch.Draw(shelfTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); textOpenInventory.Draw(spriteBatch); ItemInv[] invShelf=((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; @@ -7949,7 +7950,7 @@ enum Precipitation : byte { // int i=0; for (int y = 0; y<3*40; y+=40) { for (int x = 0; x<3*40; x+=40) { - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+x+20+5+1+2, Global.WindowHeightHalf+20-2+y+20+3+2), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+x+20+5+1+2, Global.WindowHeightHalf+20-2+y+20+3+2), Color.White); // if (!invMove||(invMove && invStartInventory[invStartId]!=invShelf[i])) { @@ -7988,11 +7989,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(boxWoodenTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + spriteBatch.Draw(boxWoodenTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); textOpenInventory.Draw(spriteBatch); ItemInv[] invBoxWooden=((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; @@ -8005,7 +8006,7 @@ enum Precipitation : byte { int i=0; for (int y = 0; y<2*40; y+=40) { for (int x = 0; x<12*40; x+=40) { - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+x+59, Global.WindowHeightHalf+59+y), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+x+59, Global.WindowHeightHalf+59+y), Color.White); // if (!invMove||(invMove&&invStartInventory[invStartId]!=invBoxWooden[i])) { invBoxWooden[i].Draw(); @@ -8032,11 +8033,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(boxAdvTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + spriteBatch.Draw(boxAdvTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); textOpenInventory.Draw(spriteBatch); ItemInv[] invAdvBox=((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; @@ -8050,7 +8051,7 @@ enum Precipitation : byte { int i=0; for (int y = 0; y<4*40; y+=40) { for (int x = 0; x<12*40; x+=40) { - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+20+x, Global.WindowHeightHalf+23+y), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+20+x, Global.WindowHeightHalf+23+y), Color.White); // if (!invMove||(invMove&&invStartInventory[invStartId]!=invAdvBox[i])) { invAdvBox[i].Draw(); @@ -8092,12 +8093,12 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-150-2, Global.WindowHeightHalf-234,304,464+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-150-1, Global.WindowHeightHalf-233,302,464,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-232,300,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198,300,430), Color.LightBlue); buttonClose.ButtonDraw(); textOpenInventory.Draw(spriteBatch); - spriteBatch.Draw(rocketTexture,new Rectangle(Global.WindowWidthHalf-62, Global.WindowHeightHalf-190,123,380), ColorWhite); + spriteBatch.Draw(rocketTexture,new Rectangle(Global.WindowWidthHalf-62, Global.WindowHeightHalf-190,123,380), Color.White); buttonRocket.ButtonDraw(); break; @@ -8111,11 +8112,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255); - spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), ColorLightBlue); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(chargerTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + spriteBatch.Draw(chargerTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); textOpenInventory.Draw(spriteBatch); ItemInv[] invCharger=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; @@ -8123,7 +8124,7 @@ enum Precipitation : byte { DrawInventoryWithMoving(); #region Place for charging - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+40+20+5+1+2, Global.WindowHeightHalf+20-2+40+20+3+2), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+40+20+5+1+2, Global.WindowHeightHalf+20-2+40+20+3+2), Color.White); // if (!invMove||(invMove&&invStartInventory[invStartId]!=invCharger[0])) { invCharger[0].Draw(); @@ -8148,11 +8149,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(minerTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + spriteBatch.Draw(minerTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); textOpenInventory.Draw(spriteBatch); ItemInv[] invMiner=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; @@ -8166,7 +8167,7 @@ enum Precipitation : byte { int i=0; for (int y = 0; y<2*40; y+=40) { for (int x = 0; x<12*40; x+=40) { - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+x+59, Global.WindowHeightHalf+59+y), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+x+59, Global.WindowHeightHalf+59+y), Color.White); // if (!invMove||(invMove&&invStartInventory[invStartId]!=invMiner[i])) { invMiner[i].Draw(); @@ -8193,11 +8194,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(radioTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200),new Rectangle(16*(int)(15*_secondTimer/60f),0,16,16), ColorWhite); + spriteBatch.Draw(radioTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200),new Rectangle(16*(int)(15*_secondTimer/60f),0,16,16), Color.White); textOpenInventory.Draw(spriteBatch); @@ -8209,7 +8210,7 @@ enum Precipitation : byte { if (radioplaying) { spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2+400-50,600,50), ColorGray); - spriteBatch.Draw(RadioButtonPause,new Vector2(Global.WindowWidthHalf-24, Global.WindowHeightHalf-200+2+400-50), ColorWhite); + spriteBatch.Draw(RadioButtonPause,new Vector2(Global.WindowWidthHalf-24, Global.WindowHeightHalf-200+2+400-50), Color.White); } } break; @@ -8223,11 +8224,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(ComposterFullTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + spriteBatch.Draw(ComposterFullTexture,new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); textOpenInventory.Draw(spriteBatch); ItemInv[] invComposter=((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; @@ -8241,7 +8242,7 @@ enum Precipitation : byte { int i=0; for (int y = 0; y<3*40; y+=40) { for (int x = 0; x<3*40; x+=40) { - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+x+20+5+1+2, Global.WindowHeightHalf+20-2+y+20+3+2), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+x+20+5+1+2, Global.WindowHeightHalf+20-2+y+20+3+2), Color.White); // if (!invMove||(invMove&&invStartInventory[invStartId]!=invComposter[i])) { invComposter[i].Draw(); @@ -8267,11 +8268,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255); - spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), ColorLightBlue); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(sewingMachineTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + spriteBatch.Draw(sewingMachineTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); textOpenInventory.Draw(spriteBatch); DrawInventoryNormal(); @@ -8282,12 +8283,12 @@ enum Precipitation : byte { int size2 = (int)((1f/((((int)(inventoryScrollbarValueCraftingMax/5f)+1)*40)/160f))*160); int pos2 = (int)((((inventoryScrollbarValueCrafting*5)/40f)/inventoryScrollbarValueCraftingMax)*(160-size2))*8; if (size2>20) { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarBetweenTexture, new Rectangle(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+10-1+8, 20, size2-20), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11+size2-20-2+8), Color.White); } else { - spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), ColorWhite); - spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), ColorWhite); + spriteBatch.Draw(scrollbarUpTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+8), Color.White); + spriteBatch.Draw(scrollbarDownTexture, new Vector2(Global.WindowWidthHalf, Global.WindowHeightHalf-200+2+4+200+8+pos2+11-2+8), Color.White); } } @@ -8303,7 +8304,7 @@ enum Precipitation : byte { else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r200_g200_b200); } else { if (selectedCraftingItem==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), color_r150_g150_b150); - else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), ColorWhite); + else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+40+4+xx, Global.WindowHeightHalf-200+2+4+200+8+yh+8), Color.White); } InventoryCrafting[i].Draw(); //Texture2D tex = ItemIdToTexture(InventoryCrafting[i].X); @@ -8319,7 +8320,7 @@ enum Precipitation : byte { #endregion - DrawNeedNew(); + DrawNeed(); buttonInvHead.ButtonDraw(); buttonInvChest.ButtonDraw(); @@ -8342,11 +8343,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234, 604, 434+2, 1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233, 602, 434, 1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232, 600, 34), color_r10_g140_b255); - spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), ColorLightBlue); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2, 600, 400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(TextureOxygenMachine, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), ColorWhite); + spriteBatch.Draw(TextureOxygenMachine, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200), Color.White); textOpenInventory.Draw(spriteBatch); ItemInv[] invOxygenMachine=((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv; @@ -8354,7 +8355,7 @@ enum Precipitation : byte { DrawInventoryWithMoving(); #region Place for charging - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+40+20+5+1+2, Global.WindowHeightHalf+20-2+40+20+3+2), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+10+40+20+5+1+2, Global.WindowHeightHalf+20-2+40+20+3+2), Color.White); // if (!invMove||(invMove&&invStartInventory[invStartId]!=invOxygenMachine[0])) { invOxygenMachine[0].Draw(); @@ -8377,11 +8378,11 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-300-2, Global.WindowHeightHalf-234,604,434+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-300-1, Global.WindowHeightHalf-233,602,434,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-232,600,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300, Global.WindowHeightHalf-200+2,600,400-2), Color.LightBlue); buttonClose.ButtonDraw(); - spriteBatch.Draw(TextureBarrel, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), ColorWhite); + spriteBatch.Draw(TextureBarrel, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4,200,200), Color.White); textOpenInventory.Draw(spriteBatch); Barrel barrel=(Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]; ItemInv[] invBarrel=barrel.Inv; @@ -8391,32 +8392,32 @@ enum Precipitation : byte { DrawSideInventory(); #region Barel inventory - Vector2 vec=new Vector2(Global.WindowWidthHalf-300+119, Global.WindowHeightHalf-198+250); + Vector2 vec=new(Global.WindowWidthHalf-300+119, Global.WindowHeightHalf-198+250); // In - spriteBatch.Draw(inventorySlotInTexture, vec, ColorWhite); + spriteBatch.Draw(inventorySlotInTexture, vec, Color.White); invBarrel[0].Draw(); // Out vec.Y+=64; - spriteBatch.Draw(inventorySlotOutTexture, vec, ColorWhite); + spriteBatch.Draw(inventorySlotOutTexture, vec, Color.White); invBarrel[1].Draw(); //bar - spriteBatch.Draw(TextureBarBarrel, new Vector2(Global.WindowWidthHalf-300+4+42, Global.WindowHeightHalf-200+2+4+217), ColorWhite); + spriteBatch.Draw(TextureBarBarrel, new Vector2(Global.WindowWidthHalf-300+4+42, Global.WindowHeightHalf-200+2+4+217), Color.White); int a=(int)(barrel.LiquidAmount/255f*146); switch (barrel.LiquidId) { case (byte)LiquidId.Water: - spriteBatch.Draw(waterTexture, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a),new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), ColorWhite); + spriteBatch.Draw(waterTexture, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a),new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), Color.White); break; case (byte)LiquidId.WaterSalt: - spriteBatch.Draw(waterTexture, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a),new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), ColorWhite); + spriteBatch.Draw(waterTexture, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a),new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), Color.White); break; case (byte)LiquidId.Lava: - spriteBatch.Draw(lavaTexture, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a), new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), ColorWhite); + spriteBatch.Draw(lavaTexture, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a), new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), Color.White); break; case (byte)LiquidId.DyeArmy: @@ -8520,7 +8521,7 @@ enum Precipitation : byte { break; default: - spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a), new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), ColorWhite); + spriteBatch.Draw(pixel, new Rectangle(Global.WindowWidthHalf-300+4+42+5, Global.WindowHeightHalf-200+2+4+217+5+146-a, 25, a), new Rectangle(0,0,25,(int)(barrel.LiquidAmount/255f*16)), Color.White); break; } @@ -8535,22 +8536,22 @@ enum Precipitation : byte { #region Game menu case InventoryType.GameMenu: spriteBatch.Draw(pixel, new Rectangle(0,0, Global.WindowWidth, Global.WindowHeight), new Color((uint)(animationInvBack << 24))); - + DrawFrame(Global.WindowWidthHalf-150-2, Global.WindowHeightHalf-234+50, 304, 464+2-100,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-150-1, Global.WindowHeightHalf-233+50, 302, 464-100, 1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-232+50,300,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198+50,300,430-100), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-198+50,300,430-100), Color.LightBlue); textOpenInventory.Draw(spriteBatch); // Exit button [X] buttonClose.ButtonDraw(); - + // Continue game buttonContinue.ButtonDraw(); // Exit game buttonExit.ButtonDraw(); - + // Acheavements buttonAcheavements.ButtonDraw(); @@ -8595,7 +8596,7 @@ enum Precipitation : byte { "[Fps]: "+/*1f / (float)gameTime.ElapsedGameTime.TotalSeconds*/(int)Math.Round(fps, 3)+Environment.NewLine+ "[Fps f]: "+1f/(float)gameTime.ElapsedGameTime.TotalSeconds+Environment.NewLine+ "[CPU] Proces: "+(usageCpuProcess/Environment.ProcessorCount).ToString("0.00")+"%, Volné cpu: "+(100-usageCpu).ToString("0.00")+"%"+Environment.NewLine+ - "[RAM] Proces: "+(usageRamProcess/1048576).ToString("0.00")+"MB, Volná ram: "+usageRam.ToString("0.00")+"MB"+Environment.NewLine, new Color(dayAlpha*2, dayAlpha*2, dayAlpha*2)); ; + "[RAM] Proces: "+(usageRamProcess/1048576).ToString("0.00")+"MB, Volná ram: "+usageRam.ToString("0.00")+"MB"+Environment.NewLine, new Color(dayAlpha*2, dayAlpha*2, dayAlpha*2)); } } else if (Setting.Fps) { @@ -8674,7 +8675,7 @@ enum Precipitation : byte { // Exit game buttonExit.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60-2+50); - + // Acheavements buttonAcheavements.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60+60-2+50); @@ -8689,7 +8690,7 @@ enum Precipitation : byte { } break; - case InventoryType.BasicInv: + case InventoryType.BasicInv: { buttonClose.Position.X=Global.WindowWidthHalf+300-32; buttonClose.Position.Y=Global.WindowHeightHalf-232+1; @@ -8807,7 +8808,7 @@ enum Precipitation : byte { buttonInvTabTools.Position.X=xx; buttonInvTabTools.Position.Y=Global.WindowHeightHalf+20+32+64+32+8-2; - for (int i=0; i<4; i++) { + for (int i=0; i<4; i++) { ((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i].SetPos(InventoryGetPosFurnaceStone(i)); } } @@ -8944,7 +8945,7 @@ enum Precipitation : byte { } void MouseRightAction() { - int x = mousePosDiv16.X, + int x = mousePosDiv16.X, y = mousePosDiv16.Y; if (y<0) return; @@ -9255,7 +9256,7 @@ enum Precipitation : byte { return; } break; - } + } void ChangeLeaves(ushort newLeavesId, Texture2D newLeavesTexture) { LeavesBlock leaves=(LeavesBlock)chunk.TopBlocks[y]; @@ -9292,14 +9293,14 @@ enum Precipitation : byte { case (ushort)BlockId.Shelf: inventory=InventoryType.Shelf; SetCaptionInventory(); - selectedMashine=mousePosDiv16.Clone();; + selectedMashine=mousePosDiv16.Clone(); if (lastMashineType!=inventory) SetUpInvToNew(); return; case (ushort)BlockId.Barrel: inventory=InventoryType.Barrel; SetCaptionInventory(); - selectedMashine=mousePosDiv16.Clone();; + selectedMashine=mousePosDiv16.Clone(); if (lastMashineType!=inventory) SetUpInvToNew(); return; @@ -9313,7 +9314,7 @@ enum Precipitation : byte { case (ushort)BlockId.BoxWooden: inventory=InventoryType.BoxWooden; SetCaptionInventory(); - selectedMashine=mousePosDiv16.Clone();; + selectedMashine=mousePosDiv16.Clone(); if (lastMashineType!=inventory) SetUpInvToNew(); return; @@ -9454,19 +9455,19 @@ enum Precipitation : byte { if (isNotPlant) { switch (id) { case (ushort)Items.Seeds: - switch (random.Int(10)) { - default: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Dandelion,new Vector2(mousePosRoundX,mousePosRoundY)); break; - case 1: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Orchid, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 2: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Rose, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 3: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Heather, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 4: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.Violet, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 5: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassDesert, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 6: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassForest, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 7: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassHills, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 8: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassJungle, new Vector2(mousePosRoundX, mousePosRoundY)); break; - case 9: chunk.TopBlocks[y]=TopBlockFromId((ushort)BlockId.GrassPlains, new Vector2(mousePosRoundX, mousePosRoundY)); break; - } - chunk.IsTopBlocks[y]=true; + chunk.TopBlocks[y] = FastRandom.Int(10) switch { + 1 => TopBlockFromId((ushort)BlockId.Orchid, new Vector2(mousePosRoundX, mousePosRoundY)), + 2 => TopBlockFromId((ushort)BlockId.Rose, new Vector2(mousePosRoundX, mousePosRoundY)), + 3 => TopBlockFromId((ushort)BlockId.Heather, new Vector2(mousePosRoundX, mousePosRoundY)), + 4 => TopBlockFromId((ushort)BlockId.Violet, new Vector2(mousePosRoundX, mousePosRoundY)), + 5 => TopBlockFromId((ushort)BlockId.GrassDesert, new Vector2(mousePosRoundX, mousePosRoundY)), + 6 => TopBlockFromId((ushort)BlockId.GrassForest, new Vector2(mousePosRoundX, mousePosRoundY)), + 7 => TopBlockFromId((ushort)BlockId.GrassHills, new Vector2(mousePosRoundX, mousePosRoundY)), + 8 => TopBlockFromId((ushort)BlockId.GrassJungle, new Vector2(mousePosRoundX, mousePosRoundY)), + 9 => TopBlockFromId((ushort)BlockId.GrassPlains, new Vector2(mousePosRoundX, mousePosRoundY)), + _ => TopBlockFromId((ushort)BlockId.Dandelion, new Vector2(mousePosRoundX, mousePosRoundY)), + }; + chunk.IsTopBlocks[y]=true; if (chunk.StartSomething>y)chunk.StartSomething=/*(byte)*/y; InventoryRemoveSelectedItem(); return; @@ -9545,19 +9546,19 @@ enum Precipitation : byte { if (NotExists) { switch (mobId) { case (ushort)BlockId.Fish: - chunk.Mobs.Add(new Fish(/*mobId,*/ y, x,random.Bool(), fishTexture0, fishTexture1)); + chunk.Mobs.Add(new Fish(/*mobId,*/ y, x,FastRandom.Bool(), fishTexture0, fishTexture1)); break; case (ushort)BlockId.Chicken: - chunk.Mobs.Add(new Chicken(y, x, random.Bool(), chickenWalkTexture, chickenEatTexture)); + chunk.Mobs.Add(new Chicken(y, x, FastRandom.Bool(), chickenWalkTexture, chickenEatTexture)); break; case (ushort)BlockId.Rabbit: - chunk.Mobs.Add(new Rabbit(y, x, random.Bool(), rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture)); + chunk.Mobs.Add(new Rabbit(y, x, FastRandom.Bool(), rabbitWalkTexture, rabbitEatTexture, rabbitJumpTexture)); break; - + case (ushort)BlockId.MobParrot: - chunk.Mobs.Add(new Parrot(y, x, random.Bool(), false, TextureParrotStill, TextureParrotFly)); + chunk.Mobs.Add(new Parrot(y, x, FastRandom.Bool(), false, TextureParrotStill, TextureParrotFly)); break; } InventoryRemoveSelectedItem(); @@ -9604,43 +9605,44 @@ enum Precipitation : byte { chunk.TopBlocks[y]=block; chunk.IsTopBlocks[y]=true; - + if (chunk.StartSomething>y) chunk.StartSomething=/*(byte)*/y; - + chunk.RefreshLightingAddTop(y,blockId); InventoryRemoveSelectedItem(); return; } else return; - } else return; + } else return; } else { if (id==(ushort)Items.BucketForRubber) { if (!chunk.IsBackground[y])return; if (chunk.Background[y].Id!=(ushort)BlockId.RubberTreeWood) return; } - if (id==(ushort)Items.ChristmasStar) { + if (id==(ushort)Items.ChristmasStar) { if (chunk.IsTopBlocks[y+1]) { if (chunk.TopBlocks[y+1].Id==(ushort)BlockId.SpruceLeaves) { LeavesBlock leavesBlock=(LeavesBlock)block; (leavesBlock.tree=((LeavesBlock)chunk.TopBlocks[y+1]).tree).TitlesLeaves.Add(new UShortAndByte((ushort)x, (byte)y)); leavesBlock.SetOrigin(); - + chunk.TopBlocks[y]=block; chunk.IsTopBlocks[y]=true; // chunk.RefreshLightingAddTop(y,(ushort)BlockId.SpruceLeaves); if (chunk.StartSomething>y) chunk.StartSomething=y; } } - + return; } chunk.TopBlocks[y]=block; chunk.IsTopBlocks[y]=true; if (chunk.StartSomething>y) chunk.StartSomething=y; - terrain[x].RefreshLightingAddTop(y,id: blockId); + terrain[x].RefreshLightingAddTop(y, id: blockId); + if (blockId<(ushort)BlockId._MoreInLoad) { switch (blockId) { case (ushort)BlockId.FurnaceStone: @@ -9781,7 +9783,7 @@ enum Precipitation : byte { for (int i=0; i0) if (terrain[x-1].IsSolidBlocks[y]) return false; + if (x0) if (terrain[x].IsSolidBlocks[y-1]) return false; + return true; + } + #region Destruction void GetItemsFromBlock(int type, int X, int Y) { int X16=X*16, Y16=Y*16; @@ -10066,7 +10076,7 @@ enum Precipitation : byte { DropItemToPos(new ItemNonInvBasic((ushort)Items.AngelHair, 1), X16, Y16); RefreshAroundLabels(X, Y); return; - + case (ushort)BlockId.ChristmasBall: DropItemToPos(new ItemNonInvBasic((ushort)Items.ChristmasBallGray, 1), X16, Y16); RefreshAroundLabels(X, Y); @@ -10096,7 +10106,7 @@ enum Precipitation : byte { DropItemToPos(new ItemNonInvBasic((ushort)Items.ChristmasBallPurple, 1), X16, Y16); RefreshAroundLabels(X, Y); return; - + case (ushort)BlockId.ChristmasBallLightGreen: DropItemToPos(new ItemNonInvBasic((ushort)Items.ChristmasBallLightGreen, 1), X16, Y16); RefreshAroundLabels(X, Y); @@ -10180,14 +10190,14 @@ enum Precipitation : byte { case (ushort)BlockId.AppleLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); return; @@ -10205,7 +10215,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); return; } } @@ -10214,14 +10224,14 @@ enum Precipitation : byte { case (ushort)BlockId.EucalyptusLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.EucalyptusSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.EucalyptusSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.EucalyptusLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.EucalyptusLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); return; @@ -10239,7 +10249,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.EucalyptusSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.EucalyptusSapling, 1), X16, Y16); return; } } @@ -10248,14 +10258,14 @@ enum Precipitation : byte { case (ushort)BlockId.AcaciaLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); return; @@ -10273,7 +10283,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaSapling, 1), X16, Y16); return; } } @@ -10282,14 +10292,14 @@ enum Precipitation : byte { case (ushort)BlockId.WillowLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WillowSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WillowSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WillowLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WillowLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10307,7 +10317,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WillowSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WillowSapling, 1), X16, Y16); return; } } @@ -10316,14 +10326,14 @@ enum Precipitation : byte { case (ushort)BlockId.OliveLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10341,7 +10351,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); return; } } @@ -10350,14 +10360,14 @@ enum Precipitation : byte { case (ushort)BlockId.RubberTreeLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.RubberTreeSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.RubberTreeSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.RubberTreeLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.RubberTreeLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10375,7 +10385,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.RubberTreeSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.RubberTreeSapling, 1), X16, Y16); return; } } @@ -10384,14 +10394,14 @@ enum Precipitation : byte { case (ushort)BlockId.KapokLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10409,7 +10419,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); return; } } @@ -10418,14 +10428,14 @@ enum Precipitation : byte { case (ushort)BlockId.KapokLeacesFlowering: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokLeacesFlowering, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokLeacesFlowering, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokLeacesFlowering, 1), X16, Y16); return; @@ -10443,7 +10453,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); return; } } @@ -10452,21 +10462,21 @@ enum Precipitation : byte { case (ushort)BlockId.KapokLeacesFibre: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); - DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokFibre, 1), X16, Y16); + DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokFibre, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokLeavesFibre, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokLeavesFibre, 1), X16, Y16); else { - DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); - DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokFibre, 1), X16, Y16); + DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); + DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokFibre, 1), X16, Y16); } } else { - DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokFibre, 1), X16, Y16); + DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokFibre, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); return; @@ -10478,13 +10488,13 @@ enum Precipitation : byte { case 3: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); return; - + case 4: DropItemToPos(new ItemNonInvBasic((ushort)Items.Leave, 1), X16, Y16); return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.KapokSapling, 1), X16, Y16); return; } } @@ -10493,10 +10503,10 @@ enum Precipitation : byte { case (ushort)BlockId.OliveLeavesWithOlives: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveLeaves, 1), X16, Y16); else { DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvBasic((ushort)Items.Olive, 1), X16, Y16); @@ -10504,8 +10514,8 @@ enum Precipitation : byte { } else { DropItemToPos(new ItemNonInvBasic((ushort)Items.Olive, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10523,7 +10533,7 @@ enum Precipitation : byte { return; case 5: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OliveSapling, 1), X16, Y16); return; } } @@ -10532,21 +10542,21 @@ enum Precipitation : byte { case (ushort)BlockId.LemonLeavesWithLemons: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AcaciaSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvBasic((ushort)Items.Lemon, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonLeavesWithLemons, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonLeavesWithLemons, 1), X16, Y16); else { - DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); + DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvBasic((ushort)Items.Lemon, 1), X16, Y16); } } else { DropItemToPos(new ItemNonInvBasic((ushort)Items.Lemon, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10560,7 +10570,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonSapling, 1), X16, Y16); return; } } @@ -10569,14 +10579,14 @@ enum Precipitation : byte { case (ushort)BlockId.LindenLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LindenSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LindenSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LindenLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LindenLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10590,7 +10600,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LindenSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LindenSapling, 1), X16, Y16); return; } } @@ -10599,14 +10609,14 @@ enum Precipitation : byte { case (ushort)BlockId.OakLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OakSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OakSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OakLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OakLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10620,7 +10630,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OakSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OakSapling, 1), X16, Y16); return; } } @@ -10629,16 +10639,16 @@ enum Precipitation : byte { case (ushort)BlockId.OrangeLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { DropItemToPos(new ItemNonInvFood((ushort)Items.Orange, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10652,7 +10662,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); return; } } @@ -10661,27 +10671,27 @@ enum Precipitation : byte { case (ushort)BlockId.SpruceLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SpruceSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SpruceSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SpruceLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SpruceLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick, 1), X16, Y16); } else { - if (random.Bool()) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick,1), X16, Y16); - else if (random.Bool_20Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SpruceSapling, 1), X16, Y16); + if (FastRandom.Bool()) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick,1), X16, Y16); + else if (FastRandom.Bool_20Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SpruceSapling, 1), X16, Y16); } } return; case (ushort)BlockId.PlumLeavesWithPlums: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Plum, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumLeavesWithPlums, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumLeavesWithPlums, 1), X16, Y16); else { DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Plum, 1), X16, Y16); @@ -10689,8 +10699,8 @@ enum Precipitation : byte { } else { DropItemToPos(new ItemNonInvFood((ushort)Items.Plum, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10704,7 +10714,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); return; } } @@ -10713,14 +10723,14 @@ enum Precipitation : byte { case (ushort)BlockId.PlumLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10734,7 +10744,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PlumSapling, 1), X16, Y16); return; } } @@ -10743,14 +10753,14 @@ enum Precipitation : byte { case (ushort)BlockId.PineLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PineSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PineSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PineLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.PineLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10764,7 +10774,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.PineSapling,1),X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.PineSapling,1),X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Banana, 1), X16, Y16); return; } @@ -10774,12 +10784,12 @@ enum Precipitation : byte { case (ushort)BlockId.OrangeLeavesWithOranges: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Orange, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeLeavesWithOranges, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeLeavesWithOranges, 1), X16, Y16); else { DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Orange, 1), X16, Y16); @@ -10787,8 +10797,8 @@ enum Precipitation : byte { } else { DropItemToPos(new ItemNonInvFood((ushort)Items.Orange, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(6)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(6)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10802,7 +10812,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.OrangeSapling, 1), X16, Y16); return; } } @@ -10811,21 +10821,21 @@ enum Precipitation : byte { case (ushort)BlockId.AppleLeavesWithApples: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Apple, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleLeavesWithApples, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleLeavesWithApples, 1), X16, Y16); else { - DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); + DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Apple, 1), X16, Y16); } } else { DropItemToPos(new ItemNonInvFood((ushort)Items.Apple, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10839,7 +10849,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.AppleSapling, 1), X16, Y16); return; } } @@ -10848,14 +10858,14 @@ enum Precipitation : byte { case (ushort)BlockId.CherryLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherryLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherryLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10869,7 +10879,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); return; } } @@ -10878,21 +10888,21 @@ enum Precipitation : byte { case (ushort)BlockId.CherryLeavesWithCherries: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Cherry, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherryLeavesWithCherries, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CherryLeavesWithCherries, 1), X16, Y16); else { - DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); + DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvFood((ushort)Items.Cherry, 1), X16, Y16); } } else { DropItemToPos(new ItemNonInvFood((ushort)Items.Cherry, 1), X16, Y16); - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10906,7 +10916,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.CherrySapling, 1), X16, Y16); return; } } @@ -10915,14 +10925,14 @@ enum Precipitation : byte { case (ushort)BlockId.LemonLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonLeaves, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonLeaves, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10936,7 +10946,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.LemonSapling, 1), X16, Y16); return; } } @@ -10945,14 +10955,14 @@ enum Precipitation : byte { case (ushort)BlockId.MangroveLeaves: if (GameMethods.IsSelectedKnife(InventoryNormal[boxSelected].Id)) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MangroveSapling, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MangroveSapling, 1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); } else if (GameMethods.IsSelectedShears(InventoryNormal[boxSelected].Id)) { DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks, 1), X16, Y16); DropItemToPos(new ItemNonInvBasic((ushort)Items.Leave,1), X16, Y16); } else { - if (random.Bool_20Percent()) { - switch (random.Int(5)) { + if (FastRandom.Bool_20Percent()) { + switch (FastRandom.Int(5)) { case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -10966,7 +10976,7 @@ enum Precipitation : byte { return; case 4: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.MangroveSapling, 1), X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.MangroveSapling, 1), X16, Y16); return; } } @@ -11034,32 +11044,32 @@ enum Precipitation : byte { return; case (ushort)BlockId.GrassDesert: - if (random.Int(6)==1)DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_33_333Percent()/* Int(3)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); + if (FastRandom.Int(6)==1)DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_33_333Percent()/* Int(3)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); return; case (ushort)BlockId.GrassForest: - if (random.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); - else if (random.Bool_10Percent()/* Int(10)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); + if (FastRandom.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); + else if (FastRandom.Bool_10Percent()/* Int(10)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); return; case (ushort)BlockId.GrassHills: - if (random.Int(7)==1)DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_20Percent() /*Int(5)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); - else if (random.Bool_10Percent() /*Int(10)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); + if (FastRandom.Int(7)==1)DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_20Percent() /*Int(5)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); + else if (FastRandom.Bool_10Percent() /*Int(10)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); return; case (ushort)BlockId.GrassJungle: - if (random.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_20Percent()/* Int(5)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); - else if (random.Bool_5_555Percent() /*Int(20)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); + if (FastRandom.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_20Percent()/* Int(5)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); + else if (FastRandom.Bool_5_555Percent() /*Int(20)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); return; case (ushort)BlockId.GrassPlains: - if (random.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_33_333Percent() /*Int(3)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); - else if (random.Bool_10Percent() /*Int(10)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); + if (FastRandom.Bool_20Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_33_333Percent() /*Int(3)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay,1), X16, Y16); + else if (FastRandom.Bool_10Percent() /*Int(10)==1*/)DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); return; @@ -11067,7 +11077,7 @@ enum Precipitation : byte { case (ushort)BlockId.Glass: DropItemToPos(new ItemNonInvBasic((ushort)Items.Glass, 1), X16, Y16); return; - + case (ushort)BlockId.ChristmasStar: DropItemToPos(new ItemNonInvBasic((ushort)Items.ChristmasStar, 1), X16, Y16); return; @@ -11094,12 +11104,12 @@ enum Precipitation : byte { return; case (ushort)BlockId.BranchALittle1: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick,1), X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick,1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; case (ushort)BlockId.BranchALittle2: - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick,1), X16, Y16); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.Stick,1), X16, Y16); else DropItemToPos(new ItemNonInvBasic((ushort)Items.Sticks,1), X16, Y16); return; @@ -11142,7 +11152,7 @@ enum Precipitation : byte { case (ushort)BlockId.Rocks: AchievementStoneAge=true; - switch (random.Int(100)) { + switch (FastRandom.Int(100)) { case 0: DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); return; case 1: DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); return; case 2: DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); return; @@ -11221,25 +11231,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneBasalt: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneBasalt), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11249,25 +11262,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneDiorit: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneDiorit), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11277,25 +11293,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneDolomite: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.BackDolomite), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11305,25 +11324,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneGabbro: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneGabbro), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11333,25 +11355,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneGneiss: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneGneiss), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11361,25 +11386,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneLimestone: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneLimestone), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11389,25 +11417,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneRhyolite: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneRhyolite), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11417,25 +11448,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneSandstone: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneSandstone), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11445,25 +11479,28 @@ enum Precipitation : byte { return; case (ushort)BlockId.StoneSchist: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool_2Percent() /*Int(50)==1*/) { - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.StoneSchist), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool_2Percent() /*Int(50)==1*/) { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Smaragd, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Ruby, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saphirite, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Diamond, 1), X16, Y16); + } } { Terrain chunk=terrain[X]; @@ -11473,15 +11510,18 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreCoal: - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalWood, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreCoal), X16, Y16); + else { + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCoal,1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CoalWood, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11490,12 +11530,15 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreAluminium: - if (random.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.Aluminium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreAluminium), X16, Y16); + else { + if (FastRandom.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.Aluminium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11504,13 +11547,16 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreCopper: - if (random.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CopperDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreCopper), X16, Y16); + else { + if (FastRandom.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemCopper, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.CopperDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11519,13 +11565,16 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreGold: - if (random.Bool_75Percent()/* Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.GoldDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreGold), X16, Y16); + else { + if (FastRandom.Bool_75Percent()/* Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemGold, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.GoldDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11534,13 +11583,16 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreIron: - if (random.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.IronDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreIron), X16, Y16); + else { + if (FastRandom.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemIron, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.IronDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11549,14 +11601,17 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreSilver: - if (random.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SilverDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreSilver), X16, Y16); + else { + if (FastRandom.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemSilver, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SilverDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Silicium, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11565,13 +11620,16 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreTin: - if (random.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.TinDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreTin), X16, Y16); + else { + if (FastRandom.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.ItemTin, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.TinDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11580,12 +11638,15 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreSaltpeter: - if (random.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saltpeter, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreSaltpeter), X16, Y16); + else { + if (FastRandom.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.Saltpeter, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11594,12 +11655,15 @@ enum Precipitation : byte { return; case (ushort)BlockId.OreSulfur: - if (random.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.SulfurDust, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.OreSulfur), X16, Y16); + else { + if (FastRandom.Bool_75Percent() /*Int4()!=1*/) DropItemToPos(new ItemNonInvBasic((ushort)Items.SulfurDust, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11608,12 +11672,15 @@ enum Precipitation : byte { return; case (ushort)BlockId.Cobblestone: - DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); - else if (random.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + if (NoAround(X, Y)) DropItemToPos(new ItemNonInvBasic((ushort)Items.BackCobblestone), X16, Y16); + else { + DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.MediumStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.SmallStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Gravel, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.BigStone, 1), X16, Y16); + else if (FastRandom.Bool()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Sand, 1), X16, Y16); + } { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; @@ -11673,7 +11740,7 @@ enum Precipitation : byte { terrain[X].IsBackground[Y]=true; terrain[X].Background[Y]=BackBlockFromId((ushort)BlockId.BackDirt,new Vector2(X16, Y16)); return; - + case (ushort)BlockId.GrassBlockSnowPlains: DropItemToPos(new ItemNonInvBasic((ushort)Items.Dirt, 1), X16, Y16); DestroyGrassUp(destroyBlockX,destroyBlockY-1); @@ -11843,382 +11910,335 @@ enum Precipitation : byte { } float GetBackBlockDestroingSpeed(ushort type) { - switch (type) { - case (ushort)BlockId.AdvancedSpaceBack: return 400*DestroyPickaxe(); - - case (ushort)BlockId.AppleWood: return 300*DestroyAxe(); - case (ushort)BlockId.CherryWood: return 300*DestroyAxe(); - case (ushort)BlockId.LemonWood: return 300*DestroyAxe(); - case (ushort)BlockId.LindenWood: return 320*DestroyAxe(); - case (ushort)BlockId.OakWood: return 320*DestroyAxe(); - case (ushort)BlockId.OrangeWood: return 300*DestroyAxe(); - case (ushort)BlockId.PineWood: return 300*DestroyAxe(); - case (ushort)BlockId.PlumWood: return 300*DestroyAxe(); - case (ushort)BlockId.SpruceWood: return 280*DestroyAxe(); - - case (ushort)BlockId.KapokWood: return 280*DestroyAxe(); - - case (ushort)BlockId.OliveWood: return 280*DestroyAxe(); - - case (ushort)BlockId.MangroveWood: return 280*DestroyAxe(); - case (ushort)BlockId.WillowWood: return 280*DestroyAxe(); - case (ushort)BlockId.RubberTreeWood: return 280*DestroyAxe(); - case (ushort)BlockId.EucalyptusWood: return 280*DestroyAxe(); - case (ushort)BlockId.AcaciaWood: return 280*DestroyAxe(); - - - case (ushort)BlockId.BackCobblestone: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackGravel: return 300*DestroyShovel(); - case (ushort)BlockId.BackDirt: return 300*DestroyShovel(); - case (ushort)BlockId.BackRedSand: return 300*DestroyShovel(); - case (ushort)BlockId.BackRegolite: return 300*DestroyShovel(); - case (ushort)BlockId.BackSand: return 300*DestroyShovel(); - - case (ushort)BlockId.BackCoal: return 290*DestroyPickaxe(); - case (ushort)BlockId.BackCopper: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackTin: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackIron: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackAluminium: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackSilver: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackGold: return 300*DestroyPickaxe(); - - case (ushort)BlockId.BackSulfur: return 250*DestroyPickaxe(); - case (ushort)BlockId.BackSaltpeter: return 250*DestroyPickaxe(); - - case (ushort)BlockId.BackAnorthosite: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackBasalt: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackClay: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackDiorit: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackDolomite: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackFlint: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackGabbro: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackGneiss: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackLimestone: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackMudstone: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackRhyolite: return 300*DestroyPickaxe(); - case (ushort)BlockId.BackSandstone: return 300*DestroyPickaxe(); - } - - return 0; - } + return type switch { + (ushort)BlockId.AdvancedSpaceBack => 400 * DestroyPickaxe(), + (ushort)BlockId.AppleWood => 300 * DestroyAxe(), + (ushort)BlockId.CherryWood => 300 * DestroyAxe(), + (ushort)BlockId.LemonWood => 300 * DestroyAxe(), + (ushort)BlockId.LindenWood => 320 * DestroyAxe(), + (ushort)BlockId.OakWood => 320 * DestroyAxe(), + (ushort)BlockId.OrangeWood => 300 * DestroyAxe(), + (ushort)BlockId.PineWood => 300 * DestroyAxe(), + (ushort)BlockId.PlumWood => 300 * DestroyAxe(), + (ushort)BlockId.SpruceWood => 280 * DestroyAxe(), + (ushort)BlockId.KapokWood => 280 * DestroyAxe(), + (ushort)BlockId.OliveWood => 280 * DestroyAxe(), + (ushort)BlockId.MangroveWood => 280 * DestroyAxe(), + (ushort)BlockId.WillowWood => 280 * DestroyAxe(), + (ushort)BlockId.RubberTreeWood => 280 * DestroyAxe(), + (ushort)BlockId.EucalyptusWood => 280 * DestroyAxe(), + (ushort)BlockId.AcaciaWood => 280 * DestroyAxe(), + (ushort)BlockId.BackCobblestone => 300 * DestroyPickaxe(), + (ushort)BlockId.BackGravel => 300 * DestroyShovel(), + (ushort)BlockId.BackDirt => 300 * DestroyShovel(), + (ushort)BlockId.BackRedSand => 300 * DestroyShovel(), + (ushort)BlockId.BackRegolite => 300 * DestroyShovel(), + (ushort)BlockId.BackSand => 300 * DestroyShovel(), + (ushort)BlockId.BackCoal => 290 * DestroyPickaxe(), + (ushort)BlockId.BackCopper => 300 * DestroyPickaxe(), + (ushort)BlockId.BackTin => 300 * DestroyPickaxe(), + (ushort)BlockId.BackIron => 300 * DestroyPickaxe(), + (ushort)BlockId.BackAluminium => 300 * DestroyPickaxe(), + (ushort)BlockId.BackSilver => 300 * DestroyPickaxe(), + (ushort)BlockId.BackGold => 300 * DestroyPickaxe(), + (ushort)BlockId.BackSulfur => 250 * DestroyPickaxe(), + (ushort)BlockId.BackSaltpeter => 250 * DestroyPickaxe(), + (ushort)BlockId.BackAnorthosite => 300 * DestroyPickaxe(), + (ushort)BlockId.BackBasalt => 300 * DestroyPickaxe(), + (ushort)BlockId.BackClay => 300 * DestroyPickaxe(), + (ushort)BlockId.BackDiorit => 300 * DestroyPickaxe(), + (ushort)BlockId.BackDolomite => 300 * DestroyPickaxe(), + (ushort)BlockId.BackFlint => 300 * DestroyPickaxe(), + (ushort)BlockId.BackGabbro => 300 * DestroyPickaxe(), + (ushort)BlockId.BackGneiss => 300 * DestroyPickaxe(), + (ushort)BlockId.BackLimestone => 300 * DestroyPickaxe(), + (ushort)BlockId.BackMudstone => 300 * DestroyPickaxe(), + (ushort)BlockId.BackRhyolite => 300 * DestroyPickaxe(), + (ushort)BlockId.BackSandstone => 300 * DestroyPickaxe(), + _ => 0, + }; + } float GetSolidBlockDestroingSpeed(ushort type) { - switch (type) { - case (ushort)BlockId.Windmill: return 45; - case (ushort)BlockId.FurnaceStone: return 45; - case (ushort)BlockId.FurnaceElectric: return 45; - case (ushort)BlockId.Macerator: return 45; - case (ushort)BlockId.Miner: return 45; - case (ushort)BlockId.SolarPanel: return 45; - - case (ushort)BlockId.Clay: return 110*DestroyShovel(); - case (ushort)BlockId.GrassBlockClay: return 120*DestroyShovel(); - case (ushort)BlockId.GrassBlockSnowPlains: return 250*DestroyShovel(); - case (ushort)BlockId.GrassBlockSnowDesert: return 250*DestroyShovel(); - case (ushort)BlockId.GrassBlockSnowForest: return 250*DestroyShovel(); - case (ushort)BlockId.GrassBlockSnowHills: return 250*DestroyShovel(); - case (ushort)BlockId.GrassBlockSnowJungle: return 250*DestroyShovel(); - case (ushort)BlockId.GrassBlockSnowCompost: return 250*DestroyShovel(); - case (ushort)BlockId.GrassBlockSnowClay: return 250*DestroyShovel(); - - case (ushort)BlockId.GrassBlockDesert: return 100*DestroyShovel(); - case (ushort)BlockId.GrassBlockForest: return 100*DestroyShovel(); - case (ushort)BlockId.GrassBlockHills: return 105*DestroyShovel(); - case (ushort)BlockId.GrassBlockJungle: return 105*DestroyShovel(); - case (ushort)BlockId.GrassBlockPlains: return 95*DestroyShovel(); - case (ushort)BlockId.GrassBlockCompost: return 100*DestroyShovel(); - case (ushort)BlockId.Dirt: return 90*DestroyShovel(); - case (ushort)BlockId.Gravel: return 120*DestroyShovel(); - - case (ushort)BlockId.Sand: return 60*DestroyShovel(); - case (ushort)BlockId.Compost: return 70*DestroyShovel(); - case (ushort)BlockId.Cobblestone: return 280*DestroyPickaxe(); - - case (ushort)BlockId.Roof1: return 120*DestroyPickaxe(); - case (ushort)BlockId.Roof2: return 120*DestroyPickaxe(); - case (ushort)BlockId.DoorClose: return 280*DestroyPickaxe(); - - case (ushort)BlockId.StoneBasalt: return 320*DestroyPickaxe(); - case (ushort)BlockId.StoneDiorit: return 300*DestroyPickaxe(); - case (ushort)BlockId.StoneDolomite: return 280*DestroyPickaxe(); - case (ushort)BlockId.StoneGabbro: return 320*DestroyPickaxe(); - case (ushort)BlockId.StoneGneiss: return 320*DestroyPickaxe(); - case (ushort)BlockId.StoneLimestone: return 280*DestroyPickaxe(); - case (ushort)BlockId.StoneRhyolite: return 300*DestroyPickaxe(); - case (ushort)BlockId.StoneSandstone: return 260*DestroyPickaxe(); - case (ushort)BlockId.StoneSchist: return 300*DestroyPickaxe(); - - case (ushort)BlockId.OreCoal: return 260*DestroyPickaxe(); - case (ushort)BlockId.OreAluminium: return 320*DestroyPickaxe(); - case (ushort)BlockId.OreCopper: return 320*DestroyPickaxe(); - case (ushort)BlockId.OreGold: return 300*DestroyPickaxe(); - case (ushort)BlockId.OreIron: return 320*DestroyPickaxe(); - - case (ushort)BlockId.OreSilver: return 300*DestroyPickaxe(); - - case (ushort)BlockId.OreTin: return 300*DestroyPickaxe(); - - case (ushort)BlockId.OreSaltpeter: return 250*DestroyPickaxe(); - case (ushort)BlockId.OreSulfur: return 250*DestroyPickaxe(); - - case (ushort)BlockId.Ice: return 120*DestroyAxe(); - - case (ushort)BlockId.AdvancedSpaceBlock: return 100*DestroyPickaxe(); - case (ushort)BlockId.AdvancedSpaceFloor: return 100*DestroyPickaxe(); - case (ushort)BlockId.AdvancedSpaceWindow: return 100*DestroyPickaxe(); - - case (ushort)BlockId.Planks: return 100*DestroyAxe(); - case (ushort)BlockId.Bricks: return 160*DestroyPickaxe(); - - case (ushort)BlockId.AdvancedSpacePart1: return 90*DestroyPickaxe(); - case (ushort)BlockId.AdvancedSpacePart2: return 90*DestroyPickaxe(); - case (ushort)BlockId.AdvancedSpacePart3: return 90*DestroyPickaxe(); - case (ushort)BlockId.AdvancedSpacePart4: return 90*DestroyPickaxe(); - } - - return 0; - } + return type switch { + (ushort)BlockId.Windmill => 45, + (ushort)BlockId.FurnaceStone => 45, + (ushort)BlockId.FurnaceElectric => 45, + (ushort)BlockId.Macerator => 45, + (ushort)BlockId.Miner => 45, + (ushort)BlockId.SolarPanel => 45, + (ushort)BlockId.Clay => 110 * DestroyShovel(), + (ushort)BlockId.GrassBlockClay => 120 * DestroyShovel(), + (ushort)BlockId.GrassBlockSnowPlains => 250 * DestroyShovel(), + (ushort)BlockId.GrassBlockSnowDesert => 250 * DestroyShovel(), + (ushort)BlockId.GrassBlockSnowForest => 250 * DestroyShovel(), + (ushort)BlockId.GrassBlockSnowHills => 250 * DestroyShovel(), + (ushort)BlockId.GrassBlockSnowJungle => 250 * DestroyShovel(), + (ushort)BlockId.GrassBlockSnowCompost => 250 * DestroyShovel(), + (ushort)BlockId.GrassBlockSnowClay => 250 * DestroyShovel(), + (ushort)BlockId.GrassBlockDesert => 100 * DestroyShovel(), + (ushort)BlockId.GrassBlockForest => 100 * DestroyShovel(), + (ushort)BlockId.GrassBlockHills => 105 * DestroyShovel(), + (ushort)BlockId.GrassBlockJungle => 105 * DestroyShovel(), + (ushort)BlockId.GrassBlockPlains => 95 * DestroyShovel(), + (ushort)BlockId.GrassBlockCompost => 100 * DestroyShovel(), + (ushort)BlockId.Dirt => 90 * DestroyShovel(), + (ushort)BlockId.Gravel => 120 * DestroyShovel(), + (ushort)BlockId.Sand => 60 * DestroyShovel(), + (ushort)BlockId.Compost => 70 * DestroyShovel(), + (ushort)BlockId.Cobblestone => 280 * DestroyPickaxe(), + (ushort)BlockId.Roof1 => 120 * DestroyPickaxe(), + (ushort)BlockId.Roof2 => 120 * DestroyPickaxe(), + (ushort)BlockId.DoorClose => 280 * DestroyPickaxe(), + (ushort)BlockId.StoneBasalt => 320 * DestroyPickaxe(), + (ushort)BlockId.StoneDiorit => 300 * DestroyPickaxe(), + (ushort)BlockId.StoneDolomite => 280 * DestroyPickaxe(), + (ushort)BlockId.StoneGabbro => 320 * DestroyPickaxe(), + (ushort)BlockId.StoneGneiss => 320 * DestroyPickaxe(), + (ushort)BlockId.StoneLimestone => 280 * DestroyPickaxe(), + (ushort)BlockId.StoneRhyolite => 300 * DestroyPickaxe(), + (ushort)BlockId.StoneSandstone => 260 * DestroyPickaxe(), + (ushort)BlockId.StoneSchist => 300 * DestroyPickaxe(), + (ushort)BlockId.OreCoal => 260 * DestroyPickaxe(), + (ushort)BlockId.OreAluminium => 320 * DestroyPickaxe(), + (ushort)BlockId.OreCopper => 320 * DestroyPickaxe(), + (ushort)BlockId.OreGold => 300 * DestroyPickaxe(), + (ushort)BlockId.OreIron => 320 * DestroyPickaxe(), + (ushort)BlockId.OreSilver => 300 * DestroyPickaxe(), + (ushort)BlockId.OreTin => 300 * DestroyPickaxe(), + (ushort)BlockId.OreSaltpeter => 250 * DestroyPickaxe(), + (ushort)BlockId.OreSulfur => 250 * DestroyPickaxe(), + (ushort)BlockId.Ice => 120 * DestroyAxe(), + (ushort)BlockId.AdvancedSpaceBlock => 100 * DestroyPickaxe(), + (ushort)BlockId.AdvancedSpaceFloor => 100 * DestroyPickaxe(), + (ushort)BlockId.AdvancedSpaceWindow => 100 * DestroyPickaxe(), + (ushort)BlockId.Planks => 100 * DestroyAxe(), + (ushort)BlockId.Bricks => 160 * DestroyPickaxe(), + (ushort)BlockId.AdvancedSpacePart1 => 90 * DestroyPickaxe(), + (ushort)BlockId.AdvancedSpacePart2 => 90 * DestroyPickaxe(), + (ushort)BlockId.AdvancedSpacePart3 => 90 * DestroyPickaxe(), + (ushort)BlockId.AdvancedSpacePart4 => 90 * DestroyPickaxe(), + _ => 0, + }; + } float GetTopBlockDestroingSpeed(ushort type) { - switch (type) { - case (ushort)BlockId.Desk: return 45; - case (ushort)BlockId.Rocket: return 45; - - case (ushort)BlockId.EggDrop: return 20; - - case (ushort)BlockId.Ladder: return 90*DestroyAxe(); - case (ushort)BlockId.Lamp: return 45; - - case (ushort)BlockId.Watermill: return 45; - case (ushort)BlockId.Flag: return 45; - - case (ushort)BlockId.Label: return 30; - - case (ushort)BlockId.Snow: return 100*DestroyShovel(); - - case (ushort)BlockId.AppleLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.LemonLeavesWithLemons: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.LindenLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.OakLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.OrangeLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.SpruceLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.PlumLeavesWithPlums: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.PlumLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.PineLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.OrangeLeavesWithOranges: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.AppleLeavesWithApples: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.CherryLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.CherryLeavesWithCherries: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.LemonLeaves: return 15*DestroyKnife()*DestroyShears(); - - case (ushort)BlockId.AcaciaLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.EucalyptusLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.KapokLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.KapokLeacesFibre: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.KapokLeacesFlowering: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.MangroveLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.OliveLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.OliveLeavesWithOlives: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.RubberTreeLeaves: return 15*DestroyKnife()*DestroyShears(); - case (ushort)BlockId.WillowLeaves: return 15*DestroyKnife()*DestroyShears(); - - case (ushort)BlockId.Violet: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); - case (ushort)BlockId.Dandelion: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); - case (ushort)BlockId.Heather: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); - case (ushort)BlockId.Alore: return 30*DestroyKnife()*DestroyShears()*DestroyShovel(); - case (ushort)BlockId.CactusBig: return 60; - case (ushort)BlockId.CactusSmall: return 60; - - case (ushort)BlockId.AppleSapling: return 30*DestroyKnife(); - case (ushort)BlockId.CherrySapling: return 30*DestroyKnife(); - case (ushort)BlockId.LemonSapling: return 30*DestroyKnife(); - case (ushort)BlockId.LindenSapling: return 30*DestroyKnife(); - case (ushort)BlockId.OakSapling: return 30*DestroyKnife(); - case (ushort)BlockId.OrangeSapling: return 30*DestroyKnife(); - case (ushort)BlockId.PineSapling: return 30*DestroyKnife(); - case (ushort)BlockId.PlumSapling: return 30*DestroyKnife(); - case (ushort)BlockId.SpruceSapling: return 30*DestroyKnife(); - - case (ushort)BlockId.GrassDesert: return 30*DestroyKnife(); - case (ushort)BlockId.GrassForest: return 30*DestroyKnife(); - case (ushort)BlockId.GrassHills: return 30*DestroyKnife(); - case (ushort)BlockId.GrassJungle: return 30*DestroyKnife(); - case (ushort)BlockId.GrassPlains: return 30*DestroyKnife(); - - // case (ushort)BlockId.Liana: return 30*DestroyAxe(); - - case (ushort)BlockId.Wheat: return 30*DestroyKnife(); - case (ushort)BlockId.Onion: return 30*DestroyShovel(); - case (ushort)BlockId.Flax: return 30*DestroyKnife(); - case (ushort)BlockId.Glass: return 30; - case (ushort)BlockId.ChristmasStar: return 30; - case (ushort)BlockId.Orchid: return 30*DestroyShovel(); - case (ushort)BlockId.Radio: return 45; - case (ushort)BlockId.Rose: return 30*DestroyShovel(); - case (ushort)BlockId.Seaweed: return 30*DestroyKnife(); - case (ushort)BlockId.SugarCane: return 30*DestroyKnife(); - case (ushort)BlockId.Toadstool: return 30*DestroyKnife(); - case (ushort)BlockId.Strawberry: return 30*DestroyShovel(); - case (ushort)BlockId.Rashberry: return 30*DestroyShovel(); - case (ushort)BlockId.Blueberry: return 30*DestroyShovel(); - case (ushort)BlockId.Boletus: return 30*DestroyKnife(); - case (ushort)BlockId.SnowTop: return 45*DestroyShovel(); - case (ushort)BlockId.Roof1: return 90; - case (ushort)BlockId.Coral: return 60*DestroyKnife(); - case (ushort)BlockId.BranchALittle1: return 30; - case (ushort)BlockId.BranchALittle2: return 30; - case (ushort)BlockId.BranchFull: return 30; - case (ushort)BlockId.BranchWithout: return 30; - case (ushort)BlockId.Champignon: return 30*DestroyKnife(); - case (ushort)BlockId.DoorOpen: return 45; - } - - return 0; - } + return type switch { + (ushort)BlockId.Desk => 45, + (ushort)BlockId.Rocket => 45, + (ushort)BlockId.EggDrop => 20, + (ushort)BlockId.Ladder => 90 * DestroyAxe(), + (ushort)BlockId.Lamp => 45, + (ushort)BlockId.Watermill => 45, + (ushort)BlockId.Flag => 45, + (ushort)BlockId.Label => 30, + (ushort)BlockId.Snow => 100 * DestroyShovel(), + (ushort)BlockId.AppleLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.LemonLeavesWithLemons => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.LindenLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.OakLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.OrangeLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.SpruceLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.PlumLeavesWithPlums => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.PlumLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.PineLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.OrangeLeavesWithOranges => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.AppleLeavesWithApples => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.CherryLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.CherryLeavesWithCherries => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.LemonLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.AcaciaLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.EucalyptusLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.KapokLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.KapokLeacesFibre => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.KapokLeacesFlowering => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.MangroveLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.OliveLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.OliveLeavesWithOlives => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.RubberTreeLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.WillowLeaves => 15 * DestroyKnife() * DestroyShears(), + (ushort)BlockId.Violet => 30 * DestroyKnife() * DestroyShears() * DestroyShovel(), + (ushort)BlockId.Dandelion => 30 * DestroyKnife() * DestroyShears() * DestroyShovel(), + (ushort)BlockId.Heather => 30 * DestroyKnife() * DestroyShears() * DestroyShovel(), + (ushort)BlockId.Alore => 30 * DestroyKnife() * DestroyShears() * DestroyShovel(), + (ushort)BlockId.CactusBig => 60, + (ushort)BlockId.CactusSmall => 60, + (ushort)BlockId.AppleSapling => 30 * DestroyKnife(), + (ushort)BlockId.CherrySapling => 30 * DestroyKnife(), + (ushort)BlockId.LemonSapling => 30 * DestroyKnife(), + (ushort)BlockId.LindenSapling => 30 * DestroyKnife(), + (ushort)BlockId.OakSapling => 30 * DestroyKnife(), + (ushort)BlockId.OrangeSapling => 30 * DestroyKnife(), + (ushort)BlockId.PineSapling => 30 * DestroyKnife(), + (ushort)BlockId.PlumSapling => 30 * DestroyKnife(), + (ushort)BlockId.SpruceSapling => 30 * DestroyKnife(), + (ushort)BlockId.GrassDesert => 30 * DestroyKnife(), + (ushort)BlockId.GrassForest => 30 * DestroyKnife(), + (ushort)BlockId.GrassHills => 30 * DestroyKnife(), + (ushort)BlockId.GrassJungle => 30 * DestroyKnife(), + (ushort)BlockId.GrassPlains => 30 * DestroyKnife(), + // case (ushort)BlockId.Liana: return 30*DestroyAxe(); + (ushort)BlockId.Wheat => 30 * DestroyKnife(), + (ushort)BlockId.Onion => 30 * DestroyShovel(), + (ushort)BlockId.Flax => 30 * DestroyKnife(), + (ushort)BlockId.Glass => 30, + (ushort)BlockId.ChristmasStar => 30, + (ushort)BlockId.Orchid => 30 * DestroyShovel(), + (ushort)BlockId.Radio => 45, + (ushort)BlockId.Rose => 30 * DestroyShovel(), + (ushort)BlockId.Seaweed => 30 * DestroyKnife(), + (ushort)BlockId.SugarCane => 30 * DestroyKnife(), + (ushort)BlockId.Toadstool => 30 * DestroyKnife(), + (ushort)BlockId.Strawberry => 30 * DestroyShovel(), + (ushort)BlockId.Rashberry => 30 * DestroyShovel(), + (ushort)BlockId.Blueberry => 30 * DestroyShovel(), + (ushort)BlockId.Boletus => 30 * DestroyKnife(), + (ushort)BlockId.SnowTop => 45 * DestroyShovel(), + (ushort)BlockId.Roof1 => 90, + (ushort)BlockId.Coral => 60 * DestroyKnife(), + (ushort)BlockId.BranchALittle1 => 30, + (ushort)BlockId.BranchALittle2 => 30, + (ushort)BlockId.BranchFull => 30, + (ushort)BlockId.BranchWithout => 30, + (ushort)BlockId.Champignon => 30 * DestroyKnife(), + (ushort)BlockId.DoorOpen => 45, + _ => 0, + }; + } float GetPlantDestroingSpeed(ushort type) { - switch (type) { - case (ushort)BlockId.Wheat: return 30; - case (ushort)BlockId.Onion: return 30; - case (ushort)BlockId.Carrot: return 30; - case (ushort)BlockId.Peas: return 30; - case (ushort)BlockId.Flax: return 30; - - case (ushort)BlockId.Strawberry: return 30; - case (ushort)BlockId.Rashberry: return 30; - case (ushort)BlockId.Blueberry: return 30; - } - - return 0; - } + return type switch { + (ushort)BlockId.Wheat => 30, + (ushort)BlockId.Onion => 30, + (ushort)BlockId.Carrot => 30, + (ushort)BlockId.Peas => 30, + (ushort)BlockId.Flax => 30, + (ushort)BlockId.Strawberry => 30, + (ushort)BlockId.Rashberry => 30, + (ushort)BlockId.Blueberry => 30, + _ => 0, + }; + } float GetMobDestroingSpeed(ushort type) { - switch (type) { - case (ushort)BlockId.Rabbit: return 30*DestroyKnife(); - case (ushort)BlockId.Chicken: return 30*DestroyKnife(); - case (ushort)BlockId.Fish: return 30*DestroyKnife(); - case (ushort)BlockId.MobParrot: return 30*DestroyKnife(); - } - - return 0; - } + return type switch { + (ushort)BlockId.Rabbit => 30 * DestroyKnife(), + (ushort)BlockId.Chicken => 30 * DestroyKnife(), + (ushort)BlockId.Fish => 30 * DestroyKnife(), + (ushort)BlockId.MobParrot => 30 * DestroyKnife(), + _ => 0, + }; + } float DestroyPickaxe() { - switch (InventoryNormal[boxSelected].Id) { - case (ushort)Items.PickaxeStone: return 0.4f; - case (ushort)Items.PickaxeGold: return 0.5f; - case (ushort)Items.PickaxeCopper: return 0.3f; - case (ushort)Items.PickaxeBronze: return 0.25f; - case (ushort)Items.PickaxeAluminium: return 0.45f; - case (ushort)Items.PickaxeIron: return 0.2f; - case (ushort)Items.PickaxeSteel: return 0.19f; - - case (ushort)Items.ElectricDrill: return 0.1f; - case (ushort)Items.MediumStone: return 0.93f; - case (ushort)Items.SmallStone: return 0.96f; - case (ushort)Items.BigStone: return 0.90f; - case (ushort)Items.PickaxeHeadIron: return 0.80f; - case (ushort)Items.StoneHead: return 0.80f; - } - - return 1; - } + return InventoryNormal[boxSelected].Id switch { + (ushort)Items.PickaxeStone => 0.4f, + (ushort)Items.PickaxeGold => 0.5f, + (ushort)Items.PickaxeCopper => 0.3f, + (ushort)Items.PickaxeBronze => 0.25f, + (ushort)Items.PickaxeAluminium => 0.45f, + (ushort)Items.PickaxeIron => 0.2f, + (ushort)Items.PickaxeSteel => 0.19f, + (ushort)Items.ElectricDrill => 0.1f, + (ushort)Items.MediumStone => 0.93f, + (ushort)Items.SmallStone => 0.96f, + (ushort)Items.BigStone => 0.90f, + (ushort)Items.PickaxeHeadIron => 0.80f, + (ushort)Items.StoneHead => 0.80f, + _ => 1, + }; + } float DestroyAxe() { - switch (InventoryNormal[boxSelected].Id) { - case (ushort)Items.AxeStone: return 0.4f; - case (ushort)Items.AxeIron: return 0.2f; - case (ushort)Items.AxeGold: return 0.5f; - case (ushort)Items.AxeCopper: return 0.3f; - case (ushort)Items.AxeBronze: return 0.25f; - case (ushort)Items.AxeAluminium: return 0.35f; - case (ushort)Items.AxeSteel: return 0.19f; - - case (ushort)Items.ElectricSaw: return 0.1f; - case (ushort)Items.AxeHeadIron: return 0.87f; - case (ushort)Items.SawCopper: return 0.4f; - case (ushort)Items.SawBronze: return 0.15f; - case (ushort)Items.SawIron: return 0.08f; - case (ushort)Items.BigStone: return 0.90f; - case (ushort)Items.StoneHead: return 0.80f; - case (ushort)Items.MediumStone: return 0.93f; - case (ushort)Items.SmallStone: return 0.96f; - } - - return 1; - } + return InventoryNormal[boxSelected].Id switch { + (ushort)Items.AxeStone => 0.4f, + (ushort)Items.AxeIron => 0.2f, + (ushort)Items.AxeGold => 0.5f, + (ushort)Items.AxeCopper => 0.3f, + (ushort)Items.AxeBronze => 0.25f, + (ushort)Items.AxeAluminium => 0.35f, + (ushort)Items.AxeSteel => 0.19f, + (ushort)Items.ElectricSaw => 0.1f, + (ushort)Items.AxeHeadIron => 0.87f, + (ushort)Items.SawCopper => 0.4f, + (ushort)Items.SawBronze => 0.15f, + (ushort)Items.SawIron => 0.08f, + (ushort)Items.BigStone => 0.90f, + (ushort)Items.StoneHead => 0.80f, + (ushort)Items.MediumStone => 0.93f, + (ushort)Items.SmallStone => 0.96f, + _ => 1, + }; + } float DestroyKnife() { - switch (InventoryNormal[boxSelected].Id) { - case (ushort)Items.KnifeCopper: return 0.35f; - case (ushort)Items.KnifeBronze: return 0.3f; - case (ushort)Items.KnifeGold: return 0.5f; - case (ushort)Items.KnifeIron: return 0.25f; - case (ushort)Items.KnifeSteel: return 0.2f; - case (ushort)Items.KnifeAluminium: return 0.3f; - } - return 1; - } + return InventoryNormal[boxSelected].Id switch { + (ushort)Items.KnifeCopper => 0.35f, + (ushort)Items.KnifeBronze => 0.3f, + (ushort)Items.KnifeGold => 0.5f, + (ushort)Items.KnifeIron => 0.25f, + (ushort)Items.KnifeSteel => 0.2f, + (ushort)Items.KnifeAluminium => 0.3f, + _ => 1f, + }; + } float DestroyShears() { - switch (InventoryNormal[boxSelected].Id) { - case (ushort)Items.ShearsCopper: return 0.35f; - case (ushort)Items.ShearsBronze: return 0.3f; - case (ushort)Items.ShearsGold: return 0.5f; - case (ushort)Items.ShearsIron: return 0.25f; - case (ushort)Items.ShearsSteel: return 0.2f; - case (ushort)Items.ShearsAluminium: return 0.3f; - } - return 1; - } + return InventoryNormal[boxSelected].Id switch { + (ushort)Items.ShearsCopper => 0.35f, + (ushort)Items.ShearsBronze => 0.3f, + (ushort)Items.ShearsGold => 0.5f, + (ushort)Items.ShearsIron => 0.25f, + (ushort)Items.ShearsSteel => 0.2f, + (ushort)Items.ShearsAluminium => 0.3f, + _ => 1f, + }; + } float DestroyShovel() { - switch (InventoryNormal[boxSelected].Id) { - case (ushort)Items.ShovelStone: return 0.4f; - case (ushort)Items.ShovelGold: return 0.3f; - case (ushort)Items.ShovelCopper: return 0.25f; - case (ushort)Items.ShovelBronze: return 0.25f; - case (ushort)Items.ShovelIron: return 0.2f; - - case (ushort)Items.ShovelAluminium: return 0.19f; - case (ushort)Items.ShovelSteel: return 0.2f; - - case (ushort)Items.ElectricDrill: return 0.1f; - case (ushort)Items.ShovelHeadIron: return 0.87f; - case (ushort)Items.StoneHead: return 0.80f; - case (ushort)Items.MediumStone: return 0.86f; - case (ushort)Items.SmallStone: return 0.88f; - case (ushort)Items.BigStone: return 0.84f; - } - - return 1; - } + return InventoryNormal[boxSelected].Id switch { + (ushort)Items.ShovelStone => 0.4f, + (ushort)Items.ShovelGold => 0.3f, + (ushort)Items.ShovelCopper => 0.25f, + (ushort)Items.ShovelBronze => 0.25f, + (ushort)Items.ShovelIron => 0.2f, + (ushort)Items.ShovelAluminium => 0.19f, + (ushort)Items.ShovelSteel => 0.2f, + (ushort)Items.ElectricDrill => 0.1f, + (ushort)Items.ShovelHeadIron => 0.87f, + (ushort)Items.StoneHead => 0.80f, + (ushort)Items.MediumStone => 0.86f, + (ushort)Items.SmallStone => 0.88f, + (ushort)Items.BigStone => 0.84f, + _ => 1, + }; + } void GetItemsFromPlant(int type, int x, int y, bool grow) { - DInt pos =new DInt{X=x*16, Y=y*16 }; + DInt pos =new() { X=x*16, Y=y*16 }; if (grow) { switch (type) { case (ushort)BlockId.Wheat: DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatStraw,1), pos); DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds,1), pos); - if (random.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds,1), pos); + if (FastRandom.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds,1), pos); return; case (ushort)BlockId.Onion: { float des=GameMethods.FoodMaxDescay((ushort)Items.Onion); - if (random.Bool()) DropItemToPos(new ItemNonInvFood((ushort)Items.Onion, 1, des), pos); - if (random.Bool()) DropItemToPos(new ItemNonInvFood((ushort)Items.Onion, 1, des), pos); - if (random.Bool()) DropItemToPos(new ItemNonInvFood((ushort)Items.Onion, 1, des), pos); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvFood((ushort)Items.Onion, 1, des), pos); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvFood((ushort)Items.Onion, 1, des), pos); + if (FastRandom.Bool()) DropItemToPos(new ItemNonInvFood((ushort)Items.Onion, 1, des), pos); } return; case (ushort)BlockId.Carrot: { float des=GameMethods.FoodMaxDescay((ushort)Items.Carrot); - if (random.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Carrot,1,des), pos); - if (random.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Carrot,1,des), pos); - if (random.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Carrot,1,des), pos); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Carrot,1,des), pos); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Carrot,1,des), pos); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Carrot,1,des), pos); } return; @@ -12227,7 +12247,7 @@ enum Precipitation : byte { float des=GameMethods.FoodMaxDescay((ushort)Items.Peas); DropItemToPos(new ItemNonInvFood((ushort)Items.Peas,1,des), pos); DropItemToPos(new ItemNonInvFood((ushort)Items.Peas,1,des), pos); - if (random.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Peas,1,des), pos); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvFood((ushort)Items.Peas,1,des), pos); } return; @@ -12235,28 +12255,28 @@ enum Precipitation : byte { DropItemToPos(new ItemNonInvBasic((ushort)Items.Flax,1), pos); DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds,1), pos); DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds,1), pos); - if (random.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds,1), pos); + if (FastRandom.Bool())DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds,1), pos); return; case (ushort)BlockId.Strawberry: DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantStrawberry,1), pos); - if (random.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantStrawberry,1), pos); + if (FastRandom.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantStrawberry,1), pos); return; case (ushort)BlockId.Rashberry: DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantRashberry,1), pos); - if (random.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantRashberry,1), pos); + if (FastRandom.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantRashberry,1), pos); return; case (ushort)BlockId.Blueberry: DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantBlueberry,1), pos); - if (random.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantBlueberry,1), pos); + if (FastRandom.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.PlantBlueberry,1), pos); return; } } else { switch (type) { case (ushort)BlockId.Wheat: - if (random.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds,1), pos); + if (FastRandom.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds,1), pos); return; case (ushort)BlockId.Onion: @@ -12271,7 +12291,7 @@ enum Precipitation : byte { return; case (ushort)BlockId.Flax: - if (random.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds,1), pos); + if (FastRandom.Bool_12_5Percent())DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds,1), pos); return; case (ushort)BlockId.Strawberry: @@ -12289,40 +12309,40 @@ enum Precipitation : byte { } } - void GetItemsFromMob(int type, int X, int Y) { + void GetItemsFromMob(ushort type, int X, int Y) { int X16=X*16,Y16=Y*16; switch (type) { case (ushort)BlockId.Chicken: - if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatStraw, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay, 1), X16, Y16); + if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatStraw, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay, 1), X16, Y16); DropItemToPos(new ItemNonInvBasic((ushort)Items.RabbitMeat, 1), X16, Y16); return; case (ushort)BlockId.Rabbit: - if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatStraw, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay, 1), X16, Y16); + if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatStraw, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay, 1), X16, Y16); DropItemToPos(new ItemNonInvBasic((ushort)Items.RabbitMeat, 1), X16, Y16); return; - + case (ushort)BlockId.MobParrot: - if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatStraw, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); - else if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay, 1), X16, Y16); + if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatStraw, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.FlaxSeeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Seeds, 1), X16, Y16); + else if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.Hay, 1), X16, Y16); DropItemToPos(new ItemNonInvBasic((ushort)Items.RabbitMeat, 1), X16, Y16); return; case (ushort)BlockId.Fish: DropItemToPos(new ItemNonInvBasic((ushort)Items.AnimalFish, 1), X16, Y16); - if (random.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AnimalFish, 1), X16, Y16); + if (FastRandom.Bool_12_5Percent()) DropItemToPos(new ItemNonInvBasic((ushort)Items.AnimalFish, 1), X16, Y16); return; } } @@ -12521,10 +12541,10 @@ enum Precipitation : byte { unsafe void Save() { isDisposed=true; - List bytes=new List(); - List tmpBytes=new List(); + List bytes=new(); + List tmpBytes=new(); - List bytesLiveObjects = new List { + List bytesLiveObjects = new() { (byte)LiveObjects.Length, (byte)(LiveObjects.Length >> 8), (byte)(LiveObjects.Length >> 16) @@ -12569,7 +12589,7 @@ enum Precipitation : byte { lastTypeCount=1; #if DEBUG - if (SolidBlockFromId(newSolidBlockId, Vector2Zero)==null) { + if (SolidBlockFromId(newSolidBlockId, Vector2Zero)==null) { throw new Exception("Nějaký blok je zaregistrován jako statický, ale není jako statický definován"); } #endif @@ -12628,10 +12648,10 @@ enum Precipitation : byte { lastTypeCount=1; #if DEBUG - if (TopBlockFromId(newTopBlockId, Vector2Zero)==null) { + if (TopBlockFromId(newTopBlockId, Vector2Zero)==null) { throw new Exception("Nějaký blok je zaregistrován jako top, ale není jako top definován"); } - if (BackBlockFromId(newBackBlockId, Vector2Zero)==null) { + if (BackBlockFromId(newBackBlockId, Vector2Zero)==null) { throw new Exception("Nějaký blok je zaregistrován jako top, ale není jako top definován"); } #endif @@ -12722,7 +12742,7 @@ enum Precipitation : byte { lastTypeCount=1; #if DEBUG - if (BackBlockFromId(newBackBlockId, Vector2Zero)==null) { + if (BackBlockFromId(newBackBlockId, Vector2Zero)==null) { throw new Exception("Nějaký blok je zaregistrován jako top, ale není jako top definován"); } #endif @@ -13306,7 +13326,7 @@ enum Precipitation : byte { File.WriteAllBytes(pathToWorld + @"\"+world+"LiveObjects.bin", bytesLiveObjects.ToArray()); void SaveLiveObject(LiveObject lo) { - switch (lo) { + switch (lo) { case Tree tree: // Basic info bytesLiveObjects.Add((byte)LiveObjectType.Tree); @@ -13319,7 +13339,7 @@ enum Precipitation : byte { int countWood=tree.TitlesWood.Count; bytesLiveObjects.Add((byte)countWood); - for (int i=0; i labels=new List(); + List labels=new(); string path =pathToWorld+ world+".ter"; if (File.Exists(path)) { @@ -13418,46 +13438,44 @@ enum Precipitation : byte { // 1× solid block case (byte)SaveType.SolidBlock: + #if DEBUG { - // ushort id=(ushort)(*current++ | (*current++ << 8)); - - chunk.SolidBlocks[length]=SolidBlockFromId(/*id*/(ushort)(*current++ | (*current++ << 8)), new Vector2(pos16, length*16)) - #if DEBUG - ??throw new Exception("Solid block is null") - #endif - ; + ushort id=(ushort)(*current++ | (*current++ << 8)); + chunk.SolidBlocks[length]=SolidBlockFromId(id, new Vector2(pos16, length*16)) ?? throw new Exception("Solid block is null"); + } + #else + chunk.SolidBlocks[length]=SolidBlockFromId(/*id*/(ushort)(*current++ | (*current++ << 8)), new Vector2(pos16, length*16)); + #endif - chunk.IsSolidBlocks[length]=true; + chunk.IsSolidBlocks[length]=true; - if (startingSomething) { - startingSomething=false; - StartSomething=length; - } - - length++; + if (startingSomething) { + startingSomething=false; + StartSomething=length; } + + length++; break; // 1× solid block case (byte)SaveType.SolidBlockWithLowId: + #if DEBUG { - // ushort id=*current++; - - chunk.SolidBlocks[length]=SolidBlockFromId(/*id*/(ushort)*current++, new Vector2(pos16, length*16)) - #if DEBUG - ??throw new Exception("Solid block is null") - #endif - ; - - chunk.IsSolidBlocks[length]=true; + ushort id=*current++; + chunk.SolidBlocks[length]=SolidBlockFromId(id, new Vector2(pos16, length*16)) ?? throw new Exception("Solid block is null"); + } + #else + chunk.SolidBlocks[length]=SolidBlockFromId(/*id*/(ushort)*current++, new Vector2(pos16, length*16)); + #endif - if (startingSomething) { - startingSomething=false; - StartSomething=length; - } + chunk.IsSolidBlocks[length]=true; - length++; + if (startingSomething) { + startingSomething=false; + StartSomething=length; } + + length++; break; // ?× solid block @@ -13478,7 +13496,7 @@ enum Precipitation : byte { #if DEBUG ??throw new Exception("Solid block is null") #endif - ; + ; chunk.IsSolidBlocks[length]=true; length++; @@ -13522,46 +13540,42 @@ enum Precipitation : byte { // 1× back block case (byte)SaveType.BackBlock: + #if DEBUG { - // ushort id=(ushort)(*current++ | (*current++ << 8)); + ushort id=(ushort)(*current++ | (*current++ << 8)); + chunk.Background[length]=BackBlockFromId(id, new Vector2(pos16, length*16)) ?? throw new Exception("Back block is null"); + } + #else + chunk.Background[length]=BackBlockFromId((ushort)(*current++ | (*current++ << 8)), new Vector2(pos16, length*16)); + #endif - // chunk.SolidBlocks[length]=new AirSolidBlock { - /* Back=*/chunk.Background[length]=BackBlockFromId(/*id*/(ushort)(*current++ | (*current++ << 8)), new Vector2(pos16, length*16)) - #if DEBUG - ??throw new Exception("Back block is null") - #endif - // , - //} - ; - chunk.IsBackground[length]=true; + chunk.IsBackground[length]=true; - if (startingSomething) { - startingSomething=false; - StartSomething=length; - } - length++; + if (startingSomething) { + startingSomething=false; + StartSomething=length; } + length++; break; // 1× back block case (byte)SaveType.BackBlockWithLowId: + #if DEBUG { - // ushort id=*current++; - - chunk.Background[length]=BackBlockFromId((ushort)*current++, new Vector2(pos16, length*16)) - #if DEBUG - ??throw new Exception("Back block is null") - #endif - ; + ushort id=*current++; + chunk.Background[length]=BackBlockFromId(id, new Vector2(pos16, length*16)) ?? throw new Exception("Back block '"+id+"' is null"); + } + #else + chunk.Background[length]=BackBlockFromId((ushort)*current++, new Vector2(pos16, length*16)); + #endif - chunk.IsBackground[length]=true; + chunk.IsBackground[length]=true; - if (startingSomething) { - startingSomething=false; - StartSomething=length; - } - length++; + if (startingSomething) { + startingSomething=false; + StartSomething=length; } + length++; break; // ?× back block @@ -13577,24 +13591,17 @@ enum Precipitation : byte { Block block=BackBlockFromId(id, new Vector2(pos16, length*16)); - - - // chunk.SolidBlocks[length]=new AirSolidBlock { - /*Back=*/ - chunk.Background[length]=block - #if DEBUG - ??throw new Exception("Back block is null, možná špatně naprogramováno načítání terénu, nebo v BackBlockFromId není zaregistrován block")//, - #endif - ; - //}; + chunk.Background[length]=block + #if DEBUG + ??throw new Exception("Back block is null, možná špatně naprogramováno načítání terénu, nebo v BackBlockFromId není zaregistrován block")//, + #endif + ; chunk.IsBackground[length]=true; length++; for (; length new NormalBlock(backgroundDirtTexture, type, position), + (ushort)BlockId.BackSand => new NormalBlock(backgroundSandTexture, type, position), + (ushort)BlockId.BackCobblestone => new NormalBlock(backgroundCobblestoneTexture, type, position), + (ushort)BlockId.BackClay => new NormalBlock(backgroundClayTexture, type, position), + (ushort)BlockId.BackRedSand => new NormalBlock(backgroundRedSandTexture, type, position), + (ushort)BlockId.BackRegolite => new NormalBlock(backgroundRegoliteTexture, type, position), + (ushort)BlockId.BackGravel => new NormalBlock(backgroundGravelTexture, type, position), + (ushort)BlockId.BackAnorthosite => new NormalBlock(backgroundAnorthositeTexture, type, position), + (ushort)BlockId.BackBasalt => new NormalBlock(backgroundBasaltTexture, type, position), + (ushort)BlockId.BackDiorit => new NormalBlock(backgroundDioritTexture, type, position), + (ushort)BlockId.BackDolomite => new NormalBlock(backgroundDolomiteTexture, type, position), + (ushort)BlockId.BackFlint => new NormalBlock(backgroundFlintTexture, type, position), + (ushort)BlockId.BackGabbro => new NormalBlock(backgroundGabbroTexture, type, position), + (ushort)BlockId.BackGneiss => new NormalBlock(backgroundGneissTexture, type, position), + (ushort)BlockId.BackLimestone => new NormalBlock(backgroundLimestoneTexture, type, position), + (ushort)BlockId.BackMudstone => new NormalBlock(backgroundMudstoneTexture, type, position), + (ushort)BlockId.BackRhyolite => new NormalBlock(backgroundRhyoliteTexture, type, position), + (ushort)BlockId.BackSandstone => new NormalBlock(backgroundSandstoneTexture, type, position), + (ushort)BlockId.BackSchist => new NormalBlock(backgroundSchistTexture, type, position), + (ushort)BlockId.BackCoal => new NormalBlock(backgroundCoalTexture, type, position), + (ushort)BlockId.BackCopper => new NormalBlock(backgroundCopperTexture, type, position), + (ushort)BlockId.BackTin => new NormalBlock(backgroundTinTexture, type, position), + (ushort)BlockId.BackIron => new NormalBlock(backgroundIronTexture, type, position), + (ushort)BlockId.BackAluminium => new NormalBlock(backgroundAluminiumTexture, type, position), + (ushort)BlockId.BackSilver => new NormalBlock(backgroundSilverTexture, type, position), + (ushort)BlockId.BackGold => new NormalBlock(backgroundGoldTexture, type, position), + (ushort)BlockId.BackSulfur => new NormalBlock(TextureBackSulfurOre, type, position), + (ushort)BlockId.BackSaltpeter => new NormalBlock(TextureBackSaltpeterOre, type, position), + // Wood + (ushort)BlockId.AppleWood => new WoodBlock { Texture = TextureAppleWood, Id = type, Position = position }, + (ushort)BlockId.CherryWood => new WoodBlock { Texture = cherryWoodTexture, Id = type, Position = position }, + (ushort)BlockId.LemonWood => new WoodBlock { Texture = TextureLemonWood, Id = type, Position = position }, + (ushort)BlockId.LindenWood => new WoodBlock { Texture = TextureLindenWood, Id = type, Position = position }, + (ushort)BlockId.OakWood => new WoodBlock { Texture = TextureOakWood, Id = type, Position = position }, + (ushort)BlockId.OrangeWood => new WoodBlock { Texture = TextureOrangeWood, Id = type, Position = position }, + (ushort)BlockId.PineWood => new WoodBlock { Texture = pineWoodTexture, Id = type, Position = position }, + (ushort)BlockId.PlumWood => new WoodBlock { Texture = TexturePlumWood, Id = type, Position = position }, + (ushort)BlockId.SpruceWood => new WoodBlock { Texture = spruceWoodTexture, Id = type, Position = position }, + (ushort)BlockId.WillowWood => new WoodBlock { Texture = TextureWillowWood, Id = type, Position = position }, + (ushort)BlockId.MangroveWood => new WoodBlock { Texture = TextureMangroveWood, Id = type, Position = position }, + (ushort)BlockId.EucalyptusWood => new WoodBlock { Texture = TextureEucalyptusWood, Id = type, Position = position }, + (ushort)BlockId.OliveWood => new WoodBlock { Texture = TextureOliveWood, Id = type, Position = position }, + (ushort)BlockId.RubberTreeWood => new WoodBlock { Texture = TextureRubberTreeWood, Id = type, Position = position }, + (ushort)BlockId.AcaciaWood => new WoodBlock { Texture = TextureAcaciaWood, Id = type, Position = position }, + (ushort)BlockId.KapokWood => new WoodBlock { Texture = TextureKapokWood, Id = type, Position = position }, + // Artifical + (ushort)BlockId.AdvancedSpaceBack => new NormalBlock(advancedSpaceBackTexture, type, position), + (ushort)BlockId.AdvancedSpaceWindow => new NormalBlock(advancedSpaceWindowTexture, type, position), + (ushort)BlockId.Glass => new NormalBlock(glassTexture, type, position), + (ushort)BlockId.Coral => new NormalBlock(coralTexture, type, position), + (ushort)BlockId.Seaweed => new NormalBlock(seaweedTexture, type, position), + _ => null, + }; + } Block SolidBlockFromId(ushort type, Vector2 position) { - switch (type) { - // Stone - case (ushort)BlockId.StoneBasalt: return new NormalBlock{Texture=basaltTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneDiorit: return new NormalBlock{Texture=dioritTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneDolomite: return new NormalBlock{Texture=dolomiteTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneGabbro: return new NormalBlock{Texture=gabbroTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneGneiss: return new NormalBlock{Texture=gneissTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneLimestone: return new NormalBlock{Texture=limestoneTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneRhyolite: return new NormalBlock{Texture=rhyoliteTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneSandstone: return new NormalBlock{Texture=sandstoneTexture, Id=type, Position=position}; - case (ushort)BlockId.StoneSchist: return new NormalBlock{Texture=schistTexture, Id=type, Position=position}; - case (ushort)BlockId.Anorthosite: return new NormalBlock{Texture=anorthositeTexture, Id=type, Position=position}; - case (ushort)BlockId.MudStone: return new NormalBlock{Texture=mudstoneTexture, Id=type, Position=position}; - case (ushort)BlockId.Regolite: return new NormalBlock{Texture=regoliteTexture, Id=type, Position=position}; - case (ushort)BlockId.RedSand: return new NormalBlock{Texture=TextureRedSand, Id=type, Position=position}; - - case (ushort)BlockId.Compost: return new NormalBlock{Texture=CompostTexture, Id=type, Position=position}; - - // Ore - case (ushort)BlockId.OreAluminium: return new NormalBlock{Texture=TextureOreAluminium, Id=type, Position=position}; - case (ushort)BlockId.OreCopper: return new NormalBlock{Texture=TextureOreCopper, Id=type, Position=position}; - case (ushort)BlockId.OreGold: return new NormalBlock{Texture=TextureOreGold, Id=type, Position=position}; - case (ushort)BlockId.OreIron: return new NormalBlock{Texture=TextureOreIron, Id=type, Position=position}; - case (ushort)BlockId.OreSilver: return new NormalBlock{Texture=TextureOreSilver, Id=type, Position=position}; - case (ushort)BlockId.OreTin: return new NormalBlock{Texture=TextureOreTin, Id=type, Position=position}; - case (ushort)BlockId.OreCoal: return new NormalBlock{ Texture=TextureOreCoal, Id=type,Position=position}; - case (ushort)BlockId.OreSulfur: return new NormalBlock{Texture=TextureOreSulfur, Id=type, Position=position}; - case (ushort)BlockId.OreSaltpeter: return new NormalBlock{Texture=TextureOreSaltpeter, Id=type, Position=position}; - - // Blocks - case (ushort)BlockId.Cobblestone: return new NormalBlock{Texture=cobblestoneTexture, Id=type, Position=position}; - case (ushort)BlockId.Gravel: return new NormalBlock{Texture=gravelTexture, Id=type, Position=position}; - case (ushort)BlockId.Sand: return new NormalBlock{Texture=sandTexture, Id=type, Position=position}; - case (ushort)BlockId.Dirt: return new NormalBlock{Texture=TextureDirt, Id=type, Position=position}; - case (ushort)BlockId.Ice: return new NormalBlock{Texture=iceTexture, Id=type, Position=position}; - case (ushort)BlockId.Clay: return new NormalBlock{Texture=clayTexture, Id=type, Position=position}; - - // Grass - case (ushort)BlockId.GrassBlockDesert: return new NormalBlock{Texture=TextureGrassBlockDesert, Id=type,Position=position}; - case (ushort)BlockId.GrassBlockForest: return new NormalBlock{Texture=TextureGrassBlockForest, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockHills: return new NormalBlock{Texture=TextureGrassBlockHills, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockJungle: return new NormalBlock{Texture=TextureGrassBlockJungle, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockPlains: return new NormalBlock{Texture=TextureGrassBlockPlains, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockClay: return new NormalBlock{Texture=TextureGrassBlockClay, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockCompost: return new NormalBlock{Texture=TextureGrassBlockCompost, Id=type, Position=position}; - - case (ushort)BlockId.GrassBlockSnowDesert: return new NormalBlock{Texture=TextureGrassBlockSnow, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockSnowForest: return new NormalBlock{Texture=TextureGrassBlockSnow, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockSnowHills: return new NormalBlock{Texture=TextureGrassBlockSnow, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockSnowJungle: return new NormalBlock{Texture=TextureGrassBlockSnow, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockSnowPlains: return new NormalBlock{Texture=TextureGrassBlockSnow, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockSnowClay: return new NormalBlock{Texture=TextureGrassBlockSnow, Id=type, Position=position}; - case (ushort)BlockId.GrassBlockSnowCompost: return new NormalBlock{Texture=TextureGrassBlockSnow, Id=type, Position=position}; - - // Artifical - case (ushort)BlockId.Roof1: return new NormalBlock{Texture=roof1Texture,Id=type, Position=position}; - case (ushort)BlockId.Roof2: return new NormalBlock{Texture=roof2Texture,Id=type, Position=position}; - case (ushort)BlockId.Bricks: return new NormalBlock{Texture=bricksTexture,Id=type, Position=position}; - - case (ushort)BlockId.DoorClose: return new NormalBlock{Texture=doorCloseTexture,Id=type, Position=position}; - case (ushort)BlockId.Planks: return new NormalBlock{Texture=planksTexture,Id=type, Position=position}; - - case (ushort)BlockId.AdvancedSpaceBlock: return new NormalBlock{Texture=advancedSpaceBlockTexture, Id=type, Position=position}; - case (ushort)BlockId.AdvancedSpaceFloor: return new NormalBlock{Texture=advancedSpaceFloorTexture, Id=type, Position=position}; - case (ushort)BlockId.AdvancedSpacePart1: return new NormalBlock{Texture=advancedSpacePart1Texture, Id=type, Position=position}; - case (ushort)BlockId.AdvancedSpacePart2: return new NormalBlock{Texture=advancedSpacePart2Texture, Id=type, Position=position}; - case (ushort)BlockId.AdvancedSpacePart3: return new NormalBlock{Texture=advancedSpacePart3Texture, Id=type, Position=position}; - case (ushort)BlockId.AdvancedSpacePart4: return new NormalBlock{Texture=advancedSpacePart4Texture, Id=type, Position=position}; - - case (ushort)BlockId.Snow: return new NormalBlock{Texture=snowTexture, Id=type, Position=position}; - - default: return null; - } - } + return type switch { + // Stone + (ushort)BlockId.StoneBasalt => new NormalBlock { Texture = basaltTexture, Id = type, Position = position }, + (ushort)BlockId.StoneDiorit => new NormalBlock { Texture = dioritTexture, Id = type, Position = position }, + (ushort)BlockId.StoneDolomite => new NormalBlock { Texture = dolomiteTexture, Id = type, Position = position }, + (ushort)BlockId.StoneGabbro => new NormalBlock { Texture = gabbroTexture, Id = type, Position = position }, + (ushort)BlockId.StoneGneiss => new NormalBlock { Texture = gneissTexture, Id = type, Position = position }, + (ushort)BlockId.StoneLimestone => new NormalBlock { Texture = limestoneTexture, Id = type, Position = position }, + (ushort)BlockId.StoneRhyolite => new NormalBlock { Texture = rhyoliteTexture, Id = type, Position = position }, + (ushort)BlockId.StoneSandstone => new NormalBlock { Texture = sandstoneTexture, Id = type, Position = position }, + (ushort)BlockId.StoneSchist => new NormalBlock { Texture = schistTexture, Id = type, Position = position }, + (ushort)BlockId.Anorthosite => new NormalBlock { Texture = anorthositeTexture, Id = type, Position = position }, + (ushort)BlockId.MudStone => new NormalBlock { Texture = mudstoneTexture, Id = type, Position = position }, + (ushort)BlockId.Regolite => new NormalBlock { Texture = regoliteTexture, Id = type, Position = position }, + (ushort)BlockId.RedSand => new NormalBlock { Texture = TextureRedSand, Id = type, Position = position }, + (ushort)BlockId.Compost => new NormalBlock { Texture = CompostTexture, Id = type, Position = position }, + // Ore + (ushort)BlockId.OreAluminium => new NormalBlock { Texture = TextureOreAluminium, Id = type, Position = position }, + (ushort)BlockId.OreCopper => new NormalBlock { Texture = TextureOreCopper, Id = type, Position = position }, + (ushort)BlockId.OreGold => new NormalBlock { Texture = TextureOreGold, Id = type, Position = position }, + (ushort)BlockId.OreIron => new NormalBlock { Texture = TextureOreIron, Id = type, Position = position }, + (ushort)BlockId.OreSilver => new NormalBlock { Texture = TextureOreSilver, Id = type, Position = position }, + (ushort)BlockId.OreTin => new NormalBlock { Texture = TextureOreTin, Id = type, Position = position }, + (ushort)BlockId.OreCoal => new NormalBlock { Texture = TextureOreCoal, Id = type, Position = position }, + (ushort)BlockId.OreSulfur => new NormalBlock { Texture = TextureOreSulfur, Id = type, Position = position }, + (ushort)BlockId.OreSaltpeter => new NormalBlock { Texture = TextureOreSaltpeter, Id = type, Position = position }, + // Blocks + (ushort)BlockId.Cobblestone => new NormalBlock { Texture = cobblestoneTexture, Id = type, Position = position }, + (ushort)BlockId.Gravel => new NormalBlock { Texture = gravelTexture, Id = type, Position = position }, + (ushort)BlockId.Sand => new NormalBlock { Texture = sandTexture, Id = type, Position = position }, + (ushort)BlockId.Dirt => new NormalBlock { Texture = TextureDirt, Id = type, Position = position }, + (ushort)BlockId.Ice => new NormalBlock { Texture = iceTexture, Id = type, Position = position }, + (ushort)BlockId.Clay => new NormalBlock { Texture = clayTexture, Id = type, Position = position }, + // Grass + (ushort)BlockId.GrassBlockDesert => new NormalBlock { Texture = TextureGrassBlockDesert, Id = type, Position = position }, + (ushort)BlockId.GrassBlockForest => new NormalBlock { Texture = TextureGrassBlockForest, Id = type, Position = position }, + (ushort)BlockId.GrassBlockHills => new NormalBlock { Texture = TextureGrassBlockHills, Id = type, Position = position }, + (ushort)BlockId.GrassBlockJungle => new NormalBlock { Texture = TextureGrassBlockJungle, Id = type, Position = position }, + (ushort)BlockId.GrassBlockPlains => new NormalBlock { Texture = TextureGrassBlockPlains, Id = type, Position = position }, + (ushort)BlockId.GrassBlockClay => new NormalBlock { Texture = TextureGrassBlockClay, Id = type, Position = position }, + (ushort)BlockId.GrassBlockCompost => new NormalBlock { Texture = TextureGrassBlockCompost, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowDesert => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowForest => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowHills => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowJungle => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowPlains => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowClay => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowCompost => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + // Artifical + (ushort)BlockId.Roof1 => new NormalBlock { Texture = roof1Texture, Id = type, Position = position }, + (ushort)BlockId.Roof2 => new NormalBlock { Texture = roof2Texture, Id = type, Position = position }, + (ushort)BlockId.Bricks => new NormalBlock { Texture = bricksTexture, Id = type, Position = position }, + (ushort)BlockId.DoorClose => new NormalBlock { Texture = doorCloseTexture, Id = type, Position = position }, + (ushort)BlockId.Planks => new NormalBlock { Texture = planksTexture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpaceBlock => new NormalBlock { Texture = advancedSpaceBlockTexture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpaceFloor => new NormalBlock { Texture = advancedSpaceFloorTexture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart1 => new NormalBlock { Texture = advancedSpacePart1Texture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart2 => new NormalBlock { Texture = advancedSpacePart2Texture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart3 => new NormalBlock { Texture = advancedSpacePart3Texture, Id = type, Position = position }, + (ushort)BlockId.AdvancedSpacePart4 => new NormalBlock { Texture = advancedSpacePart4Texture, Id = type, Position = position }, + (ushort)BlockId.Snow => new NormalBlock { Texture = snowTexture, Id = type, Position = position }, + _ => null, + }; + } Block TopBlockFromId(ushort type, Vector2 position) { switch (type) { @@ -15253,17 +15237,17 @@ enum Precipitation : byte { case (ushort)BlockId.AppleLeavesWithApples: return new LeavesBlock(TextureAppleLeavesWithApples,type, position); case (ushort)BlockId.AppleBranches: return new LeavesBlock(TextureBranches,type, position); case (ushort)BlockId.AppleLeavesBlossom: return new LeavesBlock(TextureBranches,type, position); - + case (ushort)BlockId.CherryLeaves: return new LeavesBlock(TextureCherryLeaves,type, position); case (ushort)BlockId.CherryLeavesWithCherries: return new LeavesBlock(TextureCherryLeavesWithCherries,type, position); case (ushort)BlockId.CherryBranches: return new LeavesBlock(TextureBranches,type, position); case (ushort)BlockId.WillowBranches: return new LeavesBlock(TextureBranches,type, position); case (ushort)BlockId.CherryLeavesBlossom: return new LeavesBlock(TextureBranches,type, position); - + case (ushort)BlockId.PlumLeaves: return new LeavesBlock(TexturePlumLeaves,type, position); case (ushort)BlockId.PlumLeavesBlossom: return new LeavesBlock(TextureBranches,type, position); case (ushort)BlockId.PlumBranches: return new LeavesBlock(TextureBranches,type, position); - + case (ushort)BlockId.OakBranches: return new LeavesBlock(TextureBranches,type, position); case (ushort)BlockId.LindenBranches: return new LeavesBlock(TextureBranches,type, position); case (ushort)BlockId.LemonLeavesWithLemons: return new LeavesBlock(lemonLeavesWithLemonsTexture,type, position); @@ -15287,7 +15271,7 @@ enum Precipitation : byte { case (ushort)BlockId.KapokLeaves: return new LeavesBlock(TextureKapokLeaves,type, position); case (ushort)BlockId.EggDrop: - if (easter) return new NormalBlock{Texture=TextureEggDropE[random.Int4()], Id=type, Position=position}; + if (easter) return new NormalBlock{Texture=TextureEggDropE[FastRandom.Int4()], Id=type, Position=position}; else return new NormalBlock{Texture=TextureEggDrop, Id=type, Position=position}; case (ushort)BlockId.WillowSapling: return new NormalBlock{Texture=TextureWillowSapling, Id=type, Position=position}; @@ -15305,7 +15289,7 @@ enum Precipitation : byte { case (ushort)BlockId.Oil: return new NormalBlock{Texture=oilTexture, Id=type, Position=position }; case (ushort)BlockId.WaterBlock: return new Water(waterTexture,type, position); case (ushort)BlockId.WaterSalt: return new Water(waterTexture,type, position); - case (ushort)BlockId.Rocks: return new NormalBlock{Texture=TextureRocks[random.Int4()], Id=type, Position=position }; + case (ushort)BlockId.Rocks: return new NormalBlock{Texture=TextureRocks[FastRandom.Int4()], Id=type, Position=position }; // Saplings case (ushort)BlockId.AppleSapling: return new NormalBlock{Texture=TextureAppleSapling, Id=type, Position=position }; @@ -15364,7 +15348,7 @@ enum Precipitation : byte { // Electric mashines case (ushort)BlockId.Lamp: - MashineBlockBasic m=new MashineBlockBasic(lampTexture,type, position,0); + MashineBlockBasic m=new(lampTexture,type, position,0); lightsLamp.Add(m); return m; @@ -15399,19 +15383,18 @@ enum Precipitation : byte { } Plant GetPlantFromId(ushort input, byte height, byte grow, short x) { - switch (input) { - case (ushort)BlockId.Wheat: return new Plant(input,height,grow, x, wheatTexture); - case (ushort)BlockId.Onion: return new Plant(input,height,grow, x, plantOnionTexture); - case (ushort)BlockId.Peas: return new Plant(input, height, grow, x, plantPeasTexture); - case (ushort)BlockId.Carrot: return new Plant(input, height, grow, x, plantCarrotTexture); - case (ushort)BlockId.Flax: return new Plant(input, height, grow, x, flaxTexture); - case (ushort)BlockId.Strawberry: return new Plant(input,height,grow, x, strawberryPlantTexture); - case (ushort)BlockId.Rashberry: return new Plant(input,height,grow, x, rashberryPlantTexture); - case (ushort)BlockId.Blueberry: return new Plant(input,height,grow, x, blueberryPlantTexture); - - default: return null; - } - } + return input switch { + (ushort)BlockId.Wheat => new Plant(input, height, grow, x, wheatTexture), + (ushort)BlockId.Onion => new Plant(input, height, grow, x, plantOnionTexture), + (ushort)BlockId.Peas => new Plant(input, height, grow, x, plantPeasTexture), + (ushort)BlockId.Carrot => new Plant(input, height, grow, x, plantCarrotTexture), + (ushort)BlockId.Flax => new Plant(input, height, grow, x, flaxTexture), + (ushort)BlockId.Strawberry => new Plant(input, height, grow, x, strawberryPlantTexture), + (ushort)BlockId.Rashberry => new Plant(input, height, grow, x, rashberryPlantTexture), + (ushort)BlockId.Blueberry => new Plant(input, height, grow, x, blueberryPlantTexture), + _ => null, + }; + } //Mob GetMobFromId(ushort id, byte height, bool dir, int x) { // switch (id) { @@ -15474,7 +15457,7 @@ enum Precipitation : byte { } void GrowTreeFood(int reg) { - int id=random.Int(100-1)+1+reg, i=random.Int(124)+1; + int id=FastRandom.Int(100-1)+1+reg, i=FastRandom.Int(124)+1; Terrain chunk=terrain[id]; if (chunk.IsTopBlocks[i]) { @@ -15606,7 +15589,7 @@ enum Precipitation : byte { if (i-10<0)return; blocks[i]=null; chunk.IsTopBlocks[i]=false; - if (random.Bool())TreeSpruceLittle(id,i+1); + if (FastRandom.Bool())TreeSpruceLittle(id,i+1); else TreeSpruceBig(id,i+1); return; @@ -15663,14 +15646,14 @@ enum Precipitation : byte { if (i-9<0)return; blocks[i]=null; chunk.IsTopBlocks[i]=false; - if (random.Bool()) { + if (FastRandom.Bool()) { TreeOakLittle(id,i+1); } else { TreeOakMedium(id,i+1); } return; } - } else if (random.Int(10000)==1) { + } else if (FastRandom.Int(10000)==1) { // Terrain chunk=terrain[id]; if (chunk.IsSolidBlocks[i]) { switch (chunk.SolidBlocks[i].Id) { @@ -15681,7 +15664,7 @@ enum Precipitation : byte { case (ushort)BlockId.Dirt: if (!chunk.IsSolidBlocks[i-1]) { - int r=random.Bool() ? 1 : -1; + int r=FastRandom.Bool() ? 1 : -1; if (terrain[id+r].IsSolidBlocks[i]) { switch (terrain[id+r].SolidBlocks[i].Id) { case (ushort)BlockId.GrassBlockDesert: @@ -15715,7 +15698,7 @@ enum Precipitation : byte { case (ushort)BlockId.Clay: if (!chunk.IsSolidBlocks[i-1]) { - int r=random.Bool() ? 1 : -1; + int r=FastRandom.Bool() ? 1 : -1; if (terrain[id+r].IsSolidBlocks[i]) { if (terrain[id+r].SolidBlocks[i].Id==(ushort)BlockId.GrassBlockClay) { chunk.SolidBlocks[i].Id=(ushort)BlockId.GrassBlockClay; @@ -15833,7 +15816,7 @@ enum Precipitation : byte { } void PlayerGravity() { - List blocks=new List(); + List blocks=new(); distanceToGround=100000; @@ -15851,13 +15834,13 @@ enum Precipitation : byte { for (int y = Yfrom; yGlobal.WindowHeightHalf-200+2+4+4+(4*40)) return -1; if (mouseRealPosY=0) { @@ -17738,7 +17710,7 @@ enum Precipitation : byte { // Clothes if (inventory==InventoryType.BasicInv || inventory==InventoryType.Creative) { if ((i=InvClothesMoveId())>=0) { - if (i<8) MouseItemNameEvent(InventoryClothes[i]/*.Id*/); + if (i<8) MouseItemNameEvent(InventoryClothes[i]); return; } } @@ -17746,7 +17718,7 @@ enum Precipitation : byte { // Shelf if (inventory==InventoryType.Shelf || inventory==InventoryType.Composter) { if ((i=InvShelfMoveId())>=0) { - MouseItemNameEvent(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + MouseItemNameEvent(((ShelfBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]); return; } } @@ -17754,7 +17726,7 @@ enum Precipitation : byte { // FurnaceStone if (inventory==InventoryType.FurnaceStone) { if ((i=InvFurnaceStoneMoveId())>=0) { - MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*, i*/); + MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]); return; } } @@ -17762,7 +17734,7 @@ enum Precipitation : byte { // BoxWooden if (inventory==InventoryType.BoxWooden) { if ((i=InvWoodenBoxMoveId())>=0) { - MouseItemNameEvent(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + MouseItemNameEvent(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]); return; } } @@ -17770,7 +17742,7 @@ enum Precipitation : byte { // Adv box if (inventory==InventoryType.BoxAdv) { if ((i=InvAdvBoxMoveId())>=0) { - MouseItemNameEvent(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + MouseItemNameEvent(((BoxBlock)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]); return; } } @@ -17778,7 +17750,7 @@ enum Precipitation : byte { // Miner if (inventory==InventoryType.Miner) { if ((i=InvWoodenBoxMoveId())>=0) { - MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]/*.Id*/); + MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i]); return; } } @@ -17786,19 +17758,19 @@ enum Precipitation : byte { // Charger || OxygenMachine if (inventory==InventoryType.Charger || inventory==InventoryType.OxygenMachine) { if (In40(Global.WindowWidthHalf-300+38+40,Global.WindowHeightHalf+20-2+40+25)) { - MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[0]/*.Id*/); + MouseItemNameEvent(((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[0]); return; } } if (inventory==InventoryType.Barrel) { if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250)) { - MouseItemNameEvent(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[0]/*.Id*/); + MouseItemNameEvent(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[0]); return; } if (In40(Global.WindowWidthHalf-300+119,Global.WindowHeightHalf-198+250+64)) { - MouseItemNameEvent(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[1]/*.Id*/); + MouseItemNameEvent(((Barrel)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[1]); return; } } @@ -17807,7 +17779,7 @@ enum Precipitation : byte { if (inventory==InventoryType.Creative) { if (!creativeTabCrafting){ if ((i=GetInventoryIdCreative())>=0) { - MouseItemNameEvent(InventoryCreative[i]/*.Id*/); + MouseItemNameEvent(InventoryCreative[i]); return; } } @@ -17822,7 +17794,7 @@ enum Precipitation : byte { || inventory==InventoryType.FurnaceStone || inventory==InventoryType.FurnaceElectric) { if ((i=GetCraftingInventoryId())>=0) { - MouseItemNameEvent(InventoryCrafting[i]/*.Id*/); + MouseItemNameEvent(InventoryCrafting[i]); return; } } @@ -18004,7 +17976,7 @@ enum Precipitation : byte { } return inInv; } - + if (GameMethods.IsItemInvFood16(id)) { int inInv = 0; foreach (ItemInv i in InventoryNormal) { @@ -18055,11 +18027,11 @@ enum Precipitation : byte { // for (int i=0; i<5; i++) InventoryNormal[i].Draw(); //} - void DrawNeedNew() { + void DrawNeed() { if (CurrentDeskCrafting==null)return; if (selectedCraftingItem==-1)return; if (SelectedCraftingRecipe==-1)return; - spriteBatch.Draw(inventoryNeedTexture, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8, Global.WindowHeightHalf-200+2+4+200+8+8), ColorWhite); + spriteBatch.Draw(inventoryNeedTexture, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8, Global.WindowHeightHalf-200+2+4+200+8+8), Color.White); CraftingIn[] slots=CurrentDeskCrafting[SelectedCraftingRecipe].Input; int i = 0; @@ -18075,7 +18047,7 @@ enum Precipitation : byte { /*GameDraw.DrawItemInInventory*/DrawItem(/*ItemIdToTexture(item[slot.TmpSelected].Id),*/ item[slot.TmpSelected], Global.WindowWidthHalf-300+4+200+80+40+8+x*40+4, 4+y*40+Global.WindowHeightHalf-200+2+4+200+8+8); - spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16), ColorWhite); + spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16), Color.White); }else{ // ItemNonInv selectedSlot=item[slot.SelectedItem]; @@ -18093,7 +18065,7 @@ enum Precipitation : byte { } else { /*GameDraw.DrawItemInInventory*/DrawItem(/*slot.Texture, */item[slot.SelectedItem], Global.WindowWidthHalf-300+4+200+80+40+8+x*40+4, 4+y*40+Global.WindowHeightHalf-200+2+4+200+8+8); } - spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16), ColorWhite); + spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16), Color.White); } } @@ -18130,7 +18102,7 @@ enum Precipitation : byte { if (CurrentDeskCrafting==null)return; if (selectedCraftingItem==-1)return; if (SelectedCraftingRecipe==-1)return; - spriteBatch.Draw(inventoryNeedTexture, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8, Global.WindowHeightHalf-200+2+4+200+8+8+AddH), ColorWhite); + spriteBatch.Draw(inventoryNeedTexture, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8, Global.WindowHeightHalf-200+2+4+200+8+8+AddH), Color.White); CraftingIn[] slots=CurrentDeskCrafting[SelectedCraftingRecipe].Input; int i = 0; @@ -18147,7 +18119,7 @@ enum Precipitation : byte { // GameDraw.DrawItemInInventory(ItemIdToTexture(item[slot.TmpSelected].Id), , Global.WindowWidthHalf-300+4+200+80+40+8+x*40+4, 4+y*40+Global.WindowHeightHalf-200+2+4+200+8+8+AddH); - spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16+AddH), ColorWhite); + spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16+AddH), Color.White); }else{ // ItemNonInv selectedSlot=item[slot.SelectedItem]; @@ -18164,7 +18136,7 @@ enum Precipitation : byte { } else { /*GameDraw.DrawItemInInventory*/DrawItem(/*slot.Texture,*/ item[slot.SelectedItem], Global.WindowWidthHalf-300+4+200+80+40+8+x*40+4, 4+y*40+Global.WindowHeightHalf-200+2+4+200+8+8+AddH); } - spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16+AddH), ColorWhite); + spriteBatch.Draw(TextureSelectCrafting, new Vector2(Global.WindowWidthHalf-300+4+200+80+40+8+x*40+40-16, y*40+Global.WindowHeightHalf-200+2+4+200+8+8+40-16+AddH), Color.White); } } @@ -18537,10 +18509,10 @@ enum Precipitation : byte { foreach (CraftingOut d in CurrentDeskCrafting[SelectedCraftingRecipe].Output){//selectedCraftingItem if (d.EveryTime) AddItemToPlayer(d.Item); else{ - if (random.Double()maxInvCount) break; - spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), ColorWhite); + spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); //if (InventoryNormal[i].X!=0) { // if (!invMove || (invMove && invStartInventory,invStartId!=i)) { @@ -18655,7 +18627,7 @@ enum Precipitation : byte { int xx=0, yh=0; for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { if (i>maxInvCount) break; - spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), ColorWhite); + spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+200+4+4+xx, Global.WindowHeightHalf-200+2+4+yh), Color.White); xx+=40; @@ -18696,8 +18668,8 @@ enum Precipitation : byte { || inventory==InventoryType.Creative || inventory==InventoryType.Miner || inventory==InventoryType.Shelf) { - spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+8*40, Global.WindowHeightHalf-200+2+4+40*5), ColorWhite); - spriteBatch.Draw(TextureBin,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+8*40+4, Global.WindowHeightHalf-200+2+4+40*5+4), ColorWhite); + spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+8*40, Global.WindowHeightHalf-200+2+4+40*5), Color.White); + spriteBatch.Draw(TextureBin,new Vector2(Global.WindowWidthHalf-300+4+200+4+4+8*40+4, Global.WindowHeightHalf-200+2+4+40*5+4), Color.White); } } @@ -18706,7 +18678,7 @@ enum Precipitation : byte { // // Slots // for (int i = 0; i<5; i++) { // if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.LightBlue); - // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), ColorWhite); + // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidth-40, Global.WindowHeightHalf-80+i*40), Color.White); // } // // Items @@ -18716,15 +18688,16 @@ enum Precipitation : byte { //} void DrawSideInventory() { - int x=Global.WindowWidth-40; - int y=Global.WindowHeightHalf-80; - // Vector2 vec = new Vector2(x,y); - + //int x=; + //int y=; + Vector2 vec = new(Global.WindowWidth-40, Global.WindowHeightHalf-80); //slots for (int i = 0; i<5; i++) { - if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, new Vector2(x, y), ColorLightBlue); - else spriteBatch.Draw(inventorySlotTexture, new Vector2(x, y), ColorWhite); - y+=40; + // Vector2 vec=new(x, y); + + if (boxSelected==i) spriteBatch.Draw(inventorySlotTexture, vec/*new Vector2(x, y)*/, Color.LightBlue); + else spriteBatch.Draw(inventorySlotTexture, vec/*new Vector2(x, y)*/, Color.White); + vec.Y+=40; } //items @@ -18899,7 +18872,7 @@ enum Precipitation : byte { case (ushort)Items.RabbitMeat: barEat -=10; barWater -=1; - if (random.Bool_20Percent()) { + if (FastRandom.Bool_20Percent()) { barHeart +=5; if (barHeart>32)barHeart=32; } @@ -19122,7 +19095,7 @@ enum Precipitation : byte { (ushort)Items.DyeDarkGreen, (ushort)Items.DyeArmy, (ushort)Items.DyeBrown, - + }; inventoryScrollbarValueCraftingMax=items.Length-1; @@ -20004,7 +19977,7 @@ enum Precipitation : byte { (ushort)Items.BareLabel, (ushort)Items.Rubber, (ushort)Items.Plastic, - + (ushort)Items.ChristmasStar, (ushort)Items.ChristmasBallGray, @@ -20233,582 +20206,582 @@ enum Precipitation : byte { } Texture2D ItemIdToTexture(ushort id) { - switch (id) { - case (ushort)Items.ChristmasBallGray: return TextureChristmasBall; - case (ushort)Items.ChristmasBallYellow: return TextureChristmasBallYellow; - case (ushort)Items.ChristmasBallOrange: return TextureChristmasBallOrange; - case (ushort)Items.ChristmasBallRed: return TextureChristmasBallRed; - case (ushort)Items.ChristmasBallPurple: return TextureChristmasBallPurple; - case (ushort)Items.ChristmasBallPink: return TextureChristmasBallPink; - case (ushort)Items.ChristmasBallLightGreen: return TextureChristmasBallLightGreen; - case (ushort)Items.ChristmasBallBlue: return TextureChristmasBallBlue; - case (ushort)Items.ChristmasBallTeal: return TextureChristmasBallTeal; - case (ushort)Items.AngelHair: return TextureAngelHair; - - case (ushort)Items.ChristmasStar:return TextureChristmasStar; - case (ushort)Items.AirTank:return TextureAirTank; - case (ushort)Items.AirTank2:return TextureAirTank2; - case (ushort)Items.OxygenMachine:return TextureOxygenMachine; - case (ushort)Items.BackSulfur:return TextureBackSulfurOre; - case (ushort)Items.BackSaltpeter:return TextureBackSaltpeterOre; - case (ushort)Items.Ammo:return TextureAmmo; - case (ushort)Items.Gun:return TextureGun; - case (ushort)Items.Saltpeter:return TextureSaltpeter; - case (ushort)Items.SulfurDust:return TextureSulfur; - case (ushort)Items.OreSaltpeter:return TextureOreSaltpeter; - case (ushort)Items.OreSulfur:return TextureOreSulfur; - case (ushort)Items.Gunpowder:return TextureGunpowder; - - case (ushort)Items.BucketForRubber:return TextureBucketForRubber; - case (ushort)Items.Resin:return TextureResin; - case (ushort)Items.Aluminium:return ItemAluminiumTexture; - case (ushort)Items.TorchOFF:return TextureTorchOff; - //case (ushort)Items.BronzeHeadHoe:return TextureHoeHeadBronze; - //case (ushort)Items.CopperHeadHoe:return TextureHoeHeadCopper; - //case (ushort)Items.HoeHeadIron:return TextureHoeHeadIron; - case (ushort)Items.HoeCopper:return TextureHoeCopper; - - case (ushort)Items.Mobile:return mobileTexture; - case (ushort)Items.SewingMachine:return sewingMachineTexture; - case (ushort)Items.BucketOil:return bucketOilTexture; - case (ushort)Items.TorchON:return torchInvTexture; - - case (ushort)Items.BottleOil:return bottleOilTexture; - case (ushort)Items.BoxAdv:return boxAdvTexture; - case (ushort)Items.BoxWooden:return boxWoodenTexture; - case (ushort)Items.Shelf:return shelfTexture; - case (ushort)Items.Heater:return heatherTexture; - case (ushort)Items.WoodDust:return ItemWoodDustTexture; - case (ushort)Items.AluminiumDust:return ItemAluminiumDustTexture; - case (ushort)Items.FlaxSeeds:return flaxSeedsTexture; - case (ushort)Items.MudIngot:return oneMudBrickTexture; - case (ushort)Items.AluminiumIngot:return ItemAluminiumIngotTexture; - case (ushort)Items.Nail:return nailTexture; - case (ushort)Items.Silicium:return siliciumTexture; - case (ushort)Items.StoneBasalt: return basaltTexture; - case (ushort)Items.StoneLimestone: return limestoneTexture; - case (ushort)Items.StoneRhyolite: return rhyoliteTexture; - case (ushort)Items.StoneGneiss: return gneissTexture; - case (ushort)Items.StoneSandstone: return sandstoneTexture; - case (ushort)Items.StoneSchist: return schistTexture; - case (ushort)Items.StoneGabbro: return gabbroTexture; - case (ushort)Items.StoneDiorit: return dioritTexture; - case (ushort)Items.StoneDolomite: return dolomiteTexture; - case (ushort)Items.Flax: return flaxInvTexture; - case (ushort)Items.Dirt: return TextureDirt; - case (ushort)Items.Sand: return sandTexture; - case (ushort)Items.Lava: return lavaTexture; - case (ushort)Items.Stonerubble: return cobblestoneTexture; - case (ushort)Items.Gravel: return gravelTexture; - - case (ushort)Items.WoodOak: return TextureOakWood; - case (ushort)Items.WoodSpruce: return spruceWoodTexture; - case (ushort)Items.WoodLinden: return TextureLindenWood; - case (ushort)Items.WoodPine: return pineWoodTexture; - case (ushort)Items.WoodApple: return TextureAppleWood; - case (ushort)Items.WoodCherry: return cherryWoodTexture; - case (ushort)Items.WoodPlum: return TexturePlumWood; - case (ushort)Items.WoodLemon: return TextureLemonWood; - case (ushort)Items.WoodOrange: return TextureOrangeWood; - - case (ushort)Items.OakLeaves: return TextureOakLeaves; - - case (ushort)Items.GrassBlockDesert: return TextureGrassBlockDesert; - case (ushort)Items.GrassBlockForest: return TextureGrassBlockForest; - case (ushort)Items.GrassBlockHills: return TextureGrassBlockHills; - case (ushort)Items.GrassBlockJungle: return TextureGrassBlockJungle; - case (ushort)Items.GrassBlockPlains: return TextureGrassBlockPlains; - case (ushort)Items.GrassBlockCompost: return TextureGrassBlockCompost; + return id switch{ + (ushort)Items.ChristmasBallGray => TextureChristmasBall, + (ushort)Items.ChristmasBallYellow => TextureChristmasBallYellow, + (ushort)Items.ChristmasBallOrange => TextureChristmasBallOrange, + (ushort)Items.ChristmasBallRed => TextureChristmasBallRed, + (ushort)Items.ChristmasBallPurple => TextureChristmasBallPurple, + (ushort)Items.ChristmasBallPink => TextureChristmasBallPink, + (ushort)Items.ChristmasBallLightGreen => TextureChristmasBallLightGreen, + (ushort)Items.ChristmasBallBlue => TextureChristmasBallBlue, + (ushort)Items.ChristmasBallTeal => TextureChristmasBallTeal, + (ushort)Items.AngelHair => TextureAngelHair, + + (ushort)Items.ChristmasStar => TextureChristmasStar, + (ushort)Items.AirTank => TextureAirTank, + (ushort)Items.AirTank2 => TextureAirTank2, + (ushort)Items.OxygenMachine => TextureOxygenMachine, + (ushort)Items.BackSulfur => TextureBackSulfurOre, + (ushort)Items.BackSaltpeter => TextureBackSaltpeterOre, + (ushort)Items.Ammo => TextureAmmo, + (ushort)Items.Gun => TextureGun, + (ushort)Items.Saltpeter => TextureSaltpeter, + (ushort)Items.SulfurDust => TextureSulfur, + (ushort)Items.OreSaltpeter => TextureOreSaltpeter, + (ushort)Items.OreSulfur => TextureOreSulfur, + (ushort)Items.Gunpowder => TextureGunpowder, + + (ushort)Items.BucketForRubber => TextureBucketForRubber, + (ushort)Items.Resin => TextureResin, + (ushort)Items.Aluminium => ItemAluminiumTexture, + (ushort)Items.TorchOFF => TextureTorchOff, + //(ushort)Items.BronzeHeadHoe => TextureHoeHeadBronze, + //(ushort)Items.CopperHeadHoe => TextureHoeHeadCopper, + (ushort)Items.HoeHeadIron => TextureHoeHeadIron, + (ushort)Items.HoeCopper => TextureHoeCopper, + + (ushort)Items.Mobile => mobileTexture, + (ushort)Items.SewingMachine => sewingMachineTexture, + (ushort)Items.BucketOil => bucketOilTexture, + (ushort)Items.TorchON => torchInvTexture, + + (ushort)Items.BottleOil => bottleOilTexture, + (ushort)Items.BoxAdv => boxAdvTexture, + (ushort)Items.BoxWooden => boxWoodenTexture, + (ushort)Items.Shelf => shelfTexture, + (ushort)Items.Heater => heatherTexture, + (ushort)Items.WoodDust => ItemWoodDustTexture, + (ushort)Items.AluminiumDust => ItemAluminiumDustTexture, + (ushort)Items.FlaxSeeds => flaxSeedsTexture, + (ushort)Items.MudIngot => oneMudBrickTexture, + (ushort)Items.AluminiumIngot => ItemAluminiumIngotTexture, + (ushort)Items.Nail => nailTexture, + (ushort)Items.Silicium => siliciumTexture, + (ushort)Items.StoneBasalt => basaltTexture, + (ushort)Items.StoneLimestone => limestoneTexture, + (ushort)Items.StoneRhyolite => rhyoliteTexture, + (ushort)Items.StoneGneiss => gneissTexture, + (ushort)Items.StoneSandstone => sandstoneTexture, + (ushort)Items.StoneSchist => schistTexture, + (ushort)Items.StoneGabbro => gabbroTexture, + (ushort)Items.StoneDiorit => dioritTexture, + (ushort)Items.StoneDolomite => dolomiteTexture, + (ushort)Items.Flax => flaxInvTexture, + (ushort)Items.Dirt => TextureDirt, + (ushort)Items.Sand => sandTexture, + (ushort)Items.Lava => lavaTexture, + (ushort)Items.Stonerubble => cobblestoneTexture, + (ushort)Items.Gravel => gravelTexture, + + (ushort)Items.WoodOak => TextureOakWood, + (ushort)Items.WoodSpruce => spruceWoodTexture, + (ushort)Items.WoodLinden => TextureLindenWood, + (ushort)Items.WoodPine => pineWoodTexture, + (ushort)Items.WoodApple => TextureAppleWood, + (ushort)Items.WoodCherry => cherryWoodTexture, + (ushort)Items.WoodPlum => TexturePlumWood, + (ushort)Items.WoodLemon => TextureLemonWood, + (ushort)Items.WoodOrange => TextureOrangeWood, + + (ushort)Items.OakLeaves => TextureOakLeaves, + + (ushort)Items.GrassBlockDesert => TextureGrassBlockDesert, + (ushort)Items.GrassBlockForest => TextureGrassBlockForest, + (ushort)Items.GrassBlockHills => TextureGrassBlockHills, + (ushort)Items.GrassBlockJungle => TextureGrassBlockJungle, + (ushort)Items.GrassBlockPlains => TextureGrassBlockPlains, + (ushort)Items.GrassBlockCompost => TextureGrassBlockCompost, //Crafted - case (ushort)Items.Glass: return glassTexture; - case (ushort)Items.Bricks: return bricksTexture; + (ushort)Items.Glass => glassTexture, + (ushort)Items.Bricks => bricksTexture, - case (ushort)Items.Planks: return planksTexture; + (ushort)Items.Planks => planksTexture, - case (ushort)Items.Desk: return deskTexture; - case (ushort)Items.Door: return ItemDoorTexture; - case (ushort)Items.Ladder: return ladderTexture; - case (ushort)Items.Flag: return ItemFlagTexture; + (ushort)Items.Desk => deskTexture, + (ushort)Items.Door => ItemDoorTexture, + (ushort)Items.Ladder => ladderTexture, + (ushort)Items.Flag => ItemFlagTexture, - case (ushort)Items.Rope: return ItemRopeTexture; + (ushort)Items.Rope => ItemRopeTexture, - case (ushort)Items.HayBlock: return hayBlockTexture; + (ushort)Items.HayBlock => hayBlockTexture, - case (ushort)Items.Roof1: return roof1Texture; - case (ushort)Items.Roof2: return roof2Texture; + (ushort)Items.Roof1 => roof1Texture, + (ushort)Items.Roof2 => roof2Texture, //Mashines - case (ushort)Items.AdvancedSpaceBack: return advancedSpaceBackTexture; - case (ushort)Items.AdvancedSpaceWindow: return advancedSpaceWindowTexture; - case (ushort)Items.AdvancedSpaceBlock: return advancedSpaceBlockTexture; - case (ushort)Items.AdvancedSpaceFloor: return advancedSpaceFloorTexture; - case (ushort)Items.AdvancedSpacePart1: return advancedSpacePart1Texture; - case (ushort)Items.AdvancedSpacePart2: return advancedSpacePart2Texture; - case (ushort)Items.AdvancedSpacePart3: return advancedSpacePart3Texture; - case (ushort)Items.AdvancedSpacePart4: return advancedSpacePart4Texture; - - case (ushort)Items.WindMill: return ItemWindMillTexture; - case (ushort)Items.WaterMill: return ItemWaterMillTexture; - case (ushort)Items.SolarPanel: return solarPanelTexture; - - case (ushort)Items.Miner: return minerTexture; - case (ushort)Items.Macerator: return maceratorOneTexture; - case (ushort)Items.Lamp: return lampTexture; - case (ushort)Items.Radio: return radioInvTexture; - case (ushort)Items.Label: return labelOneTexture; - case (ushort)Items.Rocket: return ItemRocketTexture; - case (ushort)Items.FurnaceElectric: return furnaceElectricOneTexture; - case (ushort)Items.FurnaceStone: return furnaceStoneOneTexture; - case (ushort)Items.Barrel: return TextureBarrel; + (ushort)Items.AdvancedSpaceBack => advancedSpaceBackTexture, + (ushort)Items.AdvancedSpaceWindow => advancedSpaceWindowTexture, + (ushort)Items.AdvancedSpaceBlock => advancedSpaceBlockTexture, + (ushort)Items.AdvancedSpaceFloor => advancedSpaceFloorTexture, + (ushort)Items.AdvancedSpacePart1 => advancedSpacePart1Texture, + (ushort)Items.AdvancedSpacePart2 => advancedSpacePart2Texture, + (ushort)Items.AdvancedSpacePart3 => advancedSpacePart3Texture, + (ushort)Items.AdvancedSpacePart4 => advancedSpacePart4Texture, + + (ushort)Items.WindMill => ItemWindMillTexture, + (ushort)Items.WaterMill => ItemWaterMillTexture, + (ushort)Items.SolarPanel => solarPanelTexture, + + (ushort)Items.Miner => minerTexture, + (ushort)Items.Macerator => maceratorOneTexture, + (ushort)Items.Lamp => lampTexture, + (ushort)Items.Radio => radioInvTexture, + (ushort)Items.Label => labelOneTexture, + (ushort)Items.Rocket => ItemRocketTexture, + (ushort)Items.FurnaceElectric => furnaceElectricOneTexture, + (ushort)Items.FurnaceStone => furnaceStoneOneTexture, + (ushort)Items.Barrel => TextureBarrel, //Food - case (ushort)Items.Banana: return ItemBananaTexture; - case (ushort)Items.Cherry: return ItemCherryTexture; - case (ushort)Items.Lemon: return ItemLemonTexture; - case (ushort)Items.Orange: return ItemOrangeTexture; - case (ushort)Items.Plum: return ItemPlumTexture; - case (ushort)Items.Apple: return ItemAppleTexture; - case (ushort)Items.Rashberry: return rashberryTexture; - case (ushort)Items.Strawberry: return strawberryTexture; - case (ushort)Items.Blueberries: return blueberryTexture; + (ushort)Items.Banana => ItemBananaTexture, + (ushort)Items.Cherry => ItemCherryTexture, + (ushort)Items.Lemon => ItemLemonTexture, + (ushort)Items.Orange => ItemOrangeTexture, + (ushort)Items.Plum => ItemPlumTexture, + (ushort)Items.Apple => ItemAppleTexture, + (ushort)Items.Rashberry => rashberryTexture, + (ushort)Items.Strawberry => strawberryTexture, + (ushort)Items.Blueberries => blueberryTexture, - case (ushort)Items.RabbitMeatCooked: return ItemRabbtCookedMeatTexture; - case (ushort)Items.RabbitMeat: return ItemRabbitMeatTexture; + (ushort)Items.RabbitMeatCooked => ItemRabbtCookedMeatTexture, + (ushort)Items.RabbitMeat => ItemRabbitMeatTexture, - case (ushort)Items.AnimalFish: return fishTexture0; - case (ushort)Items.FishMeatCooked: return fishCookedTexture; + (ushort)Items.AnimalFish => fishTexture0, + (ushort)Items.FishMeatCooked => fishCookedTexture, - case (ushort)Items.Egg: return TextureItemEgg; - case (ushort)Items.boiledEgg: return TextureItemBoiledEgg; + (ushort)Items.Egg => TextureItemEgg, + (ushort)Items.boiledEgg => TextureItemBoiledEgg, //Clothes - case (ushort)Items.Backpack: return ItemBackpackTexture; + (ushort)Items.Backpack => ItemBackpackTexture, //Items - case (ushort)Items.CoalDust: return ItemCoalDustTexture; - case (ushort)Items.BronzeDust: return ItemBronzeDustTexture; - case (ushort)Items.GoldDust: return ItemGoldDustTexture; - case (ushort)Items.IronDust: return ItemIronDustTexture; - case (ushort)Items.SilverDust: return ItemSilverDustTexture; - case (ushort)Items.CopperDust: return ItemCopperDustTexture; - case (ushort)Items.TinDust: return ItemTinDustTexture; - - case (ushort)Items.BronzeIngot: return ItemBronzeIngotTexture; - case (ushort)Items.SteelIngot: return TextureIngotSteel; - case (ushort)Items.GoldIngot: return ItemGoldIngotTexture; - case (ushort)Items.IronIngot: return ItemIronIngotTexture; - case (ushort)Items.TinIngot: return ItemTinIngotTexture; - case (ushort)Items.SilverIngot: return ItemSilverIngotTexture; - case (ushort)Items.CopperIngot: return ItemCopperIngotTexture; - - case (ushort)Items.PlateIron: return plateIronTexture; - case (ushort)Items.PlateBronze: return plateBronzeTexture; - case (ushort)Items.plateAluminium: return plateAluminiumTexture; - case (ushort)Items.PlateCopper: return plateCopperTexture; - case (ushort)Items.PlateGold: return plateGoldTexture; - - case (ushort)Items.OreCoal: return TextureOreCoal; - case (ushort)Items.ItemCoal: return ItemCoalTexture; - case (ushort)Items.ItemGold: return ItemGoldTexture; - case (ushort)Items.ItemTin: return ItemTinTexture; - case (ushort)Items.ItemSilver: return ItemSilverTexture; - case (ushort)Items.ItemIron: return ItemIronTexture; - case (ushort)Items.ItemCopper: return ItemCopperTexture; - case (ushort)Items.Ash: return ashTexture; - case (ushort)Items.CoalWood: return coalWoodTexture; - - case (ushort)Items.Saphirite: return ItemSaphiriteTexture; - case (ushort)Items.Diamond: return ItemDiamondTexture; - case (ushort)Items.Smaragd: return ItemSmaragdTexture; - case (ushort)Items.Ruby: return ItemRubyTexture; - case (ushort)Items.SmallStone: return ItemSmallStoneTexture; - case (ushort)Items.BigStone: return ItemBigStoneTexture; - case (ushort)Items.MediumStone: return ItemMediumStoneTexture; - - case (ushort)Items.Bulb: return ItemBulbTexture; - case (ushort)Items.Circuit: return ItemCircuitTexture; - case (ushort)Items.ItemBattery: return ItemBatteryTexture; - case (ushort)Items.BigCircuit: return ItemBigCircuitTexture; - case (ushort)Items.OneBrick: return oneBrickTexture; - - case (ushort)Items.Cloth: return clothTexture; - case (ushort)Items.Yarn: return yarnTexture; - - case (ushort)Items.Condenser: return condenserTexture; - case (ushort)Items.Diode: return diodeTexture; - case (ushort)Items.Tranzistor: return tranzistorTexture; - case (ushort)Items.Rezistance: return resistanceTexture; - case (ushort)Items.Motor: return motorTexture; - case (ushort)Items.BareLabel: return bareLabelTexture; + (ushort)Items.CoalDust => ItemCoalDustTexture, + (ushort)Items.BronzeDust => ItemBronzeDustTexture, + (ushort)Items.GoldDust => ItemGoldDustTexture, + (ushort)Items.IronDust => ItemIronDustTexture, + (ushort)Items.SilverDust => ItemSilverDustTexture, + (ushort)Items.CopperDust => ItemCopperDustTexture, + (ushort)Items.TinDust => ItemTinDustTexture, + + (ushort)Items.BronzeIngot => ItemBronzeIngotTexture, + (ushort)Items.SteelIngot => TextureIngotSteel, + (ushort)Items.GoldIngot => ItemGoldIngotTexture, + (ushort)Items.IronIngot => ItemIronIngotTexture, + (ushort)Items.TinIngot => ItemTinIngotTexture, + (ushort)Items.SilverIngot => ItemSilverIngotTexture, + (ushort)Items.CopperIngot => ItemCopperIngotTexture, + + (ushort)Items.PlateIron => plateIronTexture, + (ushort)Items.PlateBronze => plateBronzeTexture, + (ushort)Items.plateAluminium => plateAluminiumTexture, + (ushort)Items.PlateCopper => plateCopperTexture, + (ushort)Items.PlateGold => plateGoldTexture, + + (ushort)Items.OreCoal => TextureOreCoal, + (ushort)Items.ItemCoal => ItemCoalTexture, + (ushort)Items.ItemGold => ItemGoldTexture, + (ushort)Items.ItemTin => ItemTinTexture, + (ushort)Items.ItemSilver => ItemSilverTexture, + (ushort)Items.ItemIron => ItemIronTexture, + (ushort)Items.ItemCopper => ItemCopperTexture, + (ushort)Items.Ash => ashTexture, + (ushort)Items.CoalWood => coalWoodTexture, + + (ushort)Items.Saphirite => ItemSaphiriteTexture, + (ushort)Items.Diamond => ItemDiamondTexture, + (ushort)Items.Smaragd => ItemSmaragdTexture, + (ushort)Items.Ruby => ItemRubyTexture, + (ushort)Items.SmallStone => ItemSmallStoneTexture, + (ushort)Items.BigStone => ItemBigStoneTexture, + (ushort)Items.MediumStone => ItemMediumStoneTexture, + + (ushort)Items.Bulb => ItemBulbTexture, + (ushort)Items.Circuit => ItemCircuitTexture, + (ushort)Items.ItemBattery => ItemBatteryTexture, + (ushort)Items.BigCircuit => ItemBigCircuitTexture, + (ushort)Items.OneBrick => oneBrickTexture, + + (ushort)Items.Cloth => clothTexture, + (ushort)Items.Yarn => yarnTexture, + + (ushort)Items.Condenser => condenserTexture, + (ushort)Items.Diode => diodeTexture, + (ushort)Items.Tranzistor => tranzistorTexture, + (ushort)Items.Rezistance => resistanceTexture, + (ushort)Items.Motor => motorTexture, + (ushort)Items.BareLabel => bareLabelTexture, //Plants - case (ushort)Items.OakSapling: return oakSaplingTexture; - case (ushort)Items.LindenSapling: return TextureLindenSapling; - case (ushort)Items.PineSapling: return pineSaplingTexture; - case (ushort)Items.AppleSapling: return TextureAppleSapling; - case (ushort)Items.LemonSapling: return lemonSaplingTexture; - case (ushort)Items.CherrySapling: return cherrySaplingTexture; - case (ushort)Items.PlumSapling: return plumSaplingTexture; - case (ushort)Items.SpruceSapling: return spruceSaplingTexture; - case (ushort)Items.OrangeSapling: return orangeSaplingTexture; - - case (ushort)Items.Dandelion: return plantDandelionTexture; - case (ushort)Items.PlantRose: return plantRoseTexture; - case (ushort)Items.PlantOrchid: return plantOrchidTexture; - case (ushort)Items.PlantViolet: return plantVioletTexture; - - case (ushort)Items.PlantStrawberry: return invStrawberryTexture; - case (ushort)Items.PlantRashberry: return invRashberryTexture; - case (ushort)Items.PlantBlueberry: return invBlueberryTexture; - - case (ushort)Items.CactusBig: return cactusBigTexture; - case (ushort)Items.CactusSmall: return cactusLittleTexture; - - case (ushort)Items.SugarCane: return sugarCaneTexture; - case (ushort)Items.Onion: return ItemOnionTexture; - - case (ushort)Items.Toadstool: return toadstoolTexture; - case (ushort)Items.Boletus: return boletusTexture; - case (ushort)Items.Champignon: return champignonTexture; - - case (ushort)Items.Coral: return coralTexture; - case (ushort)Items.Seaweed: return seaweedTexture; - case (ushort)Items.PlantSeaweed: return seaweedTexture; - case (ushort)Items.PlantOnion: return plantOnionTexture; + (ushort)Items.OakSapling => oakSaplingTexture, + (ushort)Items.LindenSapling => TextureLindenSapling, + (ushort)Items.PineSapling => pineSaplingTexture, + (ushort)Items.AppleSapling => TextureAppleSapling, + (ushort)Items.LemonSapling => lemonSaplingTexture, + (ushort)Items.CherrySapling => cherrySaplingTexture, + (ushort)Items.PlumSapling => plumSaplingTexture, + (ushort)Items.SpruceSapling => spruceSaplingTexture, + (ushort)Items.OrangeSapling => orangeSaplingTexture, + + (ushort)Items.Dandelion => plantDandelionTexture, + (ushort)Items.PlantRose => plantRoseTexture, + (ushort)Items.PlantOrchid => plantOrchidTexture, + (ushort)Items.PlantViolet => plantVioletTexture, + + (ushort)Items.PlantStrawberry => invStrawberryTexture, + (ushort)Items.PlantRashberry => invRashberryTexture, + (ushort)Items.PlantBlueberry => invBlueberryTexture, + + (ushort)Items.CactusBig => cactusBigTexture, + (ushort)Items.CactusSmall => cactusLittleTexture, + + (ushort)Items.SugarCane => sugarCaneTexture, + (ushort)Items.Onion => ItemOnionTexture, + + (ushort)Items.Toadstool => toadstoolTexture, + (ushort)Items.Boletus => boletusTexture, + (ushort)Items.Champignon => champignonTexture, + + (ushort)Items.Coral => coralTexture, + (ushort)Items.Seaweed => seaweedTexture, + (ushort)Items.PlantSeaweed => seaweedTexture, + (ushort)Items.PlantOnion => plantOnionTexture, //Nature - case (ushort)Items.WheatSeeds: return ItemWheatSeedsTexture; - case (ushort)Items.Seeds: return ItemSeedsTexture; + (ushort)Items.WheatSeeds => ItemWheatSeedsTexture, + (ushort)Items.Seeds => ItemSeedsTexture, - case (ushort)Items.WheatStraw: return ItemWheatStrawTexture; - case (ushort)Items.Hay: return ItemHayTexture; + (ushort)Items.WheatStraw => ItemWheatStrawTexture, + (ushort)Items.Hay => ItemHayTexture, - case (ushort)Items.Leave: return ItemLeaveTexture; - case (ushort)Items.Stick: return ItemStickTexture; - case (ushort)Items.Sticks: return ItemSticksTexture; - case (ushort)Items.Rubber: return ItemRubberTexture; + (ushort)Items.Leave => ItemLeaveTexture, + (ushort)Items.Stick => ItemStickTexture, + (ushort)Items.Sticks => ItemSticksTexture, + (ushort)Items.Rubber => ItemRubberTexture, //Tools - case (ushort)Items.Bucket: return ItemBucketTexture; - case (ushort)Items.BucketWater: return ItemBucketWaterTexture; + (ushort)Items.Bucket => ItemBucketTexture, + (ushort)Items.BucketWater => ItemBucketWaterTexture, - case (ushort)Items.StoneHead: return stoneHeadTexture; + (ushort)Items.StoneHead => stoneHeadTexture, - //case (ushort)Items.AxeHeadIron: return TextureHeadAxeIron; - //case (ushort)Items.ShovelHeadIron: return TextureHeadShovelIron; - //case (ushort)Items.PickaxeHeadIron: return TextureHeadPickaxeIron; + //(ushort)Items.AxeHeadIron => TextureHeadAxeIron, + //(ushort)Items.ShovelHeadIron => TextureHeadShovelIron, + //(ushort)Items.PickaxeHeadIron => TextureHeadPickaxeIron, //Shovel - case (ushort)Items.ShovelStone: return TextureShovelStone; - case (ushort)Items.ShovelCopper: return TextureShovelCopper; - case (ushort)Items.ShovelBronze: return TextureShovelBronze; - case (ushort)Items.ShovelGold: return TextureShovelGold; - case (ushort)Items.ShovelIron: return TextureShovelIron; - case (ushort)Items.ShovelSteel: return TextureShovelSteel; - case (ushort)Items.ShovelAluminium: return TextureShovelAluminium; + (ushort)Items.ShovelStone => TextureShovelStone, + (ushort)Items.ShovelCopper => TextureShovelCopper, + (ushort)Items.ShovelBronze => TextureShovelBronze, + (ushort)Items.ShovelGold => TextureShovelGold, + (ushort)Items.ShovelIron => TextureShovelIron, + (ushort)Items.ShovelSteel => TextureShovelSteel, + (ushort)Items.ShovelAluminium => TextureShovelAluminium, // Pickaxe - case (ushort)Items.PickaxeStone: return TexturePickaxeStone; - case (ushort)Items.PickaxeCopper: return TexturePickaxeCopper; - case (ushort)Items.PickaxeBronze: return TexturePickaxeBronze; - case (ushort)Items.PickaxeGold: return TexturePickaxeGold; - case (ushort)Items.PickaxeIron: return TexturePickaxeIron; - case (ushort)Items.PickaxeSteel: return TexturePickaxeSteel; - case (ushort)Items.PickaxeAluminium: return TexturePickaxeAluminium; + (ushort)Items.PickaxeStone => TexturePickaxeStone, + (ushort)Items.PickaxeCopper => TexturePickaxeCopper, + (ushort)Items.PickaxeBronze => TexturePickaxeBronze, + (ushort)Items.PickaxeGold => TexturePickaxeGold, + (ushort)Items.PickaxeIron => TexturePickaxeIron, + (ushort)Items.PickaxeSteel => TexturePickaxeSteel, + (ushort)Items.PickaxeAluminium => TexturePickaxeAluminium, // Axe - case (ushort)Items.AxeStone: return TextureAxeStone; - case (ushort)Items.AxeCopper: return TextureAxeCopper; - case (ushort)Items.AxeBronze: return TextureAxeBronze; - case (ushort)Items.AxeGold: return TextureAxeGold; - case (ushort)Items.AxeIron: return TextureAxeIron; - case (ushort)Items.AxeSteel: return TextureAxeSteel; - case (ushort)Items.AxeAluminium: return TextureAxeAluminium; + (ushort)Items.AxeStone => TextureAxeStone, + (ushort)Items.AxeCopper => TextureAxeCopper, + (ushort)Items.AxeBronze => TextureAxeBronze, + (ushort)Items.AxeGold => TextureAxeGold, + (ushort)Items.AxeIron => TextureAxeIron, + (ushort)Items.AxeSteel => TextureAxeSteel, + (ushort)Items.AxeAluminium => TextureAxeAluminium, // Hammers - case (ushort)Items.HammerCopper: return TextureHammerCopper; - case (ushort)Items.HammerBronze: return TextureHammerBronze; - case (ushort)Items.HammerIron: return TextureHammerIron; - case (ushort)Items.HammerGold: return TextureHammerGold; - case (ushort)Items.HammerSteel: return TextureHammerSteel; - case (ushort)Items.HammerAluminium: return TextureHammerAluminium; + (ushort)Items.HammerCopper => TextureHammerCopper, + (ushort)Items.HammerBronze => TextureHammerBronze, + (ushort)Items.HammerIron => TextureHammerIron, + (ushort)Items.HammerGold => TextureHammerGold, + (ushort)Items.HammerSteel => TextureHammerSteel, + (ushort)Items.HammerAluminium => TextureHammerAluminium, // Shears - case (ushort)Items.ShearsCopper: return TextureShearsCopper; - case (ushort)Items.ShearsBronze: return TextureShearsBronze; - case (ushort)Items.ShearsGold: return TextureShearsGold; - case (ushort)Items.ShearsIron: return TextureShearsIron; - case (ushort)Items.ShearsSteel: return TextureShearsSteel; - case (ushort)Items.ShearsAluminium: return TextureShearsAluminium; + (ushort)Items.ShearsCopper => TextureShearsCopper, + (ushort)Items.ShearsBronze => TextureShearsBronze, + (ushort)Items.ShearsGold => TextureShearsGold, + (ushort)Items.ShearsIron => TextureShearsIron, + (ushort)Items.ShearsSteel => TextureShearsSteel, + (ushort)Items.ShearsAluminium => TextureShearsAluminium, // Saw - case (ushort)Items.SawCopper: return TextureSawCopper; - case (ushort)Items.SawBronze: return TextureSawBronze; - case (ushort)Items.SawGold: return TextureSawGold; - case (ushort)Items.SawIron: return TextureSawIron; - case (ushort)Items.SawSteel: return TextureSawSteel; - case (ushort)Items.SawAluminium: return TextureSawAluminium; - - case (ushort)Items.ElectricDrill: return TextureDrillElectric; - case (ushort)Items.ElectricSaw: return electricSawTexture; - - case (ushort)Items.OreAluminium: return TextureOreAluminium; - case (ushort)Items.OreCopper: return TextureOreCopper; - case (ushort)Items.OreGold: return TextureOreGold; - case (ushort)Items.OreIron: return TextureOreIron; - case (ushort)Items.OreSilver: return TextureOreSilver; - case (ushort)Items.OreTin: return TextureOreTin; - - case (ushort)Items.AppleLeaves: return TextureAppleLeaves; - case (ushort)Items.AppleLeavesWithApples: return TextureAppleLeavesWithApples; - case (ushort)Items.OrangeLeaves: return TextureOrangeLeaves; - case (ushort)Items.OrangeLeavesWithOranges: return TextureOrangeLeavesWithOranges; - case (ushort)Items.PlumLeaves: return TexturePlumLeaves; - case (ushort)Items.PlumLeavesWithPlums: return TexturePlumLeavesWithPlums; - case (ushort)Items.CherryLeaves: return TextureCherryLeaves; - case (ushort)Items.CherryLeavesWithCherries: return TextureCherryLeavesWithCherries; - case (ushort)Items.LemonLeaves: return TextureLemonLeaves; - case (ushort)Items.LemonLeavesWithLemons: return lemonLeavesWithLemonsTexture; - case (ushort)Items.LindenLeaves: return TextureLindenLeaves; - case (ushort)Items.SpruceLeaves: return spruceLeavesTexture; - case (ushort)Items.PineLeaves: return pineLeavesTexture; - - case (ushort)Items.Snow: return snowTexture; - case (ushort)Items.SnowTop: return snowTopTexture; - case (ushort)Items.Ice: return iceTexture; - - case (ushort)Items.GrassDesert: return grassDesertTexture; - case (ushort)Items.GrassForest: return grassForestTexture; - case (ushort)Items.GrassHills: return grassHillsTexture; - case (ushort)Items.GrassJungle: return grassJungleTexture; - case (ushort)Items.GrassPlains: return grassPlainsTexture; - - case (ushort)Items.Alore: return plantAloreTexture; - case (ushort)Items.Plastic: return ItemPlasticTexture; - - case (ushort)Items.Carrot: return ItemCarrotTexture; - case (ushort)Items.PlantCarrot: return plantCarrotTexture; - case (ushort)Items.Peas: return ItemPeasTexture; - case (ushort)Items.PlantPeas: return plantPeasTexture; - - case (ushort)Items.Battery: return ItemBatteryTexture; - - case (ushort)Items.BottleWater: return bottleWaterTexture; - case (ushort)Items.Bottle: return bottleEmptyTexture; - case (ushort)Items.BowlEmpty: return bowlEmptyTexture; - case (ushort)Items.BowlWithMushrooms: return bowlMushroomsTexture; - case (ushort)Items.BowlWithVegetables: return bowlVegetablesTexture; - - case (ushort)Items.ElectricDrillOff: return TextureDrillElectric; - case (ushort)Items.ElectricSawOff: return electricSawTexture; - - case (ushort)Items.HoeStone: return TextureHoeStone; - case (ushort)Items.HoeBronze: return TextureHoeBronze; - case (ushort)Items.HoeIron: return TextureHoeIron; - - case (ushort)Items.Charger: return chargerTexture; - - case (ushort)Items.Clay: return clayTexture; - case (ushort)Items.GrassBlockClay: return TextureGrassBlockClay; - case (ushort)Items.BackDirt: return backgroundDirtTexture; - case (ushort)Items.BackSand: return backgroundSandTexture; - case (ushort)Items.BackClay: return backgroundClayTexture; - case (ushort)Items.BackCobblestone: return backgroundCobblestoneTexture; - case (ushort)Items.BackGravel: return backgroundGravelTexture; - case (ushort)Items.BackRedSand: return backgroundRedSandTexture; - case (ushort)Items.BackRegolite: return backgroundRegoliteTexture; - - case (ushort)Items.BackCoal: return backgroundCoalTexture; - case (ushort)Items.BackAluminium: return backgroundAluminiumTexture; - case (ushort)Items.BackCopper: return backgroundCopperTexture; - case (ushort)Items.BackGold: return backgroundGoldTexture; - case (ushort)Items.BackIron: return backgroundIronTexture; - case (ushort)Items.BackTin: return backgroundTinTexture; - case (ushort)Items.BackSilver: return backgroundSilverTexture; - - - case (ushort)Items.BackAnorthosite: return backgroundAnorthositeTexture; - case (ushort)Items.BackBasalt: return backgroundBasaltTexture; - case (ushort)Items.BackDiorit: return backgroundDioritTexture; - case (ushort)Items.BackDolomite: return backgroundDolomiteTexture; - case (ushort)Items.BackFlint: return backgroundFlintTexture; - case (ushort)Items.BackGabbro: return backgroundGabbroTexture; - case (ushort)Items.BackGneiss: return backgroundGneissTexture; - case (ushort)Items.BackLimestone: return backgroundLimestoneTexture; - case (ushort)Items.BackMudstone: return backgroundMudstoneTexture; - case (ushort)Items.BackSandstone: return backgroundSandstoneTexture; - case (ushort)Items.BackSchist: return backgroundSchistTexture; - case (ushort)Items.BackRhyolite: return backgroundRhyoliteTexture; - - case (ushort)Items.StoneFlint: return flintTexture; - case (ushort)Items.StoneMudstone: return mudstoneTexture; - case (ushort)Items.StoneAnorthosite: return anorthositeTexture; - case (ushort)Items.AnimalRabbit: return rabbitStillTexture; - case (ushort)Items.AnimalParrot: return TextureParrotStill; - case (ushort)Items.AnimalChicken: return chickenStillTexture; - case (ushort)Items.Rod: return RodTexture; - case (ushort)Items.TorchElectricOFF: return LightElectricTexture; - case (ushort)Items.TorchElectricON: return LightElectricTexture; - case (ushort)Items.Compost: return CompostTexture; - case (ushort)Items.Composter: return ComposterTexture; - - case (ushort)Items.FormalShoes: return TextureItemFormalShoes; - case (ushort)Items.Pumps: return TextureItemPumps; - case (ushort)Items.Sneakers: return TextureItemSneakers; - case (ushort)Items.SpaceBoots: return TextureItemSpaceBoots; - - case (ushort)Items.Jeans: return TextureItemJeans; - case (ushort)Items.Shorts: return TextureItemShorts; - case (ushort)Items.SpaceTrousers: return TextureItemSpaceTrousers; - case (ushort)Items.ArmyTrousers: return TextureItemArmyTrousers; - case (ushort)Items.Skirt: return TextureItemSkirt; - - case (ushort)Items.TShirt: return TextureItemTShirt; - case (ushort)Items.SpaceSuit: return TextureItemSpaceSuit; - case (ushort)Items.Dress: return TextureItemDress; - case (ushort)Items.Shirt: return TextureItemShirt; - - case (ushort)Items.Cap: return TextureItemCap; - case (ushort)Items.Hat: return TextureItemHat; - case (ushort)Items.Crown: return TextureItemCrown; - case (ushort)Items.SpaceHelmet: return TextureItemSpaceHelmet; - - case (ushort)Items.Underpants: return TextureItemUnderpants; - case (ushort)Items.BoxerShorts: return TextureItemBoxerShorts; - case (ushort)Items.Panties: return TextureItemPanties; - case (ushort)Items.Swimsuit: return TextureItemSwimsuit; - case (ushort)Items.BikiniDown: return TextureItemBikiniDown; - - case (ushort)Items.Bra: return TextureItemBra; - case (ushort)Items.BikiniTop: return TextureItemBikiniTop; - - case (ushort)Items.CoatArmy: return TextureItemCoatArmy; - case (ushort)Items.Coat: return TextureItemCoat; - case (ushort)Items.JacketDenim: return ItemJacketDenimTexture; - case (ushort)Items.JacketFormal: return ItemJacketFormalTexture; - case (ushort)Items.JacketShort: return TextureItemJacketShort; - - case (ushort)Items.AcaciaLeaves: return TextureAcaciaLeaves; - case (ushort)Items.AcaciaWood: return TextureAcaciaWood; - case (ushort)Items.AcaciaSapling: return TextureAcaciaSapling; - case (ushort)Items.MangroveLeaves: return TextureMangroveLeaves; - case (ushort)Items.MangroveWood: return TextureMangroveWood; - case (ushort)Items.MangroveSapling: return TextureMangroveSapling; - case (ushort)Items.WillowLeaves: return TextureWillowLeaves; - case (ushort)Items.WillowWood: return TextureWillowWood; - case (ushort)Items.WillowSapling: return TextureWillowSapling; - case (ushort)Items.Olive: return ItemOliveTexture; - case (ushort)Items.OliveLeaves: return TextureOliveLeaves; - case (ushort)Items.OliveLeavesWithOlives:return TextureOliveLeavesWithOlives; - case (ushort)Items.OliveWood: return TextureOliveWood; - case (ushort)Items.OliveSapling: return TextureOliveSapling; - case (ushort)Items.EucalyptusLeaves: return TextureEucalyptusLeaves; - case (ushort)Items.EucalyptusSapling: return TextureEucalyptusSapling; - case (ushort)Items.EucalyptusWood: return TextureEucalyptusWood; - case (ushort)Items.RubberTreeLeaves: return TextureRubberTreeLeaves; - case (ushort)Items.RubberTreeSapling: return TextureRubberTreeSapling; - case (ushort)Items.RubberTreeWood: return TextureRubberTreeWood; - case (ushort)Items.KapokLeaves: return TextureKapokLeaves; - case (ushort)Items.KapokLeavesFibre: return TextureKapokLeavesFibre; - case (ushort)Items.KapokLeacesFlowering: return TextureKapokBlossom; - case (ushort)Items.KapokSapling: return TextureKapokSapling; - case (ushort)Items.KapokWood: return TextureKapokWood; - case (ushort)Items.KapokFibre: return ItemKapokFibreTexture; - case (ushort)Items.KnifeCopper: return TextureKnifeCopper; - case (ushort)Items.KnifeBronze: return TextureKnifeBronze; - case (ushort)Items.KnifeGold: return TextureKnifeGold; - case (ushort)Items.KnifeIron: return TextureKnifeIron; - case (ushort)Items.KnifeSteel: return TextureKnifeSteel; - case (ushort)Items.KnifeAluminium: return TextureKnifeAluminium; - - case (ushort)Items.HoeGold: return TextureHoeGold; - case (ushort)Items.HoeSteel: return TextureHoeSteel; - case (ushort)Items.HoeAluminium: return TextureHoeAluminium; - case (ushort)Items.DyeGold: return TextureDyeGold; - case (ushort)Items.DyeWhite: return TextureDyeWhite; - case (ushort)Items.DyeYellow: return TextureDyeYellow; - case (ushort)Items.DyeOrange: return TextureDyeOrange; - case (ushort)Items.DyeRed: return TextureDyeRed; - case (ushort)Items.DyeDarkRed: return TextureDyeDarkRed; - case (ushort)Items.DyeOlive: return TextureDyeOlive; - case (ushort)Items.DyePurple: return TextureDyePurple; - case (ushort)Items.DyePink: return TextureDyePink; - case (ushort)Items.DyeTeal: return TextureDyeTeal; - case (ushort)Items.DyeLightBlue: return TextureDyeLightBlue; - case (ushort)Items.DyeBlue: return TextureDyeBlue; - case (ushort)Items.DyeMagenta: return TextureDyeMagenta; - case (ushort)Items.DyeDarkBlue: return TextureDyeDarkBlue; - case (ushort)Items.DyeBlack: return TextureDyeBlack; - case (ushort)Items.DyeBrown: return TextureDyeBrown; - case (ushort)Items.DyeLightGray: return TextureDyeLightGray; - case (ushort)Items.DyeGray: return TextureDyeGray; - case (ushort)Items.DyeDarkGray: return TextureDyeDarkGray; - case (ushort)Items.DyeViolet: return TextureDyeViolet; - case (ushort)Items.DyeSpringGreen: return TextureDyeSpringGreen; - case (ushort)Items.DyeRoseQuartz: return TextureDyeRoseQuartz; - case (ushort)Items.TestTube: return TextureTestTube; - case (ushort)Items.DyeLightGreen: return TextureDyeLightGreen; - case (ushort)Items.DyeGreen: return TextureDyeGreen; - case (ushort)Items.DyeArmy: return TextureDyeArmy; - case (ushort)Items.DyeDarkGreen: return TextureDyeDarkGreen; + (ushort)Items.SawCopper => TextureSawCopper, + (ushort)Items.SawBronze => TextureSawBronze, + (ushort)Items.SawGold => TextureSawGold, + (ushort)Items.SawIron => TextureSawIron, + (ushort)Items.SawSteel => TextureSawSteel, + (ushort)Items.SawAluminium => TextureSawAluminium, + + (ushort)Items.ElectricDrill => TextureDrillElectric, + (ushort)Items.ElectricSaw => electricSawTexture, + + (ushort)Items.OreAluminium => TextureOreAluminium, + (ushort)Items.OreCopper => TextureOreCopper, + (ushort)Items.OreGold => TextureOreGold, + (ushort)Items.OreIron => TextureOreIron, + (ushort)Items.OreSilver => TextureOreSilver, + (ushort)Items.OreTin => TextureOreTin, + + (ushort)Items.AppleLeaves => TextureAppleLeaves, + (ushort)Items.AppleLeavesWithApples => TextureAppleLeavesWithApples, + (ushort)Items.OrangeLeaves => TextureOrangeLeaves, + (ushort)Items.OrangeLeavesWithOranges => TextureOrangeLeavesWithOranges, + (ushort)Items.PlumLeaves => TexturePlumLeaves, + (ushort)Items.PlumLeavesWithPlums => TexturePlumLeavesWithPlums, + (ushort)Items.CherryLeaves => TextureCherryLeaves, + (ushort)Items.CherryLeavesWithCherries => TextureCherryLeavesWithCherries, + (ushort)Items.LemonLeaves => TextureLemonLeaves, + (ushort)Items.LemonLeavesWithLemons => lemonLeavesWithLemonsTexture, + (ushort)Items.LindenLeaves => TextureLindenLeaves, + (ushort)Items.SpruceLeaves => spruceLeavesTexture, + (ushort)Items.PineLeaves => pineLeavesTexture, + + (ushort)Items.Snow => snowTexture, + (ushort)Items.SnowTop => snowTopTexture, + (ushort)Items.Ice => iceTexture, + + (ushort)Items.GrassDesert => grassDesertTexture, + (ushort)Items.GrassForest => grassForestTexture, + (ushort)Items.GrassHills => grassHillsTexture, + (ushort)Items.GrassJungle => grassJungleTexture, + (ushort)Items.GrassPlains => grassPlainsTexture, + + (ushort)Items.Alore => plantAloreTexture, + (ushort)Items.Plastic => ItemPlasticTexture, + + (ushort)Items.Carrot => ItemCarrotTexture, + (ushort)Items.PlantCarrot => plantCarrotTexture, + (ushort)Items.Peas => ItemPeasTexture, + (ushort)Items.PlantPeas => plantPeasTexture, + + (ushort)Items.Battery => ItemBatteryTexture, + + (ushort)Items.BottleWater => bottleWaterTexture, + (ushort)Items.Bottle => bottleEmptyTexture, + (ushort)Items.BowlEmpty => bowlEmptyTexture, + (ushort)Items.BowlWithMushrooms => bowlMushroomsTexture, + (ushort)Items.BowlWithVegetables => bowlVegetablesTexture, + + (ushort)Items.ElectricDrillOff => TextureDrillElectric, + (ushort)Items.ElectricSawOff => electricSawTexture, + + (ushort)Items.HoeStone => TextureHoeStone, + (ushort)Items.HoeBronze => TextureHoeBronze, + (ushort)Items.HoeIron => TextureHoeIron, + + (ushort)Items.Charger => chargerTexture, + + (ushort)Items.Clay => clayTexture, + (ushort)Items.GrassBlockClay => TextureGrassBlockClay, + (ushort)Items.BackDirt => backgroundDirtTexture, + (ushort)Items.BackSand => backgroundSandTexture, + (ushort)Items.BackClay => backgroundClayTexture, + (ushort)Items.BackCobblestone => backgroundCobblestoneTexture, + (ushort)Items.BackGravel => backgroundGravelTexture, + (ushort)Items.BackRedSand => backgroundRedSandTexture, + (ushort)Items.BackRegolite => backgroundRegoliteTexture, + + (ushort)Items.BackCoal => backgroundCoalTexture, + (ushort)Items.BackAluminium => backgroundAluminiumTexture, + (ushort)Items.BackCopper => backgroundCopperTexture, + (ushort)Items.BackGold => backgroundGoldTexture, + (ushort)Items.BackIron => backgroundIronTexture, + (ushort)Items.BackTin => backgroundTinTexture, + (ushort)Items.BackSilver => backgroundSilverTexture, + + + (ushort)Items.BackAnorthosite => backgroundAnorthositeTexture, + (ushort)Items.BackBasalt => backgroundBasaltTexture, + (ushort)Items.BackDiorit => backgroundDioritTexture, + (ushort)Items.BackDolomite => backgroundDolomiteTexture, + (ushort)Items.BackFlint => backgroundFlintTexture, + (ushort)Items.BackGabbro => backgroundGabbroTexture, + (ushort)Items.BackGneiss => backgroundGneissTexture, + (ushort)Items.BackLimestone => backgroundLimestoneTexture, + (ushort)Items.BackMudstone => backgroundMudstoneTexture, + (ushort)Items.BackSandstone => backgroundSandstoneTexture, + (ushort)Items.BackSchist => backgroundSchistTexture, + (ushort)Items.BackRhyolite => backgroundRhyoliteTexture, + + (ushort)Items.StoneFlint => flintTexture, + (ushort)Items.StoneMudstone => mudstoneTexture, + (ushort)Items.StoneAnorthosite => anorthositeTexture, + (ushort)Items.AnimalRabbit => rabbitStillTexture, + (ushort)Items.AnimalParrot => TextureParrotStill, + (ushort)Items.AnimalChicken => chickenStillTexture, + (ushort)Items.Rod => RodTexture, + (ushort)Items.TorchElectricOFF => LightElectricTexture, + (ushort)Items.TorchElectricON => LightElectricTexture, + (ushort)Items.Compost => CompostTexture, + (ushort)Items.Composter => ComposterTexture, + + (ushort)Items.FormalShoes => TextureItemFormalShoes, + (ushort)Items.Pumps => TextureItemPumps, + (ushort)Items.Sneakers => TextureItemSneakers, + (ushort)Items.SpaceBoots => TextureItemSpaceBoots, + + (ushort)Items.Jeans => TextureItemJeans, + (ushort)Items.Shorts => TextureItemShorts, + (ushort)Items.SpaceTrousers => TextureItemSpaceTrousers, + (ushort)Items.ArmyTrousers => TextureItemArmyTrousers, + (ushort)Items.Skirt => TextureItemSkirt, + + (ushort)Items.TShirt => TextureItemTShirt, + (ushort)Items.SpaceSuit => TextureItemSpaceSuit, + (ushort)Items.Dress => TextureItemDress, + (ushort)Items.Shirt => TextureItemShirt, + + (ushort)Items.Cap => TextureItemCap, + (ushort)Items.Hat => TextureItemHat, + (ushort)Items.Crown => TextureItemCrown, + (ushort)Items.SpaceHelmet => TextureItemSpaceHelmet, + + (ushort)Items.Underpants => TextureItemUnderpants, + (ushort)Items.BoxerShorts => TextureItemBoxerShorts, + (ushort)Items.Panties => TextureItemPanties, + (ushort)Items.Swimsuit => TextureItemSwimsuit, + (ushort)Items.BikiniDown => TextureItemBikiniDown, + + (ushort)Items.Bra => TextureItemBra, + (ushort)Items.BikiniTop => TextureItemBikiniTop, + + (ushort)Items.CoatArmy => TextureItemCoatArmy, + (ushort)Items.Coat => TextureItemCoat, + (ushort)Items.JacketDenim => ItemJacketDenimTexture, + (ushort)Items.JacketFormal => ItemJacketFormalTexture, + (ushort)Items.JacketShort => TextureItemJacketShort, + + (ushort)Items.AcaciaLeaves => TextureAcaciaLeaves, + (ushort)Items.AcaciaWood => TextureAcaciaWood, + (ushort)Items.AcaciaSapling => TextureAcaciaSapling, + (ushort)Items.MangroveLeaves => TextureMangroveLeaves, + (ushort)Items.MangroveWood => TextureMangroveWood, + (ushort)Items.MangroveSapling => TextureMangroveSapling, + (ushort)Items.WillowLeaves => TextureWillowLeaves, + (ushort)Items.WillowWood => TextureWillowWood, + (ushort)Items.WillowSapling => TextureWillowSapling, + (ushort)Items.Olive => ItemOliveTexture, + (ushort)Items.OliveLeaves => TextureOliveLeaves, + (ushort)Items.OliveLeavesWithOlives => TextureOliveLeavesWithOlives, + (ushort)Items.OliveWood => TextureOliveWood, + (ushort)Items.OliveSapling => TextureOliveSapling, + (ushort)Items.EucalyptusLeaves => TextureEucalyptusLeaves, + (ushort)Items.EucalyptusSapling => TextureEucalyptusSapling, + (ushort)Items.EucalyptusWood => TextureEucalyptusWood, + (ushort)Items.RubberTreeLeaves => TextureRubberTreeLeaves, + (ushort)Items.RubberTreeSapling => TextureRubberTreeSapling, + (ushort)Items.RubberTreeWood => TextureRubberTreeWood, + (ushort)Items.KapokLeaves => TextureKapokLeaves, + (ushort)Items.KapokLeavesFibre => TextureKapokLeavesFibre, + (ushort)Items.KapokLeacesFlowering => TextureKapokBlossom, + (ushort)Items.KapokSapling => TextureKapokSapling, + (ushort)Items.KapokWood => TextureKapokWood, + (ushort)Items.KapokFibre => ItemKapokFibreTexture, + (ushort)Items.KnifeCopper => TextureKnifeCopper, + (ushort)Items.KnifeBronze => TextureKnifeBronze, + (ushort)Items.KnifeGold => TextureKnifeGold, + (ushort)Items.KnifeIron => TextureKnifeIron, + (ushort)Items.KnifeSteel => TextureKnifeSteel, + (ushort)Items.KnifeAluminium => TextureKnifeAluminium, + + (ushort)Items.HoeGold => TextureHoeGold, + (ushort)Items.HoeSteel => TextureHoeSteel, + (ushort)Items.HoeAluminium => TextureHoeAluminium, + (ushort)Items.DyeGold => TextureDyeGold, + (ushort)Items.DyeWhite => TextureDyeWhite, + (ushort)Items.DyeYellow => TextureDyeYellow, + (ushort)Items.DyeOrange => TextureDyeOrange, + (ushort)Items.DyeRed => TextureDyeRed, + (ushort)Items.DyeDarkRed => TextureDyeDarkRed, + (ushort)Items.DyeOlive => TextureDyeOlive, + (ushort)Items.DyePurple => TextureDyePurple, + (ushort)Items.DyePink => TextureDyePink, + (ushort)Items.DyeTeal => TextureDyeTeal, + (ushort)Items.DyeLightBlue => TextureDyeLightBlue, + (ushort)Items.DyeBlue => TextureDyeBlue, + (ushort)Items.DyeMagenta => TextureDyeMagenta, + (ushort)Items.DyeDarkBlue => TextureDyeDarkBlue, + (ushort)Items.DyeBlack => TextureDyeBlack, + (ushort)Items.DyeBrown => TextureDyeBrown, + (ushort)Items.DyeLightGray => TextureDyeLightGray, + (ushort)Items.DyeGray => TextureDyeGray, + (ushort)Items.DyeDarkGray => TextureDyeDarkGray, + (ushort)Items.DyeViolet => TextureDyeViolet, + (ushort)Items.DyeSpringGreen => TextureDyeSpringGreen, + (ushort)Items.DyeRoseQuartz => TextureDyeRoseQuartz, + (ushort)Items.TestTube => TextureTestTube, + (ushort)Items.DyeLightGreen => TextureDyeLightGreen, + (ushort)Items.DyeGreen => TextureDyeGreen, + (ushort)Items.DyeArmy => TextureDyeArmy, + (ushort)Items.DyeDarkGreen => TextureDyeDarkGreen, //Shovel - case (ushort)Items.ShovelHeadCopper: return TextureShovelHeadCopper; - case (ushort)Items.ShovelHeadBronze: return TextureShovelHeadBronze; - case (ushort)Items.ShovelHeadGold: return TextureShovelHeadGold; - case (ushort)Items.ShovelHeadIron: return TextureShovelHeadIron; - case (ushort)Items.ShovelHeadSteel: return TextureShovelHeadSteel; - case (ushort)Items.ShovelHeadAluminium: return TextureShovelHeadAluminium; + (ushort)Items.ShovelHeadCopper => TextureShovelHeadCopper, + (ushort)Items.ShovelHeadBronze => TextureShovelHeadBronze, + (ushort)Items.ShovelHeadGold => TextureShovelHeadGold, + (ushort)Items.ShovelHeadIron => TextureShovelHeadIron, + (ushort)Items.ShovelHeadSteel => TextureShovelHeadSteel, + (ushort)Items.ShovelHeadAluminium => TextureShovelHeadAluminium, // Pickaxe - case (ushort)Items.PickaxeHeadCopper: return TexturePickaxeHeadCopper; - case (ushort)Items.PickaxeHeadBronze: return TexturePickaxeHeadBronze; - case (ushort)Items.PickaxeHeadGold: return TexturePickaxeHeadGold; - case (ushort)Items.PickaxeHeadIron: return TexturePickaxeHeadIron; - case (ushort)Items.PickaxeHeadSteel: return TexturePickaxeHeadSteel; - case (ushort)Items.PickaxeHeadAluminium: return TexturePickaxeHeadAluminium; + (ushort)Items.PickaxeHeadCopper => TexturePickaxeHeadCopper, + (ushort)Items.PickaxeHeadBronze => TexturePickaxeHeadBronze, + (ushort)Items.PickaxeHeadGold => TexturePickaxeHeadGold, + (ushort)Items.PickaxeHeadIron => TexturePickaxeHeadIron, + (ushort)Items.PickaxeHeadSteel => TexturePickaxeHeadSteel, + (ushort)Items.PickaxeHeadAluminium => TexturePickaxeHeadAluminium, // Axe - case (ushort)Items.AxeHeadCopper: return TextureAxeHeadCopper; - case (ushort)Items.AxeHeadBronze: return TextureAxeHeadBronze; - case (ushort)Items.AxeHeadGold: return TextureAxeHeadGold; - case (ushort)Items.AxeHeadIron: return TextureAxeHeadIron; - case (ushort)Items.AxeHeadSteel: return TextureAxeHeadSteel; - case (ushort)Items.AxeHeadAluminium: return TextureAxeHeadAluminium; + (ushort)Items.AxeHeadCopper => TextureAxeHeadCopper, + (ushort)Items.AxeHeadBronze => TextureAxeHeadBronze, + (ushort)Items.AxeHeadGold => TextureAxeHeadGold, + (ushort)Items.AxeHeadIron => TextureAxeHeadIron, + (ushort)Items.AxeHeadSteel => TextureAxeHeadSteel, + (ushort)Items.AxeHeadAluminium => TextureAxeHeadAluminium, // Shears - case (ushort)Items.ShearsHeadCopper: return TextureShearsHeadCopper; - case (ushort)Items.ShearsHeadBronze: return TextureShearsHeadBronze; - case (ushort)Items.ShearsHeadGold: return TextureShearsHeadGold; - case (ushort)Items.ShearsHeadIron: return TextureShearsHeadIron; - case (ushort)Items.ShearsHeadSteel: return TextureShearsHeadSteel; - case (ushort)Items.ShearsHeadAluminium: return TextureShearsHeadAluminium; - - case (ushort)Items.KnifeHeadCopper: return TextureKnifeHeadCopper; - case (ushort)Items.KnifeHeadBronze: return TextureKnifeHeadBronze; - case (ushort)Items.KnifeHeadGold: return TextureKnifeHeadGold; - case (ushort)Items.KnifeHeadIron: return TextureKnifeHeadIron; - case (ushort)Items.KnifeHeadSteel: return TextureKnifeHeadSteel; - case (ushort)Items.KnifeHeadAluminium: return TextureKnifeHeadAluminium; - - case (ushort)Items.HoeHeadCopper: return TextureHoeHeadCopper; - case (ushort)Items.HoeHeadBronze: return TextureHoeHeadBronze; - case (ushort)Items.HoeHeadGold: return TextureHoeHeadGold; - case (ushort)Items.HoeHeadIron: return TextureHoeHeadIron; - case (ushort)Items.HoeHeadSteel: return TextureHoeHeadSteel; - case (ushort)Items.HoeHeadAluminium: return TextureHoeHeadAluminium; - - case (ushort)Items.RedSand: return TextureRedSand; - case (ushort)Items.FishMeat: return fishTexture0; - - default: + (ushort)Items.ShearsHeadCopper => TextureShearsHeadCopper, + (ushort)Items.ShearsHeadBronze => TextureShearsHeadBronze, + (ushort)Items.ShearsHeadGold => TextureShearsHeadGold, + (ushort)Items.ShearsHeadIron => TextureShearsHeadIron, + (ushort)Items.ShearsHeadSteel => TextureShearsHeadSteel, + (ushort)Items.ShearsHeadAluminium => TextureShearsHeadAluminium, + + (ushort)Items.KnifeHeadCopper => TextureKnifeHeadCopper, + (ushort)Items.KnifeHeadBronze => TextureKnifeHeadBronze, + (ushort)Items.KnifeHeadGold => TextureKnifeHeadGold, + (ushort)Items.KnifeHeadIron => TextureKnifeHeadIron, + (ushort)Items.KnifeHeadSteel => TextureKnifeHeadSteel, + (ushort)Items.KnifeHeadAluminium => TextureKnifeHeadAluminium, + + (ushort)Items.HoeHeadCopper => TextureHoeHeadCopper, + (ushort)Items.HoeHeadBronze => TextureHoeHeadBronze, + (ushort)Items.HoeHeadGold => TextureHoeHeadGold, + //(ushort)Items.HoeHeadIron => TextureHoeHeadIron, + (ushort)Items.HoeHeadSteel => TextureHoeHeadSteel, + (ushort)Items.HoeHeadAluminium => TextureHoeHeadAluminium, + + (ushort)Items.RedSand => TextureRedSand, + (ushort)Items.FishMeat => fishTexture0, + + _=> #if DEBUG - throw new Exception("Missing texture for item "+(Items)id); + throw new Exception("Missing texture for item "+(Items)id), #else - return null; + null, #endif - } + }; } //void ItemDrop(ItemNonInv item, DInt _pos) { @@ -20867,7 +20840,7 @@ enum Precipitation : byte { break; case "ExternalTextEditor": - FormTextInput f = new FormTextInput(editText); + FormTextInput f = new(editText); f.ShowDialog(); if (f.save) { editText=f.ret; @@ -20897,7 +20870,7 @@ enum Precipitation : byte { case "ExternalTextEditor": // ExternalTextEditor=true; - FormTextInput f = new FormTextInput(editText); + FormTextInput f = new(editText); f.ShowDialog(); if (f.save) { editText=f.ret; @@ -21016,80 +20989,78 @@ enum Precipitation : byte { } string ConvertNormalToUpper(string key) { - switch (key) { - case "q": return "Q"; - case "w": return "W"; - case "e": return "E"; - case "r": return "R"; - case "t": return "T"; - case "z": return "Z"; - case "u": return "U"; - case "i": return "I"; - case "o": return "O"; - case "p": return "P"; - case "a": return "A"; - case "s": return "S"; - case "d": return "D"; - case "f": return "F"; - case "g": return "G"; - case "h": return "H"; - case "j": return "J"; - case "k": return "K"; - case "l": return "L"; - case "y": return "Y"; - case "x": return "X"; - case "c": return "C"; - case "v": return "V"; - case "b": return "B"; - case "n": return "N"; - case "m": return "M"; - - case "ú": return "/"; - case ")": return "("; - case ",": return "?"; - case ".": return ":"; - case "-": return "_"; - case "¨": return "'"; - case "´": return "ˇ"; - case "=": return "%"; - case "§": return "!"; - } - - return ""; - } + return key switch { + "q" => "Q", + "w" => "W", + "e" => "E", + "r" => "R", + "t" => "T", + "z" => "Z", + "u" => "U", + "i" => "I", + "o" => "O", + "p" => "P", + "a" => "A", + "s" => "S", + "d" => "D", + "f" => "F", + "g" => "G", + "h" => "H", + "j" => "J", + "k" => "K", + "l" => "L", + "y" => "Y", + "x" => "X", + "c" => "C", + "v" => "V", + "b" => "B", + "n" => "N", + "m" => "M", + "ú" => "/", + ")" => "(", + "," => "?", + "." => ":", + "-" => "_", + "¨" => "'", + "´" => "ˇ", + "=" => "%", + "§" => "!", + _ => "", + }; + } string ConvertNormalToCtrls(string key) { - switch (key) { - case "x": return "Delete"; - case "c": return "Copy"; - case "v": return "Paste"; - case "i": return "ExternalTextEditor"; - } - return ""; - } + return key switch { + "x" => "Delete", + "c" => "Copy", + "v" => "Paste", + "i" => "ExternalTextEditor", + _ => "", + }; + } string ConvertNormalToAtls(string key) { - switch (key) { - case "q": return "\""; - case "w": return "|"; - case "f": return "["; - case "g": return "]"; - case "x": return "#"; - case "c": return "&"; - case "v": return "@"; - case "b": return "{"; - case "n": return "}"; - case "ú": return "÷"; - case ")": return "×"; - case ",": return "<"; - case ".": return ">"; - case "-": return "*"; - case "+": return "~"; - case "š": return "^"; - case "ř": return "°"; - } - return ""; - } + return key switch { + "q" => "\"", + "w" => "|", + "f" => "[", + "g" => "]", + "x" => "#", + "c" => "&", + "v" => "@", + "b" => "{", + "n" => "}", + "ú" => "÷", + ")" => "×", + "," => "<", + "." => ">", + "-" => "*", + "+" => "~", + "š" => "^", + "ř" => "°", + _ => "", + }; + } #endregion #region Energy @@ -21097,7 +21068,7 @@ enum Precipitation : byte { for (int i=0; i0.5f) { - if (random.Bool_10Percent())oxygenMachine.AddEnergy(); + if (FastRandom.Bool_10Percent())oxygenMachine.AddEnergy(); } if (oxygenMachine.Inv[0].Id!=0) { @@ -21962,7 +21932,7 @@ enum Precipitation : byte { DroppedItems.RemoveAt(i); return; } - } + } } Terrain chunk=terrain[ch.X]; for (int y=ch.Y+1; y<100; y++) { @@ -21984,7 +21954,7 @@ enum Precipitation : byte { for (int y=ch.Y+1; y<100; y++) { if (terrain[ch.X].IsBackground[y]) { if (terrain[ch.X].Background[y].Id==(ushort)BlockId.RubberTreeWood) { - if (random.Int(2000)==1) { + if (FastRandom.Int(2000)==1) { RemovefromBucketsForRubber(ch.X,ch.Y); TerrainSetTopBlockNormal(ch.X,ch.Y,(ushort)BlockId.BucketWithLatex,TextureBucketWithLatex); return true; @@ -22137,7 +22107,7 @@ enum Precipitation : byte { chunk.Plants.RemoveAt(i); RemovePlant(x); break; - } + } } } @@ -22238,8 +22208,8 @@ enum Precipitation : byte { #region Trees void AutoDestroyLeaves(ushort wood, ushort leaves) { - int Xran=terrainStartIndexX+random.Int(terrainStartIndexW-terrainStartIndexX), - Yran=terrainStartIndexY+random.Int(terrainStartIndexH-terrainStartIndexY); + int Xran=terrainStartIndexX+FastRandom.Int(terrainStartIndexW-terrainStartIndexX), + Yran=terrainStartIndexY+FastRandom.Int(terrainStartIndexH-terrainStartIndexY); if (terrain[Xran].IsTopBlocks[Yran]) { if (terrain[Xran].TopBlocks[Yran].Id==leaves) { @@ -22259,7 +22229,7 @@ enum Precipitation : byte { Terrain chunk=terrain[Xran]; List listLeaves=((LeavesBlock)chunk.TopBlocks[Yran]).tree.TitlesLeaves; - + for (int i = 0; i listLeaves=((LeavesBlock)chunk.TopBlocks[Yran]).tree.TitlesLeaves; - + for (int i = 0; i listLeaves=((LeavesBlock)chunk.TopBlocks[Yran]).tree.TitlesLeaves; - + for (int i = 0; i rndChunks=new List<(int, float)>(); + // Sort FastRandom near chunks + List<(int, float)> rndChunks=new(); int src=(int)(r.Position.X)/16; - for (int i=1; i<20; i++){ - (int, float) ch1 = (src+i, random.Float()); - (int, float) ch2 = (src-i, random.Float()); + for (int i=1; i<20; i++){ + (int, float) ch1 = (src+i, FastRandom.Float()); + (int, float) ch2 = (src-i, FastRandom.Float()); rndChunks.Add(ch1); rndChunks.Add(ch2); } - - // sort chunks randomly + + // sort chunks randomly rndChunks.Sort((i1, i2) => i1.Item2.CompareTo(i2.Item2)); // find leaves and move to - foreach ((int, float) ch in rndChunks) { + foreach ((int, float) ch in rndChunks) { Terrain chunkJ=terrain[ch.Item1]; - for (int i=chunkJ.StartSomething; i<125; i++) { - if (chunkJ.IsTopBlocks[i]){ + for (int i=chunkJ.StartSomething; i<125; i++) { + if (chunkJ.IsTopBlocks[i]){ if (GameMethods.IsLeaves(chunkJ.TopBlocks[i].Id)) { - r.StopFlying += delegate() { + r.StopFlying += delegate() { Terrain dscChunk=terrain[(int)r.Position.X/16]; if (dscChunk.IsTopBlocks[(int)r.Position.Y/16]) { return true; } - - return false; + + return false; }; - + r.SetFlying(ch.Item1*16,i*16); return; } - } + } } // } } @@ -22685,10 +22655,10 @@ enum Precipitation : byte { TerrainSetBackground(x, y-7, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); TerrainSetBackground(x, y-8, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); TerrainSetBackground(x-2, y-6, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); - if (random.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); - if (random.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); - if (random.Bool()) TerrainSetBackground(x-1, y-5, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); - if (random.Bool()) TerrainSetBackground(x+1, y-5, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-5, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-5, (ushort)BlockId.RubberTreeWood, TextureRubberTreeWood); TerrainSetTopBlockNormal(x+1, y-4, (ushort)BlockId.RubberTreeLeaves, TextureRubberTreeLeaves); TerrainSetTopBlockNormal(x+1, y-4, (ushort)BlockId.RubberTreeLeaves, TextureRubberTreeLeaves); @@ -22737,7 +22707,7 @@ enum Precipitation : byte { TerrainSetBackground(x, y-4, (ushort)BlockId.AcaciaWood, TextureAcaciaWood); TerrainSetBackground(x, y-5, (ushort)BlockId.AcaciaWood, TextureAcaciaWood); - if (random.Bool()) { + if (FastRandom.Bool()) { TerrainSetBackground(x-1, y-4, (ushort)BlockId.AcaciaWood, TextureAcaciaWood); TerrainSetBackground(x-2, y-5, (ushort)BlockId.AcaciaWood, TextureAcaciaWood); TerrainSetBackground(x+1, y-3, (ushort)BlockId.AcaciaWood, TextureAcaciaWood); @@ -22766,7 +22736,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x+1, y-6, (ushort)BlockId.AcaciaLeaves, TextureAcaciaLeaves); TerrainSetTopBlockNormal(x, y-6, (ushort)BlockId.AcaciaLeaves, TextureAcaciaLeaves); - Terrain + Terrain chunk0= terrain[x ], chunkM1=terrain[x- 1], chunkM2=terrain[x- 2], @@ -22790,8 +22760,8 @@ enum Precipitation : byte { TerrainSetBackground(x, y-3, (ushort)BlockId.MangroveWood, TextureMangroveWood); TerrainSetBackground(x, y-4, (ushort)BlockId.MangroveWood, TextureMangroveWood); - if (random.Bool()) TerrainSetBackground(x-1, y-3, (ushort)BlockId.MangroveWood, TextureMangroveWood); - if (random.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.MangroveWood, TextureMangroveWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-3, (ushort)BlockId.MangroveWood, TextureMangroveWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.MangroveWood, TextureMangroveWood); TerrainSetTopBlockNormal(x+1, y-3, (ushort)BlockId.MangroveLeaves, TextureMangroveLeaves); TerrainSetTopBlockNormal(x-1, y-3, (ushort)BlockId.MangroveLeaves, TextureMangroveLeaves); @@ -22801,7 +22771,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x-1, y-4, (ushort)BlockId.MangroveLeaves, TextureMangroveLeaves); TerrainSetTopBlockNormal(x, y-5, (ushort)BlockId.MangroveLeaves, TextureMangroveLeaves); - Terrain + Terrain chunkM1=terrain[x- 1], chunk0= terrain[x ], chunkP1=terrain[x+ 1]; @@ -22816,9 +22786,9 @@ enum Precipitation : byte { TerrainSetBackground(x, y-2, (ushort)BlockId.WillowWood, TextureWillowWood); TerrainSetBackground(x, y-3, (ushort)BlockId.WillowWood, TextureWillowWood); TerrainSetBackground(x, y-4, (ushort)BlockId.WillowWood, TextureWillowWood); - if (random.Bool()) TerrainSetBackground(x, y-4, (ushort)BlockId.WillowWood, TextureWillowWood); + if (FastRandom.Bool()) TerrainSetBackground(x, y-4, (ushort)BlockId.WillowWood, TextureWillowWood); - switch (Rabcr.random.Int(3)) { + switch (FastRandom.Int(3)) { case 0: TerrainSetBackground(x-1, y-3, (ushort)BlockId.WillowWood,TextureWillowWood); @@ -22855,7 +22825,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x, y-5, (ushort)BlockId.WillowLeaves, TextureWillowLeaves); TerrainSetTopBlockNormal(x+1, y-5, (ushort)BlockId.WillowLeaves, TextureWillowLeaves); - Terrain + Terrain chunkM2=terrain[x- 2], chunkM1=terrain[x- 1], chunk0 =terrain[x ], @@ -22877,7 +22847,7 @@ enum Precipitation : byte { TerrainSetBackground(x, y-5, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); TerrainSetBackground(x, y-6, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); - if (random.Bool()) { + if (FastRandom.Bool()) { TerrainSetBackground(x-1, y-3, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); TerrainSetBackground(x-2, y-4, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); TerrainSetBackground(x-2, y-5, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); @@ -22888,7 +22858,7 @@ enum Precipitation : byte { TerrainSetBackground(x-2, y-5, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); } - if (random.Bool()) { + if (FastRandom.Bool()) { TerrainSetBackground(x+1, y-3, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); TerrainSetBackground(x+2, y-4, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); TerrainSetBackground(x+2, y-5, (ushort)BlockId.EucalyptusWood, TextureEucalyptusWood); @@ -22916,7 +22886,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x, y-7, (ushort)BlockId.EucalyptusLeaves, TextureEucalyptusLeaves); TerrainSetTopBlockNormal(x+1, y-7, (ushort)BlockId.EucalyptusLeaves, TextureEucalyptusLeaves); - Terrain + Terrain chunkM2=terrain[x- 2], chunkM1=terrain[x- 1], chunk0= terrain[x ], @@ -22934,7 +22904,7 @@ enum Precipitation : byte { TerrainSetBackground(x, y-1, (ushort)BlockId.OliveWood, TextureOliveWood); TerrainSetBackground(x, y-2, (ushort)BlockId.OliveWood, TextureOliveWood); - if (random.Bool()) { + if (FastRandom.Bool()) { TerrainSetBackground(x, y-3, (ushort)BlockId.OliveWood, TextureOliveWood); TerrainSetBackground(x-1, y-3, (ushort)BlockId.OliveWood, TextureOliveWood); TerrainSetBackground(x-1, y-4, (ushort)BlockId.OliveWood, TextureOliveWood); @@ -22963,7 +22933,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x, y-6, (ushort)BlockId.OliveLeaves, TextureOliveLeaves); TerrainSetTopBlockNormal(x+1, y-6, (ushort)BlockId.OliveLeaves, TextureOliveLeaves); - Terrain + Terrain chunkM2=terrain[x- 2], chunkM1=terrain[x- 1], chunk0 =terrain[x ], @@ -22982,8 +22952,8 @@ enum Precipitation : byte { TerrainSetBackground(x, y-1, (ushort)BlockId.KapokWood, TextureKapokWood); TerrainSetBackground(x+1, y-1,(ushort)BlockId.KapokWood, TextureKapokWood); TerrainSetBackground(x-1, y-1,(ushort)BlockId.KapokWood, TextureKapokWood); - - if (random.Bool()) { + + if (FastRandom.Bool()) { TerrainSetBackground(x+1, y-2,(ushort)BlockId.KapokWood, TextureKapokWood); TerrainSetBackground(x-1, y-2,(ushort)BlockId.KapokWood, TextureKapokWood); } @@ -23034,7 +23004,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x-1, y-18, (ushort)BlockId.KapokLeaves, TextureKapokLeaves); TerrainSetTopBlockNormal(x+1, y-18, (ushort)BlockId.KapokLeaves, TextureKapokLeaves); - Terrain + Terrain chunkM3=terrain[x-3], chunkM2=terrain[x-2], chunkM1=terrain[x-1], @@ -23061,7 +23031,7 @@ enum Precipitation : byte { TerrainSetBackground(x+1, y-5, (ushort)BlockId.AppleWood, TextureAppleWood); TerrainSetBackground(x-1, y-5, (ushort)BlockId.AppleWood, TextureAppleWood); TerrainSetBackground(x+1, y-6, (ushort)BlockId.AppleWood, TextureAppleWood); - + TerrainSetTopBlockNormal(x+2, y-3,(ushort)BlockId.AppleLeavesWithApples, TextureAppleLeavesWithApples); TerrainSetTopBlockNormal(x-2, y-3,(ushort)BlockId.AppleLeaves, TextureAppleLeaves); TerrainSetTopBlockNormal(x+1, y-3,(ushort)BlockId.AppleLeavesWithApples, TextureAppleLeavesWithApples); @@ -23078,8 +23048,8 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x+1, y-6,(ushort)BlockId.AppleLeavesWithApples, TextureAppleLeavesWithApples); TerrainSetTopBlockNormal(x-1, y-6,(ushort)BlockId.AppleLeavesWithApples, TextureAppleLeavesWithApples); TerrainSetTopBlockNormal(x, y-6,(ushort)BlockId.AppleLeaves, TextureAppleLeaves); - - Terrain + + Terrain chunk0 =terrain[x ], chunkM1=terrain[x- 1], chunkM2=terrain[x- 2], @@ -23101,13 +23071,13 @@ enum Precipitation : byte { TerrainSetBackground(x, y-5, (ushort)BlockId.OrangeWood, TextureOrangeWood); TerrainSetBackground(x, y-6, (ushort)BlockId.OrangeWood, TextureOrangeWood); - if (random.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.OrangeWood, TextureOrangeWood); - if (random.Bool()) TerrainSetBackground(x+1, y-5, (ushort)BlockId.OrangeWood, TextureOrangeWood); - if (random.Bool()) TerrainSetBackground(x-1, y-7, (ushort)BlockId.OrangeWood, TextureOrangeWood); - if (random.Bool()) { + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.OrangeWood, TextureOrangeWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-5, (ushort)BlockId.OrangeWood, TextureOrangeWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-7, (ushort)BlockId.OrangeWood, TextureOrangeWood); + if (FastRandom.Bool()) { TerrainSetBackground(x+1, y-7, (ushort)BlockId.OrangeWood, TextureOrangeWood); - if (random.Bool()) TerrainSetBackground(x+1, y-8, (ushort)BlockId.OrangeWood, TextureOrangeWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-8, (ushort)BlockId.OrangeWood, TextureOrangeWood); } TerrainSetTopBlockNormal(x+1, y-4, (ushort)BlockId.OrangeLeaves, TextureOrangeLeavesWithOranges); @@ -23136,8 +23106,8 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x+1, y-9, (ushort)BlockId.OrangeLeaves, TextureOrangeLeaves); TerrainSetTopBlockNormal(x-1, y-9, (ushort)BlockId.OrangeLeaves, TextureOrangeLeaves); TerrainSetTopBlockNormal(x, y-9, (ushort)BlockId.OrangeLeaves, TextureOrangeLeaves); - - Terrain + + Terrain chunkM2=terrain[x-2], chunkM1=terrain[x-1], chunk0 =terrain[x ], @@ -23157,7 +23127,7 @@ enum Precipitation : byte { TerrainSetBackground(0, y-3, (ushort)BlockId.LemonWood, TextureLemonWood); TerrainSetBackground(0, y-4, (ushort)BlockId.LemonWood, TextureLemonWood); - if (random.Bool()) TerrainSetBackground(x-1, y-4,(ushort)BlockId.LemonWood, TextureLemonWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-4,(ushort)BlockId.LemonWood, TextureLemonWood); else TerrainSetBackground(x+1, y-5, (ushort)BlockId.LemonWood, TextureLemonWood); TerrainSetTopBlockNormal(x+1, y-3, (ushort)BlockId.LemonLeaves, TextureLemonLeaves); @@ -23176,9 +23146,9 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x, y-6, (ushort)BlockId.LemonLeaves, TextureLemonLeaves); TerrainSetTopBlockNormal(x+1, y-6, (ushort)BlockId.LemonLeaves, TextureLemonLeaves); TerrainSetTopBlockNormal(x-1, y-6, (ushort)BlockId.LemonLeaves, TextureLemonLeaves); - - Terrain + + Terrain chunkM2=terrain[x- 2], chunkM1=terrain[x- 1], chunk0 =terrain[x ], @@ -23222,7 +23192,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x-1, y-7, (ushort)BlockId.CherryLeaves, TextureCherryLeaves); TerrainSetTopBlockNormal(x, y-7, (ushort)BlockId.CherryLeaves, TextureCherryLeaves); - Terrain + Terrain chunkM2=terrain[x-2], chunkM1=terrain[x-1], chunk0 =terrain[x ], @@ -23245,7 +23215,7 @@ enum Precipitation : byte { TerrainSetBackground(x-1, y-5, (ushort)BlockId.PlumWood, TexturePlumWood); TerrainSetBackground(x+1, y-5, (ushort)BlockId.PlumWood, TexturePlumWood); TerrainSetBackground(x-1, y-6, (ushort)BlockId.PlumWood, TexturePlumWood); - + TerrainSetTopBlockNormal(x+1, y-3, (ushort)BlockId.PlumLeaves, TexturePlumLeaves); TerrainSetTopBlockNormal(x-1, y-3, (ushort)BlockId.PlumLeaves, TexturePlumLeaves); TerrainSetTopBlockNormal(x, y-3, (ushort)BlockId.PlumLeaves, TexturePlumLeaves); @@ -23264,7 +23234,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x, y-6, (ushort)BlockId.PlumLeaves, TexturePlumLeaves); TerrainSetTopBlockNormal(x, y-7, (ushort)BlockId.PlumLeaves, TexturePlumLeaves); - Terrain + Terrain chunkM2=terrain[x-2], chunkM1=terrain[x-1], chunk0 =terrain[x ], @@ -23287,10 +23257,10 @@ enum Precipitation : byte { TerrainSetBackground(x, y-5, (ushort)BlockId.OakWood, TextureOakWood); TerrainSetBackground(x-1, y-7, (ushort)BlockId.OakWood, TextureOakWood); TerrainSetBackground(x+1, y-7, (ushort)BlockId.OakWood, TextureOakWood); - if (random.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.OakWood, TextureOakWood); - if (random.Bool()) TerrainSetBackground(x+1, y-8, (ushort)BlockId.OakWood, TextureOakWood); - if (random.Bool()) TerrainSetBackground(x-1, y-8, (ushort)BlockId.OakWood, TextureOakWood); - if (random.Bool_20Percent()) TerrainSetBackground(x-2, y-7, (ushort)BlockId.OakWood, TextureOakWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.OakWood, TextureOakWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-8, (ushort)BlockId.OakWood, TextureOakWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-8, (ushort)BlockId.OakWood, TextureOakWood); + if (FastRandom.Bool_20Percent()) TerrainSetBackground(x-2, y-7, (ushort)BlockId.OakWood, TextureOakWood); TerrainSetTopBlockNormal(x+1, y-4, (ushort)BlockId.OakLeaves, TextureOakLeaves); TerrainSetTopBlockNormal(x, y-4, (ushort)BlockId.OakLeaves, TextureOakLeaves); @@ -23318,8 +23288,8 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x+1, y-9, (ushort)BlockId.OakLeaves, TextureOakLeaves); TerrainSetTopBlockNormal(x, y-9, (ushort)BlockId.OakLeaves, TextureOakLeaves); TerrainSetTopBlockNormal(x-1, y-9, (ushort)BlockId.OakLeaves, TextureOakLeaves); - - Terrain + + Terrain chunkM2=terrain[x-2], chunkM1=terrain[x-1], chunk0 =terrain[x ], @@ -23342,7 +23312,7 @@ enum Precipitation : byte { TerrainSetBackground(0, y-6,(ushort)BlockId.PineWood, pineWoodTexture); TerrainSetBackground(0, y-7,(ushort)BlockId.PineWood, pineWoodTexture); - if (random.Bool()) TerrainSetBackground(0, y-8,(ushort)BlockId.PineWood, pineWoodTexture); + if (FastRandom.Bool()) TerrainSetBackground(0, y-8,(ushort)BlockId.PineWood, pineWoodTexture); TerrainSetTopBlockNormal(x+2, y-6, (ushort)BlockId.PineLeaves, pineLeavesTexture); TerrainSetTopBlockNormal(x-2, y-6, (ushort)BlockId.PineLeaves, pineLeavesTexture); @@ -23377,10 +23347,10 @@ enum Precipitation : byte { TerrainSetBackground(x, y-5, (ushort)BlockId.SpruceWood, spruceWoodTexture); TerrainSetBackground(x, y-6, (ushort)BlockId.SpruceWood, spruceWoodTexture); TerrainSetBackground(x, y-8, (ushort)BlockId.SpruceWood, spruceWoodTexture); - if (random.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.SpruceWood, spruceWoodTexture); - if (random.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.SpruceWood, spruceWoodTexture); - if (random.Bool()) TerrainSetBackground(x+1, y-6, (ushort)BlockId.SpruceWood, spruceWoodTexture); - if (random.Bool()) TerrainSetBackground(x-1, y-6, (ushort)BlockId.SpruceWood, spruceWoodTexture); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.SpruceWood, spruceWoodTexture); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.SpruceWood, spruceWoodTexture); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-6, (ushort)BlockId.SpruceWood, spruceWoodTexture); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-6, (ushort)BlockId.SpruceWood, spruceWoodTexture); TerrainSetTopBlockNormal(x+2, y-3, (ushort)BlockId.SpruceLeaves, spruceLeavesTexture); TerrainSetTopBlockNormal(x+1, y-3, (ushort)BlockId.SpruceLeaves, spruceLeavesTexture); @@ -23409,7 +23379,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x, y-9, (ushort)BlockId.SpruceLeaves, spruceLeavesTexture); TerrainSetTopBlockNormal(x, y-10, (ushort)BlockId.SpruceLeaves, spruceLeavesTexture); - Terrain + Terrain chunkM2=terrain[x-2], chunkM1=terrain[x-1], chunk0 =terrain[x ], @@ -23430,10 +23400,10 @@ enum Precipitation : byte { TerrainSetBackground(0, y-4, (ushort)BlockId.LindenWood, TextureLindenWood); TerrainSetBackground(0, y-5, (ushort)BlockId.LindenWood, TextureLindenWood); - if (random.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.LindenWood, TextureLindenWood); - if (random.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.LindenWood, TextureLindenWood); - if (random.Bool()) TerrainSetBackground(x-1, y-5, (ushort)BlockId.LindenWood, TextureLindenWood); - if (random.Bool()) TerrainSetBackground(x+1, y-5, (ushort)BlockId.LindenWood, TextureLindenWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-4, (ushort)BlockId.LindenWood, TextureLindenWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-4, (ushort)BlockId.LindenWood, TextureLindenWood); + if (FastRandom.Bool()) TerrainSetBackground(x-1, y-5, (ushort)BlockId.LindenWood, TextureLindenWood); + if (FastRandom.Bool()) TerrainSetBackground(x+1, y-5, (ushort)BlockId.LindenWood, TextureLindenWood); TerrainSetBackground(x, y-6, (ushort)BlockId.LindenWood, TextureLindenWood); TerrainSetBackground(x, y-7, (ushort)BlockId.LindenWood, TextureLindenWood); @@ -23466,7 +23436,7 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x-1, y-9, (ushort)BlockId.LindenLeaves, TextureLindenLeaves); TerrainSetTopBlockNormal(x, y-10,(ushort)BlockId.LindenLeaves, TextureLindenLeaves); - Terrain + Terrain chunkM2=terrain[x- 2], chunkM1=terrain[x- 1], chunk0 =terrain[x ], @@ -23492,8 +23462,8 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x, y-4, (ushort)BlockId.OakLeaves, TextureOakLeaves); TerrainSetTopBlockNormal(x-1, y-4, (ushort)BlockId.OakLeaves, TextureOakLeaves); TerrainSetTopBlockNormal(x, y-5, (ushort)BlockId.OakLeaves, TextureOakLeaves); - - Terrain + + Terrain chunkM1=terrain[x-1], chunk0 =terrain[x ], chunkP1=terrain[x+1]; @@ -23516,8 +23486,8 @@ enum Precipitation : byte { TerrainSetTopBlockNormal(x-1, y-3, (ushort)BlockId.SpruceLeaves, spruceLeavesTexture); TerrainSetTopBlockNormal(x, y-4, (ushort)BlockId.SpruceLeaves, spruceLeavesTexture); TerrainSetTopBlockNormal(x, y-5, (ushort)BlockId.SpruceLeaves, spruceLeavesTexture); - - Terrain + + Terrain chunkM1=terrain[x-1], chunk0 =terrain[x ], chunkP1=terrain[x+1]; @@ -23535,32 +23505,34 @@ enum Precipitation : byte { } static DInt InventoryGetPosFurnaceStone(int ix) { - switch (ix) { - case 0: return new DInt{ X=Global.WindowWidthHalf-300+4+1+40+4, Y=Global.WindowHeightHalf-200+2+4+60 +4 }; - case 1: return new DInt{ X=Global.WindowWidthHalf-300+4+1+40+40+4, Y=Global.WindowHeightHalf-200+2+4+60 +4 }; - case 2: return new DInt{ X=Global.WindowWidthHalf-300+4+1+40*2+40+4, Y=Global.WindowHeightHalf-200+2+4+60 +4 }; - case 3: return new DInt{ X=Global.WindowWidthHalf-300+4+1+40+40+4, Y=Global.WindowHeightHalf-200+2+4+60+40+8 +4 }; - } - #if DEBUG - throw new Exception("Unknown pos id of stone frurnace inv"); - #else + return ix switch { + 0 => new DInt { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, + 1 => new DInt { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, + 2 => new DInt { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 * 2 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, + 3 => new DInt { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 40 + 8 + 4 }, + _ => throw new Exception("Unknown pos id of stone frurnace inv"), + }; + +#if DEBUG +#else return null; - #endif - } +#endif + } static Vector2 InventoryGetPosFurnaceStoneVector2(int ix) { - switch (ix) { - case 0: return new Vector2{X=Global.WindowWidthHalf-300+4+1+40+4, Y=Global.WindowHeightHalf-200+2+4+60+4}; - case 1: return new Vector2{X=Global.WindowWidthHalf-300+4+1+40+40+4, Y=Global.WindowHeightHalf-200+2+4+60+4}; - case 2: return new Vector2{X=Global.WindowWidthHalf-300+4+1+40*2+40+4, Y=Global.WindowHeightHalf-200+2+4+60+4}; - case 3: return new Vector2{X=Global.WindowWidthHalf-300+4+1+40+40+4, Y=Global.WindowHeightHalf-200+2+4+60+40+8+4}; - } - #if DEBUG - throw new Exception("Unknown pos id of stone frurnace inv"); - #else + return ix switch { + 0 => new Vector2 { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, + 1 => new Vector2 { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, + 2 => new Vector2 { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 * 2 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, + 3 => new Vector2 { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 40 + 8 + 4 }, + _ => throw new Exception("Unknown pos id of stone frurnace inv"), + }; + +#if DEBUG +#else return Vector2.Zero; - #endif - } +#endif + } static Vector2 InventoryGetPosClothesVector2(int ix) { if (ix<4) return new Vector2{ X=Global.WindowWidthHalf-300+4+60+4, Y=Global.WindowHeightHalf-200+2+4+4+ix*40 }; @@ -23573,8 +23545,9 @@ enum Precipitation : byte { for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { if (i>maxInvCount) break; - if (ix==i) return new DInt{X= Global.WindowWidthHalf-300+4+200+4+4+xx+4,Y=Global.WindowHeightHalf-200+2+4+yh+4 }; - + if (ix==i) + return new DInt{X= Global.WindowWidthHalf-300+4+200+4+4+xx+4,Y=Global.WindowHeightHalf-200+2+4+yh+4 }; + xx+=40; if (xx==9*40) { @@ -23592,7 +23565,7 @@ enum Precipitation : byte { if (i>maxInvCount) break; if (ix==i) return new Vector2{ X=Global.WindowWidthHalf-300+4+200+4+4+xx+4, Y=Global.WindowHeightHalf-200+2+4+yh+4 }; - + xx+=40; if (xx==9*40) { @@ -23603,9 +23576,9 @@ enum Precipitation : byte { return Vector2.Zero; } - static DInt InventoryGetPosNormal5(int ix) => new DInt{ X=Global.WindowWidth-36, Y=Global.WindowHeightHalf-80+ix*40+4 }; + static DInt InventoryGetPosNormal5(int ix) => new() { X=Global.WindowWidth-36, Y=Global.WindowHeightHalf-80+ix*40+4 }; - static Vector2 InventoryGetPosNormal5Vector2(int ix) => new Vector2{ X=Global.WindowWidth-36, Y=Global.WindowHeightHalf-80+ix*40+4 }; + static Vector2 InventoryGetPosNormal5Vector2(int ix) => new() { X=Global.WindowWidth-36, Y=Global.WindowHeightHalf-80+ix*40+4 }; static DInt InventoryGetPosAdvBox(int i) { int row=i/12; @@ -23651,7 +23624,7 @@ enum Precipitation : byte { DrawFrame(Global.WindowWidthHalf-150-2, Global.WindowHeightHalf-134,304,234+2,1, color_r0_g0_b0_a100); DrawFrame(Global.WindowWidthHalf-150-1, Global.WindowHeightHalf-133,302,234,1, color_r0_g0_b0_a200); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-132,300,34), color_r10_g140_b255); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-100+2,300,200-2), ColorLightBlue); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-150, Global.WindowHeightHalf-100+2,300,200-2), Color.LightBlue); buttonClosePopUp.Position=new Vector2(Global.WindowWidthHalf+150-32,Global.WindowHeightHalf-132+1); buttonClosePopUp.ButtonDraw(/*spriteBatch,newMouseState.X,newMouseState.Y,Global.WindowWidthHalf+150-32,Global.WindowHeightHalf-132+1,mouseLeftDown*/); @@ -23669,16 +23642,16 @@ enum Precipitation : byte { bool hasItem=HasItem(); bool HasItem() { - switch (items[i]) { - case ItemNonInvBasic t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=t.Count; - case ItemNonInvTool t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=t.Count; - case ItemNonInvFood t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=t.Count; - //case ItemNonInvNonStackable t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; - //case ItemNonInvBasicColoritzedNonStackable t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; - default:return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; - } - //return false; - } + return items[i] switch { + ItemNonInvBasic t => TotalItemsInInventoryForAllTypes(items[i].Id) >= t.Count, + ItemNonInvTool t => TotalItemsInInventoryForAllTypes(items[i].Id) >= t.Count, + ItemNonInvFood t => TotalItemsInInventoryForAllTypes(items[i].Id) >= t.Count, + //case ItemNonInvNonStackable t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; + //case ItemNonInvBasicColoritzedNonStackable t: return TotalItemsInInventoryForAllTypes(items[i].Id)>=1; + _ => TotalItemsInInventoryForAllTypes(items[i].Id) >= 1, + }; + //return false; + } if (In40(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20)) { if (mouseLeftDown) { @@ -23693,7 +23666,7 @@ enum Precipitation : byte { if (hasItem) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.DarkGray); else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.Red); } else { - if (hasItem) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), ColorWhite); + if (hasItem) spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), Color.White); else spriteBatch.Draw(inventorySlotTexture,new Vector2(Global.WindowWidthHalf-150+10+x*40, Global.WindowHeightHalf-100+y*40+20), new Color(255,150,150)); } @@ -23757,7 +23730,7 @@ enum Precipitation : byte { case InventoryType.FurnaceStone: textOpenInventory=new Text(Lang.Texts[170],Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10-3,BitmapFont.bitmapFont18); - //for (int i=0; i<4; i++) { + //for (int i=0; i<4; i++) { // ((MashineBlockBasic)terrain[selectedMashine.X].TopBlocks[selectedMashine.Y]).Inv[i].SetPos(InventoryGetPosFurnaceStone(i)); //} return; @@ -23805,7 +23778,7 @@ enum Precipitation : byte { case InventoryType.OxygenMachine: textOpenInventory=new Text(Lang.Texts[298], Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10-3,BitmapFont.bitmapFont18); return; - + case InventoryType.GameMenu: textOpenInventory=new Text(Lang.Texts[114], Global.WindowWidthHalf-300-2+10, Global.WindowHeightHalf-234+10-3,BitmapFont.bitmapFont18); return; @@ -23823,7 +23796,7 @@ enum Precipitation : byte { if (In40(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243)) { if (mouseLeftDown) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), Color.LightGray); else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), ColorSmokeWhite); - } else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), ColorWhite); + } else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), Color.White); // if (!invMove || (invMove && invStartInventory[invStartId]!=InventoryCreative[i])) { InventoryCreative[i].Draw(); @@ -23877,7 +23850,7 @@ enum Precipitation : byte { if (precipitation) { Water w=(Water)chunk.TopBlocks[iy]; if (w.GetMass<255) { - if (random.Bool_1Percent())w.Mass(w.GetMass+1); + if (FastRandom.Bool_1Percent())w.Mass(w.GetMass+1); } } } @@ -23917,7 +23890,7 @@ enum Precipitation : byte { } else { // Voda padá na prázdné místo - Water w=new Water(waterTexture,id,new Vector2(ix*16,iy*16+16),((Water)chunk.TopBlocks[iy]).GetMass); + Water w=new(waterTexture,id,new Vector2(ix*16,iy*16+16),((Water)chunk.TopBlocks[iy]).GetMass); //if (chunk.IsBackground[iy+1]) ((AirSolidBlock)chunk.SolidBlocks[iy+1]).Top=w; //else chunk.SolidBlocks[iy+1]=new AirSolidBlock{ Top=w }; chunk.TopBlocks[iy+1]=w; @@ -23939,8 +23912,8 @@ enum Precipitation : byte { bool left=false, right=false; Terrain leftChunk=null, rightChunk=null; - if (ix>0){ - leftChunk=terrain[ix-1]; + if (ix>0){ + leftChunk=terrain[ix-1]; if (leftChunk.IsTopBlocks[iy]) { if (leftChunk.TopBlocks[iy].Id==id) left=true; @@ -23948,7 +23921,7 @@ enum Precipitation : byte { if (!left) { if (!leftChunk.IsSolidBlocks[iy]) { - Water w=new Water(waterTexture, id, new Vector2(ix*16-16, iy*16)); + Water w=new(waterTexture, id, new Vector2(ix*16-16, iy*16)); // if (leftChunk.IsBackground[iy]) ((AirSolidBlock)leftChunk.SolidBlocks[iy]).Top=w; // else leftChunk.SolidBlocks[iy]=new AirSolidBlock{ Top=w }; @@ -23961,7 +23934,7 @@ enum Precipitation : byte { } } - if (ix bytes=new List(); + List bytes=new(); foreach (ItemInv x in inv) x.SaveBytes(bytes); File.WriteAllBytes(pathToWorld+@"\"+name+".bin", bytes.ToArray()); } @@ -24349,7 +24322,7 @@ enum Precipitation : byte { //if (In40(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243)) { // if (mouseLeftDown) spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), Color.LightGray); // else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), ColorSmokeWhite); - //} else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), ColorWhite); + //} else spriteBatch.Draw(inventorySlotTexture, new Vector2(Global.WindowWidthHalf-300+4+60+x+4-16, Global.WindowHeightHalf-200+2+4+y+4+243), Color.White); // if (!invMove || (invMove && invStartInventory[invStartId]!=InventoryCreative[i])) { InventoryCreative[i].SetPos(Global.WindowWidthHalf-300+4+60+x+4-16+4, Global.WindowHeightHalf-200+2+4+y+4+243+4); @@ -24377,10 +24350,10 @@ enum Precipitation : byte { int cursorWidth = 15; if (mouseRealPosX+cursorWidth+mouseItemNameWidth=0) { DInt p=InventoryGetPosBarrel(1); barrel.Inv[1]=new ItemInvBasic32(ItemIdToTexture(newId), newId, 1, p.X, p.Y); @@ -24976,7 +24949,7 @@ enum Precipitation : byte { } } - void CreateGradientTexture() { + void CreateGradientTexture() { TextureSunGradient?.Dispose(); int height=Global.WindowHeight; @@ -24985,13 +24958,13 @@ enum Precipitation : byte { Color[] colors=new Color[height]; Color ColorBef; - for (int p=1; ppos) { for (int i = 0; ipos) { + if (Biomes[i].End>pos) { return Biomes[i]/*.Name*/; } } - } else { + } else { for (int i = half; ipos) { + if (Biomes[i].End>pos) { return Biomes[i]/*.Name*/; } } @@ -25022,41 +24995,41 @@ enum Precipitation : byte { return new BiomeData(); } - Color BiomeColor(Biome biome) { - switch (biome) { - case Biome.Desert: return Color.Yellow; - case Biome.Savanna: return new Color(110,85,32); - case Biome.SaltOcean: return new Color(10,48,96); - case Biome.Arctic: return Color.White; - case Biome.Bog: return new Color(111,81,14); - case Biome.ColdTaiga: return new Color(25,21,3); - case Biome.Taiga: return new Color(47,59,11); - case Biome.Tundra: return new Color(188,7,1); - case Biome.WetTundra: return new Color(20,16,3); - case Biome.Swamp: return new Color(26,46,12); - case Biome.TropicalRainforest: return new Color(3,36,2); - case Biome.Subtropics: return new Color(39,42,14); - case Biome.ArcticPlains: return new Color(163,169,186); - case Biome.Beach: return new Color(213,159,109); - case Biome.BothForest: return new Color(107,146,15); - case Biome.DryTundra: return new Color(9,8,5); - case Biome.Fen: return new Color(61,84,21); - case Biome.HotPlains: return new Color(128,54,8); - case Biome.HumidSubtropical: return new Color(28,59,13); - case Biome.LeaveForest: return new Color(11,57,10); - case Biome.Mangrove: return new Color(60,85,16); - case Biome.Plains: return new Color(57,59,9); - case Biome.SpruceForest: return new Color(53,54,13); - case Biome.Jungle: return new Color(2,61,0); - } - //#if DEBUG - //throw new Exception("Missing biome color"); - //#else - return Color.Green; - // #endif - } + Color BiomeColor(Biome biome) { + return biome switch { + Biome.Desert => Color.Yellow, + Biome.Savanna => new Color(110, 85, 32), + Biome.SaltOcean => new Color(10, 48, 96), + Biome.Arctic => Color.White, + Biome.Bog => new Color(111, 81, 14), + Biome.ColdTaiga => new Color(25, 21, 3), + Biome.Taiga => new Color(47, 59, 11), + Biome.Tundra => new Color(188, 7, 1), + Biome.WetTundra => new Color(20, 16, 3), + Biome.Swamp => new Color(26, 46, 12), + Biome.TropicalRainforest => new Color(3, 36, 2), + Biome.Subtropics => new Color(39, 42, 14), + Biome.ArcticPlains => new Color(163, 169, 186), + Biome.Beach => new Color(213, 159, 109), + Biome.BothForest => new Color(107, 146, 15), + Biome.DryTundra => new Color(9, 8, 5), + Biome.Fen => new Color(61, 84, 21), + Biome.HotPlains => new Color(128, 54, 8), + Biome.HumidSubtropical => new Color(28, 59, 13), + Biome.LeaveForest => new Color(11, 57, 10), + Biome.Mangrove => new Color(60, 85, 16), + Biome.Plains => new Color(57, 59, 9), + Biome.SpruceForest => new Color(53, 54, 13), + Biome.Jungle => new Color(2, 61, 0), + //#if DEBUG + //throw new Exception("Missing biome color"); + //#else + _ => Color.Green, + }; + // #endif + } - void SaveSettings(){ + void SaveSettings(){ #if DEBUG Debug.WriteLine("Saved Settings.txt"); #endif @@ -25094,25 +25067,25 @@ enum Precipitation : byte { void CreateJumpMess(List blocks) { if (blocks.Count==2){ - DInt d=blocks[0].Y0.5f ? 2 : 1, z>0.5f ? 2 : 1), HSpeed=-1.5f-z, - VSpeed=(i-4+random.Float()*0.5f)*0.1f, + VSpeed=(i-4+FastRandom.Float()*0.5f)*0.1f, LimitY=(xterrainStartIndexW+10) waveGrassIndex=terrainStartIndexX-10<0 ? 0 : terrainStartIndexX-10; Terrain chunk=terrain[waveGrassIndex]; - for (int y=chunk.StartSomething; y<125; y++) { + for (int y=chunk.StartSomething; y<125; y++) { if (chunk.IsTopBlocks[y]){ - switch (chunk.TopBlocks[y].Id) { + switch (chunk.TopBlocks[y].Id) { case (ushort)BlockId.GrassDesert: case (ushort)BlockId.GrassForest: case (ushort)BlockId.GrassHills: @@ -25214,7 +25187,7 @@ enum Precipitation : byte { case (ushort)BlockId.Rose: { if (chunk.TopBlocks[y] is NormalBlock n) { - BasicWavingPlant p=new BasicWavingPlant(n.Texture, n.Id, n.Position, true); + BasicWavingPlant p=new(n.Texture, n.Id, n.Position, true); chunk.TopBlocks[y]=p; WavingPlants.Add(p); return; @@ -25230,13 +25203,13 @@ enum Precipitation : byte { if (!(p is FruitPlantWaving)) { if (p.Height<=chunk.LightPosFull) { - + FruitPlantWaving z=p.TurnToWavingPlant(true); // chunk.TopBlocks[y]=p; chunk.Plants[i]=z; WavingPlants.Add(z); return; - + } } } @@ -25258,7 +25231,7 @@ enum Precipitation : byte { } } - //bool IsSelectedShears() { + //bool IsSelectedShears() { // if (InventoryNormal[boxSelected].Id==(ushort)Items.ShearsCopper) return true; // if (InventoryNormal[boxSelected].Id==(ushort)Items.ShearsBronze) return true; // if (InventoryNormal[boxSelected].Id==(ushort)Items.ShearsGold) return true; @@ -25268,7 +25241,7 @@ enum Precipitation : byte { // return false; //} - //bool IsSelectedKnife() { + //bool IsSelectedKnife() { // if (InventoryNormal[boxSelected].Id==(ushort)Items.KnifeCopper) return true; // if (InventoryNormal[boxSelected].Id==(ushort)Items.KnifeBronze) return true; // if (InventoryNormal[boxSelected].Id==(ushort)Items.KnifeGold) return true; @@ -25278,58 +25251,59 @@ enum Precipitation : byte { // return false; //} - float GetTemperature(Biome biome) { - switch (biome) { - case Biome.ArcticPlains: return TemperatureFromTo(-5,-15, -50,-60); - case Biome.Arctic: return TemperatureFromTo(0,-6, -24,-32); - case Biome.DryTundra: return TemperatureFromTo(20,-2, -30,-50); - case Biome.Tundra: return TemperatureFromTo(13,-2, -15,-40); - case Biome.WetTundra: return TemperatureFromTo(18,1, -20,-35); - case Biome.ColdTaiga: return TemperatureFromTo(20,1,-30,-54); - case Biome.Taiga: return TemperatureFromTo(22,8, -20,-45); - case Biome.SpruceForest: return TemperatureFromTo(15,9, -2,-7); - case Biome.BothForest: return TemperatureFromTo(25,15, -1,-6); - case Biome.Plains: return TemperatureFromTo(29,16, -2,-7); - case Biome.LeaveForest: return TemperatureFromTo(26,19, 5,-1); - case Biome.Swamp: return TemperatureFromTo(29,24, 16,6); - case Biome.Fen: return TemperatureFromTo(24,16, -2,-4); - case Biome.Bog: return TemperatureFromTo(19,11,7,1); - case Biome.SaltOcean: return TemperatureFromTo(28,24, 15,8); - case Biome.ExtremeColdBeach: return TemperatureFromTo(2,-1, 1,-3); - case Biome.ColdBeach: return TemperatureFromTo(16,12, 1,-3); - case Biome.Beach: return TemperatureFromTo(26,23, 10,8); - case Biome.HotBeach: return TemperatureFromTo(27,24, 21,16); - case Biome.HotPlains: return TemperatureFromTo(33,21, 14,2); - case Biome.Mangrove: return TemperatureFromTo(24,20, 22,18); - case Biome.HumidSubtropical: return TemperatureFromTo(28,24, 18,6); - case Biome.Subtropics: return TemperatureFromTo(29,18, 20,9); - case Biome.Desert: return TemperatureFromTo(39,25, 19,6); - case Biome.Savanna: return TemperatureFromTo(33,24, 17,6); - case Biome.Jungle: return TemperatureFromTo(32,24, 29,23); - case Biome.TropicalRainforest: return TemperatureFromTo(32,24, 29,23); - case Biome.None: return 0; - } - #if DEBUG - throw new Exception("Missing biome color"); - #else + float GetTemperature(Biome biome) { + return biome switch { + Biome.ArcticPlains => TemperatureFromTo(-5, -15, -50, -60), + Biome.Arctic => TemperatureFromTo(0, -6, -24, -32), + Biome.DryTundra => TemperatureFromTo(20, -2, -30, -50), + Biome.Tundra => TemperatureFromTo(13, -2, -15, -40), + Biome.WetTundra => TemperatureFromTo(18, 1, -20, -35), + Biome.ColdTaiga => TemperatureFromTo(20, 1, -30, -54), + Biome.Taiga => TemperatureFromTo(22, 8, -20, -45), + Biome.SpruceForest => TemperatureFromTo(15, 9, -2, -7), + Biome.BothForest => TemperatureFromTo(25, 15, -1, -6), + Biome.Plains => TemperatureFromTo(29, 16, -2, -7), + Biome.LeaveForest => TemperatureFromTo(26, 19, 5, -1), + Biome.Swamp => TemperatureFromTo(29, 24, 16, 6), + Biome.Fen => TemperatureFromTo(24, 16, -2, -4), + Biome.Bog => TemperatureFromTo(19, 11, 7, 1), + Biome.SaltOcean => TemperatureFromTo(28, 24, 15, 8), + Biome.ExtremeColdBeach => TemperatureFromTo(2, -1, 1, -3), + Biome.ColdBeach => TemperatureFromTo(16, 12, 1, -3), + Biome.Beach => TemperatureFromTo(26, 23, 10, 8), + Biome.HotBeach => TemperatureFromTo(27, 24, 21, 16), + Biome.HotPlains => TemperatureFromTo(33, 21, 14, 2), + Biome.Mangrove => TemperatureFromTo(24, 20, 22, 18), + Biome.HumidSubtropical => TemperatureFromTo(28, 24, 18, 6), + Biome.Subtropics => TemperatureFromTo(29, 18, 20, 9), + Biome.Desert => TemperatureFromTo(39, 25, 19, 6), + Biome.Savanna => TemperatureFromTo(33, 24, 17, 6), + Biome.Jungle => TemperatureFromTo(32, 24, 29, 23), + Biome.TropicalRainforest => TemperatureFromTo(32, 24, 29, 23), + Biome.None => 0, + _ => throw new Exception("Missing biome color"), + }; + +#if DEBUG +#else return 0; - #endif - } +#endif + } /// From 1 to 8, bigger for more humid /// - float TemperatureFromTo(int daySummerTemperature, int nightSummerTemperature, int dayWinterTemperature, int nightWinterTemperature, float temperatureSpeedChange=6) { + float TemperatureFromTo(int daySummerTemperature, int nightSummerTemperature, int dayWinterTemperature, int nightWinterTemperature, float temperatureSpeedChange=6) { float tempDay, tempNight; - if (day>22 && day<200){ + if (day>22 && day<200){ tempDay=FastMath.Smooth((day-22)/178f)*(daySummerTemperature-dayWinterTemperature)+dayWinterTemperature; tempNight=FastMath.Smooth((day-22)/178f)*(nightSummerTemperature-nightWinterTemperature)+nightWinterTemperature; - } else if (day<22) { + } else if (day<22) { tempDay=(1-FastMath.Smooth((day+156)/178f))*(daySummerTemperature-dayWinterTemperature)+dayWinterTemperature; tempNight=(1-FastMath.Smooth((day+156)/178f))*(nightSummerTemperature-nightWinterTemperature)+nightWinterTemperature; - } else { - tempDay=(1-FastMath.Smooth((day-200)/178))*(daySummerTemperature-dayWinterTemperature)+dayWinterTemperature; - tempNight=(1-FastMath.Smooth((day-200)/178))*(nightSummerTemperature-nightWinterTemperature)+nightWinterTemperature; + } else { + tempDay=(1-FastMath.Smooth((day-200)/178f))*(daySummerTemperature-dayWinterTemperature)+dayWinterTemperature; + tempNight=(1-FastMath.Smooth((day-200)/178f))*(nightSummerTemperature-nightWinterTemperature)+nightWinterTemperature; } float noon=(dayEnd-(dayStart+1))*hour; @@ -25342,34 +25316,34 @@ enum Precipitation : byte { else return FastMath.Smooth((time-(noon-dayStart*hour))/(noon-dayStart*hour))*(tempDay-tempNight)+tempNight; } - void ChangeLeavesForceEverything() { + void ChangeLeavesForceEverything() { // Spring: branches -> flowering leaves or leaves - if (day>=80 && day<=100) { - for (int x=0; x=80 && day<=100) { + for (int x=0; x Blossom case (ushort)BlockId.AppleBranches: leaves.Id=(ushort)BlockId.AppleLeavesBlossom; leaves.Texture=TextureAppleBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; case (ushort)BlockId.AppleLeaves: leaves.Id=(ushort)BlockId.AppleLeavesBlossom; leaves.Texture=TextureAppleBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; case (ushort)BlockId.AppleLeavesWithApples: leaves.Id=(ushort)BlockId.AppleLeavesBlossom; leaves.Texture=TextureAppleBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; #endregion @@ -25377,19 +25351,19 @@ enum Precipitation : byte { case (ushort)BlockId.PlumBranches: leaves.Id=(ushort)BlockId.PlumLeavesBlossom; leaves.Texture=TexturePlumBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; case (ushort)BlockId.PlumLeaves: leaves.Id=(ushort)BlockId.PlumLeavesBlossom; leaves.Texture=TexturePlumBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; case (ushort)BlockId.PlumLeavesWithPlums: leaves.Id=(ushort)BlockId.PlumLeaves; leaves.Texture=TexturePlumBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; #endregion @@ -25397,7 +25371,7 @@ enum Precipitation : byte { case (ushort)BlockId.CherryBranches: leaves.Id=(ushort)BlockId.CherryLeavesBlossom; leaves.Texture=TextureCherryBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; case (ushort)BlockId.CherryLeaves: @@ -25408,7 +25382,7 @@ enum Precipitation : byte { case (ushort)BlockId.CherryLeavesWithCherries: leaves.Id=(ushort)BlockId.CherryLeavesBlossom; leaves.Texture=TextureCherryBlossom; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; #endregion @@ -25416,19 +25390,19 @@ enum Precipitation : byte { case (ushort)BlockId.OakBranches: leaves.Id=(ushort)BlockId.OakLeaves; leaves.Texture=TextureOakLeaves; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; case (ushort)BlockId.LindenBranches: leaves.Id=(ushort)BlockId.LindenLeaves; leaves.Texture=TextureLindenLeaves; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; case (ushort)BlockId.WillowBranches: leaves.Id=(ushort)BlockId.WillowLeaves; leaves.Texture=TextureWillowLeaves; - leaves.Color=ColorWhite; + leaves.Color=Color.White; continue; #endregion } @@ -25440,25 +25414,25 @@ enum Precipitation : byte { } // Summer: set leaves - if (day>=100 && day<=280) { - for (int x=0; x=100 && day<=280) { + for (int x=0; x Colorful - if (day>=280 && day<=340) { - Color[] colors=new Color[]{ - + if (day>=280 && day<=340) { + Color[] colors=new Color[]{ + new Color(144, 170, 6), new Color(162, 163, 3), new Color(212, 103, 25), @@ -25526,12 +25500,12 @@ enum Precipitation : byte { new Color(254, 255, 74), }; - for (int x=0; x Branches - if (day<=80 || day>=340) { - for (int x=0; x=340) { + for (int x=0; x flowering leaves or leaves - if (day>=80 && day<=100) { - for (int x=0; x=80 && day<=100) { + for (int x=0; x=100 && day<=280) { - for (int x=0; x=100 && day<=280) { + for (int x=0; x Colorful - if (day>=280 && day<=340) { - Color[] colors=new Color[]{ - + if (day>=280 && day<=340) { + Color[] colors=new Color[]{ + new Color(144, 170, 6), new Color(162, 163, 3), new Color(212, 103, 25), @@ -25823,48 +25797,48 @@ enum Precipitation : byte { new Color(254, 255, 74), }; - for (int x=0; x Branches - if (day<=80 || day>=340) { - for (int x=0; x=340) { + for (int x=0; x=(dayStart+1)*hour && time<=dayEnd*hour) { - return Color.LightSkyBlue; + return Color.LightSkyBlue; // Night } else if (time<=dayStart*hour || time>=(dayEnd+1)*hour) { return ColorNightColorBack; // Sun rising (before sun) - } else if (time>=dayStart*hour && time<=(dayStart+0.5f)*hour) { + } else if (time>=dayStart*hour && time<=(dayStart+0.5f)*hour) { if (Constants.AnimationsGame) { float a=-(dayStart*hour-time)/(hour); return FastMath.Lerp(ColorNightColorBack, Color.LightSkyBlue, a); } else return FastMath.Lerp(ColorNightColorBack, Color.LightSkyBlue, -(dayStart*hour-time)/(hour)); - } else if (time>=(dayStart+0.5f)*hour && time<=(dayStart+1)*hour) { + } else if (time>=(dayStart+0.5f)*hour && time<=(dayStart+1)*hour) { // Sun rising (before sun) if (Constants.AnimationsGame) { @@ -25951,7 +25925,7 @@ enum Precipitation : byte { return FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, a); } else return FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, 0.5f+((dayStart+0.5f)*hour-time)/hour); - } else if (time>=dayEnd*hour && time<=(dayEnd+0.5f)*hour) { + } else if (time>=dayEnd*hour && time<=(dayEnd+0.5f)*hour) { // Sun setting if (Constants.AnimationsGame) { @@ -25959,7 +25933,7 @@ enum Precipitation : byte { return FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, a); } else return FastMath.Lerp(Color.LightSkyBlue, ColorNightColorBack, 0.5f-((dayEnd+0.5f)*hour-time)/(hour*2)); - } else if (time>=(dayEnd+0.5f)*hour && time<=(dayEnd+1)*hour) { + } else if (time>=(dayEnd+0.5f)*hour && time<=(dayEnd+1)*hour) { // Sun setting if (Constants.AnimationsGame) { @@ -25968,26 +25942,26 @@ enum Precipitation : byte { } else return FastMath.Lerp(ColorNightColorBack, Color.LightSkyBlue, ((dayEnd+1)*hour-time)/(hour*2)); } - return Color.LightSkyBlue; + return Color.LightSkyBlue; } - Color GetColorBackRain() { + Color GetColorBackRain() { // Day if (time>=(dayStart+1)*hour && time<=dayEnd*hour) { - return ColorDayRainBack; + return ColorDayRainBack; // Night } else if (time<=dayStart*hour || time>=(dayEnd+1)*hour) { return ColorNightColorBackRain; // Sun rising (before sun) - } else if (time>=dayStart*hour && time<=(dayStart+0.5f)*hour) { + } else if (time>=dayStart*hour && time<=(dayStart+0.5f)*hour) { if (Constants.AnimationsGame) { float a=-(dayStart*hour-time)/(hour); return FastMath.Lerp(ColorNightColorBackRain, ColorDayRainBack, a); } else return FastMath.Lerp(ColorNightColorBackRain, ColorDayRainBack, -(dayStart*hour-time)/(hour)); - } else if (time>=(dayStart+0.5f)*hour && time<=(dayStart+1)*hour) { + } else if (time>=(dayStart+0.5f)*hour && time<=(dayStart+1)*hour) { // Sun rising (before sun) if (Constants.AnimationsGame) { @@ -25995,7 +25969,7 @@ enum Precipitation : byte { return FastMath.Lerp(ColorDayRainBack, ColorNightColorBackRain, a); } else return FastMath.Lerp(ColorDayRainBack, ColorNightColorBackRain, 0.5f+((dayStart+0.5f)*hour-time)/hour); - } else if (time>=dayEnd*hour && time<=(dayEnd+0.5f)*hour) { + } else if (time>=dayEnd*hour && time<=(dayEnd+0.5f)*hour) { // Sun setting if (Constants.AnimationsGame) { @@ -26003,7 +25977,7 @@ enum Precipitation : byte { return FastMath.Lerp(ColorDayRainBack, ColorNightColorBackRain, a); } else return FastMath.Lerp(ColorDayRainBack, ColorNightColorBackRain, 0.5f-((dayEnd+0.5f)*hour-time)/(hour*2)); - } else if (time>=(dayEnd+0.5f)*hour && time<=(dayEnd+1)*hour) { + } else if (time>=(dayEnd+0.5f)*hour && time<=(dayEnd+1)*hour) { // Sun setting if (Constants.AnimationsGame) { @@ -26012,116 +25986,116 @@ enum Precipitation : byte { } else return FastMath.Lerp(ColorNightColorBackRain, ColorDayRainBack, ((dayEnd+1)*hour-time)/(hour*2)); } - return ColorDayRainBack; + return ColorDayRainBack; } - bool Command() { + bool Command() { if (text.StartsWith("*time-set ")) { if (int.TryParse(text.Substring("*time-set ".Length), out int num)) { - time=num*hour; + time=num*hour; } else if (float.TryParse(text.Substring("*time-set ".Length), out float num2)) { - time=(int)(num2*hour); + time=(int)(num2*hour); } text=""; diserpeard=0; return true; - } + } if (text.StartsWith("*day-set ")){ if (int.TryParse(text.Substring("*day-set ".Length), out int num)){ - day=num; + day=num; ChangeLeavesForceEverything(); } text=""; diserpeard=0; return true; - } + } if (text=="*time-set early morning"){ - time=(int)(5.5f*hour); + time=(int)(5.5f*hour); ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } + } if (text=="*time-set late morning"){ - time=(int)(9.5f*hour); + time=(int)(9.5f*hour); ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } - + } + if (text=="*time-set morning"){ - time=(int)(7f*hour); + time=(int)(7f*hour); ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } + } if (text=="*time-set noon"){ - time=(int)(12f*hour); + time=(int)(12f*hour); ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } + } if (text=="*time-set night"){ - time=(int)(20f*hour); + time=(int)(20f*hour); ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } + } if (text=="*time-set afternoon"){ - time=(int)(14f*hour); + time=(int)(14f*hour); ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } + } if (text=="*time-set evening"){ - time=(int)(16f*hour); + time=(int)(16f*hour); ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } + } if (text=="*time-set midnight"){ - time=0; + time=0; ChangeLeavesForceEverything(); text=""; diserpeard=0; return true; - } + } if (text=="*give-mobile") { InventoryAddOne((ushort)Items.Mobile); text=""; diserpeard=0;text="";diserpeard=0; return true; - } + } if (text=="*wd0") { Global.WorldDifficulty=0;text="";diserpeard=0; return true; - } + } if (text=="*wd1") { Global.WorldDifficulty=1;text="";diserpeard=0; return true; - } + } if (text=="*wd2") { Global.WorldDifficulty=2;text="";diserpeard=0; return true; - } + } if (text=="*rain-change") { changeRain=1; text="";diserpeard=0; return true; - } + } if (text=="*wind-change") { timeToChageWind=1; text="";diserpeard=0; @@ -26129,140 +26103,140 @@ enum Precipitation : byte { } if (text.StartsWith("*error")) { throw new Exception("Manual error"); - } + } return false; } - class ParticleMess { - public Vector2 Position; - public Rectangle Source; - public Texture2D Texture; - public int Disepeard; - - public float LimitY; - public float HSpeed; - public float VSpeed; - public Color Color; - - public void Update() { - HSpeed+=gravity*0.5f; - Position.Y+=HSpeed; - - Position.X+=VSpeed; - - if (Position.Y>=LimitY) Position.Y=LimitY; - } - - public void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, Source, Color*(Disepeard/50f)); - } - - class ParticleRain { - public Vector2 Position; - - public float HSpeed; - public float VSpeed; - public Color Color; - // public float Angle; - - public float Size; - - public ParticleRain(float size, float vSpeed) { - Color=Color.Blue*(Size=size); - VSpeed=vSpeed*(size*0.5f+0.5f); - } - - public void Update() { - Position.X+=HSpeed*Size; - Position.Y+=VSpeed; - } - - public void Draw(float x, float y,float a) => Rabcr.spriteBatch.Draw( - texture: Rabcr.Pixel, - destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), 1, Size<0.5f ? 2 : 3), - //sourceRectangle: null, - //effects:SpriteEffects.None, - color: Color*a/*,*/ - //rotation: Angle, - //origin: Vector2.Zero, - //layerDepth: 1f - ); - } - - class ParticleSnow { - public Vector2 Position; - - public float HSpeed; - public float VSpeed; - public Color Color; - // public float Angle; - int time; - public float Size; - - public ParticleSnow(float size, float vSpeed) { - Color=Color.White*(Size=size); - VSpeed=vSpeed*size; - } - - public void Update() { - time++; - Position.X+=HSpeed+((float)Math.Cos(time/10f))*0.25f; - Position.Y+=VSpeed+((float)Math.Sin(time/10f))*HSpeed*0.5f/*+0.2f*/; - } - - public void Draw(float x, float y,float A) => Rabcr.spriteBatch.Draw( - texture: Rabcr.Pixel, - destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), Size>0.5f ? 2 : 1, Size>0.5f ? 2 : 1), - //sourceRectangle: null, - //effects:SpriteEffects.None, - color: Color*A//, - //rotation: Angle, - //origin: Vector2.Zero, - //layerDepth: 1f - ); - - } - - class FallingLeave { - public Texture2D texture; - public Vector2 Position; - public float angle; - public float time; - // public float size; - Vector2 vecOrigin; - public float VSpeed; - public Rectangle srcrec; - public Color Color = Color.White; - public FallingLeave(int x, int y, float size, bool leftWind, bool rain, Rectangle src) { - Position=new Vector2(x, y); - vecOrigin=new Vector2(size, size); - if (rain) { - if (leftWind) VSpeed=-0.01f; else VSpeed=0.01f; - } else { - if (leftWind) VSpeed=-0.09f; else VSpeed=0.09f; - } - srcrec=src; - } - - public void Update() { - time+=0.07f; - Position.X+=VSpeed; - Position.Y+=(float)Math.Cos(time)*0.125f+0.35f; - angle=(float)Math.Cos(time)*0.3f+FastMath.PI/2f; - } - - public void Draw() { - Rabcr.spriteBatch.Draw( - texture: texture, - position: new Vector2(Position.X, Position.Y/*, srcrec.Width, srcrec.Height*/), - // destinationRectangle: new Rectangle((int)Position.X, (int)Position.Y, srcrec.Width, srcrec.Height), - sourceRectangle: srcrec/*new Rectangle(0,0,2,3)*/, - effects: SpriteEffects.None, - color: Color, - scale: 1f, - rotation: angle, - origin: vecOrigin, - layerDepth: 1f); - } - } + //class ParticleMess { + // public Vector2 Position; + // public Rectangle Source; + // public Texture2D Texture; + // public int Disepeard; + + // public float LimitY; + // public float HSpeed; + // public float VSpeed; + // public Color Color; + + // public void Update() { + // HSpeed+=gravity*0.5f; + // Position.Y+=HSpeed; + + // Position.X+=VSpeed; + + // if (Position.Y>=LimitY) Position.Y=LimitY; + // } + + // public void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, Source, Color*(Disepeard/50f)); + // } + + // class ParticleRain { + // public Vector2 Position; + + // public float HSpeed; + // public float VSpeed; + // public Color Color; + // // public float Angle; + + // public float Size; + + // public ParticleRain(float size, float vSpeed) { + // Color=Color.Blue*(Size=size); + // VSpeed=vSpeed*(size*0.5f+0.5f); + // } + + // public void Update() { + // Position.X+=HSpeed*Size; + // Position.Y+=VSpeed; + // } + + // public void Draw(float x, float y,float a) => Rabcr.spriteBatch.Draw( + // texture: Rabcr.Pixel, + // destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), 1, Size<0.5f ? 2 : 3), + // //sourceRectangle: null, + // //effects:SpriteEffects.None, + // color: Color*a/*,*/ + // //rotation: Angle, + // //origin: Vector2.Zero, + // //layerDepth: 1f + // ); + // } + + // class ParticleSnow { + // public Vector2 Position; + + // public float HSpeed; + // public float VSpeed; + // public Color Color; + // // public float Angle; + // int time; + // public float Size; + + // public ParticleSnow(float size, float vSpeed) { + // Color=Color.White*(Size=size); + // VSpeed=vSpeed*size; + // } + + // public void Update() { + // time++; + // Position.X+=HSpeed+((float)Math.Cos(time/10f))*0.25f; + // Position.Y+=VSpeed+((float)Math.Sin(time/10f))*HSpeed*0.5f/*+0.2f*/; + // } + + // public void Draw(float x, float y,float A) => Rabcr.spriteBatch.Draw( + // texture: Rabcr.Pixel, + // destinationRectangle: new Rectangle((int)(Position.X+0.5f+x), (int)(Position.Y+0.5f+y), Size>0.5f ? 2 : 1, Size>0.5f ? 2 : 1), + // //sourceRectangle: null, + // //effects:SpriteEffects.None, + // color: Color*A//, + // //rotation: Angle, + // //origin: Vector2.Zero, + // //layerDepth: 1f + // ); + + // } + + // class FallingLeave { + // public Texture2D texture; + // public Vector2 Position; + // public float angle; + // public float time; + // // public float size; + // Vector2 vecOrigin; + // public float VSpeed; + // public Rectangle srcrec; + // public Color Color = Color.White; + // public FallingLeave(int x, int y, float size, bool leftWind, bool rain, Rectangle src) { + // Position=new Vector2(x, y); + // vecOrigin=new Vector2(size, size); + // if (rain) { + // if (leftWind) VSpeed=-0.01f; else VSpeed=0.01f; + // } else { + // if (leftWind) VSpeed=-0.09f; else VSpeed=0.09f; + // } + // srcrec=src; + // } + + // public void Update() { + // time+=0.07f; + // Position.X+=VSpeed; + // Position.Y+=(float)Math.Cos(time)*0.125f+0.35f; + // angle=(float)Math.Cos(time)*0.3f+FastMath.PI/2f; + // } + + // public void Draw() { + // Rabcr.spriteBatch.Draw( + // texture: texture, + // position: new Vector2(Position.X, Position.Y/*, srcrec.Width, srcrec.Height*/), + // // destinationRectangle: new Rectangle((int)Position.X, (int)Position.Y, srcrec.Width, srcrec.Height), + // sourceRectangle: srcrec/*new Rectangle(0,0,2,3)*/, + // effects: SpriteEffects.None, + // color: Color, + // scale: 1f, + // rotation: angle, + // origin: vecOrigin, + // layerDepth: 1f); + // } + // } } } \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu.cs b/rabcrClient/WindowsAndStates/GameStates/Menu.cs index dd31215..5fcba06 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu.cs @@ -41,7 +41,7 @@ class Menu : Screen { if (Global.HasSoundGraphics)MediaPlayer.Stop(); } - public override void Update(GameTime gameTime) { + public override void Update(GameTime gameTime) { // Set keyboard and mouse oldMouseState=newMouseState; newKeyboardState=Keyboard.GetState(); @@ -64,7 +64,7 @@ class Menu : Screen { if (Global.HasSoundGraphics){ if (playing < 0) { Song play/*=null*/; - switch (Rabcr.random.Int4()) { + switch (FastRandom.Int4()) { case 0: play = Songs.Happend; break; case 1: play = Songs.Medium; break; case 2: play = Songs.Root; break; diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/Informations.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/Informations.cs index 087c088..5fa1300 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/Informations.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/Informations.cs @@ -33,18 +33,18 @@ class Informations :MenuScreen { buttonMenu.Click+=ClickMenu; buttonInfoMain=new ButtonCenter(Textures.ButtonLeft) { - center=true, + // center=true, Text=Lang.Texts[2] }; buttonInfoKeyBoard=new ButtonCenter(Textures.ButtonCenter) { - center=true, + // center=true, Text=Lang.Texts[3] }; buttonInfoHow=new ButtonCenter(Textures.ButtonRight) { - center=true, + // center=true, Text=Lang.Texts[4] }; - + effectBlur=Effects.BluredTopDownBounds; scrollbar=new Scrollbar(GetDataTexture(@"Buttons\Scrollbar\Top"), GetDataTexture(@"Buttons\Scrollbar\Center"), GetDataTexture(@"Buttons\Scrollbar\Bottom")) { @@ -52,7 +52,7 @@ class Informations :MenuScreen { }; strMain=""+Lang.Texts[199]+": "+Release.Authors+"" + Environment.NewLine; - + strMain+=""+Lang.Texts[201]+": "+Release.VersionString+""+ (Release.VersionSpecialName!="" ? " ("+Release.VersionSpecialName+")": "") +Environment.NewLine; strMain+= @@ -159,7 +159,7 @@ class Informations :MenuScreen { geDo.BuildString(strHowTo); ChangeHeight(null,null); } - + base.Update(gameTime); } @@ -201,12 +201,12 @@ class Informations :MenuScreen { // Button back buttonMenu.ButtonDraw(spriteBatch, a); header.Draw(spriteBatch,Color.Black*a); - + #region Category Buttons buttonInfoMain.ButtonDraw(spriteBatch, a); buttonInfoKeyBoard.ButtonDraw(spriteBatch, a); buttonInfoHow.ButtonDraw(spriteBatch, a); - + #endregion scrollbar.ButtonDraw(spriteBatch, a); @@ -296,7 +296,7 @@ class Informations :MenuScreen { case Keys.NumPad8: return "8"; case Keys.NumPad9: return "9"; default: return Key.ToString(); - + } } diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs index 2cf9d06..602b358 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs @@ -17,13 +17,15 @@ public float const float divider255=1/255f; public XColor() { - if (Rabcr.random.Bool()) dir = 1; else dir = -1; - speed=Rabcr.random.Int(3, 10) * 0.0001f; - rotation=Rabcr.random.Int(360)*0.0174533f; + dir=FastRandom.IntPlusMinusOne(); + // Console.WriteLine(dir); + // if (Rabcr.random.Bool()) dir = 1; else dir = -1; + speed=(FastRandom.Float()*5+5f) * 0.0001f; + rotation=FastRandom.Rotatin();//.Int(360)*0.0174533f; - gR=R=Rabcr.random.Float(); - gG=G=Rabcr.random.Float(); - gB=B=Rabcr.random.Float(); + gR=R=FastRandom.Float(); + gG=G=FastRandom.Float(); + gB=B=FastRandom.Float(); change=120; } @@ -38,9 +40,9 @@ public float change--; if (change<0) { - gR=Rabcr.random.Float(); - gG=Rabcr.random.Float(); - gB=Rabcr.random.Float(); + gR=FastRandom.Float(); + gG=FastRandom.Float(); + gB=FastRandom.Float(); deltaR=(gR-R)*divider255; deltaG=(gG-G)*divider255; @@ -101,7 +103,11 @@ class MainMenu :MenuScreen { buttonsSide=new Button[]{ buttonSingleplayer, - // buttonMultiplayer, + + #if DEBUG + buttonMultiplayer, + #endif + buttonCharacter, buttonSetting, buttonLanguage, diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs index da39b86..38a8f37 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs @@ -588,7 +588,7 @@ public Texture2D TextureHandUp, TextureHandDown, - + TextureStaticSpaceSuit, TextureStaticShirt, TextureStaticSneakers, diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuLang.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuLang.cs index 1b090af..f2fa288 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuLang.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuLang.cs @@ -157,19 +157,19 @@ class LLanguage: LItem { // Name of language switch (Quality){ - default: + default: Text.Draw(sb); break; - case 0: + case 0: Text.Draw(sb, Color.Red); break; - case 1: + case 1: Text.Draw(sb, Color.Orange); break; - //case 2: + //case 2: // Text.Draw(sb, Color.Orange); // break; @@ -473,7 +473,7 @@ class LCategory:LItem { int y=0; // yy=0; - + LanguageList=new List();//{ Texture2D ok=GetDataTexture("Menu/Styles/Used"); @@ -484,7 +484,7 @@ class LCategory:LItem { foreach (string strCategory in l.Category) { string[] path=strCategory.Split('>'); InsertInto(LanguageList,path,l,null); - + } } @@ -550,7 +550,7 @@ class LCategory:LItem { } } - + { current=null; @@ -670,12 +670,12 @@ class LCategory:LItem { InsertInto(LanguageList, l); } - void InsertInto(List langs, Language lang) { + void InsertInto(List langs, Language lang) { LLanguage l = new LLanguage { TextureOK=ok, id=lang.id }; - + bool displayEnglishName=true; Language langO=Lang.Languages[l.id]; if (langO.EnglishName==langO.NativeName) displayEnglishName=false; @@ -697,7 +697,7 @@ class LCategory:LItem { l.Text=new Text(dis, xxx, y, BitmapFont.bitmapFont18); l.Quality=lang.Quality; - + if (lang.Flags!=null) { if (lang.Flags.Length>0) { @@ -748,7 +748,7 @@ class LCategory:LItem { if (yy<0)start=i; LItem c=langs[i]; c.SetPos(xxx,yy,DocumentSize); - + yy+=60; } }else{ diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs index bc2aa86..1fa5ae7 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs @@ -42,8 +42,8 @@ class MenuMultiplayer : MenuScreen { buttonLeftTexture=Textures.ButtonLeft; buttonRightTexture=Textures.ButtonRight; //buttonProblems=new Button(Textures.ButtonCenter, Fonts.Medium, Fonts.Big); - buttonAddServer=new ButtonCenter(buttonLeftTexture/*, Fonts.Medium, Fonts.Big,true*/) { center=true }; - buttonRefreshList=new ButtonCenter(buttonRightTexture/*, Fonts.Medium, Fonts.Big,true*/) { center=true }; + buttonAddServer=new ButtonCenter(buttonLeftTexture/*, Fonts.Medium, Fonts.Big,true*/) { /*center=true*/ }; + buttonRefreshList=new ButtonCenter(buttonRightTexture/*, Fonts.Medium, Fonts.Big,true*/) { /*center=true*/ }; buttonMenu=new Button(Textures.ButtonLongLeft, Lang.Texts[1]/*, Fonts.Medium, Fonts.Big,true*/); buttonMenu.Click+=ClickMenu; //buttonServer=new Button(Textures.ButtonCenter, Fonts.Medium, Fonts.Big); @@ -103,7 +103,7 @@ class MenuMultiplayer : MenuScreen { // p.Start(); //} int yy = (int)(-(servers.Count-(Global.WindowHeight-75-65)/100f)*100*scrollbar.scale)-65/*-55*/; - // + // for (int i = 0; i=Worlds.Count)break; if (yy>-70-70&&yy0) { servers[foreachedServer].currentConnection=Server.Connection.Error; // servers[foreachedServer].geDoMessage=new GeDo(Fonts.Small/*,Fonts.SmallItalic,Pixel*//*,false*/); - + if (!int.TryParse(connectionChecker.ErrorText, out int langErrorCode)) langErrorCode =1531; if (connectionChecker.ErrorDeep==0) { @@ -234,15 +234,15 @@ class MenuMultiplayer : MenuScreen { } } else if (connectionChecker.Received!=""&&connectionChecker.Received!=null) { string[] data = connectionChecker.Received.Split('|'); - servers[foreachedServer].geDoMessage=new GeDo(data[1], 100, yy+103); - servers[foreachedServer].joinedPlayers=int.Parse(data[2]); - servers[foreachedServer].maxplayers=int.Parse(data[3]); - servers[foreachedServer].version=data[4]; + servers[foreachedServer].geDoMessage=new GeDo(data[2], 100, yy+103); + servers[foreachedServer].joinedPlayers=int.Parse(data[3]); + servers[foreachedServer].maxplayers=int.Parse(data[4]); + servers[foreachedServer].version=data[1]; if (servers[foreachedServer].version!=Release.VersionString) { servers[foreachedServer].currentConnection=Server.Connection.Error; servers[foreachedServer].error=true; - servers[foreachedServer].geDoMessage=new GeDo(""+Lang.Texts[241]+" Hra je pro jinou verzi - "+servers[foreachedServer].version, 100, yy+103); + servers[foreachedServer].geDoMessage=new GeDo(""+Lang.Texts[241]+" "+Lang.Texts[1529].Replace("%name%",servers[foreachedServer].version)/* Hra je pro jinou verzi - "+*/, 100, yy+103); } else if (servers[foreachedServer].joinedPlayers==servers[foreachedServer].maxplayers) { servers[foreachedServer].error=true; servers[foreachedServer].currentConnection=Server.Connection.Error; @@ -507,7 +507,7 @@ class MenuMultiplayer : MenuScreen { // s.setting.mouseYCorrection=75; s.play=new ButtonCenter(buttonRightTexture/*,Fonts.Medium,Fonts.Big,true*/) { Text=Lang.Texts[247] /*Setting.czechLanguage ? "Připojit":"Connect"*/, - center=true + // center=true }; @@ -527,7 +527,7 @@ class MenuMultiplayer : MenuScreen { } void SetTexts() { - buttonAddServer.center=true; + // buttonAddServer.center=true; // buttonMenu.Text=Lang.Texts[1]; buttonRefreshList.Text=Lang.Texts[15]; @@ -709,12 +709,12 @@ class MenuMultiplayer : MenuScreen { } void RunMultiplayer(Server s) { - //MultiPlayer m = new MultiPlayer { - // port=s.port, - // ip=s.ip, - // pathToWorld=s.filePath - //}; - //Rabcr.GoTo(m); + Multiplayer m = new Multiplayer { + port = s.port, + ip = s.ip, + pathToWorld = s.filePath + }; + Rabcr.GoTo(m); } } diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs index 59d6d51..e3c9892 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs @@ -289,7 +289,7 @@ class MenuSetting: MenuScreen { } } { - SettingMovemer button=new SettingMovemer(Lang.Texts[354], line, movemer) { + SettingMovemer button=new SettingMovemer(Lang.Texts[354], line, movemer) { Scale=Setting.NightBrightness }; button.Click+=ClickNightBrightness; diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSingleplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSingleplayer.cs index 3ceb2e2..c14f30c 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSingleplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSingleplayer.cs @@ -159,7 +159,7 @@ class MenuSingleplayer :MenuScreen { } if (buttonNewWorld.Click) { - string worldName = (Rabcr.random.Int(1000)+""+Rabcr.random.Int(1000)+""+Rabcr.random.Int(1000)).ToString(); + string worldName = (FastRandom.Int(1000)+""+FastRandom.Int(1000)+""+FastRandom.Int(1000)).ToString(); using (AddSingleWorld asw = new AddSingleWorld(worldName)) { asw.ShowDialog(); @@ -297,12 +297,12 @@ class MenuSingleplayer :MenuScreen { if (s.generated){ s.ButtonPlay=new ButtonCenter(buttonPlayTexture) { Text=Lang.Texts[80], - center=true, + //center=true, }; } else { s.ButtonPlay=new ButtonCenter(buttonRightTexture) { Text=Lang.Texts[81], - center=true, + // center=true, }; } diff --git a/rabcrClient/WindowsAndStates/GameStates/Start.cs b/rabcrClient/WindowsAndStates/GameStates/Start.cs index e92eead..1117fbc 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Start.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Start.cs @@ -11,7 +11,7 @@ namespace rabcrClient { class Start :Screen { - enum AnimationState{ + enum AnimationState{ No, Initing, StandBy, @@ -68,13 +68,13 @@ enum AnimationState{ switch (CurrentAnimationState) { case AnimationState.No: - if (gameTime.TotalGameTime.TotalMilliseconds>500) { + if (gameTime.TotalGameTime.TotalMilliseconds>500) { StartChangeAnimation=gameTime.TotalGameTime.TotalMilliseconds-500; CurrentAnimationState=AnimationState.Initing; } break; - case AnimationState.Initing: + case AnimationState.Initing: if (alpha!=1) { alpha+=gameTime.ElapsedGameTime.Milliseconds/500f; if (alpha>1)alpha=1; @@ -125,7 +125,7 @@ enum AnimationState{ if (Textures.Logo!=null) { switch (CurrentAnimationState) { - case AnimationState.Initing: + case AnimationState.Initing: spriteBatch.Draw(Textures.Logo,new Vector2(Global.WindowWidthHalf-Textures.Logo.Width/2,Global.WindowHeightHalf-Textures.Logo.Height+20), Color.White*(float)Math.Sin(alpha*Math.PI/2f)); break; @@ -136,7 +136,7 @@ enum AnimationState{ case AnimationState.Ending: spriteBatch.Draw(Textures.Logo,new Vector2(Global.WindowWidthHalf-Textures.Logo.Width/2,Global.WindowHeightHalf-Textures.Logo.Height+20), Color.White*(1f-(float)Math.Sin(alpha*Math.PI/2f))); break; - } + } } spriteBatch.End(); @@ -159,13 +159,13 @@ enum AnimationState{ #region Load content methods SpriteFont LoadDataFont(string str) => Content.Load(Setting.StyleName+"\\Fonts\\"+str); - + Effect LoadDataEffect(string str) => Content.Load(Setting.StyleName+"\\Effects\\"+str); Song LoadDataSong(string str) => Content.Load(Setting.StyleName+"\\Songs\\"+str); - + SoundEffect LoadDataSoundEffect(string str) => Content.Load(Setting.StyleName+"\\SoundEffects\\"+str); - + Texture2D LoadDataTexture(string str) => Content.Load(Setting.StyleName+"\\Textures\\"+str); #endregion diff --git a/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.Designer.cs b/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.Designer.cs index dfded09..6780444 100644 --- a/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.Designer.cs @@ -41,14 +41,14 @@ partial class AddSingleWorld { this.panel2.SuspendLayout(); this.panel3.SuspendLayout(); this.SuspendLayout(); - // + // // timer1 - // + // this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.Timer1_Tick); - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -56,9 +56,9 @@ partial class AddSingleWorld { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(530, 34); this.panel1.TabIndex = 9; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -69,9 +69,9 @@ partial class AddSingleWorld { this.textPanel8.TabIndex = 9; this.textPanel8.TabStop = false; this.textPanel8.Text = "Přidat nový svět"; - // + // // panel2 - // + // this.panel2.Anchor = System.Windows.Forms.AnchorStyles.Top; this.panel2.BackColor = System.Drawing.Color.WhiteSmoke; this.panel2.Controls.Add(this.news1); @@ -83,10 +83,10 @@ partial class AddSingleWorld { this.panel2.Size = new System.Drawing.Size(464, 82); this.panel2.TabIndex = 2; this.panel2.Visible = false; - // + // // news1 - // - this.news1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.news1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.news1.BackColor = System.Drawing.Color.WhiteSmoke; this.news1.Location = new System.Drawing.Point(14, 8); @@ -95,10 +95,10 @@ partial class AddSingleWorld { this.news1.TabIndex = 9; this.news1.TabStop = false; this.news1.Text = "news1"; - // + // // bounds2 - // - this.bounds2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.bounds2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bounds2.BackColor = System.Drawing.Color.Transparent; this.bounds2.Location = new System.Drawing.Point(11, 5); @@ -107,9 +107,9 @@ partial class AddSingleWorld { this.bounds2.TabIndex = 0; this.bounds2.TabStop = false; this.bounds2.Text = "bounds1"; - // + // // customButton4 - // + // this.customButton4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.customButton4.BackColor = System.Drawing.Color.Transparent; this.customButton4.Disamble = false; @@ -121,9 +121,9 @@ partial class AddSingleWorld { this.customButton4.TabIndex = 2; this.customButton4.Text = "Pomoc s GeDo"; this.customButton4.Click += new System.EventHandler(this.GButton4_Click); - // + // // textPanel3 - // + // this.textPanel3.BackColor = System.Drawing.Color.Transparent; this.textPanel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel3.ForeColor = System.Drawing.Color.Black; @@ -134,9 +134,9 @@ partial class AddSingleWorld { this.textPanel3.TabIndex = 9; this.textPanel3.TabStop = false; this.textPanel3.Text = "Můžete použít GeDo značky"; - // + // // panel3 - // + // this.panel3.Anchor = System.Windows.Forms.AnchorStyles.Top; this.panel3.Controls.Add(this.textPanel4); this.panel3.Controls.Add(this.gTextPanel1); @@ -152,9 +152,9 @@ partial class AddSingleWorld { this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(447, 223); this.panel3.TabIndex = 3; - // + // // textPanel4 - // + // this.textPanel4.BackColor = System.Drawing.Color.Transparent; this.textPanel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel4.Location = new System.Drawing.Point(6, 44); @@ -164,9 +164,9 @@ partial class AddSingleWorld { this.textPanel4.TabIndex = 0; this.textPanel4.TabStop = false; this.textPanel4.Text = "Obtížnost ve světě"; - // + // // gTextPanel1 - // + // this.gTextPanel1.BackColor = System.Drawing.Color.Transparent; this.gTextPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.gTextPanel1.Location = new System.Drawing.Point(6, 119); @@ -176,9 +176,9 @@ partial class AddSingleWorld { this.gTextPanel1.TabIndex = 0; this.gTextPanel1.TabStop = false; this.gTextPanel1.Text = "Začátečnické itemy"; - // + // // textPanel7 - // + // this.textPanel7.BackColor = System.Drawing.Color.Transparent; this.textPanel7.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel7.Location = new System.Drawing.Point(6, 80); @@ -188,9 +188,9 @@ partial class AddSingleWorld { this.textPanel7.TabIndex = 0; this.textPanel7.TabStop = false; this.textPanel7.Text = "Velikost světa"; - // + // // changeButton1 - // + // this.changeButton1.BackColor = System.Drawing.Color.Transparent; this.changeButton1.Disamble = false; this.changeButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); @@ -204,9 +204,9 @@ partial class AddSingleWorld { this.changeButton1.Size = new System.Drawing.Size(167, 35); this.changeButton1.TabIndex = 3; this.changeButton1.Text = "changeButton1"; - // + // // bar1 - // + // this.bar1.Location = new System.Drawing.Point(5, 179); this.bar1.Name = "bar1"; this.bar1.Size = new System.Drawing.Size(436, 22); @@ -214,9 +214,9 @@ partial class AddSingleWorld { this.bar1.TabStop = false; this.bar1.Value = 0F; this.bar1.Visible = false; - // + // // changeButtonStartUpItems - // + // this.changeButtonStartUpItems.BackColor = System.Drawing.Color.Transparent; this.changeButtonStartUpItems.Disamble = false; this.changeButtonStartUpItems.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); @@ -230,9 +230,9 @@ partial class AddSingleWorld { this.changeButtonStartUpItems.Selected = 0; this.changeButtonStartUpItems.Size = new System.Drawing.Size(167, 35); this.changeButtonStartUpItems.TabIndex = 5; - // + // // changeButton3 - // + // this.changeButton3.BackColor = System.Drawing.Color.Transparent; this.changeButton3.Disamble = false; this.changeButton3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); @@ -246,9 +246,9 @@ partial class AddSingleWorld { this.changeButton3.Size = new System.Drawing.Size(167, 35); this.changeButton3.TabIndex = 5; this.changeButton3.Text = "changeButton1"; - // + // // textPanel6 - // + // this.textPanel6.BackColor = System.Drawing.Color.Transparent; this.textPanel6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel6.Location = new System.Drawing.Point(4, 153); @@ -259,9 +259,9 @@ partial class AddSingleWorld { this.textPanel6.TabStop = false; this.textPanel6.Text = "Proces"; this.textPanel6.Visible = false; - // + // // customButton6 - // + // this.customButton6.BackColor = System.Drawing.Color.Transparent; this.customButton6.Disamble = false; this.customButton6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); @@ -272,9 +272,9 @@ partial class AddSingleWorld { this.customButton6.TabIndex = 6; this.customButton6.Text = "Načíst svět ze souboru"; this.customButton6.Click += new System.EventHandler(this.GButton6_Click); - // + // // bounds3 - // + // this.bounds3.BackColor = System.Drawing.Color.Transparent; this.bounds3.Location = new System.Drawing.Point(2, 176); this.bounds3.Name = "bounds3"; @@ -283,9 +283,9 @@ partial class AddSingleWorld { this.bounds3.TabStop = false; this.bounds3.Text = "bounds1"; this.bounds3.Visible = false; - // + // // customButton2 - // + // this.customButton2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton2.BackColor = System.Drawing.Color.Transparent; this.customButton2.Disamble = false; @@ -297,9 +297,9 @@ partial class AddSingleWorld { this.customButton2.TabIndex = 7; this.customButton2.Text = "Zrušit"; this.customButton2.Click += new System.EventHandler(this.GButton2_Click); - // + // // customButton3 - // + // this.customButton3.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton3.BackColor = System.Drawing.Color.Transparent; this.customButton3.Disamble = false; @@ -311,9 +311,9 @@ partial class AddSingleWorld { this.customButton3.TabIndex = 8; this.customButton3.Text = "Vytvořit"; this.customButton3.Click += new System.EventHandler(this.GButton3_Click); - // + // // link1 - // + // this.link1.BackColor = System.Drawing.Color.Transparent; this.link1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Underline); this.link1.Location = new System.Drawing.Point(40, 129); @@ -322,9 +322,9 @@ partial class AddSingleWorld { this.link1.TabIndex = 1; this.link1.Text = "Zobrazit náhled"; this.link1.Click += new System.EventHandler(this.Link1_Click); - // + // // xTextBoxName - // + // this.xTextBoxName.Anchor = System.Windows.Forms.AnchorStyles.Top; this.xTextBoxName.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.xTextBoxName.Location = new System.Drawing.Point(40, 89); @@ -334,9 +334,9 @@ partial class AddSingleWorld { this.xTextBoxName.StateSelect = GBounds.StateSelect.Between; this.xTextBoxName.TabIndex = 0; this.xTextBoxName.TextInTextBox = ""; - // + // // textPanel1 - // + // this.textPanel1.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel1.BackColor = System.Drawing.Color.Transparent; this.textPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -347,9 +347,9 @@ partial class AddSingleWorld { this.textPanel1.TabIndex = 9; this.textPanel1.TabStop = false; this.textPanel1.Text = "Název světa"; - // + // // AddSingleWorld - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); diff --git a/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.cs b/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.cs index 58c66f7..7497233 100644 --- a/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.cs +++ b/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.cs @@ -34,7 +34,8 @@ public partial class AddSingleWorld : Form { public AddSingleWorld(string rndName) { DirName=rndName; InitializeComponent(); - textPanel8.Resize+=TextPanel8_Resize; + + textPanel8.Resize+=TextPanel8_Resize; textPanel8.Text=Lang.Texts[188]; textPanel1.Text=Lang.Texts[59]; link1.Text=Lang.Texts[60]; @@ -46,7 +47,7 @@ public partial class AddSingleWorld : Form { gTextPanel1.Text=Lang.Texts[323]; textPanel3.Text=Lang.Texts[72]; customButton4.Text=Lang.Texts[194]; - changeButtonStartUpItems.List= new string[]{ Lang.Texts[148],Lang.Texts[320],Lang.Texts[321],Lang.Texts[322]}; + changeButtonStartUpItems.List= new string[]{ Lang.Texts[148],Lang.Texts[320],Lang.Texts[321],Lang.Texts[322]}; changeButtonStartUpItems.selected=0; changeButton1.List = new string[] { Lang.Texts[195], Lang.Texts[198], Lang.Texts[183]}; @@ -56,19 +57,18 @@ public partial class AddSingleWorld : Form { timer1.Start(); newWorld=Lang.Texts[17]; - //if (Setting.czechLanguage) newWorld="Nový svět"; else newWorld="New world"; string o=""; for (int i=0; i"+newWorld[i]+""; } } - + xTextBoxName.textBox.Text=o; - xTextBoxName.textBox.TextChanged+=TextBoxName_TextChanged;//"Nový svět"; + xTextBoxName.textBox.TextChanged+=TextBoxName_TextChanged; } void TextPanel8_Resize(object sender, System.EventArgs e) => textPanel8.Location=new System.Drawing.Point(Width/2-textPanel8.Width/2, textPanel8.Location.Y); diff --git a/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.resx b/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.resx index 5a6b4c4..2ba243a 100644 --- a/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.resx +++ b/rabcrClient/WindowsAndStates/Splash/AddSingleWorld.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/CheckPassword.Designer.cs b/rabcrClient/WindowsAndStates/Splash/CheckPassword.Designer.cs index 760ae7a..50b946c 100644 --- a/rabcrClient/WindowsAndStates/Splash/CheckPassword.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/CheckPassword.Designer.cs @@ -24,69 +24,68 @@ partial class CheckPassword { /// private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CheckPassword)); - this.customButton2 = new GButton(); - this.customButton1 = new GButton(); - this.textPanel1 = new GTextPanel(); - this.xTextBoxPassword = new GTextBox(); + this.customButton2 = new rabcrClient.GButton(); + this.customButton1 = new rabcrClient.GButton(); + this.textPanel1 = new rabcrClient.GTextPanel(); + this.xTextBoxPassword = new rabcrClient.GTextBox(); this.panel1 = new System.Windows.Forms.Panel(); - this.textPanel8 = new GTextPanel(); + this.textPanel8 = new rabcrClient.GTextPanel(); + this.gTextPanel1 = new rabcrClient.GTextPanel(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // customButton2 - // + // this.customButton2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton2.BackColor = System.Drawing.Color.Transparent; this.customButton2.Disamble = false; this.customButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.customButton2.ForeColor = System.Drawing.Color.Black; - this.customButton2.Location = new System.Drawing.Point(116, 145); + this.customButton2.Location = new System.Drawing.Point(116, 171); this.customButton2.Name = "customButton2"; - this.customButton2.SetOrientation = GButton.Orientation.Right; + this.customButton2.SetOrientation = rabcrClient.GButton.Orientation.Right; this.customButton2.Size = new System.Drawing.Size(146, 36); this.customButton2.TabIndex = 2; this.customButton2.Text = "Zrušit"; this.customButton2.Click += new System.EventHandler(this.GButton2_Click); - // + // // customButton1 - // + // this.customButton1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton1.BackColor = System.Drawing.Color.Transparent; this.customButton1.Disamble = true; this.customButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.customButton1.Location = new System.Drawing.Point(268, 145); + this.customButton1.Location = new System.Drawing.Point(268, 171); this.customButton1.Name = "customButton1"; - this.customButton1.SetOrientation = GButton.Orientation.Left; + this.customButton1.SetOrientation = rabcrClient.GButton.Orientation.Left; this.customButton1.Size = new System.Drawing.Size(146, 36); this.customButton1.TabIndex = 3; this.customButton1.Text = "Podtvrdit"; this.customButton1.Click += new System.EventHandler(this.GButton1_Click); - // + // // textPanel1 - // + // this.textPanel1.BackColor = System.Drawing.Color.Transparent; this.textPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel1.Location = new System.Drawing.Point(43, 60); this.textPanel1.Name = "textPanel1"; this.textPanel1.Size = new System.Drawing.Size(167, 23); - this.textPanel1.SmallFont = false; this.textPanel1.TabIndex = 0; this.textPanel1.TabStop = false; this.textPanel1.Text = "Zadejte vaše heslo"; - // + // // xTextBoxPassword - // + // this.xTextBoxPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.xTextBoxPassword.Location = new System.Drawing.Point(43, 89); this.xTextBoxPassword.Name = "xTextBoxPassword"; - this.xTextBoxPassword.PlaceHolder = null; this.xTextBoxPassword.Size = new System.Drawing.Size(447, 29); - this.xTextBoxPassword.StateSelect = GBounds.StateSelect.Between; + this.xTextBoxPassword.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.xTextBoxPassword.TabIndex = 1; this.xTextBoxPassword.TextInTextBox = ""; - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -94,28 +93,40 @@ partial class CheckPassword { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(529, 34); this.panel1.TabIndex = 12; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel8.Location = new System.Drawing.Point(173, 6); this.textPanel8.Name = "textPanel8"; this.textPanel8.Size = new System.Drawing.Size(195, 23); - this.textPanel8.SmallFont = false; this.textPanel8.TabIndex = 9; this.textPanel8.TabStop = false; this.textPanel8.Text = "Server vyžaduje heslo"; - // + // + // gTextPanel1 + // + this.gTextPanel1.BackColor = System.Drawing.Color.Transparent; + this.gTextPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); + this.gTextPanel1.ForeColor = System.Drawing.SystemColors.AppWorkspace; + this.gTextPanel1.Location = new System.Drawing.Point(43, 142); + this.gTextPanel1.Name = "gTextPanel1"; + this.gTextPanel1.Size = new System.Drawing.Size(296, 23); + this.gTextPanel1.TabIndex = 0; + this.gTextPanel1.TabStop = false; + this.gTextPanel1.Text = "Heslo je je odlišné od přihlašování"; + // // CheckPassword - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); - this.ClientSize = new System.Drawing.Size(529, 197); + this.ClientSize = new System.Drawing.Size(529, 223); this.Controls.Add(this.panel1); this.Controls.Add(this.xTextBoxPassword); + this.Controls.Add(this.gTextPanel1); this.Controls.Add(this.textPanel1); this.Controls.Add(this.customButton2); this.Controls.Add(this.customButton1); @@ -138,5 +149,6 @@ partial class CheckPassword { private GTextBox xTextBoxPassword; private System.Windows.Forms.Panel panel1; private GTextPanel textPanel8; + private GTextPanel gTextPanel1; } } \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/Splash/CheckPassword.resx b/rabcrClient/WindowsAndStates/Splash/CheckPassword.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/CheckPassword.resx +++ b/rabcrClient/WindowsAndStates/Splash/CheckPassword.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.Designer.cs b/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.Designer.cs index 46dc72e..a558b3c 100644 --- a/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.Designer.cs @@ -40,14 +40,14 @@ partial class EditSingleWorld { this.panel2.SuspendLayout(); this.panel3.SuspendLayout(); this.SuspendLayout(); - // + // // timer1 - // + // this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.Timer1_Tick); - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -55,9 +55,9 @@ partial class EditSingleWorld { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(530, 34); this.panel1.TabIndex = 10; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -68,9 +68,9 @@ partial class EditSingleWorld { this.textPanel8.TabIndex = 9; this.textPanel8.TabStop = false; this.textPanel8.Text = "Upravit svět"; - // + // // panel2 - // + // this.panel2.Anchor = System.Windows.Forms.AnchorStyles.Top; this.panel2.BackColor = System.Drawing.Color.WhiteSmoke; this.panel2.Controls.Add(this.news2); @@ -82,10 +82,10 @@ partial class EditSingleWorld { this.panel2.Size = new System.Drawing.Size(464, 82); this.panel2.TabIndex = 2; this.panel2.Visible = false; - // + // // news2 - // - this.news2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.news2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.news2.BackColor = System.Drawing.Color.WhiteSmoke; this.news2.Location = new System.Drawing.Point(14, 8); @@ -94,10 +94,10 @@ partial class EditSingleWorld { this.news2.TabIndex = 9; this.news2.TabStop = false; this.news2.Text = "news2"; - // + // // bounds1 - // - this.bounds1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.bounds1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bounds1.BackColor = System.Drawing.Color.Transparent; this.bounds1.Location = new System.Drawing.Point(11, 5); @@ -106,9 +106,9 @@ partial class EditSingleWorld { this.bounds1.TabIndex = 0; this.bounds1.TabStop = false; this.bounds1.Text = "bounds1"; - // + // // customButton1 - // + // this.customButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.customButton1.BackColor = System.Drawing.Color.Transparent; this.customButton1.Disamble = false; @@ -120,9 +120,9 @@ partial class EditSingleWorld { this.customButton1.TabIndex = 2; this.customButton1.Text = "Pomoc s GeDo"; this.customButton1.Click += new System.EventHandler(this.GButton1_Click); - // + // // textPanel6 - // + // this.textPanel6.BackColor = System.Drawing.Color.Transparent; this.textPanel6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel6.ForeColor = System.Drawing.Color.Black; @@ -133,9 +133,9 @@ partial class EditSingleWorld { this.textPanel6.TabIndex = 9; this.textPanel6.TabStop = false; this.textPanel6.Text = "Můžete použít GeDo značky"; - // + // // panel3 - // + // this.panel3.Controls.Add(this.customButton5); this.panel3.Controls.Add(this.textPanel7); this.panel3.Controls.Add(this.textPanel2); @@ -149,9 +149,9 @@ partial class EditSingleWorld { this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(447, 222); this.panel3.TabIndex = 3; - // + // // customButton5 - // + // this.customButton5.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton5.BackColor = System.Drawing.Color.Transparent; this.customButton5.Disamble = false; @@ -163,9 +163,9 @@ partial class EditSingleWorld { this.customButton5.TabIndex = 4; this.customButton5.Text = "Smazat"; this.customButton5.Click += new System.EventHandler(this.GButton5_Click); - // + // // textPanel7 - // + // this.textPanel7.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel7.BackColor = System.Drawing.Color.Transparent; this.textPanel7.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -177,9 +177,9 @@ partial class EditSingleWorld { this.textPanel7.TabIndex = 0; this.textPanel7.TabStop = false; this.textPanel7.Text = "Smazat svět"; - // + // // textPanel2 - // + // this.textPanel2.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel2.BackColor = System.Drawing.Color.Transparent; this.textPanel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -191,9 +191,9 @@ partial class EditSingleWorld { this.textPanel2.TabIndex = 0; this.textPanel2.TabStop = false; this.textPanel2.Text = "Vyčistit svět"; - // + // // textPanel5 - // + // this.textPanel5.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel5.BackColor = System.Drawing.Color.Transparent; this.textPanel5.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -205,10 +205,10 @@ partial class EditSingleWorld { this.textPanel5.TabIndex = 0; this.textPanel5.TabStop = false; this.textPanel5.Text = "Exportovat"; - // + // // bar1 - // - this.bar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.bar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bar1.Location = new System.Drawing.Point(7, 188); this.bar1.Name = "bar1"; @@ -217,9 +217,9 @@ partial class EditSingleWorld { this.bar1.TabStop = false; this.bar1.Value = 0F; this.bar1.Visible = false; - // + // // customButton7 - // + // this.customButton7.Anchor = System.Windows.Forms.AnchorStyles.Top; this.customButton7.BackColor = System.Drawing.Color.Transparent; this.customButton7.Disamble = false; @@ -231,10 +231,10 @@ partial class EditSingleWorld { this.customButton7.TabIndex = 5; this.customButton7.Text = "Exportovat"; this.customButton7.Click += new System.EventHandler(this.GButton7_Click); - // + // // bounds3 - // - this.bounds3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.bounds3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.bounds3.BackColor = System.Drawing.Color.Transparent; this.bounds3.Location = new System.Drawing.Point(4, 185); @@ -244,9 +244,9 @@ partial class EditSingleWorld { this.bounds3.TabStop = false; this.bounds3.Text = "bounds1"; this.bounds3.Visible = false; - // + // // customButton6 - // + // this.customButton6.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton6.BackColor = System.Drawing.Color.Transparent; this.customButton6.Disamble = false; @@ -258,9 +258,9 @@ partial class EditSingleWorld { this.customButton6.TabIndex = 3; this.customButton6.Text = "Vyčistit"; this.customButton6.Click += new System.EventHandler(this.GButton6_Click); - // + // // textPanel4 - // + // this.textPanel4.BackColor = System.Drawing.Color.Transparent; this.textPanel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel4.Location = new System.Drawing.Point(1, 160); @@ -271,9 +271,9 @@ partial class EditSingleWorld { this.textPanel4.TabStop = false; this.textPanel4.Text = "Proces"; this.textPanel4.Visible = false; - // + // // link1 - // + // this.link1.BackColor = System.Drawing.Color.Transparent; this.link1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Underline); this.link1.Location = new System.Drawing.Point(40, 132); @@ -282,9 +282,9 @@ partial class EditSingleWorld { this.link1.TabIndex = 1; this.link1.Text = "Zobrazit náhled"; this.link1.Click += new System.EventHandler(this.Link1_Click); - // + // // xTextBoxName - // + // this.xTextBoxName.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.xTextBoxName.Location = new System.Drawing.Point(40, 89); this.xTextBoxName.Name = "xTextBoxName"; @@ -293,9 +293,9 @@ partial class EditSingleWorld { this.xTextBoxName.StateSelect = GBounds.StateSelect.Between; this.xTextBoxName.TabIndex = 0; this.xTextBoxName.TextInTextBox = ""; - // + // // textPanel1 - // + // this.textPanel1.BackColor = System.Drawing.Color.Transparent; this.textPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel1.Location = new System.Drawing.Point(40, 60); @@ -305,9 +305,9 @@ partial class EditSingleWorld { this.textPanel1.TabIndex = 4; this.textPanel1.TabStop = false; this.textPanel1.Text = "Název světa"; - // + // // customButton3 - // + // this.customButton3.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton3.BackColor = System.Drawing.Color.Transparent; this.customButton3.Disamble = false; @@ -319,9 +319,9 @@ partial class EditSingleWorld { this.customButton3.TabIndex = 7; this.customButton3.Text = "Použít"; this.customButton3.Click += new System.EventHandler(this.GButton3_Click); - // + // // customButton2 - // + // this.customButton2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton2.BackColor = System.Drawing.Color.Transparent; this.customButton2.Disamble = false; @@ -333,9 +333,9 @@ partial class EditSingleWorld { this.customButton2.TabIndex = 6; this.customButton2.Text = "Zrušit"; this.customButton2.Click += new System.EventHandler(this.GButton2_Click); - // + // // EditSingleWorld - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); diff --git a/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.resx b/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.resx index 25d240e..e7e1f19 100644 --- a/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.resx +++ b/rabcrClient/WindowsAndStates/Splash/EditSingleWorld.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormAch.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormAch.Designer.cs index 2d2f9f1..65bcb30 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAch.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormAch.Designer.cs @@ -33,9 +33,9 @@ partial class FormAch { this.achievmentControl1 = new rabcr.AchievmentControl(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -43,9 +43,9 @@ partial class FormAch { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(579, 34); this.panel1.TabIndex = 0; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -56,9 +56,9 @@ partial class FormAch { this.textPanel8.TabIndex = 0; this.textPanel8.TabStop = false; this.textPanel8.Text = "Achievements"; - // + // // buttonClose - // + // this.buttonClose.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.buttonClose.BackColor = System.Drawing.Color.Transparent; this.buttonClose.Disamble = false; @@ -70,9 +70,9 @@ partial class FormAch { this.buttonClose.TabIndex = 2; this.buttonClose.Text = "Close"; this.buttonClose.Click += new System.EventHandler(this.CustomButton1_Click); - // + // // achievmentControl3 - // + // this.achievmentControl3.Anchor = System.Windows.Forms.AnchorStyles.None; this.achievmentControl3.BackColor = System.Drawing.Color.Transparent; this.achievmentControl3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -83,9 +83,9 @@ partial class FormAch { this.achievmentControl3.TabIndex = 3; this.achievmentControl3.Text = "Future age"; this.achievmentControl3.Click += new System.EventHandler(this.AchievmentControl3_Click); - // + // // achievmentControl2 - // + // this.achievmentControl2.Anchor = System.Windows.Forms.AnchorStyles.None; this.achievmentControl2.BackColor = System.Drawing.Color.Transparent; this.achievmentControl2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -96,9 +96,9 @@ partial class FormAch { this.achievmentControl2.TabIndex = 3; this.achievmentControl2.Text = "Iron age"; this.achievmentControl2.Click += new System.EventHandler(this.achievmentControl2_Click); - // + // // achievmentControl0 - // + // this.achievmentControl0.Anchor = System.Windows.Forms.AnchorStyles.None; this.achievmentControl0.BackColor = System.Drawing.Color.Transparent; this.achievmentControl0.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -109,9 +109,9 @@ partial class FormAch { this.achievmentControl0.TabIndex = 3; this.achievmentControl0.Text = "Stone age"; this.achievmentControl0.Click += new System.EventHandler(this.AchievmentControl0_Click); - // + // // achievmentControl1 - // + // this.achievmentControl1.Anchor = System.Windows.Forms.AnchorStyles.None; this.achievmentControl1.BackColor = System.Drawing.Color.Transparent; this.achievmentControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -122,9 +122,9 @@ partial class FormAch { this.achievmentControl1.TabIndex = 3; this.achievmentControl1.Text = "Bronze age"; this.achievmentControl1.Click += new System.EventHandler(this.AchievmentControl1_Click); - // + // // FormAch - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(579, 420); diff --git a/rabcrClient/WindowsAndStates/Splash/FormAch.cs b/rabcrClient/WindowsAndStates/Splash/FormAch.cs index 3026fb3..12f0c40 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAch.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormAch.cs @@ -34,25 +34,25 @@ public partial class FormAch: Form { } void AchievmentControl0_Click(object sender, System.EventArgs e) { - using (FormAchDetail fad=new FormAchDetail(achievmentControl0.Text,achievmentControl0.Done,Lang.Texts[1480],0)) { + using (FormAchDetail fad=new FormAchDetail(achievmentControl0.Text,achievmentControl0.Done,Lang.Texts[1480],0)) { fad.ShowDialog(); } } void AchievmentControl1_Click(object sender, System.EventArgs e) { - using (FormAchDetail fad=new FormAchDetail(achievmentControl1.Text,achievmentControl1.Done, Lang.Texts[1482],1)) { + using (FormAchDetail fad=new FormAchDetail(achievmentControl1.Text,achievmentControl1.Done, Lang.Texts[1482],1)) { fad.ShowDialog(); } } void achievmentControl2_Click(object sender, System.EventArgs e) { - using (FormAchDetail fad=new FormAchDetail(achievmentControl2.Text,achievmentControl2.Done, Lang.Texts[1484],2)) { + using (FormAchDetail fad=new FormAchDetail(achievmentControl2.Text,achievmentControl2.Done, Lang.Texts[1484],2)) { fad.ShowDialog(); } } void AchievmentControl3_Click(object sender, System.EventArgs e) { - using (FormAchDetail fad=new FormAchDetail(achievmentControl3.Text,achievmentControl3.Done, Lang.Texts[1486],3)) { + using (FormAchDetail fad=new FormAchDetail(achievmentControl3.Text,achievmentControl3.Done, Lang.Texts[1486],3)) { fad.ShowDialog(); } } diff --git a/rabcrClient/WindowsAndStates/Splash/FormAch.resx b/rabcrClient/WindowsAndStates/Splash/FormAch.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAch.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormAch.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormAchDetail.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormAchDetail.Designer.cs index 2aff3e2..0e1fe35 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAchDetail.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormAchDetail.Designer.cs @@ -33,9 +33,9 @@ partial class FormAchDetail { this.gTextPanel3 = new GTextPanel(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -43,9 +43,9 @@ partial class FormAchDetail { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(579, 34); this.panel1.TabIndex = 0; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -56,9 +56,9 @@ partial class FormAchDetail { this.textPanel8.TabIndex = 0; this.textPanel8.TabStop = false; this.textPanel8.Text = "Achievement detail"; - // + // // buttonClose - // + // this.buttonClose.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.buttonClose.BackColor = System.Drawing.Color.Transparent; this.buttonClose.Disamble = false; @@ -70,9 +70,9 @@ partial class FormAchDetail { this.buttonClose.TabIndex = 2; this.buttonClose.Text = "Close"; this.buttonClose.Click += new System.EventHandler(this.ButtonClose_Click); - // + // // gTextPanel1 - // + // this.gTextPanel1.BackColor = System.Drawing.Color.Transparent; this.gTextPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.gTextPanel1.Location = new System.Drawing.Point(31, 110); @@ -82,9 +82,9 @@ partial class FormAchDetail { this.gTextPanel1.TabIndex = 0; this.gTextPanel1.TabStop = false; this.gTextPanel1.Text = "This is text about acheavement detail"; - // + // // buttonShare - // + // this.buttonShare.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.buttonShare.BackColor = System.Drawing.Color.Transparent; this.buttonShare.Disamble = true; @@ -96,9 +96,9 @@ partial class FormAchDetail { this.buttonShare.TabIndex = 2; this.buttonShare.Text = "Share as Game Jolt Trophy"; this.buttonShare.Click += new System.EventHandler(this.ButtonShare_Click); - // + // // gTextPanel2 - // + // this.gTextPanel2.BackColor = System.Drawing.Color.Transparent; this.gTextPanel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.gTextPanel2.Location = new System.Drawing.Point(31, 51); @@ -108,9 +108,9 @@ partial class FormAchDetail { this.gTextPanel2.TabIndex = 0; this.gTextPanel2.TabStop = false; this.gTextPanel2.Text = "Base achievement"; - // + // // gTextPanel3 - // + // this.gTextPanel3.BackColor = System.Drawing.Color.Transparent; this.gTextPanel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.gTextPanel3.Location = new System.Drawing.Point(31, 80); @@ -120,9 +120,9 @@ partial class FormAchDetail { this.gTextPanel3.TabIndex = 0; this.gTextPanel3.TabStop = false; this.gTextPanel3.Text = "Not acquired"; - // + // // FormAchDetail - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(579, 274); diff --git a/rabcrClient/WindowsAndStates/Splash/FormAchDetail.cs b/rabcrClient/WindowsAndStates/Splash/FormAchDetail.cs index 0d1cd27..216a5fe 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAchDetail.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormAchDetail.cs @@ -28,8 +28,8 @@ public partial class FormAchDetail: Form { } private void ButtonShare_Click(object sender, System.EventArgs e) { - if (!buttonShare.Disamble) { - using (FormAchGameJolt fagj=new FormAchGameJolt(Level,NameText)) { + if (!buttonShare.Disamble) { + using (FormAchGameJolt fagj=new FormAchGameJolt(Level,NameText)) { fagj.ShowDialog(); } } diff --git a/rabcrClient/WindowsAndStates/Splash/FormAchDetail.resx b/rabcrClient/WindowsAndStates/Splash/FormAchDetail.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAchDetail.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormAchDetail.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.Designer.cs index 19bfb40..9bbf326 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.Designer.cs @@ -34,9 +34,9 @@ partial class FormAchGameJolt { this.buttonSubmit = new GButton(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -44,9 +44,9 @@ partial class FormAchGameJolt { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(440, 34); this.panel1.TabIndex = 0; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -57,9 +57,9 @@ partial class FormAchGameJolt { this.textPanel8.TabIndex = 0; this.textPanel8.TabStop = false; this.textPanel8.Text = "Share stone age acheavement"; - // + // // buttonCancel - // + // this.buttonCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.buttonCancel.BackColor = System.Drawing.Color.Transparent; this.buttonCancel.Disamble = false; @@ -71,9 +71,9 @@ partial class FormAchGameJolt { this.buttonCancel.TabIndex = 2; this.buttonCancel.Text = "Cancel"; this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); - // + // // textBoxNick - // + // this.textBoxNick.Anchor = System.Windows.Forms.AnchorStyles.None; this.textBoxNick.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.textBoxNick.Location = new System.Drawing.Point(84, 118); @@ -83,9 +83,9 @@ partial class FormAchGameJolt { this.textBoxNick.StateSelect = GBounds.StateSelect.Between; this.textBoxNick.TabIndex = 3; this.textBoxNick.TextInTextBox = ""; - // + // // textPanelNick - // + // this.textPanelNick.Anchor = System.Windows.Forms.AnchorStyles.None; this.textPanelNick.BackColor = System.Drawing.Color.Transparent; this.textPanelNick.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -96,9 +96,9 @@ partial class FormAchGameJolt { this.textPanelNick.TabIndex = 0; this.textPanelNick.TabStop = false; this.textPanelNick.Text = "Game Jolt Nick"; - // + // // textBoxToken - // + // this.textBoxToken.Anchor = System.Windows.Forms.AnchorStyles.None; this.textBoxToken.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.textBoxToken.Location = new System.Drawing.Point(84, 194); @@ -108,9 +108,9 @@ partial class FormAchGameJolt { this.textBoxToken.StateSelect = GBounds.StateSelect.Between; this.textBoxToken.TabIndex = 3; this.textBoxToken.TextInTextBox = ""; - // + // // textPanelToken - // + // this.textPanelToken.Anchor = System.Windows.Forms.AnchorStyles.None; this.textPanelToken.BackColor = System.Drawing.Color.Transparent; this.textPanelToken.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -121,9 +121,9 @@ partial class FormAchGameJolt { this.textPanelToken.TabIndex = 0; this.textPanelToken.TabStop = false; this.textPanelToken.Text = "Game Jolt Token"; - // + // // buttonSubmit - // + // this.buttonSubmit.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.buttonSubmit.BackColor = System.Drawing.Color.Transparent; this.buttonSubmit.Disamble = true; @@ -135,9 +135,9 @@ partial class FormAchGameJolt { this.buttonSubmit.TabIndex = 2; this.buttonSubmit.Text = "Submit"; this.buttonSubmit.Click += new System.EventHandler(this.CustomButton1_Click); - // + // // FormAchGameJolt - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(440, 330); diff --git a/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.cs b/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.cs index 8588b0d..a7becf4 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.cs @@ -12,7 +12,7 @@ public partial class FormAchGameJolt: Form { Level=level; DoubleBuffered=true; textBoxNick.textBox.TextChanged+=TextBox_TextChanged; - textBoxToken.textBox.TextChanged+=TextBox_TextChanged1; + textBoxToken.textBox.TextChanged+=TextBox_TextChanged1; textPanel8.Text=Text=name; textPanelNick.Text=Lang.Texts[1488]; textPanelToken.Text=Lang.Texts[1489]; @@ -24,10 +24,10 @@ public partial class FormAchGameJolt: Form { void TextPanel8_Resize(object sender, System.EventArgs e) => textPanel8.Location=new System.Drawing.Point(Width/2-textPanel8.Width/2, textPanel8.Location.Y); - void TextBox_TextChanged1(object sender, System.EventArgs e) => buttonSubmit.Disamble=textBoxNick.textBox.Text.Length<3 || textBoxToken.textBox.Text.Length<3; + void TextBox_TextChanged1(object sender, System.EventArgs e) => buttonSubmit.Disamble=textBoxNick.textBox.Text.Length<3 || textBoxToken.textBox.Text.Length<3; + + void TextBox_TextChanged(object sender, System.EventArgs e) => buttonSubmit.Disamble=textBoxNick.textBox.Text.Length<3 || textBoxToken.textBox.Text.Length<3; - void TextBox_TextChanged(object sender, System.EventArgs e) => buttonSubmit.Disamble=textBoxNick.textBox.Text.Length<3 || textBoxToken.textBox.Text.Length<3; - void CustomButton1_Click(object sender, System.EventArgs e) { if (!buttonCancel.Disamble) { WebClient wc = new WebClient(); @@ -37,7 +37,7 @@ public partial class FormAchGameJolt: Form { secretKey="url"+secretKey.Substring(1,9); secretKey=""; - switch (Level) { + switch (Level) { // Bronze case 0: @@ -45,9 +45,9 @@ public partial class FormAchGameJolt: Form { string url=Release.stringGameJoltServerGate+"username="+textBoxNick.textBox.Text+"&token="+textBoxToken.textBox.Text+"&id=134205&version="+Release.VersionString+secretKey; string get = wc.DownloadString(url); - if (get=="SUCCESS") { + if (get=="SUCCESS") { MessageBox.Show(Lang.Texts[1499]); - } else { + } else { MessageBox.Show(Lang.Texts[1500],Lang.Texts[46]); } @@ -64,9 +64,9 @@ public partial class FormAchGameJolt: Form { string url=Release.stringGameJoltServerGate+"username="+textBoxNick.textBox.Text+"&token="+textBoxToken.textBox.Text+"&id=13407&version="+Release.VersionString+secretKey; string get = wc.DownloadString(url); - if (get=="SUCCESS") { + if (get=="SUCCESS") { MessageBox.Show(Lang.Texts[1499]); - } else { + } else { MessageBox.Show(Lang.Texts[1500],Lang.Texts[46]); } @@ -83,9 +83,9 @@ public partial class FormAchGameJolt: Form { string url=Release.stringGameJoltServerGate+"username="+textBoxNick.textBox.Text+"&token="+textBoxToken.textBox.Text+"&id=134208&version="+Release.VersionString+secretKey; string get = wc.DownloadString(url); - if (get=="SUCCESS") { + if (get=="SUCCESS") { MessageBox.Show(Lang.Texts[1499]); - } else { + } else { MessageBox.Show(Lang.Texts[1500],Lang.Texts[46]); } @@ -102,9 +102,9 @@ public partial class FormAchGameJolt: Form { string url=Release.stringGameJoltServerGate+"username="+textBoxNick.textBox.Text+"&token="+textBoxToken.textBox.Text+"&id=134209&version="+Release.VersionString+secretKey; string get = wc.DownloadString(url); - if (get=="SUCCESS") { + if (get=="SUCCESS") { MessageBox.Show(Lang.Texts[1499]); - } else { + } else { MessageBox.Show(Lang.Texts[1500],Lang.Texts[46]); } @@ -115,7 +115,7 @@ public partial class FormAchGameJolt: Form { } break; } - + Close(); } } diff --git a/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.resx b/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormAchGameJolt.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.Designer.cs index 177ff67..15bba93 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.Designer.cs @@ -36,9 +36,9 @@ partial class FormBadTranslation { this.textPanel8 = new GTextPanel(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // customButton2 - // + // this.customButton2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton2.BackColor = System.Drawing.Color.Transparent; this.customButton2.Disamble = false; @@ -50,9 +50,9 @@ partial class FormBadTranslation { this.customButton2.TabIndex = 3; this.customButton2.Text = "Zrušit"; this.customButton2.Click += new System.EventHandler(this.GButton2_Click); - // + // // customButton1 - // + // this.customButton1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton1.BackColor = System.Drawing.Color.Transparent; this.customButton1.Disamble = false; @@ -64,9 +64,9 @@ partial class FormBadTranslation { this.customButton1.TabIndex = 4; this.customButton1.Text = "Podtvrdit"; this.customButton1.Click += new System.EventHandler(this.GButton1_Click); - // + // // gTextPanel1 - // + // this.gTextPanel1.Anchor = System.Windows.Forms.AnchorStyles.Top; this.gTextPanel1.BackColor = System.Drawing.Color.Transparent; this.gTextPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -77,9 +77,9 @@ partial class FormBadTranslation { this.gTextPanel1.TabIndex = 11; this.gTextPanel1.TabStop = false; this.gTextPanel1.Text = "Write down what is currently showing"; - // + // // gTextPanel2 - // + // this.gTextPanel2.Anchor = System.Windows.Forms.AnchorStyles.Top; this.gTextPanel2.BackColor = System.Drawing.Color.Transparent; this.gTextPanel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -90,9 +90,9 @@ partial class FormBadTranslation { this.gTextPanel2.TabIndex = 11; this.gTextPanel2.TabStop = false; this.gTextPanel2.Text = "Write down what should show"; - // + // // gTextPanel3 - // + // this.gTextPanel3.Anchor = System.Windows.Forms.AnchorStyles.Top; this.gTextPanel3.BackColor = System.Drawing.Color.Transparent; this.gTextPanel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -103,9 +103,9 @@ partial class FormBadTranslation { this.gTextPanel3.TabIndex = 11; this.gTextPanel3.TabStop = false; this.gTextPanel3.Text = "Write down where is it"; - // + // // xTextboxRight - // + // this.xTextboxRight.Anchor = System.Windows.Forms.AnchorStyles.Top; this.xTextboxRight.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.xTextboxRight.Location = new System.Drawing.Point(37, 170); @@ -115,9 +115,9 @@ partial class FormBadTranslation { this.xTextboxRight.StateSelect = GBounds.StateSelect.Between; this.xTextboxRight.TabIndex = 1; this.xTextboxRight.TextInTextBox = ""; - // + // // xTextboxWrong - // + // this.xTextboxWrong.Anchor = System.Windows.Forms.AnchorStyles.Top; this.xTextboxWrong.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.xTextboxWrong.Location = new System.Drawing.Point(37, 90); @@ -127,9 +127,9 @@ partial class FormBadTranslation { this.xTextboxWrong.StateSelect = GBounds.StateSelect.Between; this.xTextboxWrong.TabIndex = 0; this.xTextboxWrong.TextInTextBox = ""; - // + // // gTextBoxWhere - // + // this.gTextBoxWhere.Anchor = System.Windows.Forms.AnchorStyles.Top; this.gTextBoxWhere.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.gTextBoxWhere.Location = new System.Drawing.Point(37, 249); @@ -139,10 +139,10 @@ partial class FormBadTranslation { this.gTextBoxWhere.StateSelect = GBounds.StateSelect.Between; this.gTextBoxWhere.TabIndex = 2; this.gTextBoxWhere.TextInTextBox = ""; - // + // // panel1 - // - this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); @@ -150,9 +150,9 @@ partial class FormBadTranslation { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(426, 34); this.panel1.TabIndex = 11; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); @@ -163,9 +163,9 @@ partial class FormBadTranslation { this.textPanel8.TabIndex = 9; this.textPanel8.TabStop = false; this.textPanel8.Text = "Report bad translation"; - // + // // FormBadTranslation - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); diff --git a/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.resx b/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormBadTranslation.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormColors.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormColors.Designer.cs index c9562bf..69ea38b 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormColors.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormColors.Designer.cs @@ -25,14 +25,14 @@ partial class FormColors { private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormColors)); this.panel1 = new System.Windows.Forms.Panel(); - this.textPanel8 = new GTextPanel(); - this.customButton2 = new GButton(); - this.customButton1 = new GButton(); + this.textPanel8 = new rabcrClient.GTextPanel(); + this.customButton2 = new rabcrClient.GButton(); + this.customButton1 = new rabcrClient.GButton(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -40,22 +40,21 @@ partial class FormColors { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(579, 34); this.panel1.TabIndex = 0; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel8.Location = new System.Drawing.Point(222, 8); this.textPanel8.Name = "textPanel8"; this.textPanel8.Size = new System.Drawing.Size(125, 23); - this.textPanel8.SmallFont = false; this.textPanel8.TabIndex = 0; this.textPanel8.TabStop = false; this.textPanel8.Text = "Vyberte barvu"; - // + // // customButton2 - // + // this.customButton2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton2.BackColor = System.Drawing.Color.Transparent; this.customButton2.Disamble = false; @@ -63,30 +62,31 @@ partial class FormColors { this.customButton2.ForeColor = System.Drawing.Color.Black; this.customButton2.Location = new System.Drawing.Point(143, 226); this.customButton2.Name = "customButton2"; - this.customButton2.SetOrientation = GButton.Orientation.Right; + this.customButton2.SetOrientation = rabcrClient.GButton.Orientation.Right; this.customButton2.Size = new System.Drawing.Size(146, 36); this.customButton2.TabIndex = 1; this.customButton2.Text = "Zrušit"; this.customButton2.Click += new System.EventHandler(this.CustomButton2_Click); - // + // // customButton1 - // + // this.customButton1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.customButton1.BackColor = System.Drawing.Color.Transparent; this.customButton1.Disamble = true; this.customButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.customButton1.Location = new System.Drawing.Point(295, 226); this.customButton1.Name = "customButton1"; - this.customButton1.SetOrientation = GButton.Orientation.Left; + this.customButton1.SetOrientation = rabcrClient.GButton.Orientation.Left; this.customButton1.Size = new System.Drawing.Size(146, 36); this.customButton1.TabIndex = 2; this.customButton1.Text = "Použít"; this.customButton1.Click += new System.EventHandler(this.CustomButton1_Click); - // + // // FormColors - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); this.ClientSize = new System.Drawing.Size(579, 274); this.Controls.Add(this.panel1); this.Controls.Add(this.customButton2); diff --git a/rabcrClient/WindowsAndStates/Splash/FormColors.resx b/rabcrClient/WindowsAndStates/Splash/FormColors.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormColors.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormColors.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormGiftCode.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormGiftCode.Designer.cs index a7d835b..ab7f9f1 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormGiftCode.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormGiftCode.Designer.cs @@ -25,16 +25,16 @@ partial class FormGiftCode { private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormGiftCode)); this.panel1 = new System.Windows.Forms.Panel(); - this.textPanel8 = new GTextPanel(); - this.buttonCancel = new GButton(); - this.gTextBox1 = new GTextBox(); - this.gTextPanel1 = new GTextPanel(); - this.buttonApply = new GButton(); + this.textPanel8 = new rabcrClient.GTextPanel(); + this.buttonCancel = new rabcrClient.GButton(); + this.gTextBox1 = new rabcrClient.GTextBox(); + this.gTextPanel1 = new rabcrClient.GTextPanel(); + this.buttonApply = new rabcrClient.GButton(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -42,77 +42,75 @@ partial class FormGiftCode { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(440, 34); this.panel1.TabIndex = 0; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel8.Location = new System.Drawing.Point(182, 8); this.textPanel8.Name = "textPanel8"; this.textPanel8.Size = new System.Drawing.Size(83, 23); - this.textPanel8.SmallFont = false; this.textPanel8.TabIndex = 0; this.textPanel8.TabStop = false; this.textPanel8.Text = "Gift code"; - // + // // buttonCancel - // + // this.buttonCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.buttonCancel.BackColor = System.Drawing.Color.Transparent; this.buttonCancel.Disamble = false; this.buttonCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.buttonCancel.Location = new System.Drawing.Point(76, 216); this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.SetOrientation = GButton.Orientation.Right; + this.buttonCancel.SetOrientation = rabcrClient.GButton.Orientation.Right; this.buttonCancel.Size = new System.Drawing.Size(146, 36); this.buttonCancel.TabIndex = 2; this.buttonCancel.Text = "Cancel"; this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); - // + // // gTextBox1 - // + // this.gTextBox1.Anchor = System.Windows.Forms.AnchorStyles.None; this.gTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.gTextBox1.Location = new System.Drawing.Point(82, 118); this.gTextBox1.Name = "gTextBox1"; - this.gTextBox1.PlaceHolder = null; this.gTextBox1.Size = new System.Drawing.Size(286, 29); - this.gTextBox1.StateSelect = GBounds.StateSelect.Between; + this.gTextBox1.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.gTextBox1.TabIndex = 3; this.gTextBox1.TextInTextBox = ""; - // + // // gTextPanel1 - // + // this.gTextPanel1.Anchor = System.Windows.Forms.AnchorStyles.None; this.gTextPanel1.BackColor = System.Drawing.Color.Transparent; this.gTextPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.gTextPanel1.Location = new System.Drawing.Point(82, 89); this.gTextPanel1.Name = "gTextPanel1"; this.gTextPanel1.Size = new System.Drawing.Size(83, 23); - this.gTextPanel1.SmallFont = false; this.gTextPanel1.TabIndex = 0; this.gTextPanel1.TabStop = false; this.gTextPanel1.Text = "Gift code"; - // + // // buttonApply - // + // this.buttonApply.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.buttonApply.BackColor = System.Drawing.Color.Transparent; this.buttonApply.Disamble = true; this.buttonApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.buttonApply.Location = new System.Drawing.Point(228, 216); this.buttonApply.Name = "buttonApply"; - this.buttonApply.SetOrientation = GButton.Orientation.Left; + this.buttonApply.SetOrientation = rabcrClient.GButton.Orientation.Left; this.buttonApply.Size = new System.Drawing.Size(146, 36); this.buttonApply.TabIndex = 2; this.buttonApply.Text = "Apply"; this.buttonApply.Click += new System.EventHandler(this.CustomButton1_Click); - // + // // FormGiftCode - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); this.ClientSize = new System.Drawing.Size(440, 274); this.Controls.Add(this.gTextPanel1); this.Controls.Add(this.gTextBox1); diff --git a/rabcrClient/WindowsAndStates/Splash/FormGiftCode.cs b/rabcrClient/WindowsAndStates/Splash/FormGiftCode.cs index d2185f1..3d0f62e 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormGiftCode.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormGiftCode.cs @@ -6,13 +6,13 @@ public partial class FormGiftCode: Form { public string giftData; public bool DropGift; - + public FormGiftCode() { InitializeComponent(); DoubleBuffered=true; Text=textPanel8.Text=gTextPanel1.Text=Lang.Texts[1476]; textPanel8.Resize+=TextPanel8_Resize; - + gTextBox1.textBox.TextChanged+=TextBox_TextChanged; buttonApply.Text=Lang.Texts[58]; @@ -36,16 +36,16 @@ public partial class FormGiftCode: Form { #if DEBUG System.Diagnostics.Debug.WriteLine("Gift result: "+result); #endif - if (result.Length==0) { - MessageBox.Show(Lang.Texts[46]); - } else if (result.Contains("|")) { + if (result.Length==0) { + MessageBox.Show(Lang.Texts[46]); + } else if (result.Contains("|")) { string[] raw=result.Split('|'); - switch (raw[0]) { + switch (raw[0]) { case "E": if (int.TryParse(raw[1], out int eid)) { - switch (eid){ + switch (eid){ case 1: - MessageBox.Show(Lang.Texts[46]); + MessageBox.Show(Lang.Texts[46]); break; case 2: @@ -53,7 +53,7 @@ public partial class FormGiftCode: Form { break; case 3: - MessageBox.Show(Lang.Texts[46]); + MessageBox.Show(Lang.Texts[46]); break; case 4: @@ -64,25 +64,25 @@ public partial class FormGiftCode: Form { MessageBox.Show(Lang.Texts[1495]); break; - default: + default: MessageBox.Show(Lang.Texts[46]); break; } - } else MessageBox.Show(Lang.Texts[46]); + } else MessageBox.Show(Lang.Texts[46]); break; case "O": - MessageBox.Show(Lang.Texts[1492]); + MessageBox.Show(Lang.Texts[1492]); giftData=raw[1]; DropGift=true; break; default: - MessageBox.Show(Lang.Texts[46]); + MessageBox.Show(Lang.Texts[46]); break; } } else { - MessageBox.Show(Lang.Texts[46]); + MessageBox.Show(Lang.Texts[46]); } } diff --git a/rabcrClient/WindowsAndStates/Splash/FormGiftCode.resx b/rabcrClient/WindowsAndStates/Splash/FormGiftCode.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormGiftCode.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormGiftCode.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs index 9896e00..f1549db 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs @@ -1,218 +1,218 @@ -//namespace rabcrClient { -// partial class FormLogin { -// /// -// /// Required designer variable. -// /// -// private System.ComponentModel.IContainer components = null; +namespace rabcrClient { + partial class FormLogin { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; -// /// -// /// Clean up any resources being used. -// /// -// /// true if managed resources should be disposed; otherwise, false. -// protected override void Dispose(bool disposing) { -// if (disposing&&(components!=null)) { -// components.Dispose(); -// } -// base.Dispose(disposing); -// } + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } -// #region Windows Form Designer generated code + #region Windows Form Designer generated code -// /// -// /// Required method for Designer support - do not modify -// /// the contents of this method with the code editor. -// /// -// private void InitializeComponent() { -// System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormLogin)); -// this.panel1 = new System.Windows.Forms.Panel(); -// this.textPanel1 = new GTextPanel(); -// this.panel2 = new System.Windows.Forms.Panel(); -// this.geDoPanel1 = new rabcrClient.GeDoPanel(); -// this.textPanel4 = new GTextPanel(); -// this.customButton2 = new GButton(); -// this.customButton1 = new GButton(); -// this.textPanel3 = new GTextPanel(); -// this.textPanel2 = new GTextPanel(); -// this.xTextbox2 = new GTextBox(); -// this.xTextbox1 = new GTextBox(); -// this.panel1.SuspendLayout(); -// this.SuspendLayout(); -// // -// // panel1 -// // -// this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); -// this.panel1.Controls.Add(this.textPanel1); -// this.panel1.Dock = System.Windows.Forms.DockStyle.Top; -// this.panel1.Location = new System.Drawing.Point(0, 0); -// this.panel1.Name = "panel1"; -// this.panel1.Size = new System.Drawing.Size(426, 34); -// this.panel1.TabIndex = 0; -// // -// // textPanel1 -// // -// this.textPanel1.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.textPanel1.BackColor = System.Drawing.Color.Transparent; -// this.textPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); -// this.textPanel1.Location = new System.Drawing.Point(157, 7); -// this.textPanel1.Name = "textPanel1"; -// this.textPanel1.Size = new System.Drawing.Size(90, 23); -// this.textPanel1.SmallFont = false; -// this.textPanel1.TabIndex = 0; -// this.textPanel1.TabStop = false; -// this.textPanel1.Text = "Přihlášení"; -// // -// // panel2 -// // -// this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) -// | System.Windows.Forms.AnchorStyles.Right))); -// this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); -// this.panel2.Location = new System.Drawing.Point(0, 260); -// this.panel2.Name = "panel2"; -// this.panel2.Size = new System.Drawing.Size(426, 2); -// this.panel2.TabIndex = 5; -// this.panel2.Visible = false; -// // -// // geDoPanel1 -// // -// this.geDoPanel1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; -// this.geDoPanel1.Location = new System.Drawing.Point(38, 268); -// this.geDoPanel1.Name = "geDoPanel1"; -// this.geDoPanel1.Size = new System.Drawing.Size(351, 100); -// this.geDoPanel1.TabIndex = 7; -// this.geDoPanel1.TabStop = false; -// this.geDoPanel1.Text = "geDoPanel1"; -// this.geDoPanel1.Visible = false; -// // -// // textPanel4 -// // -// this.textPanel4.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.textPanel4.BackColor = System.Drawing.Color.Transparent; -// this.textPanel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); -// this.textPanel4.Location = new System.Drawing.Point(157, 161); -// this.textPanel4.Name = "textPanel4"; -// this.textPanel4.Size = new System.Drawing.Size(127, 23); -// this.textPanel4.SmallFont = false; -// this.textPanel4.TabIndex = 0; -// this.textPanel4.TabStop = false; -// this.textPanel4.Text = "Přihlašování..."; -// this.textPanel4.Visible = false; -// // -// // customButton2 -// // -// this.customButton2.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.customButton2.BackColor = System.Drawing.Color.Transparent; -// this.customButton2.Disamble = false; -// this.customButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); -// this.customButton2.Location = new System.Drawing.Point(144, 246); -// this.customButton2.Name = "customButton2"; -// this.customButton2.SetOrientation = GButton.Orientation.Right; -// this.customButton2.Size = new System.Drawing.Size(87, 36); -// this.customButton2.TabIndex = 2; -// this.customButton2.Text = "Zrušit"; -// this.customButton2.Click += new System.EventHandler(this.GButton2_Click); -// // -// // customButton1 -// // -// this.customButton1.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.customButton1.BackColor = System.Drawing.Color.Transparent; -// this.customButton1.Disamble = false; -// this.customButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); -// this.customButton1.Location = new System.Drawing.Point(237, 246); -// this.customButton1.Name = "customButton1"; -// this.customButton1.SetOrientation = GButton.Orientation.Left; -// this.customButton1.Size = new System.Drawing.Size(145, 36); -// this.customButton1.TabIndex = 3; -// this.customButton1.Text = "Přihlásit se"; -// this.customButton1.Click += new System.EventHandler(this.GButton1_Click); -// // -// // textPanel3 -// // -// this.textPanel3.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.textPanel3.BackColor = System.Drawing.Color.Transparent; -// this.textPanel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); -// this.textPanel3.Location = new System.Drawing.Point(38, 165); -// this.textPanel3.Name = "textPanel3"; -// this.textPanel3.Size = new System.Drawing.Size(55, 23); -// this.textPanel3.SmallFont = false; -// this.textPanel3.TabIndex = 0; -// this.textPanel3.TabStop = false; -// this.textPanel3.Text = "Heslo"; -// // -// // textPanel2 -// // -// this.textPanel2.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.textPanel2.BackColor = System.Drawing.Color.Transparent; -// this.textPanel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); -// this.textPanel2.Location = new System.Drawing.Point(38, 88); -// this.textPanel2.Name = "textPanel2"; -// this.textPanel2.Size = new System.Drawing.Size(90, 23); -// this.textPanel2.SmallFont = false; -// this.textPanel2.TabIndex = 0; -// this.textPanel2.TabStop = false; -// this.textPanel2.Text = "Přezdívka"; -// // -// // xTextbox2 -// // -// this.xTextbox2.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.xTextbox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); -// this.xTextbox2.Location = new System.Drawing.Point(38, 195); -// this.xTextbox2.Name = "xTextbox2"; -// this.xTextbox2.PlaceHolder = "********"; -// this.xTextbox2.Size = new System.Drawing.Size(351, 29); -// this.xTextbox2.StateSelect = GBounds.StateSelect.Between; -// this.xTextbox2.TabIndex = 1; -// this.xTextbox2.TextInTextBox = ""; -// // -// // xTextbox1 -// // -// this.xTextbox1.Anchor = System.Windows.Forms.AnchorStyles.Top; -// this.xTextbox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); -// this.xTextbox1.Location = new System.Drawing.Point(38, 122); -// this.xTextbox1.Name = "xTextbox1"; -// this.xTextbox1.PlaceHolder = "Mimonitko8"; -// this.xTextbox1.Size = new System.Drawing.Size(351, 29); -// this.xTextbox1.StateSelect = GBounds.StateSelect.Between; -// this.xTextbox1.TabIndex = 0; -// this.xTextbox1.TextInTextBox = ""; -// // -// // FormLogin -// // -// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); -// this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; -// this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); -// this.ClientSize = new System.Drawing.Size(426, 376); -// this.Controls.Add(this.textPanel4); -// this.Controls.Add(this.customButton2); -// this.Controls.Add(this.customButton1); -// this.Controls.Add(this.textPanel3); -// this.Controls.Add(this.textPanel2); -// this.Controls.Add(this.xTextbox2); -// this.Controls.Add(this.xTextbox1); -// this.Controls.Add(this.panel1); -// this.Controls.Add(this.geDoPanel1); -// this.Controls.Add(this.panel2); -// this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); -// this.MinimumSize = new System.Drawing.Size(375, 415); -// this.Name = "FormLogin"; -// this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; -// this.Text = "Přihlášení"; -// this.panel1.ResumeLayout(false); -// this.ResumeLayout(false); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormLogin)); + this.panel1 = new System.Windows.Forms.Panel(); + this.textPanel1 = new GTextPanel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.geDoPanel1 = new rabcrClient.GeDoPanel(); + this.textPanel4 = new GTextPanel(); + this.customButton2 = new GButton(); + this.customButton1 = new GButton(); + this.textPanel3 = new GTextPanel(); + this.textPanel2 = new GTextPanel(); + this.xTextbox2 = new GTextBox(); + this.xTextbox1 = new GTextBox(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.panel1.Controls.Add(this.textPanel1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(426, 34); + this.panel1.TabIndex = 0; + // + // textPanel1 + // + this.textPanel1.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.textPanel1.BackColor = System.Drawing.Color.Transparent; + this.textPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); + this.textPanel1.Location = new System.Drawing.Point(157, 7); + this.textPanel1.Name = "textPanel1"; + this.textPanel1.Size = new System.Drawing.Size(90, 23); + this.textPanel1.SmallFont = false; + this.textPanel1.TabIndex = 0; + this.textPanel1.TabStop = false; + this.textPanel1.Text = "Přihlášení"; + // + // panel2 + // + this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.panel2.Location = new System.Drawing.Point(0, 260); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(426, 2); + this.panel2.TabIndex = 5; + this.panel2.Visible = false; + // + // geDoPanel1 + // + this.geDoPanel1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.geDoPanel1.Location = new System.Drawing.Point(38, 268); + this.geDoPanel1.Name = "geDoPanel1"; + this.geDoPanel1.Size = new System.Drawing.Size(351, 100); + this.geDoPanel1.TabIndex = 7; + this.geDoPanel1.TabStop = false; + this.geDoPanel1.Text = "geDoPanel1"; + this.geDoPanel1.Visible = false; + // + // textPanel4 + // + this.textPanel4.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.textPanel4.BackColor = System.Drawing.Color.Transparent; + this.textPanel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); + this.textPanel4.Location = new System.Drawing.Point(157, 161); + this.textPanel4.Name = "textPanel4"; + this.textPanel4.Size = new System.Drawing.Size(127, 23); + this.textPanel4.SmallFont = false; + this.textPanel4.TabIndex = 0; + this.textPanel4.TabStop = false; + this.textPanel4.Text = "Přihlašování..."; + this.textPanel4.Visible = false; + // + // customButton2 + // + this.customButton2.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.customButton2.BackColor = System.Drawing.Color.Transparent; + this.customButton2.Disamble = false; + this.customButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.customButton2.Location = new System.Drawing.Point(144, 246); + this.customButton2.Name = "customButton2"; + this.customButton2.SetOrientation = GButton.Orientation.Right; + this.customButton2.Size = new System.Drawing.Size(87, 36); + this.customButton2.TabIndex = 2; + this.customButton2.Text = "Zrušit"; + this.customButton2.Click += new System.EventHandler(this.GButton2_Click); + // + // customButton1 + // + this.customButton1.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.customButton1.BackColor = System.Drawing.Color.Transparent; + this.customButton1.Disamble = false; + this.customButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.customButton1.Location = new System.Drawing.Point(237, 246); + this.customButton1.Name = "customButton1"; + this.customButton1.SetOrientation = GButton.Orientation.Left; + this.customButton1.Size = new System.Drawing.Size(145, 36); + this.customButton1.TabIndex = 3; + this.customButton1.Text = "Přihlásit se"; + this.customButton1.Click += new System.EventHandler(this.GButton1_Click); + // + // textPanel3 + // + this.textPanel3.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.textPanel3.BackColor = System.Drawing.Color.Transparent; + this.textPanel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); + this.textPanel3.Location = new System.Drawing.Point(38, 165); + this.textPanel3.Name = "textPanel3"; + this.textPanel3.Size = new System.Drawing.Size(55, 23); + this.textPanel3.SmallFont = false; + this.textPanel3.TabIndex = 0; + this.textPanel3.TabStop = false; + this.textPanel3.Text = "Heslo"; + // + // textPanel2 + // + this.textPanel2.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.textPanel2.BackColor = System.Drawing.Color.Transparent; + this.textPanel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); + this.textPanel2.Location = new System.Drawing.Point(38, 88); + this.textPanel2.Name = "textPanel2"; + this.textPanel2.Size = new System.Drawing.Size(90, 23); + this.textPanel2.SmallFont = false; + this.textPanel2.TabIndex = 0; + this.textPanel2.TabStop = false; + this.textPanel2.Text = "Přezdívka"; + // + // xTextbox2 + // + this.xTextbox2.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.xTextbox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.xTextbox2.Location = new System.Drawing.Point(38, 195); + this.xTextbox2.Name = "xTextbox2"; + this.xTextbox2.PlaceHolder = "********"; + this.xTextbox2.Size = new System.Drawing.Size(351, 29); + this.xTextbox2.StateSelect = GBounds.StateSelect.Between; + this.xTextbox2.TabIndex = 1; + this.xTextbox2.TextInTextBox = ""; + // + // xTextbox1 + // + this.xTextbox1.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.xTextbox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.xTextbox1.Location = new System.Drawing.Point(38, 122); + this.xTextbox1.Name = "xTextbox1"; + this.xTextbox1.PlaceHolder = "Mimonitko8"; + this.xTextbox1.Size = new System.Drawing.Size(351, 29); + this.xTextbox1.StateSelect = GBounds.StateSelect.Between; + this.xTextbox1.TabIndex = 0; + this.xTextbox1.TextInTextBox = ""; + // + // FormLogin + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); + this.ClientSize = new System.Drawing.Size(426, 376); + this.Controls.Add(this.textPanel4); + this.Controls.Add(this.customButton2); + this.Controls.Add(this.customButton1); + this.Controls.Add(this.textPanel3); + this.Controls.Add(this.textPanel2); + this.Controls.Add(this.xTextbox2); + this.Controls.Add(this.xTextbox1); + this.Controls.Add(this.panel1); + this.Controls.Add(this.geDoPanel1); + this.Controls.Add(this.panel2); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MinimumSize = new System.Drawing.Size(375, 415); + this.Name = "FormLogin"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Přihlášení"; + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); -// } + } -// #endregion + #endregion -// private GTextPanel textPanel1; -// private System.Windows.Forms.Panel panel1; -// public GTextBox xTextbox1; -// public GTextBox xTextbox2; -// private GTextPanel textPanel2; -// private GTextPanel textPanel3; -// private GButton customButton1; -// private GButton customButton2; -// private System.Windows.Forms.Panel panel2; -// private GTextPanel textPanel4; -// public GeDoPanel geDoPanel1; -// } -//} \ No newline at end of file + private GTextPanel textPanel1; + private System.Windows.Forms.Panel panel1; + public GTextBox xTextbox1; + public GTextBox xTextbox2; + private GTextPanel textPanel2; + private GTextPanel textPanel3; + private GButton customButton1; + private GButton customButton2; + private System.Windows.Forms.Panel panel2; + private GTextPanel textPanel4; + public GeDoPanel geDoPanel1; + } +} \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/Splash/FormLogin.cs b/rabcrClient/WindowsAndStates/Splash/FormLogin.cs index 1b8732e..f885e36 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormLogin.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormLogin.cs @@ -1,213 +1,213 @@ -//using System; -//using System.Diagnostics; -//using System.IO; -//using System.Net; -//using System.Text; -//using System.Windows.Forms; - -//namespace rabcrClient { -// public partial class FormLogin: Form { - -// // bool offline=false; -// public bool OK=false; -// public string getdata; -// //MyWebClient wc; - -// public FormLogin() { -// InitializeComponent(); - -// xTextbox2.textBox.PasswordChar='*'; -// customButton1.Text=Lang.Texts[12]; -// customButton2.Text=Lang.Texts[57]; -// textPanel3.Text=Lang.Texts[65]; -// textPanel2.Text=Lang.Texts[64]; -// geDoPanel1.BackColor=BackColor; -// Text=textPanel1.Text=Lang.Texts[215]; -// textPanel4.Text=Lang.Texts[30]; -// textPanel1.Resize+=TextPanel1_Resize; - -// //SwitchToOnline(null,new EventArgs()); - - -// } - -// private void TextPanel1_Resize(object sender, EventArgs e) { -// textPanel1.Location=new System.Drawing.Point(Width/2-textPanel1.Width/2,textPanel1.Location.Y); -// } - -// void SwitchToOffline(object sender, EventArgs e) { -// xTextbox2.Visible=false; -// textPanel3.Visible=false; - -// // offline=true; -// ///geDoPanel1.ClearEvents(); -// //GeDoEvent ev=new GeDoEvent(){ID="#E1"}; - -// //ev.Event+=SwitchToOnline; -// //geDoPanel1.AddEvent(ev); -// //geDoPanel1.Load( -// // ""+Lang.Texts[214]+" "+Environment.NewLine+ -// // Lang.Texts[66]+" "+Lang.Texts[213]+" "+Environment.NewLine+ -// // Lang.Texts[69]+" "+Lang.Texts[70]+"" -// //); -// } - -// //void SwitchToOnline(object sender, EventArgs e) { -// // xTextbox2.Visible=true; -// // textPanel3.Visible=true; -// // offline=false; -// // // geDoPanel1.ClearEvents(); -// // // GeDoEvent ev=new GeDoEvent(){ID="#E1"}; - -// // // ev.Event+=SwitchToOffline; -// // // geDoPanel1.AddEvent(ev); -// // //geDoPanel1.Load( -// // // ""+Lang.Texts[67]+" "+Environment.NewLine+ -// // // Lang.Texts[66]+" "+Lang.Texts[213]+" "+Environment.NewLine+ -// // // Lang.Texts[69]+" "+Lang.Texts[70]+"" -// // //); -// //} - -// void GButton2_Click(object sender, EventArgs e) { -// Close(); -// } - -// void GButton1_Click(object sender, EventArgs e) { -// if (xTextbox1.textBox.Text.Length<=2){ -// MessageBox.Show(Lang.Texts[232].Replace("%nick%",xTextbox1.textBox.Text)); -// return; -// } -// // if (offline){ -// if (xTextbox1.textBox.Text.ToLower()!="geftgames" && xTextbox1.textBox.Text.ToLower()!="geft" && xTextbox1.textBox.Text.ToLower()!="player"){ -// Setting.Name=xTextbox1.textBox.Text; -// Global.Logged=true; -// //Global.OnlineAccount=false; -// File.WriteAllText(Path.GetTempPath()+"\\rabcrLastPassword.txt",Setting.Name); -// OK=true; -// Close(); -// } else { -// MessageBox.Show(Lang.Texts[232].Replace("%nick%",xTextbox1.textBox.Text)); -// } -// //} else { -// // string name=xTextbox1.textBox.Text; -// // //Global.Pass=CreateMD5(xTextbox2.textBox.Text); -// // //string url="https://geftgames.ga/System/rabcr/getdata.php?username="+name+"&password="+Global.Pass; -// // //wc=new MyWebClient { -// // // Encoding=Encoding.UTF8 -// // //}; -// // //wc.DownloadStringCompleted+=Wc_DownloadStringCompleted; -// // //wc.DownloadStringAsync(new Uri(url)); -// // textPanel4.Visible=true; -// // textPanel2.Visible=false; -// // xTextbox1.Visible=false; -// // xTextbox2.Visible=false; -// // textPanel3.Visible=false; -// // customButton1.Visible=false; -// // customButton2.Visible=false; -// //} -// } - -// //void ShowLogin(){ -// // textPanel4.Visible=false; -// // textPanel2.Visible=true; -// // xTextbox1.Visible=true; -// // xTextbox2.Visible=true; -// // textPanel3.Visible=true; -// // customButton1.Visible=true; -// // customButton2.Visible=true; -// //} - -// //void Wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { -// // if (e.Error==null) { -// // string get=e.Result; -// // Console.WriteLine("GET: "+get); -// // if (string.IsNullOrEmpty(get)) { -// // MessageBox.Show(Lang.Texts[233]); -// // Close(); - -// // } else { -// // string[]g=get.Split('|'); - -// // if (g.Length>1){ -// // switch (g[0]) { -// // case "E": -// // MessageBox.Show("ERROR, "+g[1]); -// // ShowLogin(); -// // return; - -// // case "I": -// // OK=true; -// // getdata=null; -// // Setting.Name=xTextbox1.textBox.Text; -// // if (Environment.GetCommandLineArgs().Length>=3){ -// // Setting.Path=Environment.GetCommandLineArgs()[2]+"\\"+Setting.Name+"\\"; -// // } else { -// // Setting.Path=new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\"+Setting.Name+"\\"; -// // } -// // // Global.OnlineAccount=true; -// // Global.Logged=true; -// // File.WriteAllText(Path.GetTempPath()+"\\rabcrLastPassword.txt",Setting.Name+"\r\n"+Global.Pass); -// // Close(); -// // return; - -// // case "O": -// // getdata=g[1]; -// // OK=true; -// // Global.OnlineAccount=true; -// // Global.Logged=true; -// // Setting.Name=xTextbox1.textBox.Text; -// // if (Environment.GetCommandLineArgs().Length>=3){ -// // Setting.Path=Environment.GetCommandLineArgs()[2]+"\\"+Setting.Name+"\\"; -// // } else { -// // Setting.Path=new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\"+Setting.Name+"\\"; -// // } -// // File.WriteAllText(Path.GetTempPath()+"\\rabcrLastPassword.txt",Setting.Name+"\r\n"+Global.Pass); -// // Close(); -// // return; - -// // default: -// // MessageBox.Show(Lang.Texts[233]+"\r\n\r\n"+Lang.Texts[234]+"\r\n"+Lang.Texts[235]); -// // ShowLogin(); -// // return; -// // } -// // } else { -// // MessageBox.Show(Lang.Texts[233]); -// // ShowLogin(); -// // return; -// // } -// // } -// // } else { -// // MessageBox.Show(Lang.Texts[233]+"\r\n\r\n"+Lang.Texts[234]+"\r\n"+e.Error.Message); -// // ShowLogin(); -// // return; -// // } -// //} - -// //public static string CreateMD5(string input) { -// // using (System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create()) { -// // byte[] inputBytes = Encoding.ASCII.GetBytes(input); -// // byte[] hashBytes = md5.ComputeHash(inputBytes); - -// // StringBuilder sb = new StringBuilder(); -// // for (int i = 0; i < hashBytes.Length; i++) sb.Append(hashBytes[i].ToString("X2")); -// // return sb.ToString(); -// // } -// //} - -// // void LinkLabel1_LinkClicked(object sender, EventArgs e) => Process.Start("https://geftgames.ga/Account/register.php"); - -// // void Link2_Click(object sender, EventArgs e) => Process.Start("https://geftgames.ga/"); - -// //void Flush(){ -// // xTextbox1.Dis -// //} -// } - -// //class MyWebClient : WebClient{ -// // protected override WebRequest GetWebRequest(Uri uri) { -// // WebRequest w = base.GetWebRequest(uri); -// // w.Timeout = 5000; -// // return w; -// // } -// //} -//} +using System; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Text; +using System.Windows.Forms; + +namespace rabcrClient { + public partial class FormLogin : Form { + + // bool offline=false; + public bool OK = false; + public string getdata; + //MyWebClient wc; + + public FormLogin() { + InitializeComponent(); + + xTextbox2.textBox.PasswordChar = '*'; + customButton1.Text = Lang.Texts[12]; + customButton2.Text = Lang.Texts[57]; + textPanel3.Text = Lang.Texts[65]; + textPanel2.Text = Lang.Texts[64]; + geDoPanel1.BackColor = BackColor; + Text = textPanel1.Text = Lang.Texts[215]; + textPanel4.Text = Lang.Texts[30]; + textPanel1.Resize += TextPanel1_Resize; + + //SwitchToOnline(null,new EventArgs()); + + + } + + private void TextPanel1_Resize(object sender, EventArgs e) { + textPanel1.Location = new System.Drawing.Point(Width / 2 - textPanel1.Width / 2, textPanel1.Location.Y); + } + + void SwitchToOffline(object sender, EventArgs e) { + xTextbox2.Visible = false; + textPanel3.Visible = false; + + // offline=true; + ///geDoPanel1.ClearEvents(); + //GeDoEvent ev=new GeDoEvent(){ID="#E1"}; + + //ev.Event+=SwitchToOnline; + //geDoPanel1.AddEvent(ev); + //geDoPanel1.Load( + // ""+Lang.Texts[214]+" "+Environment.NewLine+ + // Lang.Texts[66]+" "+Lang.Texts[213]+" "+Environment.NewLine+ + // Lang.Texts[69]+" "+Lang.Texts[70]+"" + //); + } + + //void SwitchToOnline(object sender, EventArgs e) { + // xTextbox2.Visible=true; + // textPanel3.Visible=true; + // offline=false; + // // geDoPanel1.ClearEvents(); + // // GeDoEvent ev=new GeDoEvent(){ID="#E1"}; + + // // ev.Event+=SwitchToOffline; + // // geDoPanel1.AddEvent(ev); + // //geDoPanel1.Load( + // // ""+Lang.Texts[67]+" "+Environment.NewLine+ + // // Lang.Texts[66]+" "+Lang.Texts[213]+" "+Environment.NewLine+ + // // Lang.Texts[69]+" "+Lang.Texts[70]+"" + // //); + //} + + void GButton2_Click(object sender, EventArgs e) { + Close(); + } + + void GButton1_Click(object sender, EventArgs e) { + if (xTextbox1.textBox.Text.Length <= 2) { + MessageBox.Show(Lang.Texts[232].Replace("%nick%", xTextbox1.textBox.Text)); + return; + } + // if (offline){ + if (xTextbox1.textBox.Text.ToLower() != "geftgames" && xTextbox1.textBox.Text.ToLower() != "geft" && xTextbox1.textBox.Text.ToLower() != "player") { + Setting.Name = xTextbox1.textBox.Text; + Global.Logged = true; + //Global.OnlineAccount=false; + File.WriteAllText(Path.GetTempPath() + "\\rabcrLastPassword.txt", Setting.Name); + OK = true; + Close(); + } else { + MessageBox.Show(Lang.Texts[232].Replace("%nick%", xTextbox1.textBox.Text)); + } + //} else { + // string name=xTextbox1.textBox.Text; + // //Global.Pass=CreateMD5(xTextbox2.textBox.Text); + // //string url="https://geftgames.ga/System/rabcr/getdata.php?username="+name+"&password="+Global.Pass; + // //wc=new MyWebClient { + // // Encoding=Encoding.UTF8 + // //}; + // //wc.DownloadStringCompleted+=Wc_DownloadStringCompleted; + // //wc.DownloadStringAsync(new Uri(url)); + // textPanel4.Visible=true; + // textPanel2.Visible=false; + // xTextbox1.Visible=false; + // xTextbox2.Visible=false; + // textPanel3.Visible=false; + // customButton1.Visible=false; + // customButton2.Visible=false; + //} + } + + //void ShowLogin(){ + // textPanel4.Visible=false; + // textPanel2.Visible=true; + // xTextbox1.Visible=true; + // xTextbox2.Visible=true; + // textPanel3.Visible=true; + // customButton1.Visible=true; + // customButton2.Visible=true; + //} + + //void Wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { + // if (e.Error==null) { + // string get=e.Result; + // Console.WriteLine("GET: "+get); + // if (string.IsNullOrEmpty(get)) { + // MessageBox.Show(Lang.Texts[233]); + // Close(); + + // } else { + // string[]g=get.Split('|'); + + // if (g.Length>1){ + // switch (g[0]) { + // case "E": + // MessageBox.Show("ERROR, "+g[1]); + // ShowLogin(); + // return; + + // case "I": + // OK=true; + // getdata=null; + // Setting.Name=xTextbox1.textBox.Text; + // if (Environment.GetCommandLineArgs().Length>=3){ + // Setting.Path=Environment.GetCommandLineArgs()[2]+"\\"+Setting.Name+"\\"; + // } else { + // Setting.Path=new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\"+Setting.Name+"\\"; + // } + // // Global.OnlineAccount=true; + // Global.Logged=true; + // File.WriteAllText(Path.GetTempPath()+"\\rabcrLastPassword.txt",Setting.Name+"\r\n"+Global.Pass); + // Close(); + // return; + + // case "O": + // getdata=g[1]; + // OK=true; + // Global.OnlineAccount=true; + // Global.Logged=true; + // Setting.Name=xTextbox1.textBox.Text; + // if (Environment.GetCommandLineArgs().Length>=3){ + // Setting.Path=Environment.GetCommandLineArgs()[2]+"\\"+Setting.Name+"\\"; + // } else { + // Setting.Path=new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\"+Setting.Name+"\\"; + // } + // File.WriteAllText(Path.GetTempPath()+"\\rabcrLastPassword.txt",Setting.Name+"\r\n"+Global.Pass); + // Close(); + // return; + + // default: + // MessageBox.Show(Lang.Texts[233]+"\r\n\r\n"+Lang.Texts[234]+"\r\n"+Lang.Texts[235]); + // ShowLogin(); + // return; + // } + // } else { + // MessageBox.Show(Lang.Texts[233]); + // ShowLogin(); + // return; + // } + // } + // } else { + // MessageBox.Show(Lang.Texts[233]+"\r\n\r\n"+Lang.Texts[234]+"\r\n"+e.Error.Message); + // ShowLogin(); + // return; + // } + //} + + //public static string CreateMD5(string input) { + // using (System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create()) { + // byte[] inputBytes = Encoding.ASCII.GetBytes(input); + // byte[] hashBytes = md5.ComputeHash(inputBytes); + + // StringBuilder sb = new StringBuilder(); + // for (int i = 0; i < hashBytes.Length; i++) sb.Append(hashBytes[i].ToString("X2")); + // return sb.ToString(); + // } + //} + + // void LinkLabel1_LinkClicked(object sender, EventArgs e) => Process.Start("https://geftgames.ga/Account/register.php"); + + // void Link2_Click(object sender, EventArgs e) => Process.Start("https://geftgames.ga/"); + + //void Flush(){ + // xTextbox1.Dis + //} + } + + //class MyWebClient : WebClient{ + // protected override WebRequest GetWebRequest(Uri uri) { + // WebRequest w = base.GetWebRequest(uri); + // w.Timeout = 5000; + // return w; + // } + //} +} diff --git a/rabcrClient/WindowsAndStates/Splash/FormLogin.resx b/rabcrClient/WindowsAndStates/Splash/FormLogin.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormLogin.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormLogin.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.Designer.cs index 4cdd8f8..8f0f5ad 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.Designer.cs @@ -24,15 +24,15 @@ partial class FormTest18Plus { /// private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormTest18Plus)); - this.gTextPanel1 = new GTextPanel(); - this.gTextBox1 = new GTextBox(); - this.gButton1 = new GButton(); - this.geDoPanel1 = new GeDoPanel(); - this.geDoPanel2 = new GeDoPanel(); - this.gTextBox2 = new GTextBox(); - this.gTextBox3 = new GTextBox(); - this.geDoPanel3 = new GeDoPanel(); - this.gButton2 = new GButton(); + this.gTextPanel1 = new rabcrClient.GTextPanel(); + this.gTextBox1 = new rabcrClient.GTextBox(); + this.gButton1 = new rabcrClient.GButton(); + this.geDoPanel1 = new rabcrClient.GeDoPanel(); + this.geDoPanel2 = new rabcrClient.GeDoPanel(); + this.gTextBox2 = new rabcrClient.GTextBox(); + this.gTextBox3 = new rabcrClient.GTextBox(); + this.geDoPanel3 = new rabcrClient.GeDoPanel(); + this.gButton2 = new rabcrClient.GButton(); this.SuspendLayout(); // // gTextPanel1 @@ -41,7 +41,6 @@ partial class FormTest18Plus { this.gTextPanel1.Location = new System.Drawing.Point(12, 12); this.gTextPanel1.Name = "gTextPanel1"; this.gTextPanel1.Size = new System.Drawing.Size(135, 23); - this.gTextPanel1.SmallFont = false; this.gTextPanel1.TabIndex = 0; this.gTextPanel1.TabStop = false; this.gTextPanel1.Text = "Test plnoletosti"; @@ -51,9 +50,8 @@ partial class FormTest18Plus { this.gTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.gTextBox1.Location = new System.Drawing.Point(30, 84); this.gTextBox1.Name = "gTextBox1"; - this.gTextBox1.PlaceHolder = null; this.gTextBox1.Size = new System.Drawing.Size(231, 29); - this.gTextBox1.StateSelect = GBounds.StateSelect.Between; + this.gTextBox1.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.gTextBox1.TabIndex = 1; this.gTextBox1.TextInTextBox = ""; // @@ -64,7 +62,7 @@ partial class FormTest18Plus { this.gButton1.Disamble = false; this.gButton1.Location = new System.Drawing.Point(332, 334); this.gButton1.Name = "gButton1"; - this.gButton1.SetOrientation = GButton.Orientation.Left; + this.gButton1.SetOrientation = rabcrClient.GButton.Orientation.Left; this.gButton1.Size = new System.Drawing.Size(193, 36); this.gButton1.TabIndex = 2; this.gButton1.Text = "OK"; @@ -98,9 +96,8 @@ partial class FormTest18Plus { this.gTextBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.gTextBox2.Location = new System.Drawing.Point(30, 176); this.gTextBox2.Name = "gTextBox2"; - this.gTextBox2.PlaceHolder = null; this.gTextBox2.Size = new System.Drawing.Size(231, 29); - this.gTextBox2.StateSelect = GBounds.StateSelect.Between; + this.gTextBox2.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.gTextBox2.TabIndex = 4; this.gTextBox2.TextInTextBox = ""; // @@ -109,9 +106,8 @@ partial class FormTest18Plus { this.gTextBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.gTextBox3.Location = new System.Drawing.Point(30, 280); this.gTextBox3.Name = "gTextBox3"; - this.gTextBox3.PlaceHolder = null; this.gTextBox3.Size = new System.Drawing.Size(231, 29); - this.gTextBox3.StateSelect = GBounds.StateSelect.Between; + this.gTextBox3.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.gTextBox3.TabIndex = 4; this.gTextBox3.TextInTextBox = ""; // @@ -133,7 +129,7 @@ partial class FormTest18Plus { this.gButton2.Disamble = false; this.gButton2.Location = new System.Drawing.Point(133, 334); this.gButton2.Name = "gButton2"; - this.gButton2.SetOrientation = GButton.Orientation.Right; + this.gButton2.SetOrientation = rabcrClient.GButton.Orientation.Right; this.gButton2.Size = new System.Drawing.Size(193, 36); this.gButton2.TabIndex = 6; this.gButton2.Text = "Zrušit"; @@ -143,6 +139,7 @@ partial class FormTest18Plus { // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); this.ClientSize = new System.Drawing.Size(656, 381); this.Controls.Add(this.gButton2); this.Controls.Add(this.geDoPanel3); diff --git a/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.cs b/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.cs index 39c88c5..ff923a2 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormTest18Plus.cs @@ -12,10 +12,10 @@ public partial class FormTest18Plus: Form { void Generate(){ - NumOne=(Rabcr.random.Int(5)+3); + NumOne=(FastRandom.Int(5)+3); - time=Rabcr.random.Int(3)+2; - // int time2=Rabcr.random.Next(3)+2; + time=FastRandom.Int(3)+2; + // int time2=FastRandom.Next(3)+2; //length=time*10; //=length/rRnd; gTextPanel1.Text=Text=Lang.Texts[283]; @@ -23,7 +23,7 @@ public partial class FormTest18Plus: Form { gButton2.Text=Lang.Texts[57]; //speed=(length*time2)/time; - int m=Rabcr.random.Int(3)+1; + int m=FastRandom.Int(3)+1; geDoPanel1.Load(Lang.Texts[281].Replace("%num%",(NumOne*2).ToString())); @@ -32,7 +32,7 @@ public partial class FormTest18Plus: Form { geDoPanel3.Load(Lang.Texts[291].Replace("%speed%",(10*m).ToString()).Replace("%length%",(time*10*m).ToString())); string num2(){ - switch (Rabcr.random.Int(6)){ + switch (FastRandom.Int(6)){ default: NumTwo=Lang.Texts[284]; return "H2O"; @@ -60,7 +60,7 @@ public partial class FormTest18Plus: Form { } //string num3(){ - // switch (Rabcr.random.Next(6)){ + // switch (FastRandom.Next(6)){ // default: // NumThree="služba"; // return "service"; diff --git a/rabcrClient/WindowsAndStates/Splash/FormTextInput.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormTextInput.Designer.cs index 2ddf78f..11ab23a 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormTextInput.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormTextInput.Designer.cs @@ -24,111 +24,112 @@ partial class FormTextInput { /// private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormTextInput)); - this.gButton1 = new GButton(); - this.gTextPanel1 = new GTextPanel(); - this.gTextBox1 = new GTextBox(); - this.gButton2 = new GButton(); + this.gButton1 = new rabcrClient.GButton(); + this.gTextPanel1 = new rabcrClient.GTextPanel(); + this.gTextBox1 = new rabcrClient.GTextBox(); + this.gButton2 = new rabcrClient.GButton(); this.gImageButton1 = new GImageButton(); this.gImageButton2 = new GImageButton(); this.gImageButton3 = new GImageButton(); - this.gTextPanel2 = new GTextPanel(); + this.gTextPanel2 = new rabcrClient.GTextPanel(); this.SuspendLayout(); - // + // // gButton1 - // + // this.gButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.gButton1.BackColor = System.Drawing.Color.Transparent; this.gButton1.Disamble = false; this.gButton1.Location = new System.Drawing.Point(448, 122); this.gButton1.Name = "gButton1"; - this.gButton1.SetOrientation = GButton.Orientation.Left; + this.gButton1.SetOrientation = rabcrClient.GButton.Orientation.Left; this.gButton1.Size = new System.Drawing.Size(99, 36); this.gButton1.TabIndex = 0; this.gButton1.Text = "Použít"; this.gButton1.Click += new System.EventHandler(this.GButton1_Click); - // + // // gTextPanel1 - // + // this.gTextPanel1.BackColor = System.Drawing.Color.Transparent; this.gTextPanel1.Location = new System.Drawing.Point(17, 16); this.gTextPanel1.Name = "gTextPanel1"; this.gTextPanel1.Size = new System.Drawing.Size(106, 23); - this.gTextPanel1.SmallFont = false; this.gTextPanel1.TabIndex = 1; this.gTextPanel1.TabStop = false; this.gTextPanel1.Text = "Zadajte text"; - // + // // gTextBox1 - // - this.gTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.gTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.gTextBox1.Location = new System.Drawing.Point(12, 45); this.gTextBox1.Name = "gTextBox1"; - this.gTextBox1.PlaceHolder = null; this.gTextBox1.Size = new System.Drawing.Size(538, 29); - this.gTextBox1.StateSelect = GBounds.StateSelect.Between; + this.gTextBox1.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.gTextBox1.TabIndex = 2; this.gTextBox1.TextInTextBox = ""; - // + // // gButton2 - // + // this.gButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.gButton2.BackColor = System.Drawing.Color.Transparent; this.gButton2.Disamble = false; this.gButton2.Location = new System.Drawing.Point(343, 122); this.gButton2.Name = "gButton2"; - this.gButton2.SetOrientation = GButton.Orientation.Right; + this.gButton2.SetOrientation = rabcrClient.GButton.Orientation.Right; this.gButton2.Size = new System.Drawing.Size(99, 36); this.gButton2.TabIndex = 0; this.gButton2.Text = "Zrušit"; this.gButton2.Click += new System.EventHandler(this.GButton2_Click); - // + // // gImageButton1 - // + // this.gImageButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gImageButton1.Image = null; this.gImageButton1.Location = new System.Drawing.Point(27, 116); this.gImageButton1.Name = "gImageButton1"; this.gImageButton1.Size = new System.Drawing.Size(26, 26); this.gImageButton1.TabIndex = 3; this.gImageButton1.Text = "gImageButton1"; this.gImageButton1.Click += new System.EventHandler(this.Button3_Click); - // + // // gImageButton2 - // + // this.gImageButton2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gImageButton2.Image = null; this.gImageButton2.Location = new System.Drawing.Point(59, 116); this.gImageButton2.Name = "gImageButton2"; this.gImageButton2.Size = new System.Drawing.Size(26, 26); this.gImageButton2.TabIndex = 3; this.gImageButton2.Text = "gImageButton1"; this.gImageButton2.Click += new System.EventHandler(this.Button1_Click); - // + // // gImageButton3 - // + // this.gImageButton3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gImageButton3.Image = null; this.gImageButton3.Location = new System.Drawing.Point(91, 116); this.gImageButton3.Name = "gImageButton3"; this.gImageButton3.Size = new System.Drawing.Size(26, 26); this.gImageButton3.TabIndex = 3; this.gImageButton3.Text = "gImageButton1"; this.gImageButton3.Click += new System.EventHandler(this.Button2_Click); - // + // // gTextPanel2 - // + // this.gTextPanel2.BackColor = System.Drawing.Color.Transparent; this.gTextPanel2.Location = new System.Drawing.Point(27, 89); this.gTextPanel2.Name = "gTextPanel2"; this.gTextPanel2.Size = new System.Drawing.Size(54, 23); - this.gTextPanel2.SmallFont = false; this.gTextPanel2.TabIndex = 1; this.gTextPanel2.TabStop = false; this.gTextPanel2.Text = "Emoji"; - // + // // FormTextInput - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); this.ClientSize = new System.Drawing.Size(559, 166); this.Controls.Add(this.gImageButton3); this.Controls.Add(this.gImageButton2); diff --git a/rabcrClient/WindowsAndStates/Splash/FormTextInput.resx b/rabcrClient/WindowsAndStates/Splash/FormTextInput.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormTextInput.resx +++ b/rabcrClient/WindowsAndStates/Splash/FormTextInput.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/WindowsAndStates/Splash/Message.cs b/rabcrClient/WindowsAndStates/Splash/Message.cs index f1816cf..7fe17b2 100644 --- a/rabcrClient/WindowsAndStates/Splash/Message.cs +++ b/rabcrClient/WindowsAndStates/Splash/Message.cs @@ -76,7 +76,7 @@ class Message: Game { // //Log.Init(); // if (!Directory.Exists(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData")) { - // switch (System.Globalization.CultureInfo.CurrentCulture.EnglishName){ + // switch (System.Globalization.CultureInfo.CurrentCulture.EnglishName){ // default: // MessageBox.Show("Game data not found, game was probably runned from archive" // #if DEBUG @@ -115,7 +115,7 @@ class Message: Game { /* Rabcr.*/GraphicsManager.PreferredBackBufferHeight =(int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height*0.66667f); /* Rabcr.*/GraphicsManager.PreferredBackBufferWidth = (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width*0.66667f); - + try { GraphicsManager.ApplyChanges(); @@ -124,10 +124,10 @@ class Message: Game { //Lang.Load(); //SetLangUp(); - + } - + public static void SetLangUp(){ GC.Collect(); GC.WaitForPendingFinalizers(); @@ -160,7 +160,7 @@ class Message: Game { //GC.WaitForPendingFinalizers(); BitmapFont.bitmapFont18=new BitmapFont(18,Properties.Resources.FontInfo_traditionalChinese_18); break; - + case "korean": //BitmapFont.bitmapFont34=new BitmapFont(34,Properties.Resources.FontInfo_korean_34); //GC.Collect(); @@ -181,12 +181,12 @@ class Message: Game { } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); - Rabcr.random=new FastRandom(); + // Rabcr.random=new FastRandom(); Rabcr.ActiveWindow=IsActive; (Rabcr.Pixel=new Texture2D(GraphicsDevice, 1, 1)).SetData(new[] { Color.White }); Textures.ButtonCenter=GetDataTexture(@"Buttons\Menu\Center"); - + GraphicsManager.PreferredBackBufferWidth=840; gedo=new GeDo(5, 5); @@ -220,7 +220,7 @@ class Message: Game { private void ChangeH(object sender, EventArgs e) { GraphicsManager.PreferredBackBufferHeight = 50+gedo.GetHeight; GraphicsManager.PreferredBackBufferWidth = 840; - + ok.Position=new Vector2(245+100, GraphicsManager.PreferredBackBufferHeight-50); GraphicsManager.ApplyChanges(); } diff --git a/rabcrClient/WindowsAndStates/Splash/Password.Designer.cs b/rabcrClient/WindowsAndStates/Splash/Password.Designer.cs index 275c04b..9d358a3 100644 --- a/rabcrClient/WindowsAndStates/Splash/Password.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/Password.Designer.cs @@ -24,92 +24,89 @@ partial class Password { /// private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Password)); - this.textPanel2 = new GTextPanel(); - this.textPanel1 = new GTextPanel(); - this.customButton2 = new GButton(); - this.customButton1 = new GButton(); - this.xTextBoxPassword1 = new GTextBox(); - this.xTextBoxPassword2 = new GTextBox(); + this.textPanel2 = new rabcrClient.GTextPanel(); + this.textPanel1 = new rabcrClient.GTextPanel(); + this.customButton2 = new rabcrClient.GButton(); + this.customButton1 = new rabcrClient.GButton(); + this.xTextBoxPassword1 = new rabcrClient.GTextBox(); + this.xTextBoxPassword2 = new rabcrClient.GTextBox(); this.panel1 = new System.Windows.Forms.Panel(); - this.textPanel8 = new GTextPanel(); + this.textPanel8 = new rabcrClient.GTextPanel(); + this.gTextPanel1 = new rabcrClient.GTextPanel(); this.panel1.SuspendLayout(); this.SuspendLayout(); - // + // // textPanel2 - // + // this.textPanel2.BackColor = System.Drawing.Color.Transparent; this.textPanel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel2.Location = new System.Drawing.Point(43, 138); this.textPanel2.Name = "textPanel2"; this.textPanel2.Size = new System.Drawing.Size(265, 23); - this.textPanel2.SmallFont = false; this.textPanel2.TabIndex = 3; this.textPanel2.TabStop = false; this.textPanel2.Text = "Pro jistotu své heslo zopakujte"; - // + // // textPanel1 - // + // this.textPanel1.BackColor = System.Drawing.Color.Transparent; this.textPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel1.Location = new System.Drawing.Point(43, 60); this.textPanel1.Name = "textPanel1"; this.textPanel1.Size = new System.Drawing.Size(214, 23); - this.textPanel1.SmallFont = false; this.textPanel1.TabIndex = 0; this.textPanel1.TabStop = false; this.textPanel1.Text = "Zadejte vaše nové heslo"; - // + // // customButton2 - // + // this.customButton2.BackColor = System.Drawing.Color.Transparent; this.customButton2.Disamble = false; this.customButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.customButton2.ForeColor = System.Drawing.Color.Black; this.customButton2.Location = new System.Drawing.Point(123, 223); this.customButton2.Name = "customButton2"; - this.customButton2.SetOrientation = GButton.Orientation.Right; + this.customButton2.SetOrientation = rabcrClient.GButton.Orientation.Right; this.customButton2.Size = new System.Drawing.Size(146, 36); this.customButton2.TabIndex = 2; this.customButton2.Text = "Zrušit"; this.customButton2.Click += new System.EventHandler(this.GButton2_Click); - // + // // customButton1 - // + // this.customButton1.BackColor = System.Drawing.Color.Transparent; this.customButton1.Disamble = true; this.customButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.customButton1.Location = new System.Drawing.Point(275, 223); this.customButton1.Name = "customButton1"; - this.customButton1.SetOrientation = GButton.Orientation.Left; + this.customButton1.SetOrientation = rabcrClient.GButton.Orientation.Left; this.customButton1.Size = new System.Drawing.Size(146, 36); this.customButton1.TabIndex = 3; this.customButton1.Text = "Podtvrdit"; this.customButton1.Click += new System.EventHandler(this.GButton1_Click); - // + // // xTextBoxPassword1 - // + // this.xTextBoxPassword1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.xTextBoxPassword1.Location = new System.Drawing.Point(43, 89); this.xTextBoxPassword1.Name = "xTextBoxPassword1"; - this.xTextBoxPassword1.PlaceHolder = null; this.xTextBoxPassword1.Size = new System.Drawing.Size(433, 29); - this.xTextBoxPassword1.StateSelect = GBounds.StateSelect.Between; + this.xTextBoxPassword1.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.xTextBoxPassword1.TabIndex = 0; this.xTextBoxPassword1.TextInTextBox = ""; - // + // // xTextBoxPassword2 - // + // this.xTextBoxPassword2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.xTextBoxPassword2.Location = new System.Drawing.Point(43, 167); this.xTextBoxPassword2.Name = "xTextBoxPassword2"; - this.xTextBoxPassword2.PlaceHolder = null; this.xTextBoxPassword2.Size = new System.Drawing.Size(433, 29); - this.xTextBoxPassword2.StateSelect = GBounds.StateSelect.Between; + this.xTextBoxPassword2.StateSelect = rabcrClient.GBounds.StateSelect.Between; this.xTextBoxPassword2.TabIndex = 1; this.xTextBoxPassword2.TextInTextBox = ""; - // + // // panel1 - // + // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.panel1.Controls.Add(this.textPanel8); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -117,26 +114,38 @@ partial class Password { this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(529, 34); this.panel1.TabIndex = 13; - // + // // textPanel8 - // + // this.textPanel8.Anchor = System.Windows.Forms.AnchorStyles.Top; this.textPanel8.BackColor = System.Drawing.Color.Transparent; this.textPanel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); this.textPanel8.Location = new System.Drawing.Point(148, 8); this.textPanel8.Name = "textPanel8"; this.textPanel8.Size = new System.Drawing.Size(241, 23); - this.textPanel8.SmallFont = false; this.textPanel8.TabIndex = 9; this.textPanel8.TabStop = false; this.textPanel8.Text = "Server vyžaduje nové heslo"; - // + // + // gTextPanel1 + // + this.gTextPanel1.BackColor = System.Drawing.Color.Transparent; + this.gTextPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); + this.gTextPanel1.ForeColor = System.Drawing.SystemColors.AppWorkspace; + this.gTextPanel1.Location = new System.Drawing.Point(31, 202); + this.gTextPanel1.Name = "gTextPanel1"; + this.gTextPanel1.Size = new System.Drawing.Size(296, 23); + this.gTextPanel1.TabIndex = 14; + this.gTextPanel1.TabStop = false; + this.gTextPanel1.Text = "Heslo je je odlišné od přihlašování"; + // // Password - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253))))); this.ClientSize = new System.Drawing.Size(529, 269); + this.Controls.Add(this.gTextPanel1); this.Controls.Add(this.panel1); this.Controls.Add(this.xTextBoxPassword2); this.Controls.Add(this.xTextBoxPassword1); @@ -166,5 +175,6 @@ partial class Password { private GTextBox xTextBoxPassword2; private System.Windows.Forms.Panel panel1; private GTextPanel textPanel8; + private GTextPanel gTextPanel1; } } \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/Splash/Password.resx b/rabcrClient/WindowsAndStates/Splash/Password.resx index 1578760..28ba62c 100644 --- a/rabcrClient/WindowsAndStates/Splash/Password.resx +++ b/rabcrClient/WindowsAndStates/Splash/Password.resx @@ -1,17 +1,17 @@  - diff --git a/rabcrClient/app.manifest b/rabcrClient/app.manifest index 08b1105..09effd1 100644 --- a/rabcrClient/app.manifest +++ b/rabcrClient/app.manifest @@ -12,7 +12,7 @@ diff --git a/rabcrClient/packages.config b/rabcrClient/packages.config index 129698f..8c6625b 100644 --- a/rabcrClient/packages.config +++ b/rabcrClient/packages.config @@ -1,6 +1,6 @@  - + diff --git a/rabcrClient/rabcrClient.csproj b/rabcrClient/rabcrClient.csproj index dbf179b..4990876 100644 --- a/rabcrClient/rabcrClient.csproj +++ b/rabcrClient/rabcrClient.csproj @@ -18,6 +18,7 @@ + 9.0 publish\ true Disk @@ -39,12 +40,14 @@ full false Publish\ - WINDOWS + TRACE;DEBUG;WINDOWS none 4 true Off false + MinimumRecommendedRules.ruleset + false x86 @@ -69,14 +72,17 @@ Component + + + - + @@ -268,12 +274,6 @@ FormAchDetail.cs - - Form - - - FormBanCountry.cs - Form @@ -292,6 +292,12 @@ FormBadTranslation.cs + + Form + + + FormLogin.cs + Form @@ -346,6 +352,7 @@ + @@ -434,9 +441,6 @@ FormAchDetail.cs - - FormBanCountry.cs - FormAch.cs @@ -446,6 +450,9 @@ FormBadTranslation.cs + + FormLogin.cs + FormTest18Plus.cs @@ -471,14 +478,13 @@ + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAYGAAAAAAIACtRgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAABgAAAAYAgGAAAA4ph3OAAAAAFz + UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAABGQklEQVR4XtWdBVhV + 6dr+mTozc6a7HHUUg26wu3UcAzsBke7OTdgdY3dgdweICkgqIXYDKmA3ue7//a61N6CDnpnzne8781/X + dV9rbdjo2vfvee73fddeG7T+A9tb1DvUe9T71IfUR2qJY/G1dynxPLGJvUZvqyV+Xkg8T0j8W0L/oMTP + f0CJf0vonzWk+X9qk/i+eL74WSHx74h/T0jz/2j+X8151Dy3v/0mTlKcvHhh4gV/Tn1NfU/9oNY31GeU + MEIYWvMF/sF8M7Ox7w1wzv14gOpK3QFTioz7Tb7T/rfxD/r0nnh35K8T7zn1mlDs3ff3jGDvnGHRgVc7 + jhfyv9p+vP/ltlRrWUN3TghqFZzn3DLwxqhmAXl9m/td7mjlc9nMckzKL2YDDn+mre32KojXQfhbb+IE + haGiyoTx31H1100LHPIobUsmzuzB/YT1mfxaY6oO9SUlniteaBWAsWMz3hs+Nesjm9m3vrGder+e3czH + OqNnP2oxYubzQUPnFPmPXpM2e9TqlI3DlmccHbQ4M9t6Uda1oWv33/O7MLw8NL8LQvI7Izi/A4Lz2iPo + RlsEXm+L0bEhxV3mnMjuMuvo0W6/H97Ubf6uub1XxARar58ydOAWnzbNog4ZWLpm/WLlnvOd9rB9n+rq + bhIgakLQnJ/Q33ITJyYqRxgqjP35cdoWPErZDJw7AJzZB5zejYrMHZjibePE7xtSdakvKFF9svlCLnMf + feW99KmJy5JSG5el5dMcFpXtsptfljV6Xtll2xVX80NygwtV1+zuhl4Z8yj4gu2zwHM2Jf4XRpSHXu8l + heYRQF4nBN/oQPPbIYjmB1xrC+/z3co8cvo/c8/u+8j9dK97nme6Fnqd65TvfanNZefMvtkdZx7f2zzk + 9gyLgLwxVoGXzQwds77luYhi+v+mC8SJiar57OaRNRB6lLoFDwWAs/sJYC+QvQtlp7bh6r6l5/i8dpQ+ + 9UOTJr0/CV559yfVhrJmITEVwwLWlIV7rypf6rGi4qDbsopcAii2W1BWZju/DHarriDikicmFA3C+ML+ + iLrVFxEFvaHK74XQvG5wT3WD7aHJ8D3XB0HX2iPgKgFcbQN/yu9Ka6oV/K5SV1pw3wK+3Hte7FQ24nBA + 8bAD4bmjjrgdckgftNx62zSVZXD+SHP/6y1MXG78qKW16dVO+Ntt4uREpn9dELsaBXEEQPOFHiRtBHL3 + oDJrB0oztuJZ2iZ4j+wbbNxqSNv+Yxeae844aR4e82RA5ObyCWEbK44RQmFATCV8VlfAfUUFnJaUw35R + GWznl2LMqhsIzhyPqDwbjLtljWgCUOX3RnheD4TldcfonfPx65wseJwagcCrBHClLfwv03zK91Jr+F5u + xX1L7gngSnMZgA/3Plepa9SVZjxuhhGH/Ao7zjmW0HXRjkmd5uzvZxFY0NjY7eI3bUddEwP33xaAiJ/v + Tm6eteLmEQFhFR6c2IR7ieuBnN0oP7UdJelb8TRlE87tmH9pgNPcsb5zTqmi19/dNW7ri+yoLeW3VJsr + HoduqCgLiKmQAXiuKIfrsjKMXVgKuwUlGD3/CWyWX4F3wmwCGIDIAnZAHgHcYAdc64aRO+ah1+xTcD85 + AgGX28H/YlvJ70Ibye9SG/hcbAWfCy0pmn6J1X+Zhsui6RoINF9A8Dzfqcwl+9fHrrkdb/XfMj3TIqxw + s0VIob2F/w09LS2VeK1/u01UhegAMfDq5ceuRN7hlXgijwMKBBE/L9K34EnKRjw6sR6eU+N2hyy9mBa1 + 8V7h+K3PXozfVoGobZWYkHANM67sx5QLuxF06BwBlMJxSQkBvMDo359j+JxncDu0EuNuEkBeX5rfGwHn + BmLMvgnouzAWPWamwDVlGHxy20o+Z1pJXrktJR/K63QLyetMc3ieaS55nbWSvM41k3wuNofXpWbwJgRv + AYHme4suqJIl7FNGvhi0K/rWiHiP2N9i5s+wDC4aaR50W98s4L6Yyf1tNgFADKZiytkkfumEjbfYBTeP + iC7YgLsJ6whguwxAdEBh4loEzEt9EsFMH7ehGJP2PMXUIw8wJe4h5hVuw/ryYMSUBWDiuR1wW1YC58Uv + YL/gOWwWsAOWXYHn0dmMIWuMvzEIs/IcMP1MAFzWH8aYJemwX7UP4eluUGVaSyEne0t+J7tJ/hk9JJ+M + zpLHyZaS+6lmknuWpeR+2lLyJAjP81bwvEBdsiIM6qIl95bwprwuW1CWHC8sEXHDEm5xvncHLjie5L5u + nY/rhg0tzbxvfm3GWZsw4O+wiRMRVVGfsroZtxIF7IRn7IInqZvwKHkD9u2JgNuCXzF8fgdoTzBE2LKz + iFp3E7+fTsS6F79jXdnvNH8iNpaFIqY0kAB2wn35Czgtfk4Az2C/4iqC0scj8rItIq8MlKLODJcmnbPB + lFx7RKZ5IvS4B4KOOSLg+EDJP6Gn5JHQSXJP6CC5H2/HfVvJNbGF5HTCXHJONZdcMiwkt2yCOGMJj/OW + jB3qooBB4wnBUwYhAFgg4rolDj62ROL99uWJxT2enHrUNm/hicAtZoG3HC39L9Zpq4oXM8D/+iZmCvI4 + QOkfXBi1RVT+neMx2LsjAj3Gt0IT3yZo4NUAPwf/jB8Df4TzlD2IWH0Vc87tw8YnU7H4zk4se7aI5odi + TUkQJnLg9lj+nB3wDB67TiEkcwHGX3fApBsjEXl6mBR1Ypg0ZWNfaVO3ntjavDk2W1lhk4UFNpmZYZOp + KTaYmGC9kRHWGRhgZat28FtoLDntsZTsj5lJDidMJed0QjhtCRnCOZouxG6YympfW0gVUcUW2HLPAlkl + lrhQXq24m30KZh2LPNx7xgmVaVB+eyOPa58PGADhwX9tEzEkuuDzjt1HNB5kH9n9+MGl6BHZGoYehtB3 + 14eOrw60vbVRN7wufgr/CV3DfaFafg4zM45g6YOVmHT4AWZkJGHx3WmYXzQZ49J2wmfjdXisvwpV9mLM + emiDSTdHYPpleykqZ6Q0dWN/aZGqq7S1VStsadFCBrDR3BwbCGADAaw3NsY6Q0OsJYA1enoY564rec41 + kEYfMJLs400lp2QzuGQSgAbCWQXConwLnHhMPbFE1nMLnCuxwPkyxXjN/kK5GRKLO5e6xKy7YbNs19yJ + h1Xths9f/a3ZWPxXI0lUwEequftNp6xK8Ww/xRpGLkYwdDaEgbsB9IL00DiyMeqr6qOOqg5+CPsBzlP3 + IHLjVUzYcxPjtj1C9M5niN5XhLCdfJy8A9OvqjDpUggm33DHlFu2mHhjNCZcsJMis0dKm3v2xra2baEB + sEkNYL0wn9W/jgBk8/X1sVJXFyt0dLC4WSvY72su+RzpLDkmmMM51QKup8zhlm0B91yCoALOmkPF+Ilg + /GwqssDZFwqEs+yCc6VC5pQZTj+3qjxW2KX0xL2OhSnFbeJ9tv5ubemWL1b5/51t3z7p/VVH7+qsOVrs + sfzw7YMT1iY8MnA2gIEHFUIAwXpoEtkEDSMboq6qLn4M/xFdwnwQyrEgcmM+piYexcxT+zD15B5MSt+N + GZdm4Pe7nphZ6IKpN+0ZPbaYdNVWGn/WRgpJGyBtb9cOW9u0wRYC2MwI2mhpifWs/nVq82MYP2tE/LD6 + hfnLmjbFkiZN4Lijg+Qf3wuux1vCMZkAThJAFs3PEd1gjiXXzZH6wBxpDxk9T8xxhl0gpICwJAhztcxk + EELJDy0fhGX22jlgj89Yk8A8bW23i2JS8n+3CfN3ZaDutpOlthvTnh2MSXpYsfzwLWnIuHAZgIggPZUe + dMIZQ1HaqBdRT46h78O+h9OU3YjYcBYLrk7F8nsqLHschiWPg7Dgvi/mFHtg5m0XTMm3Z/XbYPoVZyn6 + 9GgpOMVakqu/dWtsbtkSm5o1w3pWfwzNXysqX23+KnX1LyOApQSwmABsV1nDb48z3PeOwOj93eCS3Fzu + AtcsC7jlmONgoTme0Phnz8zxnMZff2GOPHZAfqkFbgjD+fgMJQBoICQ8NkX4FVPYJFof6DJ/uW3zqXvq + aXf7P4Sw86SkvSNHstmeWXFiy8myBxtSn0qrj96RJsYkQ99HH/re1QAaRzXGLxG/KDEU/gM6hXojdO0p + DsaTsaQoFEvuh2Hx/UDMv+uDOUUCgDOmEsD4a6Mx5bIjorJHS4HJAyVN9W9i9a9n9a9j9Qvz1zD3hVar + q395DfMXUu0DVnNgP4L+c46i7ewY2MX+Cs6K4KKOopBcc6xhFwgIAsDz5+YoIYASmi10jdWfKyA8NyMI + RRoArrlWD+3TuqQICCZel7TV9vzvbYsy8N7WFKnOjkzJfntm5b4d2ZUPtp4qlzallSAm8RGWHr6FwdFh + 0PPWk6Wr0kWTcMZQVHUMfRf2HcZtisL882FYmBeChUUhWHQvEAvZAfPvurMLnDGj0B5Tb9tgZoETxp0b + LYWkEoC6+h/tW8rV9i75ckfZya0oVauE645nnAI/SdmAGxtmKQAaN0YXz21wnpWMwZPS0WZcHGwP9oML + Y8j1pJXSCZnmCD5thn23zHHgzCgcyQhlN3QkCDO8oNkCQqGAIABQh+6bYUG+KXzPmcKNcjpt8Wj08X4H + B+z0GWvAMeF/bWDetAnvbDwufbM1Q+q77VTlNgKo2JZVKW3LlLAloxwbkp9h5bG7mLD2BHS9dWXpqHTQ + NLypHEP1I+rLMSQAuM1sj1WZPlh8OQALCxg/RX5YVOyN+cXumF7oh0m3fBlDAZh8JQDjzzsgJLWftP3X + 3tjZsyceHd+sBrC9VgCPk9fjxt4VnIq2wpKWrWE3bjWCF+6G14L9sF+4FqFHe2J8pgUmnrbCJM6GJp0x + xbgz5vDMNEOfmCkYMCsJ12/3JQTTKghCp58pWnXLDK78GY3czprIGp3UY2e3ZQusm3N29L8yRd2eic+3 + nJTabDlZuWfrqcpCQpC2niSAUxK2ZlRgI7tgTcJDLDl0CwOjwqHjpQMdTwVAo7BG+CVSiaHvw7/Ht2Hf + Yv1OG2zN9cH8qz5YUOCDRYUigkLhuzsODisy4BlzCq4rU+F7eCr8T/QCcvfjSeJWNDOegwYNZqFu3Rkw + 059dBcBYZxY++WQSPvhgInTrTcC1XUshVuh7djsi4WgQcrJCcfbMCOTldURRUVeqOe7csaSY+XfNEM0u + +G3tJLSfdJzA+yL3gSmePjWT9YzGZz8mAB6vKFAAOOdWQ3A9YwynHPMHY0+2ju+9IUxeJ6ht+89s8fF4 + d0O61H5jmjRnc0Zl/pZTleVbaLxGW9kFm9LKsDbpKZYduYvo1Ulo6tVUhtBU1RSNwxqjQWQD1I2oK48D + AoDNjDaYmxGF8GOrEJkUg8jkGITG74DL0isYMysfrvMK4DDrCuwW78SoDX4AF3DiUnfjxrNlAD//PAM/ + /DCtCsDXX0+RAbz//kS8++543EtYiztHVyM+3g6pqU44fXokrl4dgYKCgTS/OwoLO1NWKC42p8yQWWiG + iYnD0W9zEMYmt8fCy6ZVEK5Ty/MUjb9MAITlfJrGCwi5JpSxLOcck3tj0trF2MR37/UfWzGL3N94Qvpp + fZoUviG18sbG1MqSzSclbM5QJABsPlnJDihHTPILrDj2APP3FsA6IhRNPZsqAMIbo2FYQ3k29KNKGQe+ + Cv0KYxZOhsvsLHjMuwD3BdfguiAfTnMK4ELz3RbkwZEARkzMRt/x24Hz+4Gz+14L4KuvpuDjj/8I4OhR + O6SnOyE3d6AawFAC+JXmiy4QsqLMZAinikwxiaaKWJrEfF91zRSPOeCeeWiGKZeETDkxMONaxQyTeRxy + XphPnVYAyBBOG8Euuf1MI68LP/1HxoOYeHy9JkFyWHtCOrQuubKEECo3pEo0nCKATRmV2JBOpVVgXXIp + Vhx9jIUHihCxPAFNPJvIEgC0wzgORHIcUHE6yhj6OvRrtAhywdipKXCZeRrOcy7CZe41OMy+gbGzbsB7 + YQFc517ByMmnYa06Clw4IANoYb4Av/wyC3XqzICp3ssR9PHHk2UA+o2m4X5CDO4eW8MOGIakpL7IyelJ + AAMJYDjNF13Qk+rCCOpC8y35NWPuTSkTfs0E9+6Z4AE74OFDBYLQ06dKR4hIevrUBPsLhflqAJQLJQAM + 2OV4xNDnsqN4X0Ft47+3LTqMz1Ycl1quSpC2rEmsLFibLNFktQiBXQEC4bFQBSOoFCuPP8WS2PuYvfMG + +keEKABUjdEovBEahDbAzxE/ywC+CfsGn4d+jjW7ZmLzwd+x89gi7ElajN2JizF5Szy85+fBdfYVjJ6c + g4HhSVUAxBs+4h23isw/DsLP0zgLSt4gXwJ/kLhO7oIZC1RYuWEaYg+NxKVLfZCfPwy3bw+h0b1pdC+q + O83uzH1zQjBVd4MC4f79agiPHil68kTAMOHeWNb+W8YIOSviRw0gxxCjj3cr6LfFa2un35e1Mgu48u9f + yl4cJ+ktPS55Lzsu5a1MkLA6ScKaExQBCBgxyZVqCfMrsDqBAI69wOLYh5iz5zaCFh1DY8/GsmQAYRwH + IjkdZQyJceDLsC+xKqYvTpywY4Xa48KFsbh40QZH0jjwLkuD4+xcjJhwEtYh8WoAewlgNwHsfC2Apykb + a0CIwW9+u2AzMQkrNk9hB/TDtWv92AWjaPZImt0Ld+8KEKILOnHfTIYgOuHOHVN+T3SCKUGYyiAEgIcP + jbk3JoRqrbpujCAxEGcLGcoam2FeYL3NKajLsulGajv/2qZS4e0FcdLIxfFS4tKj0hNCwApCEFpFEKuT + KtWi8YkVWJVYjpUJZVh29AUWxj7B3L13MGXTVfQKDqgCIMaB+qFKDH0X/h2+Cf+GK+NmSEgYg8xMV5w5 + 64pzhHDhgj1OnvSB1+9HMCQiEb19abwGwOndkLJ3vAwgQwHwIn2zPBXVQBBT0hYuW9A7JBZL10/ClSuj + cf36cHaAKyHY4+bNQTT7N5rdmzA687g191Y0vjllwa9bEIA5AVhSYm9UBeDRo+pjAWHvTZqfVQ2Ax6Vj + M8zybVIsPf/yO2sr4vHB7/slvXmHpBmEcHdRnFS+5KiEJfESBAgFRiWWHxeq4ONyLDtWhqVHS7E0vgQL + Dj3F6pRr2Hl2P+buWYBGno1kNQxviF9Cf5Fj6AfVDzKE71TfIWbTYCQnuyI7O4CDJUGccUBmtgPWbvOD + x5RF6Oy8kbMg8YY/44drAAGg/NQ2BQDNrwlAdIGQACFkar8MnlE+2LZlBKH2YBcMxY0btuyE0TweIEdS + UVEfVn5PqocMoqiojTqOTAjCjBAs5b0mkhQZUsY1gAgIRgg8rQaQbQTHTCOMjO+xyMj5jF495T3mP7dN + 24WvZ+yVxsw6IB2eewggCCyIlbAwTsKiIwJEpazFRyuwRCi+DIuPlFIlWBj/AssSniKhcB9u3ZrCSImC + tqe2LBlA2C9KDEX8KEP4IeIHOE5tydmKK6eLbtCf3gI6YTrQC9eDvkpf3ptMNqmq/tw+ekgz/xEppt8j + 2eRbJBt/Q32FJKMvqE+RZPgxTvVogBdpm6lN+Fn1M973fR8f+H6An8YbcjpqzbHABufPD2RHDFHPjAYT + Sg+uEXqyK3rxcScem/HYkt1iRBBigDaWI+nuXWMCETKSO+L+fWMZxsOHilZeNUBAjgHNN5QBWG+3O2zg + eX6Msc2fHJBF9EzYKWlP2y1tnLFPujmLnU8QmEMIAsT8wwJGJWOGiqvAgrhyzI8tw4LDJfz+CyxJfM4V + 41YUP5jDk5/IFxuOgFldFQAeCoB6ofVQJ7IOfor8SVadqDo4cMCeEMagcUhjNAltgqZhXEcQhDhuFNII + pxPnovjYYqT11Eaq2Q9INv2OAIT5X+MEAZwwFgA+oz5BUtefUXB4HtJjp+NDnw/xoS/lpygp6Td2Qj+O + OYPZacNw9uwgKTe3Bx9353FvQumOy5fbUGaEYskOMWMhibWCOUGYMZaMZQkAGghKNxjyWOwNsKeAAE4J + GeLXNUE3DT0vbDJ0Odv4T0XRlE34ntPuPhN3SplTd0svpnPiMXOfJGu2AHFQwu8HK/H7oQoaXoG5h8ow + 92ApVYId2Tdx89k+zg7m8kSm4nbhOLb6BBw+4oEGHg1kyQDC6qFuVF38HPmzDOLnqJ9RL7oeGgQ3gHYI + u4VqFN0I2tGEFsVxg9NXsYgznaiNwiML/hA/NWOoNGMLbsbOh8G4n/FR6EfVCqPCP8LH/h/j04BP8Vn0 + Z/h83Of4bNxn+Hjcx/gg+gO8F/ke3gl5B99PMiCMZoRhxTFD6QQRSWKqWlRkJAMoLhZ7I3aEIUEo5msA + 3L9PCHkGCOSMaMj+/i+6r1BltZyysa+uc664bfPNW+RmySp6qzRh/Hbp1oSdwORdwJTdEggD0/cKEJWK + 9ldgxr5yHpcRTAlj5xmKn+/l/HgKB6XJPJGJPMkoVlAUYygU/jM64BePX2TJAEIVAMJ8DYBfAvn9oF/Q + IIigIn+pMl5cwhAX8sQq+mT8DNn82gAo2oL0uOn4JPQTfBz6saIwRQLCx34f4xP/T/BptALhk+hP8M+o + f+Ifkf/AOxHv4O3gt/FWwFvIyGjN8agtzp/tgmsXe+Dmtd64fYODdf6vKL7dVe4IBYKhDEED4u5dBYAY + L8JTO2Pkke4Yur//7VYTN0409Dhjpbb59VvoRmloxCbpWMQW6XHUNkAsQifukDBpp0QYBLGnkjAqMWVn + BcGUYdouZv/Rp3jxIoYLlJms/okEMIknEM2TU7Fq/NnKHjh0ZDjqe9SXVQVAbb6Q6Ii60ZRKkchuYbyY + MQnjxXsJYgUtpq9iDSEWcl+GfokvAr7A5wGfy2uKz0I/w6ehn8qqCUB0gAaADCGcEKI+kfVR1Ed4P/J9 + vKt6F2+H03z3t6DlpoXjx02RltwerjPmoH/0NliP3wnriXthPWkffBatRGGBuKZkKEsDQdkbEAQBcFo7 + av4aNIs4BIvwuMeG3pnHDNzPDVXb/MdNXMELnI8vgtZJoaEbpMLwTVJZxBYgcisQvU3COIpdgfE7KjFh + RwWhlBNKGVfDeSh8sgPPn09l9Y+j+VFUNDWBXRDJk3JmCzty0BsJ32nNUdedBlM/h9Lg0OpxQFYUFf6T + XO1yxYe9bPy3oTQ/VDFfXMqoCaA281+KIOqfof+sgvBRpKIPIz/EexGMnvB38FboW3jLlQBctBAXZ8nx + oguWbxyD+RtCsWybCku3h2PFrghsj/Pm+NYaF84MxKrdkVi9VygKa/ZFYe3+aCoKs7bMQvvQZBh6nIOB + x9ky7m8buJ4JNXDK+WLAAPn2x5c3r+nSh74rJUP/tdKSgHVA8HoglLO/sE0SCAPsCETKqiSUCkRvLUfU + ljKcuX2Q1R/J6o9k9atofChhTJSj6MEDD1aEHQexkcxTFxyKG4Y67jTdjSaHVM+Cvo/4Xt7Lx5HfV5ku + G0/TNcb/wfxQtfkBivnC+FfNF6YLfRjKQbimaLzQ+xHq6g9g9fvT/LFa0LLXwsGDpkjP6Cylp1tKFy60 + kceDvDwjRqoxX48JZYTdR33x27gjsPDNhKH3GRh65sLAk4Z7nlX2NF8AUEOAvvuZJXqup42aWZ8QN7a9 + vHktkb70WimN9FktHfBbCwj5xwCB6yUEb5AQQoVtrCSMSoKpQPjGMoRtKEVOwT4CCCOAUAIIpvnhqKiY + QgAqAnBnOw5nVtrxxL3YBZ7wYRf84EWjVTSZawBZEa8oVNG/NF/EjjCfg2ptlf+S+SEf4oPQD6okjBd6 + T6Wufpr/lp8awBgt7D9oUZmc3FzKyWlPAO1ofmeqOWXMWLUkAEOqDSHZEMJhGHqdVgM4I5stQxD7GtJ3 + O3PAwD17VFOX1K/UtldvDgukn9yXS1M8VkinPVcB3qsBXwFinQS/GAn+3Aesq0SQrAoExZRRpci8sYem + B9Jwf1nPngWhpGQcYURyXuxGCGMJwYknG8AqcmIX9MV3njTXk8aqaCz1rYpGR3z7kvma6n+j+YwdDYBX + M7+m+R+E0HTq/RCaTv0j5B/4h0qRXP1h6ur3U6pfADh0yJIALCpPn25XefFiJ+nq1c5Sfn57qaDAgq/F + gmsFI4oQuH6wnrCPhhOAFwF4CAAaCJpjRfoep08buOZMNRiT/erdFHiLABo5L5F2Oi+Vil2XA+4rAc81 + gNcaiTAk+HDvs0a5k9lvbTmBlGHCrmJcvSMGX28a7iXr2TNflJVF8Dicq0MXArDjgOzJqgnklM6FXTAK + ftPN8WUwjQz/Al+Gf4mvVV/LZmuMrxk/rzO/atAV5ge83ny58l8DQFT/6wAcPGTF+GktnT3bQbpypQsB + dJeuX29NAC0kMS29edOMXd0a6emj8GvkQZqdI0OoabgMQIYgwOQygnKKqV0GjtlNhOdq87W0Rq3AB3YL + JMuxi6RMhyVSmdNSwHkZ4LICcFspwW2FBHfKY2UlPFYodzKP21GE5yVzGT8BNN2dhnsw/z24d0dpqTDf + neY7sAu8CCCIMeTDE3ZiF7gi7qg1fKcawWOiAdZt7IyVq9viW18C8PtOzv+aA+8bzRexQ/M1AGpGz2vN + 96H5lDD/TQAOHWohpaW15mJNLMrEyrgbK74DjW9JWfHYErtivdErcj/MvNNpcLYCwF2IhgvVMF8NoIwR + lGXgmNGs3qj46ksTw2Y8/cF2vtTfdqF0acxiYOwSihAcKKflEpyWSgQiwXV5JVyXVcBlKQHszGPUhBGA + CwE403hnAnDh3pWRFCQfP3zoTAURRBCna65sXWe+EBcu/x3kTsjOHo7UVGscO9YL3/vReH8qXJEGQE3z + a0ZP1aArzA+oxfzXRc8rAN5Rce5fC4DDsZas7jYE0J5F057n3YMzn958De2o5iwmCyzfoaLRmYr5stgF + MgC1PNRyF19XpO+WfcXALdf6pUXZyN9L9UbMk7xHLajMs1kI2FJ2i4AxBGFP8+0XS2BnUJVwWFwBh0Xl + iNx2nQCCaPZYZr89DR/LqrfD4ydj5W549MiJ8pDNF7pzx4UQXNRXIt25NrBnZdnwBY7komcQfvTn1FNI + veCSr5Zyvv9G80XuC/MD/jjo1mq+GsB7Por5bwIQG9uC59WOK+IOBNCF52zNyu/NKG3P45a4ca0rpq6Z + SlMFgKzqvRtByGYL80UnVJsvA3DNytd3PeVjNCZTT22/ltbQOWUth84pnz5sXsXtEfMljKRGLZAwmiBs + Fkqw5bHtImphJewWVlDlCN9yjQD8CcAGj57a4MFjG9x/MAIPHtrg4WNHVr6DHEEPHgTIunfPQZ6SFhe7 + 80V4EoaXDEJ0w5kzg1EnoI4seeGlvlIq8r8281+a8QjzqTeZXxOAbL4agIif1wOwYgcoAK7R7Fu3+rJ4 + +vCcW+M6gXjPX4y2gfE0/CSNpfkyAMpNwBAg1BCE8RooYu+aVajvkjVDzzWzpdp+La0hs8p7DJldtm7I + nPK7Q3+vxDBq+PxKjFhQiZE0f9Q87vl41PxyHlfAaecpTDq/EFklDjj1fATin47EhcfDcfXBcORT99kJ + Dx66MPtd2QXeBOBN820IwYadYMdjL8qHELzZyh64eNEBdYO4OAv8GT9FVAMQ+f9G80XsCPMD/sSgK8wP + UZtPCfPfBODwYUvGYwsCaMMi6crz7CrHUF5eS1y70AP9onewmtNoaAbNPUVpOkADQNMJYk+JxwqAewSw + Tt/5VA+1/Vpa1tNLB1vPKo0bMLP00aA5FRhMDfm9AkNp9rB5EobNLScUoVIel8E3Yy3mlA7D7JKhmPV8 + CBY9HYrEx4Nx9sFAXLxvjcsPR+H+wzG4y+nn3XuOBOEiG3/v3khqNB87Uc6E4M7K8uQLdEW94HoyhDoR + dZQ37glA5P/rzK+a8QjzqT9lvhrAuz6K+RoAb4VxDfAKgIOHzJCc3AI5Oc0ZQb8xMvvh8sX+uHKuD5KS + R6JH+B41gHTuT1KE4CYkukEDQm1+FQB+zznzEc2P03PNGqS2X0ur3/QXdv1nlWRazyh9Zj2rDAOogXPK + MUgWYcwuI5QyDJpdgsGzS+GdsRqzSgdjRslATH8+EDOfDsT8xwNw8IE1Ltz/DZcejcD1ByNRdGcEiopH + 4+59e4IYg3v3bdkNQ6nRjCg+vmfHOLJhi49E/ZD6qBusANB0gMj/N5ovYkeYH/Bm898IQCzCagGwY7cR + TpwQAJrh0qXuuHLZCcHLVmFA9E70iNgHE48TND2V0gBgFBGAHkHoCaOrAAgg4rEifZfMZwYupzL1nbNs + 1fZrafWZ/sy174ySq32nvyjpN7MU/WcJlUHAsJ5VDmt+zXpmCQYtKYLz0W0Ivx2IGaXWmFbSD1Of98OU + p/0w+XFfLH3QF3vu90YOO+HMvSG4UGyNW0VDkMfqL+B64N79ETReyI4SkTSUAAYTwIA/APg2/FsZwBvN + F7EjzKf+lPmUbL4agBw/4gJcLQACxtti6kIfzF2lwvItk7F0xzJ0jUiGnsdJ2WB9F2G6BkCGDEA2Xw2A + Fa7shfE1ABg4nypht1wxcMlwUduvpfXr1BKf3tNLiqmy32aUQqgPTe9LELJmlFAvMHj1BURydjOjvC+m + lfbBlJK+mPy8DyY97YOJj3/D+Ae9MfP+r4h/MADJ9wfieFF/HL89EHtujsDJO/bIvTMG1++Nwq0HtrhH + CPfuDSKA3gTQQQYgPk0jxgBxmUIAEPn/RvNF7AjzA/6k+SFq8ylhfk0AWv40vgaA+sO3Qts+FpaeaWjm + m4MeqiuwCLgAPU9hbDYNJwRhvhvNZ+UrANQQODBXgaDk57oo0nPJLNNzyigmQG+1/VpaPac+D+o17fnT + XtNKKn6dVoJfp5egN00XkmFMf4Hfpj/HwJXnEcHZzZTy3phc+isml/TGpOe/YuLTXhj/uBeiH/TEuAfd + CaEP5t7th98L+2Fu4SDMuzkMs25bY/bt/oi89RvCb/Fni7pgV2ELHCmwwqHLZqgXUg8/B/0sv1UpAIg3 + 7EX+v9F8ETvCfOpPmf8XADQZthVNHWJh6p4GQ49TaBlwEbpep6Hnla0AEB3gkqYAkDsgQw2A+5oAZFAv + AajQc854yucHqu3X0uox9WlojynPyiip59QX6DntBXoRglDP6aUQX+s19Tl6z78Ju9hNCLzphUllPTGx + pAcmvOiB8c+6Y9zjboh82BVRD7phHMeB6DtU4W+YcJOdcasfwgo6Q8XjiJv9oCIEIb9brTAzrwVWXLRC + 3RDGTxAHYAIQF+gEAJH/bzRfxI4wP6CG+cGKajVfDeAdH8X8NwEYFDQKY6e5wW2eP3yWhiAkJho+K0LQ + d9IG2Wh9J5rvnEJTGUMuSgz9AQCNfxUAwUl6zullVKjafi2tbpOfhned8qyy++RnUneaLYsQelBi333K + M3Sb8pT7J9RTOJxYgoll3TChhGa/6Ipxz7oh+kkXdkcnGULk/V6IuPsrx4pfEXqzK83vjaD8Hggo6ISQ + mz34uBeCb3SFD833ud4c3udbKvlPAOKStADwdfjXcvwI419rvogdYf4rAN4Lfo35lGz+nwCwbFddbDyu + hx3pVEYjxJ4zwJELpvBfEy6bq++UAj2nZBpKEAICZ0RVADRRJAMQ8UQ5E5qz2GdI+k4ZlVS42n4trS4T + n4Z3nvy0ssvEJ1KXSc/RVWjKc3Rj1Xed8gJdJj9D18lPqSfy3j5pMSaUdcWE0q4YX9IFUc86I+pJJ0Q8 + 6gTVw44E0R2quz0RUUwItwikYABC83sitKAHQm50g/+1jgi43gk+N1rLH55250xDzv8grgEIQFwd/Sr8 + Kzl+3mi+iB01gKrYEearAfzB/BC1+WoAb6vefi2AOVvrYENcfWxJaYidGdo4eEYXh84ZwWd1KGOHBjue + UACou0CPIGTzXWoAcBESUSXM1yidANIJIK0aQOeJj0M7T3xSRkmdJz2DkDC9M9VlMgFMelKlzpR1TAKc + MqYggrOf6JLOiHxO8592hOpRB6geCwhdobrXHRF3eiO6yBpRBf0Qkd+Hlf8rgq53hf/1jvC70QGeV5rD + 43wzuBFAnWDGTxDzP4IDMAGIq6QCwBvNVwP4R0CNzFcDqNX8GgBk898AYGpMHSzfXx+bExpiRyoB5DbF + 4fOG8F1JAO402CmJ4lRUAHAmAOd0xXwhZ8pJHNcEwHFCVhojKJURlFodQR0nPA3qOOHJM+4rOk18BlmT + nqrF4wlPqMeyCAsdxz9A93lnaZ4vwh4x15/T+KcdEP64PcIed0DkE3YAB+PQO4yookGYeGs4IuRfNfAb + Qq/1QuC1LvC90RI+11rC+1JzuGZZKgACqwF8EfaFnP1vNJ+Szac0kaNRrebXAuCtcE5BawEweV0dLN1L + AIkNsT2lEXZn6WF9cgc4LpzEjOdMyJFTUk0HyADYAU6EIEBoALDixbE+oWgA8HGFnlPqU3ZAkNp+La0O + 45/4UHeosg4TnkLWxKfoSAAdCYBf59ceo/34R7I6jH/Irxej27xcjEkZj4gX7aF61o7mCwDtEPm0G+OI + EO71RFRhf0zMH4bxNwcj8sYghF3ri9DrvzKKOsPrSit4X2gB9+yW+CmY8RPI/I/gAKziDCjsczl+Xme+ + JnJk8wP+pPlqAG/7qKv/DQCmrauLlfvqY9OxhtiS2AirE1phyLQlsAo4TgCsbGG6GAc0EcRBWZYGgFqM + HLU0ADgAO6YW6zum+qjtJ4BxD13bT3hytd24xyXC/PZqABq1H19tvqKHaBd9D+2i7qHPqiOwSx6PIGZ+ + +JM2CH3cChFPGEGPeyD8fg9EFfdHNMeASdeHY+oNO6jyf0PYjd7Urwi+1hkBFzrBO7sdfgxm9Qd+LwMQ + A/BnYZ8pAN5kvogdYX4NAG80n5LNrwmA5os347U8abwHZUON1sLcjXWx7nB9HIlviJMnG2F/Ykd0jtyj + mM9ZjzBfXx6Eab5jTQAvQ6gCoOkOx9QSXefUK7qOadULsXbRj+1ocma78U+etWe1y2LsKHqKtuMeU49k + tZf1gADuywDaRBaj85wsOOd4wevaQLhf6c9oGQzfazbwuTQCXmcHwSd3KCLPOCMyxwVT7/TFlGKungv7 + QJXXHX4XCSCrfRUAzQD8adincvy80Xxheg0A/9L8ELX5fwLAtJVNsTdWG3FxDZGSYoHDh4eic8QBAsiA + Lk3Wpfm6HAN0XcRsSA1ANp/HNQAoX6PUgHSd0p7pOaZl6jumVV+KaBt1b3DbqEdxbaMfP1LMplj17Qig + HQG0GfcQbVj18p4A2hBAG5rfNuquDKDNuAJ0mnUKneacQMfZieg0OwFd5ybJ+86zEtB+ZgJaT45H++mJ + 6DgtHm2mHUGriQfw6woHBGX2hk96J/wQzPgJ/A7fBnAA9ucA7PeJfEvhBz4034fmU5o3U6qu6WuubKoX + V1WLLHXO11SV8RoFK9LcB6RlR9lSw6lhWgicNICma+PYMW0sibFHp+DtMPbkwOuWCl3HFIrmOybJIBQA + wngNhHQFUtVjxXylA9Ie8TiOqr4Y10b1qEfrqMfrWkc/vtuG5isSRgs9RqsoGi7Mj+Y+Wuzvy2pNCK0j + iqlCtFJR4TfRIjSfuo424dfRSXUdncOvokPoBTQLyIaVXyZaBmWjXdhptArMQZ+YMERkD4Z/Wld8H8T4 + IYBvAr7BF/5fVAH4XzFfDeCtYFZ/LQC+d66HXq6hiJzhgvG/u2JIxGLoONN8V2EyATiw+h0SFQAChLwm + UADocl9tvuiEGgAU3WMMrdNxSK6+HN0q8nHLNpEPZ7SOfni7TTRN14gAWnMv1JJV34oAWtF4eU/zW7ED + WkUVo1VkEVqqbqFFxE20DC9Aq7AbaBZyDa1DrqBNyEW0DjqHFv65aOGXA0u/XFjyuF1oLgZsjkZ4dh/4 + p3fB9z8G4dtv/fDNN774/HMffPyxNz74wAvvv++Jf/yjWu+9V613331Z77zzR739di16zw2XY5fKtzGW + pG+WP1tcGL8SN2OX49KeBcjdMQ/1B6yA9sidaGJzEE3HHqOhitG6nP3oOvDYgeYLaQBozBcxUxOAMN2x + GgC/X0gAM/Qc0qvfkGkZ9USPpnq3inqYpzFcFqu+FSteqCVNFxBa0vgqRdwhACqykMe30YId0DwsD83Y + Ac0JoHnIJbQIuoAWgefQ3P8MmtF8c9+zsPI/i7YhuRi4dTwB9EVAcg98952/DOCrr3zx2Wc++OgjBcB/ + 3Hzqrbc8ZfM1AJ6lbpQB3I5bKQM4v2seGgxai0aj9qKJbRwBJELnVeOrAPDrIpIEHA0AtTSm1xQH33xd + zoB0xiRUvyXZOrj4h9aRD/qzui+1jnrIaFFLmM/4IRgafl8tYf5ded8i8g6rvkhW8/BbNL+A5hNAyHVY + sfqtgi7CKlDEz1k0IwBzP4oAzH3PEMhJtJuxGb+tcsLI/c1kAN9844cvv/TFp5/64J//DGb1B9J4Xxou + 5KGWOw1/We+880e9/bZGQWpVm//WWx6y8ULiMwTiEzV5B5fi+oElyNkyC5mbZqLhkE1oNHofmtgdQVN7 + ApANfxUAHwsAsvEavWL+y/HD53MG5JBurTsqtfpN+bYqfNAq8q5V66j7ma0j75dpAChRw8ghhCoAnH62 + iLxL3UNz5n9zZn9z1W2af5Pm59P4G9Q1WAZdhmXgRVgGXGDksOppfks1ADOfbBh5psPSJxOWITvQc2Ef + Vr8C4IsvfPHJJ9UAFPOrAfw186sBCNNrSvNJGmG++CiTMP/avsXI2kQAG2dAe6gAcIAAjhJAAgEI8zUA + 1PkvP9Z0QG0AlGiqMt8puUzXISW76ZiEl29LETcJtVI9atxKdW9XS9X94laRNF5Irn4FgFCLyPtoIVf+ + XZp/h8aLyieA8Ns0v4DG59HQa7AIugKLwMuwCLgIC/8LsPA7C0tWfTPK3DcXJt7ZMPY+BQOvZBi67IGp + x0IZwNdf+zH/FQAffuinrn5vtbxouJCA4EGjNXqd8R5q+dJwoWrztbTcX/ocmfgw34Vd83GO2Z8WMxUp + a6dAe8hmaI8iAFvRAUkKAJH3wnxZfwKAPA7UAOCQUqw7Nnm3gWPayzdmia1Z8N2faP6UlpH3T7ek+dWi + 6RGKmos940eomaqYKkKzMJofdlOyIgBLVr9F0DWYB16BecAlmPtfZOxcUFf9mSoJAEYEYOiZCkOPRBi7 + 7Wb1+zN+/Jj/vhyAXwbw7rtCXjRZZLti/Mtm16baAQjzhcSnKB8mrZPNFx9nFeaf2T4XqTRfAGgwaDMa + jeAYYMMxYEzNDngFQM0IotmvM19R8mkCmGowJuWPv+ipmerhly3D744ihAOy8TRbqIWKFR9RreYRrH52 + gDDfitVvFXYLNF+yDMmn+Tdo/jWYBVyBmf8lmNF8U9/zMPM9B1OfszCh+aaUsXcOAWQRQAYBpMLA9Yg6 + fvyY/74cgH04AIvBVlS7UvnvvOMjS8lyBcBbbwm58VjoVeNfzvya5mtpucof5FY+Tb8GRUdWIWfrHFnJ + ayYjefVkjgFb0WikGIRFBxDAWGH4q3q1A9QAXjWf3xei+Qd07VNrvzm3mVfehy1Di4yah99foql4WSpW + PE1XRAAqRg/jxyq8CJasfsvQW6z8fALIkwQAs4BrMPW/AlO/S9QFmBCAidp8E2/Gj08uAZyGkVc2AWTC + 0D0VRq4JnP2I+PFj/Pgy/33k6acGgFL53jRUSBMlbmq5Vh3XDuCP5mtpueBW3BoUH10tz3xuxa5ENgff + nK2zFQCU9rAdnAUd5BgQr3QAZ0JV1V81I9IAqFH9GvOF1MbL01BK1yFtiZ5DSu23p4sPaLQKfPhF87C7 + oaz6wpaqu2WK4SLvFTXjcTMBgJIBhN6GRchNqoDKk8yDrktmAdcJ4DJM2AEmAoDPORmAMc038hIS5gvl + qAGIWzsS1PHjx/jRABC5r5liKqYqFa9UvZaWouqvVZtebf6rAMTPuFDOGDylAdqq+sDAcQLqW69Gg4Hr + GDubWPlbaP52Vj9nQHL8HIWOGAPYBboOlBMrXx4Laql+jfHywqzafAIr0xubdltvbHKowdCE2j+godla + hN8ZRtOPt1TdeywANAu/o4imawCI/BfxowFgTgBmQXkwC7wumRKACTvAhB1g7HsBxgRg7H1WNt9Q3MLt + KYyn1B1g4JYCA+cEdfwoAD780If5L3JfM58X5tY0X1SxRhoIwujaAWhpaQAo1a+l5YQWwa3QZLTI+g1o + OGwntEfsoen7FeNHH1Kbf5zxIyQgcDHG6tfRzH7kVbAagOgAeSwQ5qsB1Kh86jHNP874ef1HlDSbVdhd + q+Zh9yY0C797i6LRNQGIgVeRZY0OMA/K1wCAKSNIADBWAzAiACMCEPfOCwDyDazyjaxZFGdCrinQdzxe + FT8ffeTL/BcAlBmPZsDVxI3GxE4RFrBeboCBqwzQc0qLGuZ7VUkB4M3ne1IvA9AepKL5MdAevovTTRE1 + nG5qRON1xNx/LPdjjhHAMQ7CPHbUAKhpvugAdfxozJcBVJkPPQdWv33KRB375H/9IT0L36LvGTF9rMLu + ZFIvBACrMFa8UHhNFcGCAMwJwEwACHw9AEMvAvCsBYC7eLeI1cMXVx0/CgBl2vkyAMU8xUTrFfoYvMEA + w7aYYNRWixrmi3HiTQCcKSfGzkploB29XzZdjpmxJ2h0MkVTWeV6rnFoO30Suiz2RYffo2DguY+Gi+hR + x5CsWgC8VP0pLwgrS98hte9Li6/Xb6q3rUKLG9H4Tc3Cim5VmV8FgbOfMDEDKn4ZADtAxE8VAF81AO9q + AMoHGBQA+gKCu7hLQAxOCXL8iOr/8ENf5r8AoCy6qqtfyW4FgjMGrTPAiO0msNlrAbt9VrLxYqB+5x1f + HgtpAPjy+T6UJroUAA2s1zDrxbWeWCXfRYzIRooLaEk8xwOwiliC4XFtYJ+li2Hx7fkaN1QDkGNIDUD9 + s7WYz+pPuanvmLzZcEzqn/ugttjEL6puFlo8hiBiLWsBYBkmpp+iA27JAMw5BdUAMPG/xuq/TPMvsvov + wFAA4CBs6HVGjiFxv7y+fN98DvTcs6Drks4Xk8j4+SMAzeJKmenUBOCCoZuMJZs9FtLYQ80kh8MtJMV8 + MVWtDYDoglcADBDxs1ueZorKV4zPYEEkoNvSCAzZ3x7DYtvANs0A9pk6CoDgja8AUEeQ/IYMza4CoEi+ + c8Ih5TAHa3tjm+N//ncHiUsTFv639WjyDMuworsWoYXlAoQiDr6UhXoKqgzCIoJuvATAqArAeRmAAQEY + yF2QKwPQ98glgBwCOCW/oI8/9lPHjy/z30cdPwKAWET5UIE0LoBSAAzbaizZH2wmOR9pLbkebUcA4mcE + gAD+jH8NADVnQJoxwPk1AE7CyHMlBu9rT+N1YHdSqCkG7OmNDnOjWUD75WKpjiAx+AoA4j2BPwAoZ+Xf + pWaIC29/6Zd1KJvqbcvQopE0O4kAnvCYhgsp5ovq13SAGQGY1gTA+DHyuUjjab4AwAhSPi8lzNfoDAGc + lgE05Qv66CM/dfXXDkBL62UAI3aYwDG2JdwS2sHteHtJmP/uu75UAH9OAPCWAVTPgF4DwIYA7DUA4mGl + moYhB1spADKaYswpHY4B/hwXOADLizH1OkADQH5nTA2gRuXrO6Y80XdISWIHjPzT0fPqJv54gUXQLR+a + nqcBIHJfBkAp8SOmoAoAYX41AFa/LBE/AoD6c1KvAfDPf1YDeO89YWagupoDaaQw3l8tBYDdLks4x7WC + Z2JHeCR1UJsvJFbLomP+OoDWEwJZ/a0wOkkftulNqwEsIQB5ISbGCmG+BoBifk0AcuzIIJLzab6voWOS + +Ps5/94m/nKEWVBRS4uQwi3mIbcLuGfkiKmnkCZ+lDWAaYACwNhPGYAVAOcYPZqPa6qNd6+GoImgpqys + Dz/0q4ofAeCddwJpZABNrB2A105LeBxpD+/ETvBM6lgFQLlc8RcBiAiiae1nucEmuSlsUpvKAEYmmKPn + akc0E++IcUoqA5AXX5oIqgGghvn8twrYAVt1xya3Mhub8T/76xtiQLYIvOXITjhsEVxYahF8s1Ixn/ET + rFS/3AG1AfASnxp/xXwNAO713AjA+RSajE2QAVTHjwAQSSNVNDGECqJpmtmMAmDC7pYIOdIVfkld4FWj + A/4ygBpjQMc5Hhh9ookMYMQxc/TdOoALys3sEK4DqgDUHAPUALiXq94huVLP4UQp94f17JOdjN3+wsD7 + uk382Q7xlyPMg2+pCOGGReDNUhlAsFiAqQFwDaCJIGO/GhGkBlBtPgdfITdhfjbn2TnQ4QsXF7s++EAB + oMTPvwawjFPPBfHdEJnUkx3QXm3+/wAADey0wIvmN4EtAfRYOZareDHrEdNUBYAOC6UKQNU0VG2+DEA2 + /4auQ0q4uOL5H/uTJ+KXkIq/HGEeWDDHLKgg3yw4v9xcAKDMAtVjADvA1P+6GgBnQRoAzPqqyldXvWw+ + peuaSQBpaMKV5/vvay4/awCE08hQmqiJIC9KGKoA2LTfEluOd8bCpF6YeqKj2nwx/fwLAIYJAHE0NglW + E2eh//bujJ4mcvZ3JoymdmJ8oPm1AmDlO5yQCEGSY8chuZyP87ninUO1b6tS/Wf/1In4dbwWAbfaMHb2 + mgfnF3HqKTH/JRmAv1gFswsIwKQKAGdBNQAI4/WF+a6i8jn/p3RcMjkAE4DdsZcAKFX8ZgC7DpogLtES + B1LbYm1yt5cAKNNWzQr4XwAQY4DDYfTeYI1BB1tjyOE2GBrbFu1mhKuvASnXgTQAlMFYA0DEjwBAEA7J + ReyAffr2J9oajYr/z/7qYrGJq6XGQbe+MQ/K70cA280C8yvMg/IkswCaTwCm/upL0QQgICgALrwEQP7Y + jlq6NF+H8+6mXPY3sjtK8/1ovjKLUQD400Q/WUr8vBxB+w4ZIj5JF0np+og92erfAzBCADjMSt/HVflW + GPmtZwevZZSuhYHrLvWV0FcBiEsWLwPgvpxRtI0zn/6c9Xz7xqud/5NN/Cpe8Wc7TP3z7U0DCvaZBRQ8 + 4NxfMvVj/MgS5l+R3w8wYRfIAMQYIACoK1/PRUi5dVuHK8+mfBH/FoDDJjh6QheJJ/Vx+KQxn69ZAf85 + APXlDtiJJqMJgEY3FeMAz0U2V5gsLsbJV0IVKea/AoDm6zgkP2AE7edj+/9o7r9pMwm8pG3in2fD6k9m + 5T+g8YRwXTLxu6oAEDMhdQcYygDkj+irIVDyR3WqAYgrke+956ceSDUANNf/NcZrpqIaAGaITzZF8imC + OGn61wFY1wAgv+kuLidwMSauBzEWdeyT5a9XA9AYLySqXjGfEFIYPXa6zif+9/+Ag2YTfzPFxOdqPfOA + a7Y0fr+J77Vyxk4VABMfAeBSjTFAAaBP8/VdsyQNAN3XABAm/isAew63JABzpGR1xdF0878OoL/6Ytzo + WHZAonIF1FExn7MYms1ukAEQjhCzX69qAE6U+H0x6O7TsU+ybTIqvv7/+d+REX8zRfzZDiPf6/bGvle3 + GvteKzTyvVLOY5p/RYwB0kuzII4BBgoAKpPHmS8BePddv6oMVy4jKNdyajfQBev3dcH+5N44lj0Yy7Y0 + Upv+qvm1/bz6cnQtAHQIQEdUv2y+iCFR9cL84xxokwhAPE4sp4oYU9t0xyTa641MbPh/bn7NzcDtYh1D + n8v9jHyu7jX2uZpv7HOt1Nj7UqURO8DI67xEAJJYB8i/vkXuAgFAgaArD8IKgOrqVcx/U/UKhS3ujHk7 + e2DOzg7o6Tm2ynzlyufrzNf8vHg/oHoWpAAQF9Y0ANQdQOMFAFH1jJlKGl9K5es4JDLzk6zVdze8fHvJ + //UmBh3joIvfGHtdbGvsfXWukffFG8beF0vFGEAA1DnxXoBk4HNaUiBUx5EuB2TxwsU09K233pLFf/JP + ydxuBozs18LYeRt0bLbW+pw3qRpAnCRfC3IU+S8ujSsRpCt3wXFmvRI7svn2iXk6dom/69kmtte3i/1O + PeD+dwFwe0tMu8RvAzTwPt/RyOtChKH3+cMEUGDkLRZj8psx7AQC0HSCHEliZsTpKF+0WIj9FfOFGg7Z + KL+b1cT2IGNkf63PeZPEm/CNRuxBU66ExYxGGYAJQB4HUiXdsQkVFI/ZHWOTbja1Ox6nM+Z4lI5NfCdd + 6wNftm0rL7SE+f91AGITJ/G27gDVP3THZtQ18DrvbOB5Ybu++9kCA8+zT/Tdz5TLxnM8MBRyF9eHxNXQ + HM6ElEsR/Pm/JPnuhVH70IjzePGebm3PeZMaDt6EJqPE25HxYjYjd4CuE413SKb5nOWIrLdPeKJjd7yg + qW3CDh27I+6Nhu5pUK/tKHFdX8zz/zbmi00GQL1Tr238B02Hpf+g53S6vb5rTqC+a24yzb6nVL54O/IM + jDg1FSDEtSBxMU7Mwd/75sNajapNH/zwoTyAym+m28ZRsXj/+3/W+tza9P53X/Dnd7BzDjH/xRSTpjum + cKBNZuYnSmK2w/y/p2uXkELjQ3RGHeqoPWxrnR/MFok/YCpi528LQIZAvattc/wbHbckEwOXU2MMXLLm + cgYUT93Sd8t6oYkhXU5JdZ0ZQ44cB2zjJO2R+2RjRHWL20Xke3UGCMUo4uOG4p5NPkd7xF4CEKvYI9AZ + w4HU9hAajdwD7SGbUH9gDOr1X02tkvf1rdfIma/5+YZDtvPn5ft+JJ0xCZW6YxIqdMYcq2xqe/hFE9uj + t3Xsjh7VsYub12T0QYfGw3ZZ1BuwQryZLmY6GvP/lgA0EGQAlPjD/+9/913nj/Rt4831HdJd9VxP7tB3 + ycrVc84q1Hc99UTPOaOUUAiBXTDmmLwoku/JYTSI2wJljdgtV7v2cFa8uIVE3L8jbpoVz+UMRtc+HoaO + R2DudAgWY7ZBz2YHGgzbigZDtqI+Y6bB4C00fBu0h26Tf77hMEIasU9qNOqQ1HjkgTLtUQfKGo/c+6TJ + yIPF/L/P6Nge3sUxxaPR4M1WX35p+Slfg6h6ETs1AYjX+bcHIE5WnPQHdXvO/6LJb9vrNx2231R3zIlh + HORm6jllnNB1yigSnzAU0z45i21ipSY2jIXRB1jRsTSYEnvO1eVrNjxuKq5e2sVBzzYeujZx0B25H0NC + DmDWinjMWBKHoSG70ZCAGo48SO1HwxGUMH6EIu3BOysbDtte3nD4znJx8632sD13tEfsSWs4dPc87SE7 + bH6xjrH8udvChj+0VYm/GP4RpQEgCkq8rr9d9Ws2DYA/dAEl7oX86Msvu33aoN+WRjo2hzvJi5gxiRN1 + HJJiGANHCeAijb5H08sYBTC0j0WfgHgMCT0Ku8g4jIk6TMXCYVwsvKcfhf+cBATMS4T/vCQs35qEowkn + EBt/Aos2JiFgzjH4UR5Tj2DsuMNwHB+LsdGHMTL0YLnh6J0POABfaTB4c3LDwVu3Nhy8eRb3bg36xfT4 + uevvep9+2uxLnquo/I+pmub/beNHs2lOqiaAmhDEixEv6hNKvE33Rd2O8xuwGtux9T2a2sQv5IIslhV+ + roldXF4rj6OF05efvLtr/8nnh45m4OCRdByMS0Ps0VSkpaUhPT1dVkZGRtXjmsepqalISk7F7gOp5eu2 + Jt9Zt+VE/rzVCRfauOw+RtNXNBiwPrBezwU9vmseJN6z/YES714J88W5iXOsGT21Vf/fGsDrukC8KNHW + AsSnn1j0+apOM6+f6ned2aRe76Um9fssa9twYEwf7WG7nA1s907s7hO3YldCVs7p06eRk5MjKzs7W1ZW + VlaVMjMzq3Tq1KkqnTx5UkApjlp8fKFN8A5359CN1sZD53f6qfNUq59aqQy/0RvZ8KsmnX7kuYjbxb8Q + 50QJ88U5ivP9/6b6xaY5MQ0EzQm/CkGOI0qGQIk3L0TlMXObf/u9iW29+l3mGDXou7xDo0Gb+208kuzN + ip4pxKqeRUNXE8Sd3NxcCNWEI0Tjk7nN1CgpKSnSccKO3j90GGf6jd6ghlpaJsJwMav5Vvk/5f9bnIMm + dmoz/29f/ZqtJoCaEMSL0EAQL+xVCDVBiGoUcSAMEkaJeBCmCdVZv359Cxp9gMZf0IiPq3TixIlgPu8n + tTQ/J/6d7yjx72pMFxUv/k9N5IjzER36OvNrAvgPbVpa/w8Tol4RAWVhHwAAAABJRU5ErkJggg== + + + \ No newline at end of file diff --git a/rabcrClient/Program.cs b/rabcrClient/Program.cs index e97b10c..4a774a5 100644 --- a/rabcrClient/Program.cs +++ b/rabcrClient/Program.cs @@ -1,10 +1,4 @@ using System; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Management; -using System.Net; -using System.Runtime.InteropServices; using System.Windows.Forms; namespace rabcrClient { @@ -13,8 +7,6 @@ public static class Program { [STAThread] static void Main(string[] args) { - - #if !DEBUG try{ #endif @@ -26,10 +18,8 @@ public static class Program { Args Use: "...\rabcrClient.exe" Path="C:\Users\..." Type="Message" Name="Player" Text="" - */ - if (args.Length>0) { switch (args[0]) { case "/Game": @@ -52,7 +42,8 @@ public static class Program { case "/Message":{ int language=-1; - /*langFilePath="",*/string Text="Error no text found", Header="Message"; + string Text="Error no text found", + Header="Message"; foreach (string arg in args) { string[] a=arg.Split('='); @@ -73,8 +64,6 @@ public static class Program { using Message message = new(language: language, Header: Header, text: Text); message.Run(); } - - break; case "/CheckServer": @@ -92,7 +81,8 @@ public static class Program { } else { //bool x=BanStateProcedure(); //if (x){ - using var game = new Rabcr(); game.Run(); + using var game = new Rabcr(); + game.Run(); // } } @@ -158,144 +148,142 @@ public static class Program { #if !DEBUG } catch (Exception ex) { - - - CultureInfo ci = CultureInfo.InstalledUICulture; - string cap, text, details; - - switch (ci.TwoLetterISOLanguageName) { - case "cs": - cap="Chyba hry"; - text="Nastala chyba hry, chcete poslat vývojářům anonymní informace o chybě?"; - details="Detail chyby"; - break; - - case "pl": - cap="Błąd gry"; - text="Wystąpił błąd w grze, czy chcesz wysłać anonimowe informacje o błędzie do programistów?"; - details="Szczegóły błędu"; - break; - - case "sk": - cap="Chyba hry"; - text="Nastala chyba hry, chcete poslať vývojárom anonymné informácie o chybe?"; - details="Detail chyby"; - break; - - case "de": - cap="Spielfehler"; - text="Es ist ein Spielfehler aufgetreten. Möchten Sie anonyme Fehlerinformationen an Entwickler senden?"; - details="Fehlerdetail"; - break; - - case "jp": - cap="ゲームエラー"; - text="ゲームエラーが発生しました。匿名のエラー情報を開発者に送信しますか?"; - details="エラーの詳細"; - break; - - default: - cap="Game error"; - text="A game error has occurred, do you want to send anonymous error information to developers?"; - details="Error detail"; - break; - } - - //try { - DialogResult dr=MessageBox.Show(text+Environment.NewLine+Environment.NewLine+details+Environment.NewLine+ex.Message, cap, MessageBoxButtons.YesNo, MessageBoxIcon.Error); - if (dr==DialogResult.Yes) { - ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DisplayConfiguration"); - - // graphics - string graphicsCard = string.Empty; - foreach (ManagementObject mo in searcher.Get()) { - foreach (PropertyData property in mo.Properties) { - if (property.Name == "Description") { - graphicsCard = property.Value.ToString(); - } - } - } - - // Ram - ManagementObjectSearcher search = new ManagementObjectSearcher("Select * From Win32_PhysicalMemory"); - ulong total = 0; - foreach (ManagementObject ram in search.Get()) { - total += (ulong)ram.GetPropertyValue("Capacity"); - } - - string send= - "?a="+Release.VersionString + - "&b="+Release.Date.Replace(" ", "%20") + - "&c="+GetOsVersionText()+ "%20"+RuntimeInformation.OSArchitecture + - "&d="+ Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")+ - "&e="+Environment.ProcessorCount.ToString() + - "&f="+graphicsCard.Replace(" ", "%20") + - "&g="+ex.Message.Replace(" ", "%20") + - "&p="+CultureInfo.InstalledUICulture.Name; - - // StackTrace - System.Diagnostics.StackTrace st=new System.Diagnostics.StackTrace(ex, true); - int count = st.FrameCount; - - - if (count>1) { - System.Diagnostics.StackFrame sf2=st.GetFrame(1); - FileInfo fi2 =new FileInfo(sf2.GetFileName()); - string trace="&r="+fi2.Name+"-method: "+sf2.GetMethod().Name.ToString()+ ", line: "+sf2.GetFileLineNumber() +Environment.NewLine; - trace=trace.Replace(" ","%20"); - send+=trace; - } else send+="&r="; - - // trace inner - if (count>0) { - System.Diagnostics.StackFrame sf = st.GetFrame(0); - FileInfo fi = new FileInfo(sf.GetFileName()); - string trace = "&h="+fi.Name+"-method: "+sf.GetMethod().Name.ToString()+", line: "+sf.GetFileLineNumber()+Environment.NewLine; - trace=trace.Replace(" ", "%20"); - send+=trace; - } else send+="&h="; - - - Clipboard.SetText(Release.stringRRE+send); - // Antispawn - System.Threading.Thread.Sleep(200); - - // Run - WebClient wc=new WebClient(); - string result=wc.DownloadString(Release.stringRRE+send); - //System.Diagnostics.Process.Start(); - if (result.StartsWith("O|")){ - Console.WriteLine("send"); - }else Console.WriteLine("not send"); - - - // Antispawn - System.Threading.Thread.Sleep(200); - Environment.Exit(-1); - - string GetOsVersionText(){ - switch (Environment.OSVersion.Version.Major) { - case 10: return "win10"; - case 6: - switch (Environment.OSVersion.Version.Minor){ - case 1: return "win 7 (or 2008 R2)"; - case 2: return "win 8"; - case 3: return "win 8.1"; - case 0: return "win Vista (or 2008)"; - default: return "win"; - } - - case 5: - switch (Environment.OSVersion.Version.Minor) { - case 0: return "win 2000"; - case 1: return "win XP"; - case 2: return "win 2003"; - default: return "win"; - } - default: return "win"; - } - } - } + FormError fe=new(ex, DateTime.Now); + fe.ShowDialog(); + + // CultureInfo ci = CultureInfo.InstalledUICulture; + // string cap, text, details; + + // switch (ci.TwoLetterISOLanguageName) { + // case "cs": + // cap="Chyba hry"; + // text="Nastala chyba hry, chcete poslat vývojářům anonymní informace o chybě?"; + // details="Detail chyby"; + // break; + + // case "pl": + // cap="Błąd gry"; + // text="Wystąpił błąd w grze, czy chcesz wysłać anonimowe informacje o błędzie do programistów?"; + // details="Szczegóły błędu"; + // break; + + // case "sk": + // cap="Chyba hry"; + // text="Nastala chyba hry, chcete poslať vývojárom anonymné informácie o chybe?"; + // details="Detail chyby"; + // break; + + // case "de": + // cap="Spielfehler"; + // text="Es ist ein Spielfehler aufgetreten. Möchten Sie anonyme Fehlerinformationen an Entwickler senden?"; + // details="Fehlerdetail"; + // break; + + // case "jp": + // cap="ゲームエラー"; + // text="ゲームエラーが発生しました。匿名のエラー情報を開発者に送信しますか?"; + // details="エラーの詳細"; + // break; + + // default: + // cap="Game error"; + // text="A game error has occurred, do you want to send anonymous error information to developers?"; + // details="Error detail"; + // break; + // } + + // //try { + // DialogResult dr=MessageBox.Show(text+Environment.NewLine+Environment.NewLine+details+Environment.NewLine+ex.Message, cap, MessageBoxButtons.YesNo, MessageBoxIcon.Error); + // if (dr==DialogResult.Yes) { + // ManagementObjectSearcher searcher = new("SELECT * FROM Win32_DisplayConfiguration"); + + // // graphics + // string graphicsCard = string.Empty; + // foreach (ManagementObject mo in searcher.Get()) { + // foreach (PropertyData property in mo.Properties) { + // if (property.Name == "Description") { + // graphicsCard = property.Value.ToString(); + // } + // } + // } + + // // Ram + // ManagementObjectSearcher search = new ManagementObjectSearcher("Select * From Win32_PhysicalMemory"); + // ulong total = 0; + // foreach (ManagementObject ram in search.Get()) { + // total += (ulong)ram.GetPropertyValue("Capacity"); + // } + + // string send= + // "?a="+Release.VersionString + + // "&b="+Release.Date.Replace(" ", "%20") + + // "&c="+GetOsVersionText()+ "%20"+RuntimeInformation.OSArchitecture + + // "&d="+ Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")+ + // "&e="+Environment.ProcessorCount.ToString() + + // "&f="+graphicsCard.Replace(" ", "%20") + + // "&g="+ex.Message.Replace(" ", "%20") + + // "&p="+CultureInfo.InstalledUICulture.Name; + + // // StackTrace + // System.Diagnostics.StackTrace st=new System.Diagnostics.StackTrace(ex, true); + // int count = st.FrameCount; + + + // if (count>1) { + // StackFrame sf2=st.GetFrame(1); + // FileInfo fi2 =new FileInfo(sf2.GetFileName()); + // string trace="&r="+fi2.Name+"-method: "+sf2.GetMethod().Name.ToString()+ ", line: "+sf2.GetFileLineNumber() +Environment.NewLine; + // trace=trace.Replace(" ","%20"); + // send+=trace; + // } else send+="&r="; + + // // trace inner + // if (count>0) { + // System.Diagnostics.StackFrame sf = st.GetFrame(0); + // FileInfo fi = new(sf.GetFileName()); + // string trace = "&h="+fi.Name+"-method: "+sf.GetMethod().Name.ToString()+", line: "+sf.GetFileLineNumber()+Environment.NewLine; + // trace=trace.Replace(" ", "%20"); + // send+=trace; + // } else send+="&h="; + + + //Clipboard.SetText(Release.stringRRE+send); + // // Antispawn + // System.Threading.Thread.Sleep(200); + + // // Run + // WebClient wc=new(); + // string result=wc.DownloadString(Release.stringRRE+send); + // //System.Diagnostics.Process.Start(); + // if (result.StartsWith("O|")){ + // Console.WriteLine("send"); + // }else Console.WriteLine("not send"); + + + // // Antispawn + // System.Threading.Thread.Sleep(200); + // Environment.Exit(-1); + + // static string GetOsVersionText(){ + // return Environment.OSVersion.Version.Major switch { + // 10 => "win10", + // 6 => Environment.OSVersion.Version.Minor switch { + // 1 => "win 7 (or 2008 R2)", + // 2 => "win 8", + // 3 => "win 8.1", + // 0 => "win Vista (or 2008)", + // _ => "win", + // }, + // 5 => Environment.OSVersion.Version.Minor switch { + // 0 => "win 2000", + // 1 => "win XP", + // 2 => "win 2003", + // _ => "win", + // }, + // _ => "win", + // }; + // } + // } } #endif From 440de9b759ec6fbad9dc92c6f04b1bac9e614d6d Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sun, 16 Jan 2022 12:24:45 +0100 Subject: [PATCH 30/55] mooved class fallingblockinfo --- rabcrClient/ClothesTypes.cs | 6 - rabcrClient/Default/Lang/Lang.xml | 449 +++++++----------- rabcrClient/InterLogic/Game/GameMethods.cs | 8 +- rabcrClient/InterLogic/Global/Setting.cs | 24 +- .../InterLogic/Graphics/Screen/Rabcr.cs | 10 +- rabcrClient/Particles.cs | 6 + .../GameStates/Menu/MainMenu.cs | 12 +- .../GameStates/Menu/MenuSetting.cs | 96 +++- rabcrClient/rabcrClient.csproj | 11 +- 9 files changed, 305 insertions(+), 317 deletions(-) diff --git a/rabcrClient/ClothesTypes.cs b/rabcrClient/ClothesTypes.cs index 73fbefb..965a051 100644 --- a/rabcrClient/ClothesTypes.cs +++ b/rabcrClient/ClothesTypes.cs @@ -2,12 +2,6 @@ using Microsoft.Xna.Framework.Graphics; namespace rabcrClient { - public class FallingBlockInfo{ - public NormalBlock block; - public DInt to, to16, from; - public bool side; - } - public class ClothesTypeUnderwearDown { public Texture2D TextureStatic, TextureWalking, TextureSwimming; public bool Colorize; diff --git a/rabcrClient/Default/Lang/Lang.xml b/rabcrClient/Default/Lang/Lang.xml index 5aebc69..1ed0873 100644 --- a/rabcrClient/Default/Lang/Lang.xml +++ b/rabcrClient/Default/Lang/Lang.xml @@ -5,6 +5,8 @@ + + @@ -98,7 +100,7 @@ - + @@ -115,7 +117,7 @@ Generated in Vygenerováno za - Vêgenerovány za + Vegenerovány za Vygenerový za Vygenerované za Generiert in @@ -201,7 +203,7 @@ Back Zpět - Zpátkê + Zpátke Wrócić Zpátky Zurück @@ -368,7 +370,7 @@ Keyboard Klávesy - Klávesê + Klávese Tastatura Tastatur キーボード @@ -780,7 +782,7 @@ Close Ukončit Začinić - Ôkončêt + Okončet Schließen Ukončiť Quitter le jeu @@ -886,7 +888,7 @@ Add Přidat - Přêdat + Předat Aděrować Hinzufügen Pridať @@ -1299,7 +1301,7 @@ The folder RabcrData has corrupted or missing content Složka RabcrData má požkozený nebo chybějící obsah Složka RabcrData má požkozenej nebo chybějící obsah - Složka RabcrData má požkozeny data nebo s chêbnym obsahem + Složka RabcrData má požkozeny data nebo s chebnym obsahem Zložka RabcrData má pożkodenia alebo chýbajúci obsah Folder RabcrData ma uszkodzoną lub brakującą zawartość フォルダーRabcrDataのコンテンツが破損しているか欠落しています @@ -1622,7 +1624,7 @@ Go to the menu Zpět do menu - Zpátkê do menô + Zpátke do meno Chodźić do menu Späť do menu Vá para o menu @@ -1813,7 +1815,7 @@ Respawn in Znovuzrodíš se za - Znovô se narodiš za + Znovo se narodiš za Znovuzrodíš sa za Odrodzenie w Malaperigita eng @@ -2076,7 +2078,7 @@ Adjusting Nastavuji Nastavuju - Nastavôjô + Nastavojo Nastavujem Naregulowanie 調整中 @@ -2282,7 +2284,7 @@ Cancel Zrušit - Anôlovat + Anolovat Přetorhnyć Abbrechen Zrušiť @@ -2366,7 +2368,7 @@ Apply Použít - Póžit + Póžet Wužiwać Übernehmen アプライ @@ -2719,7 +2721,7 @@ The size of the world Velikost světa Wulkósć swěta - Velêkosť sfěta + Velikosť sfěta Veľkosť sveta Wielkość świata O tamanho do mundo @@ -2809,7 +2811,7 @@ Load world from file Načíst svět ze souboru Swět wobchadźeć wot dataja - Načést sfět ze sóborô + Načést sfět ze sóboro Načítať svet zo súboru Załaduj świat z pliku Carregar mundo do arquivo @@ -2921,7 +2923,7 @@ Edit world Upravit svět - Ôpravêt sfět + Opravit sfět Wobdźěłać swět Bearbeiten Upraviť svet @@ -3011,7 +3013,7 @@ You can use GeDo tags Můžete použít GeDo značky - Mužete póžit GeDo značkê + Mužete póžit GeDo značke Môžete použiť GeDo značky Możesz użyć tagów GeDo U kunt GeDo-tags gebruiken @@ -3279,7 +3281,7 @@ Clean Vyčistit - Vêčêstit + Večestit Putzen Vyčistiť Limpio @@ -3458,7 +3460,7 @@ Notes Poznámky - Poznámkê + Poznámke Notatki ノート Anmerkungen @@ -3774,7 +3776,7 @@ Player Postavička - Postavêčka + Postavečka プレーヤー Charakter Jugador @@ -3936,7 +3938,7 @@ Depending on sex will be generated clothes Podle pohlaví bude vygenerováno oblečení - Podli pohlavi bôde včegenerované obšata + Podli pohlavi bode vegenerovana obšata Podľa pohlavia bude vygenerované oblečenie Odzież będzie generowana według płci 性別によって生成される服 @@ -4017,7 +4019,7 @@ Man Muž - Môž + Mož Muž Mann @@ -4096,7 +4098,7 @@ Enabled Zapnuto - Zapnôté + Zapnoté Aktiviert 有効化 Zapnuté @@ -4176,7 +4178,7 @@ Disabled Vypnuto - Vêpnôté + Vepnoté Deaktiviert 無効 Vypnuté @@ -4338,7 +4340,7 @@ Mature player Věk postavičky - Leta postavêčkê + Leta postavečke Dojrzały gracz Joueur mature Giocatore maturo @@ -4894,6 +4896,9 @@ Keyboard Klávesnice Klávesnica + Klávesnica + Klávesnica + Klávesnica Tastatur キーボード Klávesnica @@ -5217,7 +5222,7 @@ Jumping Skákání - Vêskákováni + Veskákováni Springen ジャンプ Skákanie @@ -5298,7 +5303,7 @@ Accelerate Zrychlení - Rêchléši pohêb + Rechléši poheb Убрзати Kuharakisha Beschleunegen @@ -5536,7 +5541,7 @@ Open bubble and write some text Otevřít bublinu ke psaní - Otevř žbolêno ke psani + Otevř žboleno ke psani Votevřít bublinu ke psaní Otvoriť bublinu na písanie Chat @@ -5618,7 +5623,7 @@ Drop item Vyhození itemu - Vêhozeni itemô + Vehozeni itemo Vyhodenie itema Upuść przedmiot Descarta un objeto @@ -5780,7 +5785,7 @@ Go from game to the menu Ze hry do menu - Ze hrê do menô + Ze hre do meno Od gry do menu ゲームからメニューへ Gehe vom Spiel zum Menü @@ -5861,7 +5866,7 @@ Language Jazyk - Jazêk + Jazek Rěč Sprache 言語 @@ -5944,7 +5949,7 @@ Game elements Herní prvky - Herni prvkê + Herni prvke Herné prvky ゲーム要素 Elementos del juego @@ -6173,7 +6178,7 @@ Zoom Přiblížení - Přêbléžêni + Přebléženi Vergrößern Priblíženie ズーム @@ -6244,8 +6249,8 @@ Type of scale - Typ roztáhnutí - Têp roztáhnôti + Typ roztáhnoutí + Tep roztáhnóti Stretch-Tipp Typ roztiahnutia Tipo di stiramento @@ -6466,7 +6471,7 @@ Loudness Hlasitost - Hlasêtost + Hlasetost Lautstärke Hlasitosť ボリューム @@ -6545,7 +6550,7 @@ Music Hudźba Hlasitost písní - Hlasêtost vêbřenkováni môzekê + Hlasetost vebřenkováni mozeke Musik Hlasitosť piesní Muzyka @@ -6625,7 +6630,7 @@ Effects Hlasitost efektů - Hlasêtost vêbřenkováni efektô + Hlasetost vebřenkováni efektu Hlasitosť efektov 音響効果 Efekty @@ -6705,7 +6710,7 @@ Length of transition Rychlost přechodu - Rêchlost přechodô + Rechlosť přechodo Rýchlosť prechodu Duración de la transición Lunghezza della transizione @@ -6979,7 +6984,7 @@ I've had 18 years Dosáhl jsem 18 let Su starší 18 let - Sô starši 18 let + So starši 18 let Dosiahol som 18 rokov Mi havis 18 jarojn У мене було 18 років @@ -7445,7 +7450,9 @@ Proportion Dle poměru - Podli poměrô + Podli poměro + Podla poměru + Podla poměru Podľa pomeru Proporción Proporzione @@ -7525,7 +7532,7 @@ Fill Vyplnit - Vêplnit + Veplnit Ausfüllen Vyplniť Wypełnij @@ -8109,7 +8116,7 @@ Clothes and crafting Oblečení a vyrábění - Obšata a vêráběni + Obšata a veráběni Bekleidung und Fertigung Oblečenie a vyrábanie Prendas de vestir y la fabricación @@ -8348,7 +8355,7 @@ Choose an item Vyberte item - Vêberte item + Veberte item Digitaka e dua na ka Wybierz przedmiot Wähle einen Gegenstand @@ -8414,7 +8421,7 @@ You can't breathe water Nemůžeš dýchat vodu - Nemužeš déchat vodô + Nemužeš déchat vodo Nemôžeš dýchať vodu Vi ne povas spiri akvon No puedes respirar agua @@ -8512,7 +8519,7 @@ You should eat and drink Měl bys jíst a pít Měl bys něco sníst a pít se - Měl bês něco snist a napit se + Měl bes něco snist a napit se Mal by si jesť a piť Vi devas manĝi kaj trinki Deberías comer y beber @@ -8700,8 +8707,8 @@ You were drawn to death Byl jsi utahán k smrti Byls utahán ke smrti - Bêls ôtahán ke smrti - Byl si utahanej ke smrti + Bels otahán ke smrti + Byl si utahan ke smrti Bol si uťahaný na smrť 死に疲れていました 死に疲れちょった @@ -8799,7 +8806,7 @@ Toadstool is poisonous Muchomůrka je jedovatá - Môchomurka se dá jist jen jednó + Mochomurka se dá jist jen jednó Muchotrávka je jedovatá Toadstool estas venena Toadstool es venenoso @@ -8898,7 +8905,7 @@ Fly Přiletět - Přêlétnót + Přelitnót Fliege Priletieť Flugu @@ -8977,7 +8984,7 @@ Create Vytvořit - Vêtvořit + Vetvořit Erstellen Vytvoriť Stwórz @@ -9063,7 +9070,7 @@ Sewing machine Šicí stroj - Šêci stroj + Šeci stroj Šijací stroj Kudromaŝino Màquina de cosir @@ -9142,7 +9149,7 @@ Macerator Drtič - Krôšedlo + Krošedlo Mazerator Drvič Macerador @@ -9281,6 +9288,7 @@ Items Itemy + Iteme Gegenstände Przedmioty Eroj @@ -9359,9 +9367,10 @@ Wooden box Dřevěná truhlice - Dřevěná trôhleca + Dřevěná trohleca Dřevěná kostna Dřevěná truhła + Dřevěná truhla Holztruhe Drevená truhlica Drewniana skrzynia @@ -9441,7 +9450,7 @@ Box Truhlice - Trôhleca + Trohleca Truhła Žigla Truhe @@ -9683,8 +9692,8 @@ Charger Nabíječka Nabiječka - Ladegerät Nabíjačka + Ladegerät Ładowarka Chargeur Ŝargilo @@ -9759,6 +9768,7 @@ Mining machine Vrták + Těžebné stroj Ťažobný stroj Wiertło Miner @@ -9891,7 +9901,7 @@ Folder with music Složka s hudbou - Složka s môzekó + Složka s mozekó Zložka s hudbou Dosierujo kun muziko Folder z muzyką @@ -9971,7 +9981,7 @@ Shelf Polička - Polêčka + Polečka Gestell Polica Półka @@ -10219,7 +10229,7 @@ Creative Tvořivá - Tvořêvá + Tvořevá Kreativ Tvorivá クリエイティブ @@ -10300,7 +10310,7 @@ Add new world Přidat nový svět - Přêdat nové sfět + Předat nové sfět Přidat novej svět Pridať nový svět Dodaj nowy świat @@ -10385,7 +10395,6 @@ Skrýt náhled Skovat náhled Skovat náhled - Schovat náhled Skrejt náhled Skryť náhľad Kaŝi spoiler @@ -10477,7 +10486,9 @@ Create portable world Zabalit svět do archivu - Zabalêt sfět do archivô + Zabalet sfět do archivo + Zabaliť svjet do archivu + Zabaliť svjet do archivu Zabaliť svet do archívu Krei portebla mondo Crea un mundo portátil @@ -10571,6 +10582,8 @@ Smazat celý svět Smazat celej svět Smazat celé sfět + Smazať cełý svjet + Smazať cełý svjet Odstráni celý svet Forigas la tutan mondon Elimina todo el mundo @@ -10667,10 +10680,11 @@ Where to save the world? - Smazat celej svět - Kam ôložêt sfět - Kam uložit svět - Kam uložiť svet + Kam mám uložit svět? + Kam uložit svět? + Kam oložet sfět + Kaj mŏm ulożić śwjot? + Kaj mům ulożić śwjot? Kie savi la mondon? ¿Dónde salvar al mundo? Gdzie uratować świat? @@ -12156,7 +12170,7 @@ Check if I'o using the latest version of the game Zkontrolovat zda používám nejnovější verzi hry - Skontrolovat ešlê póživám nénovjéši verzi hrê + Skontrolovat ešle póživám nénovjéši verzi hre Zkontrolovat či používam najnovšiu verzií hry Comprueba si estoy usando la última versión del juego Sprawdź, czy korzystam z najnowszej wersji gry @@ -12446,7 +12460,7 @@ Sign in Přihlášení - Přêhlášeni + Přehlášeni Prihlásenie サインイン Zaloguj się @@ -12527,7 +12541,7 @@ Choose a world Vyberte si svět - Vêberte si sfět + Veberte si sfět Vyberte si svet Wybierz świat Elektu mondon @@ -12796,7 +12810,9 @@ Prepare for regeneration Připravit k přegenerování - Přêpravit k přegenerováni + Přepravit k přegenerováni + Připraviť k přegenerování + Připraviť k přegenerování Pripraviť k pregenerovanie Preparu por regenerado Prepárate para la regeneración @@ -13166,7 +13182,7 @@ Save + Optimize Uložení + Optimalizace Uložení + Voptimalizace - Ôložêni + optimalizace + Oložêni + optimalizaca Uloženie + Optimalizácia Konservi + Optimigi Guardar + Optimizar @@ -14064,7 +14080,7 @@ We've detected errors, check Data Objevili jsme chyby, zkontrolujte Data - Vêštáralê sme mélkê, skontrolôjte Data + Veštáralê sme mélke, skontrolôjte Data Objavili sme chyby, kontrolujte Data Znaleźliśmy błędy, sprawdź dane エラーを検出しました。データを確認してください @@ -14398,7 +14414,7 @@ Crafting Vyrábění - Vêráběni + Veráběni Vyrábanie クラフト Basteln @@ -16253,32 +16269,19 @@ 五倍 - - Ex. 1 Solve the equation 2*x-%num%=0 and type the number in the box - - Př. 1 Vyřešte rovnici 2*x-%num%=0 a číslo napište do pole - - Př. 1 Vyřešte rovnicu 2*x-%num%=0 a číslo napište do pole - - Př. 1 Vêřešte rovnicô 2*x-%num%=0 a čislo napište do pole - - Bsp. 1 Lösen Sie die Gleichung 2*x-%num%=0 und geben Sie die Zahl in das Feld ein - - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力します - - Pr. 1 Vyriešte rovnicu 2*x-%num%=0 a do poľa zadajte číslo - - Ex. 1 Résolvez l'équation 2*x-%num%=0 et tapez le nombre dans la case - - Es. 1 Risolvi l'equazione 2*x-%num%=0 e digita il numero nella casella - - Ej. 1 Resuelve la ecuación 2*x-%num%=0 y escribe el número eng el cuadro - - Np. 1 Rozwiąż równanie 2*x-%num%=0 i wpisz liczbę w polu - - 例 1 方程式 2*x-%num%=0 ぅ解き、ボックスに数値ぅ入力する - - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する + Ex. 1 Solve the equation 2*x-%num%=0 and type the number in the box + Př. 1 Vyřešte rovnici 2*x-%num%=0 a číslo napište do pole + Př. 1 Vyřešte rovnicu 2*x-%num%=0 a číslo napište do pole + Př. 1 Veřešte rovnicô 2*x-%num%=0 a čislo napište do pole + Bsp. 1 Lösen Sie die Gleichung 2*x-%num%=0 und geben Sie die Zahl in das Feld ein + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力します + Pr. 1 Vyriešte rovnicu 2*x-%num%=0 a do poľa zadajte číslo + Ex. 1 Résolvez l'équation 2*x-%num%=0 et tapez le nombre dans la case + Es. 1 Risolvi l'equazione 2*x-%num%=0 e digita il numero nella casella + Ej. 1 Resuelve la ecuación 2*x-%num%=0 y escribe el número eng el cuadro + Np. 1 Rozwiąż równanie 2*x-%num%=0 i wpisz liczbę w polu + 例 1 方程式 2*x-%num%=0 ぅ解き、ボックスに数値ぅ入力する + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する 例 1 方程式 2*x-%num%=0 ば解き、ボックスに数値ば入力する @@ -16299,10 +16302,8 @@ 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する 例 1 方程式 2*x-%num%=0 解き、ボックスに数値入力する - - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する - - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する Ex. 1 Resolva a equação 2*x-%num%=0 e digite o número na caixa Eks. 1 Løs ligningen 2*x-%num%=0, og skriv tallet i boksen Ex. 1 Resoleu l'equació 2*x-%num%=0 i escriviu el número al quadre @@ -16962,7 +16963,7 @@ Hydrochloric acid kyselina chlorovodíková - kêselêna chlorovodiková + keselena chlorovodiková Kyselina chlorovodíková Ácido clorhídrico Acide chlorhydrique @@ -17492,7 +17493,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Show program details Zobrazit detaily programu - Zobrazit detajlê programô + Zobrazit detajle programo Zobraziť detaily programu Hûrguliyên bernameyê nîşan bidin Mostrar detalles del programa @@ -17582,7 +17583,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hide program details Skrýt detaily programu - Skovat detaily programô + Skovat detaily programo Schovat detaily programu Skrejt detaily programu Skryť detaily programu @@ -17769,7 +17770,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t You ran out of air Došel ti vzduch - Nebêls dlóho na luftô + Nebels dlóho na lufto Zabrakło ci powietrza Došiel ti vzduch Elfogyott a levegő @@ -17868,7 +17869,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Apparatus for air production Přístroj na tvorbu vzduchu - Přéstroj na vêráběni luftô + Přéstroj na veráběni lufto Urządzenia do produkcji powietrza Prístroj na tvorbu vzduchu Készülékek levegő előállításához @@ -17959,7 +17960,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t You need a spacesuit to survive Potřebuješ skafandr aby si přežil - Môsiš mět skafandr abês přežil + Mosiš mět skafandr abes přežil Urządzenia do produkcji powietrza Potrebuješ skafander aby si prežil Szüksége van egy kosztümre a túléléshez @@ -18139,7 +18140,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Constructed Umělé - Ôměly + Oměly Języki sztuczne Umelé jazyky Lenguajes artificiales @@ -19126,7 +19127,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Building world... Sestavování světa... - Sfět se nastrmélôje... + Sfět se nastrméloje... Xây dựng thế giới... Zostavovanie sveta... Składanie świata... @@ -19372,99 +19373,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ITukutuku vakayaloyalo Perfil de gráficos - - This setting will be applied after restart. - Tohle nastavení bude aplikováno až po znovuspuštění. - Tohle nastaveni bôde aplikováné až po znovôspôštěni. - Toto nastavenie bude aplikované po znovuspustenie. - この設定は再起動後に適用されます。 - こん設定は再起動後に適用さるっ。 - こん設定は再起動後に適用さるる。 - こん設定は再起動後に適用さるる。 - こん設定は再起動後に適用さるる。 - この設定は再起動後さ適用されます。 - この設定は再起動後に適用されー。 - この設定は再起動後に適用される。 - この設定は再起動後に適用される。 - この設定は再起動後に適用される。 - この設定は再起動後に適用される。 - この設定は再起動後に適用される。 - この設定は再起動後に適用される。 - To ustawienie zostanie zastosowane po ponownym uruchomieniu. - Diese Einstellung wird nach dem Neustart angewendet. - Esta configuración se aplicará después del reinicio. - Questa impostazione verrà applicata dopo il riavvio. - Essa configuração será aplicada após a reinicialização. - Denne indstilling anvendes efter genstart. - Ce paramètre sera appliqué après le redémarrage. - Aquest paràmetre s'aplicarà després del reinici. - Це налаштування буде застосовано після перезавантаження. - Deze instelling wordt toegepast na opnieuw opstarten. - 重新啟動後將應用此設置。 - 이 설정은 다시 시작한 후에 적용됩니다. - سيتم تطبيق هذا الإعداد بعد إعادة التشغيل. - بۇ تەڭشەك قايتا قوزغىتىلغاندىن كېيىن قوللىنىلىدۇ. - اس ترتیب کا اطلاق دوبارہ شروع ہونے کے بعد ہوگا۔ - Ово подешавање ће се применити након поновног покретања. - Vê mîhengê dê piştî destpêkirinê were sepandin. - Ta nastavitev bo uporabljena po ponovnem zagonu. - Оваа поставка ќе се примени по рестартирање. - Тази настройка ще бъде приложена след рестартиране. - Ĉi tiu agordo estos aplikita post rekomenco. - Tätä asetusta käytetään uudelleenkäynnistyksen jälkeen. - Denna inställning kommer att tillämpas efter omstart. - Ky cilësim do të zbatohet pas rinisjes. - Mpangilio huu utatumika baada ya kuanza upya. - Dës Astellung gëtt nom Restart applizéiert. - Thèid an suidheachadh seo a chuir an sàs an dèidh ath-thòiseachadh. - यह सेटिंग पुनरारंभ करने के बाद लागू की जाएगी। - रीस्टार्ट नंतर ही सेटिंग लागू होईल. - यो सेटिंग पुन: शुरू पछि लागू हुनेछ। - Lokhu kulungiselelwa kuzosetshenziswa ngemuva kokuqala kabusha. - Hic applicari posse post occasum erit sileo. - Cuirfear an socrú seo i bhfeidhm tar éis atosú. - Ezt a beállítást az újraindítás után alkalmazzák. - Ang setting na ito ay ilalapat pagkatapos ng restart. - Šis nustatymas bus pritaikytas iš naujo paleidus. - Ova postavka primijenit će se nakon ponovnog pokretanja. - Pengaturan ini akan diterapkan setelah restart. - Šis iestatījums tiks lietots pēc restartēšanas. - Dan l-issettjar jiġi applikat wara li terġa 'tibda. - Denne innstillingen blir brukt etter omstart. - Această setare va fi aplicată după repornire. - Hierdie instelling sal toegepas word na herbegin. - Olu seto luya kusetyenziswa emva kokuqalisa kwakhona. - Igenamiterere rizakoreshwa nyuma yo gutangira. - Ka whakamahia tenei tautuhinga i muri i te tiimata. - Ezarpen hau berrabiarazi ondoren aplikatuko da. - Ova postavka primijenit će se nakon ponovnog pokretanja. - Ang kini nga setting ig-apply pagkahuman sa pagsugod usab. - Zokonzera izi zidzagwiritsidwa ntchito poyambiranso. - Dizze ynstelling sil wurde tapast nei herstarten. - Esta configuración aplicarase despois do reinicio. - Anviwònman sa a pral aplike apre rekòmanse. - Za'a yi amfani da wannan saitin bayan sake kunnawa. - E noi ʻia kēia hoʻonohonoho ma hope o ka hoʻomaka hou ʻana. - Qhov kev teeb tsa no yuav raug siv tom qab pib dua. - Ntọala a ga-etinye n'ọrụ mgbe ịmalitegharị. - Энэ тохиргоог дахин эхлүүлсний дараа хэрэгжүүлэх болно. - Ity toe-javatra ity dia hampiharina aorian'ny famerenana amin'ny laoniny. - Tetapan ini akan digunakan setelah dimulakan semula. - Бу көйләү яңадан башланганнан соң кулланылачак. - Setelan iki bakal ditrapake sawise diwiwiti maneh. - Eto yii yoo lo lẹhin atunbere. - Questa impostazione serà applicata dopu u riavvio. - Þessari stillingu verður beitt eftir endurræsingu. - Бұл параметр қайта іске қосылғаннан кейін қолданылады. - Izvi zvichaiswa mushure mekutanga zvekare. - Peakanyo ena e tla sebelisoa kamora ho qala bocha. - Cài đặt này sẽ được áp dụng sau khi khởi động lại. - See seade rakendatakse pärast taaskäivitamist. - Bydd y gosodiad hwn yn cael ei gymhwyso ar ôl ailgychwyn. - ʻE fakaʻaongaʻi ʻa e tukunga ko ʻeni hili hano toe kamata. - Na ituvatuva oqo ena vakayagataki ni oti na veivakayayataki tale. - Esta configuração será aplicada após a reinicialização. - + Basic Základní @@ -21057,7 +20966,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t その他のオプションについては、グラフィックコントロールパネルを参照してください Více nastavení naleznete v ovládacím panelu grafiky Víc nastavení nandete v ovládacím panelu grafiky - Vic nastaveni nandete v ovládacim panelô grafikê + Vic nastaveni nandete v ovládacim panelo grafike Viac nastavení nájdete v ovládacom paneli grafiky Więcej ustawień można znaleźć w graficznym panelu sterowania Weitere Optionen finden Sie in der Grafiksteuerung @@ -21139,7 +21048,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Control panel is opening.|It takes a few seconds...||Not opening?|Check "NVIDIA Display Constrainer LS" service. Otevírá se ovládací panel.|Vyčkejte pár sekund...||Neotevírá se?|Zkontrolujte službu "NVIDIA Display Constrainer LS". Otvírá se ovládací panel.|Počkejte pár sekund...||Neotvírá se?|Skontrolujte službu "NVIDIA Display Constrainer LS". - Otvirá se ovládaci panel.|Počkéte pár sekund...||Neotvirá se?|Skontrolôjte slôžbô "NVIDIA Display Constrainer LS". + Otvirá se ovládaci panel.|Počkéte pár sekund...||Neotvirá se?|Skontrolojte složbo "NVIDIA Display Constrainer LS". Votevírá se ovládací panel.|Dejte tomu pár sekund...||Nevotevírá se?|Zkontrolujte službu "NVIDIA Display Constrainer LS". Otvára sa ovládací panel.|Dajte tomu pár sekúnd...||neotvára sa?|Skontrolujte službu "NVIDIA Display Constrainer LS". Panel sterowania otwiera się.|Daj mu kilka sekund...||Nie otwiera się?|Sprawdź usługę „NVIDIA Display Constrainer LS”. @@ -21387,7 +21296,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t この世界は古いバージョンで作成されているため、このバージョンと互換性がありません Tento svět byl vytvořen ve starší verzi, která není kompatibilní s nynější Tento svět byl vytvořen ve starší verzi, která néni kompatibilní s touhle - Tento sfět bêl vêtvořené ve staré verzi, kerá néni kompatibilni s tóhle + Tento sfět bel vetvořené ve staré verzi, kerá néni kompatibilni s tóhle Tento svet bol vytvorený v staršej verzii, ktorá nie je kompatibilná s terajšou Ten świat został stworzony w starszej wersji, która nie jest kompatybilna z obecną Diese Welt wurde mit einer alten Version erstellt und ist daher nicht mit dieser Version kompatibel @@ -22359,7 +22268,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Meki Levu cake Max - Max. Max + Max Uas MAX Ātawhi @@ -23534,7 +23443,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Iron pickaxe Železný krumpáč Železnej krumpáč - Železné krômpáč + Železné krompáč Železný krompáč Żelazny kilof 鉄のツルハシ @@ -24413,7 +24322,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kamenný nůž Kamenný fedrmesr Kamenný núž - Kamenný nôž + Kamenný nož ストーンナイフ Kamienny nóż Steinmesser @@ -24494,7 +24403,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Železný nůž Železné nuž Železnej nůž - Železný nôž + Železný nož Eisenmesser アイアンナイフ Żelazny nóż @@ -28773,6 +28682,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dirt Hlína + Hlena Brud Hlina Suciedad @@ -30650,7 +30560,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Spruce leaves Smrkové jehličí - Jehleči ze smrkô + Jehleči ze smrko Smrekové ihličie スプルースの葉 Igły świerkowe @@ -33348,7 +33258,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Desert grass with dirt Pouštní tráva s hlínou - Póštní tráva s hlinó + Póštní tráva s hlenó Púštna tráva s hlinou 土と砂漠の草 Trawa pustynna z gliną @@ -33429,7 +33339,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Forest grass with dirt Lesní tráva s hlínou - Lesni tráva se hlinó + Lesni tráva se hlenó Lesná tráva s hlinou 土と森の草 Trawa leśna z gliną @@ -33511,7 +33421,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hills grass with dirt Horská tráva s hlínou - Horská tráva se hlinó + Horská tráva se hlenó Horská tráva s hlinou 土と丘の草 Trawa górska z gliną @@ -33593,7 +33503,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Jungle grass with dirt Tropická tráva s hlínou - Tropická tráva s hlinó + Tropická tráva s hlenó Tropická tráva s hlinou 土と密林の草 Tropikalna trawa z gliną @@ -33674,7 +33584,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Plains grass with dirt Stepní tráva s hlínou - Stepni tráva se hlinó + Stepni tráva se hlenó Stepná tráva s hlinou 土と平野草 Trawa stepowa z gliną @@ -36197,6 +36107,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dirt background Pozadí hlíny + Pozadi hlene 土の背景 Pozadie hliny Tło gliny @@ -47866,6 +47777,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sticks Větev Haluz + Krkoš スティック Klacek Kij @@ -48861,6 +48773,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Space boots Vesmírné boty + Vesmírnej boty + Vesmírny baganče Vesmírný boty スペースブーツ Vesmírne topánky @@ -60579,8 +60493,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t The award can only be used in adventure mode, otherwise it would be too easy - Ocenění lze používat jen v dobrodružném módu, jinak by to bylo příliš jednoduché - Tak hele vocenění jen v dobrodružným módu, jinak by to bylo příliš jednoduchý + Ocenění lze používat jen v dobrodružném modu, jinak by to bylo příliš jednoduché + Tak hele vocenění jen v dobrodružným modu, jinak by to bylo příliš jednoduchý + Tož oceněni jenom v dobrodružnym módo, ináč be to belo opravdo jednodochy Ocenenie je možné používať len v dobrodružnom módu, inak by to bolo príliš jednoduché アワードはアドベンチャーモードでのみ使用できます。そうでない場合は簡単すぎます。 Le prix ne peut être utilisé qu'en mode aventure, sinon ce serait trop facile @@ -61484,7 +61399,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fly mode in creative Létající mod v kreativním modu Létající mód v kreativním módu - Létajici mód v kreativnim módu + Litaci mód v kreativnim módo Lietajúci mód v kreatívnom móde クリエイティブのフライモード Mode Fly en création @@ -66536,8 +66451,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Onglet (5 espaces) - Skrýt všechny typy tagů Hide all types of tags + Skrýt všechny typy tagů + Skovat všecky typy tagů + Skovat všecke tepe tagu + Skryť všetky typy tagov Masquer tous les types de balises إخفاء جميع أنواع العلامات Ocultar todo tipo de etiquetas @@ -66549,7 +66467,6 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Сховати всі типи тегів 모든 유형의 태그 숨기기 隱藏所有類型的標籤 - Skryť všetky typy tagov Dölj alla typer av taggar Amaga tot tipus d'etiquetes Piilota kaiken tyyppiset tunnisteet @@ -66726,7 +66643,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lemonade Šumivá voda - Šumivá limonáda + Limonáda Wainimoli Limonada Limonade @@ -66899,6 +66816,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Medium Střední + Středni Stredný Średni Mittel @@ -67015,7 +66933,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Graphics card note - Poznámka ke grafické kartě + Poznámka k grafické kartě + Poznámka ke graficky kartě Poznámka grafickej karty Uwaga karty graficznej Grafikkarten-Anmerkung @@ -67081,7 +67000,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t It looks like you have another more powerful graphics card, Vypadáto, že máte další lepší grafickou kartu, - Vyzerá to, že máte ďalšiu vynikajúcu grafickú kartu, + Vepadáto, že máte dalši lepši grafickó karto, + Vyzerá to, že máte další lepší grafickú kartu, + Vyzerá to, že máte ďalšiu lepšie grafickú kartu, Wygląda na to, że masz kolejną mocniejszą kartę graficzną, Es sieht so aus, als hätten Sie eine weitere leistungsfähigere Grafikkarte, もう一度強力なグラフィックカードを持っているように見えます、 @@ -67144,6 +67065,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t but now it is probably used slower. ale asi používáte tu pomalejší + ale ase poožéváte to pomaléši Ale teraz sa pravdepodobne používa pomalšie. Ale teraz prawdopodobnie jest używany wolniej. Aber jetzt wird es wahrscheinlich langsamer verwendet. @@ -67209,7 +67131,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Currently Using gpu: Právě používaná gpu: Fčilka používaná gpu: - V súčasnosti používajte GPU: + Práve používané GPU: Obecnie korzystanie z GPU: Derzeit mit GPU: 現在GPUを使用しています: @@ -67328,6 +67250,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fog Mlha + Mha Hmla Mgła Nebel @@ -67391,6 +67314,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Waving elements Vlnící se objekty + Płápołajucí se objekty Mávacie prvky Macha elementami Wellenförmige Elemente @@ -67586,6 +67510,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t None Žádné + Žádny Nefajčiarsky Nic なし @@ -67652,6 +67577,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hezké Pěkné Pěkny + Pěkné Vymazať Wymyślny Schick @@ -67707,60 +67633,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t 16倍 - Upscaling AA - Vyhlazení zvětšením - Upscaling AA - Upscaling AA - Upscaling Aa - アップスケーリングAA - Amorcaling AA - Opskalering AA - AA UPSCALING AA - Зголемување на АА - Upscaling aa - UpSaling aa - Upscaling aa - Upscaling aa - УпСцалинг АА - Az AA felemelkedése - Upscaling aa - Upcaling aa - Upscaling aa - UPSCALING AA - Upscaling Aa - Upscaling aa - Upscaling aa - Oppskalering AA - Upscaling aa - Îmbunătățirea AA - Uppskalande AA - AA-yê nûve dike - Àrdachadh aa - Ukuphakama kwe-AA - Upscaling aa - Inyuka i-aa - Upscal aa - Upscalcalya AA - AA upinging - Pag-update sa AA - Kukulitsa aa - Upscaling aa - Upscaling aa - Upscaling aa - Againsing AA - UPScalling AA - Na-ebili aa - Upscaling aa - Upscaling aa - Күтәрелеш А.А - 업 스케일링 AA - 升級AA - Upscaling aa - AA UPCCING AA - Upscaling aa - Matanivola Levu CakeSA - Upscaling AA - Mise à l’échelle de l’AA + Supersampling + Supersampling 1/x @@ -67768,6 +67642,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Falling leaves Padající listí + Padajici lesti Padajúce listy Opadające liście Fallende Blätter @@ -67875,6 +67750,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fancy background Hezké pozadí + Pěkné pozadí + Pěkny pozadi Na pozadí Fantazyjny tło Fancy-Hintergrund @@ -67940,6 +67817,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Better snow and rain Lepší sníh a déšť Lepší sníh a dyšť + Lepši snih a dyšť + Onakvjejší sněh a déšč Lepší sneh a dážď Lepszy śnieg i deszcz Besserer Schnee und Regen @@ -68125,6 +68004,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Spruce leaves with snow Smrkové jehličí se sněhem + Smrkovy jehleči se sněhem + Smrekové spenčí se sněhem Smrekové listy so snehom Świerkowe liście ze śniegiem Fichtenblätter mit Schnee @@ -68186,5 +68067,15 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drauni uca cevata Feuilles d’épinette avec de la neige + + + Invert mouse scroll + Obrátit posun kolečkem + + + Some settings will be applied after restart. + Některé nastavení bude aplikováno až po znovuspuštění. + Nekery nastaveni bode aplikováné až po znovospoštěni. + \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/GameMethods.cs b/rabcrClient/InterLogic/Game/GameMethods.cs index 47b8920..a18373f 100644 --- a/rabcrClient/InterLogic/Game/GameMethods.cs +++ b/rabcrClient/InterLogic/Game/GameMethods.cs @@ -275,7 +275,6 @@ public static bool IsHalfShadowBlock(ushort id) _ => false, }; - public static bool IsSelectedKnife(ushort id) => id switch { (ushort)Items.KnifeCopper => true, @@ -1202,6 +1201,7 @@ public static ushort SolidBlockFromItem(ushort item) (ushort)Items.StoneRhyolite => (ushort)BlockId.StoneRhyolite, (ushort)Items.StoneSandstone => (ushort)BlockId.StoneSandstone, (ushort)Items.StoneSchist => (ushort)BlockId.StoneSchist, + (ushort)Items.StoneAnorthosite => (ushort)BlockId.Anorthosite, // Ore (ushort)Items.OreAluminium => (ushort)BlockId.OreAluminium, (ushort)Items.OreCopper => (ushort)BlockId.OreCopper, @@ -1381,6 +1381,7 @@ public static ushort MobFromItem(ushort item) static readonly ushort[] FallingBlocks={ (ushort)BlockId.Sand, (ushort)BlockId.Dirt, + (ushort)BlockId.Gravel, (ushort)BlockId.GrassBlockClay, (ushort)BlockId.GrassBlockCompost, (ushort)BlockId.GrassBlockDesert, @@ -1395,9 +1396,9 @@ public static ushort MobFromItem(ushort item) public static bool IsFallingBlock(ushort blockId) { foreach (ushort i in FallingBlocks) { - if (blockId==i) return true; + if (blockId==i) return true; } - return true; + return false; } public static bool CanDestroy(ushort blockId) { @@ -4571,7 +4572,6 @@ public static bool IsItemInvBasic32(ushort id) _ => false, }; - public static bool IsItemInvTool32(ushort id) => id switch { // Hoe diff --git a/rabcrClient/InterLogic/Global/Setting.cs b/rabcrClient/InterLogic/Global/Setting.cs index df840d2..663c2a6 100644 --- a/rabcrClient/InterLogic/Global/Setting.cs +++ b/rabcrClient/InterLogic/Global/Setting.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using System; @@ -72,6 +73,9 @@ public enum FogTypes:byte { public static FogTypes Fog=FogTypes.Fancy; public static bool BetterSnowAndRain=true; public static float SlideChangeTimeInTicks => 0.006f/slideChangeTime; + + public static GraphicsProfile GraphicsProfile =GraphicsProfile.Reach; + public static float NightBrightness=0.6f; public static float slideChangeTime=0.05f; @@ -93,8 +97,10 @@ public enum FogTypes:byte { public static Microsoft.Xna.Framework.Input.Keys KeyDropItem=Microsoft.Xna.Framework.Input.Keys.LeftControl; public static Microsoft.Xna.Framework.Input.Keys KeyExit=Microsoft.Xna.Framework.Input.Keys.Escape; - public static Microsoft.Xna.Framework.Input.Keys KeyFlyMode=Microsoft.Xna.Framework.Input.Keys.F4; + public static Keys KeyFlyMode=Microsoft.Xna.Framework.Input.Keys.F4; public static Microsoft.Xna.Framework.Input.Keys KeyShowInfo=Microsoft.Xna.Framework.Input.Keys.F1; + public static bool Touchpad=false; + public static bool InvertedMouse=false; #endregion public static void CreateSettings() { @@ -151,8 +157,10 @@ public enum FogTypes:byte { (byte)KeyExit, (byte)KeyShowInfo, + (byte)CurrentLanguage, Constants.AnimationsControls ? (byte)1 : (byte)0, + InvertedMouse ? (byte)1 : (byte)0, WavingElements ? (byte)1 : (byte)0, Clouds ? (byte)1 : (byte)0, BackgroundFancy ? (byte)1 : (byte)0, @@ -162,7 +170,12 @@ public enum FogTypes:byte { SnowAndRain ? (byte)1 : (byte)0, Vignetting ? (byte)1 : (byte)0, SunAndMoon ? (byte)1 : (byte)0, + + (byte)Multisapling, (byte)(UpScalingSuperSapling*10), + (byte)GraphicsProfile, + + //(byte)(UpScalingSuperSapling), (byte)Fog, // (byte)GraphicsProfile, @@ -223,6 +236,7 @@ public enum FogTypes:byte { CurrentLanguage=*current++; Constants.AnimationsControls=(*current++) == 1; + InvertedMouse=(*current++) == 1; WavingElements=(*current++) == 1; Clouds=(*current++) == 1; BackgroundFancy=(*current++) == 1; @@ -232,7 +246,13 @@ public enum FogTypes:byte { SnowAndRain=(*current++) == 1; Vignetting=(*current++) == 1; SunAndMoon=(*current++) == 1; - UpScalingSuperSapling=(*current++)/10f; + + Multisapling=(*current++); + // (byte)(UpScalingSuperSapling*10), + UpScalingSuperSapling=(*current++)/10f; + GraphicsProfile=(GraphicsProfile)(*current++); + + Fog=(FogTypes)(*current++); diff --git a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs index 314a06c..9bf3cbb 100644 --- a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs +++ b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs @@ -159,7 +159,15 @@ public class Rabcr : Game { // Graphics.RasterizerState.MultiSampleAntiAlias=true; GraphicsManager.PreparingDeviceSettings += new EventHandler(graphics_PreparingDeviceSettings); void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) { - e.GraphicsDeviceInformation.GraphicsProfile = GraphicsProfile.HiDef; + if (Setting.GraphicsProfile==GraphicsProfile.HiDef) { + try{ + e.GraphicsDeviceInformation.GraphicsProfile = Setting.GraphicsProfile; + }catch{ + Setting.GraphicsProfile=GraphicsProfile.Reach; + e.GraphicsDeviceInformation.GraphicsProfile = Setting.GraphicsProfile; + } + }else e.GraphicsDeviceInformation.GraphicsProfile = Setting.GraphicsProfile; + e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount=Setting.Multisapling; // // e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval Debug.WriteLine("MultiSampleCount: " + e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount); diff --git a/rabcrClient/Particles.cs b/rabcrClient/Particles.cs index 9039033..b396a82 100644 --- a/rabcrClient/Particles.cs +++ b/rabcrClient/Particles.cs @@ -204,4 +204,10 @@ class FallingLeave { layerDepth: 1f); } } + public class FallingBlockInfo { + public NormalBlock block; + public DInt to, to16, from; + public bool side; + public float Speed; + } } \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs index 93df3c6..dbb9b1d 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs @@ -53,7 +53,7 @@ public float } } - public Color ToColor() => new Color(R, G, B); + public Color ToColor() => new(R, G, B); } class MainMenu :MenuScreen { @@ -88,8 +88,8 @@ class MainMenu :MenuScreen { var buttonSingleplayer = new Button(Textures.ButtonLongLeft, Lang.Texts[6]); buttonSingleplayer.Click+=GoToSingleplayer; - var buttonMultiplayer = new Button(Textures.ButtonLongLeft, Lang.Texts[7]); - buttonMultiplayer.Click+=GoToMultiplayer; + // var buttonMultiplayer = new Button(Textures.ButtonLongLeft, Lang.Texts[7]); + // buttonMultiplayer.Click+=GoToMultiplayer; var buttonSetting = new Button(Textures.ButtonLongLeft, Lang.Texts[8]); buttonSetting.Click+=GoToSettings; @@ -106,9 +106,9 @@ class MainMenu :MenuScreen { buttonsSide=new Button[]{ buttonSingleplayer, - #if DEBUG - buttonMultiplayer, - #endif + //#if DEBUG + //buttonMultiplayer, + //#endif buttonCharacter, buttonSetting, diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs index 15743db..ba56abb 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs @@ -24,7 +24,7 @@ class MenuSetting: MenuScreen { float smoothMouse=0; int PageHeight=1290+60+70+60+90+90+90+90+90+90+500; #endregion - + bool afterrestart; public override void Init() { buttonMenu= new Button(Textures.ButtonLongLeft,Lang.Texts[1]); buttonMenu.Click+=ClickMenu; @@ -48,7 +48,11 @@ class MenuSetting: MenuScreen { Resize(); } - void ClickMenu(object sender, EventArgs e) => ((Menu)Rabcr.screen).GoToMenu(new MainMenu()); + void ClickMenu(object sender, EventArgs e) { + if (afterrestart) System.Windows.Forms.MessageBox.Show(Lang.Texts[1616]); + + ((Menu)Rabcr.screen).GoToMenu(new MainMenu()); + } void Move(object sender, EventArgs e) { start=-1; @@ -263,13 +267,19 @@ class MenuSetting: MenuScreen { } { SettingKey button=new(tex, Lang.Texts[1514], Setting.KeyShowInfo); - button.Click+=ClickKeyRun; - settings.Add(button); - - void ClickKeyRun() { + button.Click += () => { Setting.KeyShowInfo=button.Key; Global.ChangedSettings=true; - } + }; + settings.Add(button); + } + { + SettingOnOff button=new(tex, Lang.Texts[1615], Setting.InvertedMouse); + button.Click += () => { + Setting.InvertedMouse=button.ON; + Global.ChangedSettings=true; + }; + settings.Add(button); } #endregion @@ -468,7 +478,7 @@ class MenuSetting: MenuScreen { 16 => 4, _ => 0, }; - SettingSwitcher button = new(tex, Lang.Texts[1609], new string[]{ Lang.Texts[272], Lang.Texts[276], Lang.Texts[279], Lang.Texts[1604], Lang.Texts[1605]}, index); + SettingSwitcher button = new(tex, Lang.Texts[1609], new string[]{ Lang.Texts[87/*272*/], Lang.Texts[276], Lang.Texts[279], Lang.Texts[1604], Lang.Texts[1605]}, index); button.Click += () => { Setting.Multisapling = button.selected switch { 0 => 1, @@ -477,41 +487,91 @@ class MenuSetting: MenuScreen { 3 => 8, 4 => 16, _ => 0 - }; ; + }; Global.ChangedSettings = true; + afterrestart=true; + // System.Windows.Forms.MessageBox.Show(Lang.Texts[1616]); }; settings.Add(button); } // Upscaling { + float maxUpscaling=20f; + if (Graphics.GraphicsProfile==GraphicsProfile.HiDef){ + float scale = 8192f / GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; + if (scalemaxUpscaling) { + if (Setting.UpScalingSuperSapling==16) Setting.UpScalingSuperSapling=8; + } + if (Setting.UpScalingSuperSapling>maxUpscaling) { + if (Setting.UpScalingSuperSapling==8) Setting.UpScalingSuperSapling=4; + } + if (Setting.UpScalingSuperSapling>maxUpscaling) { + if (Setting.UpScalingSuperSapling==4) Setting.UpScalingSuperSapling=2; + } + + if (Setting.UpScalingSuperSapling>maxUpscaling) { + if (Setting.UpScalingSuperSapling==2) Setting.UpScalingSuperSapling=1; + } + // Setting.UpScalingSuperSapling=1; int index=-1; - index = (int)Setting.Multisapling switch { + index = (int)Setting.UpScalingSuperSapling switch { -1 => 0, + 0 => 0, 1 => 1, 2 => 2, 4 => 3, - 8 => 4, - 16 => 5, + // 8 => 4, + // 16 => 5, _ => 0, }; - SettingSwitcher button = new(tex, Lang.Texts[1606], new string[]{ Lang.Texts[1607], Lang.Texts[272], Lang.Texts[276], Lang.Texts[279], Lang.Texts[1604], Lang.Texts[1605]}, index); + string[] res; + // if (maxUpscaling>=16) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276], Lang.Texts[279], Lang.Texts[1604], Lang.Texts[1605]}; + // else if (maxUpscaling>=8) res=new string[]{ Lang.Texts[1607], Lang.Texts[272], Lang.Texts[276], Lang.Texts[279], Lang.Texts[1604]}; + // else + if (maxUpscaling>=4) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276], Lang.Texts[279]}; + else if (maxUpscaling>=2) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276]}; + else res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87]}; + SettingSwitcher button = new(tex, Lang.Texts[1606], res, index); button.Click += () => { - Setting.Multisapling = button.selected switch { + Setting.UpScalingSuperSapling = button.selected switch { 0 => 0, 1 => 1, 2 => 2, 3 => 4, - 4 => 8, - 5 => 16, + // 4 => 8, + // 5 => 16, _ => -1 - }; ; + }; + if (Setting.UpScalingSuperSapling>maxUpscaling) Setting.UpScalingSuperSapling=1; Global.ChangedSettings = true; }; settings.Add(button); } - + // Graphics profile + { + SettingSwitcher button = new(tex, Lang.Texts[319], new string[]{ Lang.Texts[318], Lang.Texts[317] }, (int)Setting.GraphicsProfile); + button.Click += () => { + Setting.GraphicsProfile=(GraphicsProfile)button.selected; + Global.ChangedSettings=true; + afterrestart=true; + //System.Windows.Forms.MessageBox.Show(Lang.Texts[1616]); + }; + settings.Add(button); + } + //{ // SettingSwitcher button = new(tex, Lang.Texts[125], new string[]{ Lang.Texts[1587], Lang.Texts[1588], Lang.Texts[1589], Lang.Texts[1590]}, (int)Setting.AnimationsGame); // button.Click+=ClickAnimations; diff --git a/rabcrClient/rabcrClient.csproj b/rabcrClient/rabcrClient.csproj index 4990876..2e4192a 100644 --- a/rabcrClient/rabcrClient.csproj +++ b/rabcrClient/rabcrClient.csproj @@ -40,7 +40,7 @@ full false Publish\ - TRACE;DEBUG;WINDOWS + DEBUG;TRACE;WINDOWS none 4 true @@ -73,6 +73,12 @@ Component + + Form + + + FormError.cs + @@ -410,6 +416,9 @@ + + FormError.cs + GTextBox.cs From 9014262da606769ee076db14c764070778952dd6 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sun, 16 Jan 2022 20:22:49 +0100 Subject: [PATCH 31/55] optimize --- rabcrClient/InterLogic/TextDrawer.cs | 187 ++++++++++++++++----------- 1 file changed, 114 insertions(+), 73 deletions(-) diff --git a/rabcrClient/InterLogic/TextDrawer.cs b/rabcrClient/InterLogic/TextDrawer.cs index ed65273..b7d2959 100644 --- a/rabcrClient/InterLogic/TextDrawer.cs +++ b/rabcrClient/InterLogic/TextDrawer.cs @@ -96,8 +96,9 @@ public class Text { #endif for (int gg = 0; gg tmpChs=new(); char[] chs=txt.ToArray(); - int posx=X, posY=Y; + int posx=X, + posY=Y; Glyph g; for (int ch = 0; ch tmpGlyphs=new(); for (int i=0; iww) { - //if (s.StartsWith("Ma")){ - // Console.WriteLine(w); - // } - - // string need to be smaller - // int w2=0; char[] chs=s.ToCharArray(); - int ch/*=-1*/; + int ch; Glyph g; for (ch = 0; ch Date: Sun, 16 Jan 2022 20:23:04 +0100 Subject: [PATCH 32/55] new translations --- rabcrClient/Default/Lang/Lang.xml | 1398 ++++++++++++++++++++++++++++- 1 file changed, 1379 insertions(+), 19 deletions(-) diff --git a/rabcrClient/Default/Lang/Lang.xml b/rabcrClient/Default/Lang/Lang.xml index 1ed0873..1d8a574 100644 --- a/rabcrClient/Default/Lang/Lang.xml +++ b/rabcrClient/Default/Lang/Lang.xml @@ -96,8 +96,8 @@ - - + + @@ -116,6 +116,7 @@ Generated in + Generated in Vygenerováno za Vegenerovány za Vygenerový za @@ -284,6 +285,7 @@ E Muri Voltar Voltar + Atrás Main @@ -366,6 +368,7 @@ Oyambilia Prensipal Principal + Atrás Keyboard @@ -444,6 +447,7 @@ Tincidunt Tapoyanan Teclado + Teclado How to play @@ -527,6 +531,7 @@ Founga ke vaʻinga ai Na iwalewale ni qito Como jogar + Tema 'ñeni Information @@ -608,6 +613,7 @@ ITukutuku Informação Informação + Ungumfädi Singleplayer @@ -684,6 +690,8 @@ SinglePlayer Single Singleplayer + 'Nar jugador + Жалғызбыш Multiplayer @@ -774,6 +782,7 @@ Gosodiadau Kena Vanua Configurações + Configuración Styles @@ -869,6 +878,7 @@ Sogota Fechar Fechar + Cerrar Log out @@ -971,6 +981,7 @@ Kuria Adicionar Adicionar + Agregar New world @@ -1056,6 +1067,7 @@ Vuravura Vou Novo mundo Novo mundo + 'Ra'yo ar ximha̲i Folder @@ -1131,6 +1143,7 @@ Polder Папка Novo mundo + Carpeta Folder with styles @@ -1215,6 +1228,7 @@ Fehalaaki lolotonga hono fakahū Cala ena gauna ni vakavodoki Erro durante o carregamento + Error Nxoge ar carga Checked @@ -1296,6 +1310,8 @@ ʻOsi Fakaʻilongaʻi Dikevi Vakadikevi Erro durante o carregamento + Comprobado + Kutariswa The folder RabcrData has corrupted or missing content @@ -1379,6 +1395,7 @@ Na faile RadellData esa ca se yali tiko na lewena A pasta RabcrData corrompeu ou perdeu conteúdo A pasta RabcrData corrompeu ou perdeu conteúdo + Ar carpeta RabcrData pe̲ts'i contenido dañado wa ya faltante Details @@ -1457,6 +1474,7 @@ Ngaahi Fakamatala Fakaikiiki IVakamacala Matailalai Detalhes + Detalles Open @@ -1539,6 +1557,7 @@ Fakaava Dolava Abrir + Abrir Fly @@ -1620,6 +1639,9 @@ Itealaich Fly Voar + Volar + چىۋىن + Bhururuka Go to the menu @@ -1705,6 +1727,7 @@ Ewch i'r ddewislen Lako ki na menu Vá para o menu + Ma jar menú Connecting @@ -1811,6 +1834,7 @@ O a mate Você morreu Você morreu + Moriste Respawn in @@ -1887,6 +1911,8 @@ Tamusuki ena Respawn em Você morreu + Reaparecer jar + Responn in Logging in... @@ -1991,6 +2017,7 @@ Defnyddiwch Fakaʻaongaʻi Vakayagataki + Njapu'befi is number @@ -2073,6 +2100,7 @@ Sai koya na naba Usar Est le nombre + Ge ar 'bede Adjusting @@ -2155,6 +2183,7 @@ Veimoiyakataki Ajustar Adcommodatio + Za Invalid command, try @@ -2250,6 +2279,7 @@ Gwall anhysbys Fehālaaki ʻoku ʻikai ʻilo Cala tawakilai + Error desconocido Can't send socket @@ -2364,6 +2394,7 @@ Canslo Bokoci Inrito + Cancelar Apply @@ -2447,6 +2478,7 @@ Kerea Aplicar Présenter une demande + Da t'uni Name of the world @@ -2534,6 +2566,7 @@ Enw'r byd Hingoa ʻo e māmaní Yacai vuravura + Thuuhu jar ximha̲i Show spoiler @@ -2624,6 +2657,7 @@ Vakaraitaka na ka ni-ka ni-meca Mostrar a spoiler Show spoiler + Mostrar spoiler Difficulty in the World @@ -2716,6 +2750,7 @@ Faingataʻa ʻi he Māmaní Dredre e Vuravura Dificuldade no Mundo + Dificultad jar ximha̲i The size of the world @@ -2806,6 +2841,7 @@ Maint y byd Ko e lahi ʻo e mamani Na levu ni vuravura + Tamaño jar ximha̲i Load world from file @@ -2898,6 +2934,7 @@ Vakavodoki vuravura mai na faile Carregar o mundo do arquivo Charger le monde à partir d’un fichier + Cargar ya jä'i ndezu̲ ar archivo Nick @@ -3009,6 +3046,7 @@ Vakataucokotaka na vuravura Editar World Modifier le monde + Editar ar ximha̲i You can use GeDo tags @@ -3106,6 +3144,7 @@ Gallwch ddefnyddio tagiau GeDo Te ke lava ʻo fakaʻaongaʻi ʻa e GeDo tags E rawa ni o vakayagataka na veivakatakilakila ni GeDo + Dar tsa̲ ga etiquetas GeDo Remove world @@ -3197,6 +3236,7 @@ Remover o mundo Eliminar World Supprimer le monde + Da hñäki ya ximha̲i Export @@ -3277,6 +3317,7 @@ Vakauta Exportação Exportación + Exportar Clean @@ -3372,6 +3413,7 @@ Limpo Čist Propre + Limpio Server need your password @@ -3456,6 +3498,7 @@ Cadarnhau Vakadeitaka Confirmar + Confirmar Notes @@ -3536,6 +3579,7 @@ Anotações NOTAS Remarques : + Notas Zip Archive @@ -3610,6 +3654,8 @@ Zip Archive Bank Archive Archives Zip + Archivo Zip + Zip ئارخىپى Play @@ -3693,6 +3739,7 @@ Chwarae Vakatagitaka Brincar + 'Ñeni Generate @@ -3772,6 +3819,8 @@ Cynhyrchu Vakatubuka Gerar + Generar + ھاسىل قىلىش Player @@ -3852,6 +3901,8 @@ Misini ni Misini Jogador Igrač + Jugador + Mutambi Gender @@ -3934,6 +3985,7 @@ Gênero Amuna Égalité entre les sexes + Género Depending on sex will be generated clothes @@ -4015,6 +4067,7 @@ ʻE ʻosi ʻoatu ha vala ʻo makatuʻunga pe ʻi he tangata pe fefine Ena vakasulutaki na isulu vakatau ena veiyacovi Selon le sexe sera généré des vêtements + Dependiendo de ar nthönwi da generará ya 'bitu Man @@ -4094,6 +4147,7 @@ Homem Fear Selon le sexe sera généré des vêtements + Ar 'ño̲ho Enabled @@ -4174,6 +4228,7 @@ Wedi'i alluogi Rawa ni Vakayagataki Activé + Habilitado Disabled @@ -4256,6 +4311,7 @@ Desactivado Erret Handicapé + Deshabilitado Woman @@ -4336,6 +4392,7 @@ Menyw Fefine Yalewa + Ar 'be̲hñä Mature player @@ -4416,6 +4473,7 @@ Chwaraewr aeddfed Tokotaha matuʻotuʻa Dauqika matua + Jugador maduro Hair colour @@ -4506,6 +4564,7 @@ Juuksevärv Lliw gwallt Tiko na uca ni ulu + Njät'i xtä White @@ -4588,6 +4647,7 @@ Gwyn Vulavula Blanc + Nt'axi Blond @@ -4651,6 +4711,8 @@ Est blond Koko Blonde + Rubio + سېرىق Ginger @@ -4728,6 +4790,7 @@ Sinisa Gengibre Gitala + Jengibre Brown @@ -4808,6 +4871,8 @@ Cha bulawundi Maron Brun + Marrón + Bura Black @@ -4891,6 +4956,7 @@ Du Loaloa Noir + Xí mpothe Keyboard @@ -4970,6 +5036,7 @@ Tincidunt Tapoyanan Клавиатура + Teclado Player @@ -5048,6 +5115,8 @@ Tokotaha Vaʻinga Misini ni Misini Igrač + Jugador + Mutambi Move left @@ -5133,6 +5202,7 @@ Toso ki na imawi Mova-se para a esquerda Déplacer vers la gauche + Mover ar izquierda Move right @@ -5218,6 +5288,7 @@ Toso imatau Mova-se para a direita Déplacer vers la droite + Mover ar derecha Jumping @@ -5299,6 +5370,7 @@ Lade ni lade Salto Saut d’obstacles + Saltarín Accelerate @@ -5377,6 +5449,7 @@ 加速 Fakavaveʻi Vakusakusataka + Acelerar Inventory @@ -5456,6 +5529,7 @@ IYaya ni Ivoli Mātauranga Mea hana + Inventario Message @@ -5537,6 +5611,7 @@ ITukutuku Inventário Le message + 'Me̲hni pa Open bubble and write some text @@ -5619,6 +5694,7 @@ Fakaava ʻa e bubble pea hiki ha ngaahi fakamatala Dolava na bubble ka vola eso na itukutuku Abra bolha e escreva algum texto + Gi xoki ar burbuja ne gi 'yot'i 'naxtu̲i ar texto Drop item @@ -5708,6 +5784,7 @@ Vakalutuka na iyaya Item de queda Déposer l’élément + Da hñäki 'nar 'mu̲i Menu @@ -5781,6 +5858,7 @@ Меню Fakahokohoko ʻo e Meʻa ke Le menu + Menú Go from game to the menu @@ -5862,6 +5940,7 @@ ʻAlu mei he vaʻinga ki he menu Lako mai na qito ki na menu Le menu + Ma ja ar 'ñeni ar menú Language @@ -5945,6 +6024,7 @@ Iaith IVosavosa Idioma + Ar hñä Game elements @@ -6026,6 +6106,7 @@ Ngaahi ʻelemeniti ʻo e vaʻinga Gacagaca ni qito Éléments de jeu + Xe̲ni ar 'ñeni Controls animations @@ -6107,6 +6188,7 @@ Puleʻi animations Lewai ni igacagaca ni vakaraitaki Controla animações + Animaciones controles Game graphics quality @@ -6174,6 +6256,13 @@ ITuvaki ni iYauqaqa ni Qito Qualidade dos gráficos do jogo Qualité graphique du jeu + Ya ya gráficos ar 'ñeni + Didara ere idaraya + Quante qualità Grafiche di ghjocu + Leikur Grafík gæði + Ойын графикалық сапасы + ئويۇن گرافىكنىڭ سۈپىتى + Mutambo wemifananidzo Zoom @@ -6335,6 +6424,7 @@ Mataqali ivakarau ni ivakarau Genus scale Type d’échelle + Ar klase ar báscula Window @@ -6418,6 +6508,7 @@ Katubaleka Varavarankely Tipo de escala + Ventana Fps @@ -6467,6 +6558,8 @@ FPS Fps Fps + FPS + FPS Loudness @@ -6545,6 +6638,8 @@ Кычкыру Sonoridade Sonie + Sonoridad + يۇقىرى ئاۋاز Music @@ -6626,6 +6721,7 @@ Hivá IVakatagi Sonoridade + 'Me̲i Effects @@ -6706,6 +6802,7 @@ Effeithiau Ngaahi Ola Kena Revurevu + Efectos Length of transition @@ -6796,6 +6893,7 @@ Balavu ni veisau Comprimento da transição Durée de la transition + Duración ar transición Background @@ -6877,6 +6975,7 @@ Cefndir ITuvaki Historique + Ts'o̲e Enter text @@ -6975,6 +7074,7 @@ Vakacuruma na lewe ni itukutuku Digite texto Zadajte text + Introducir texto 18+ @@ -7079,6 +7179,7 @@ Sa 18 na noqu yabaki Fundo J’ai eu 18 ans + Xta tenido 18 ya je̲ya According to GG account @@ -7165,6 +7266,7 @@ Fakatatau ki he GG Account Me vaka na akaude ni TTAKA Selon le compte GG + Nä'ä mä nu GG you haven't 18 @@ -7265,6 +7367,7 @@ ʻoku teʻeki ai ke ke taʻu 18 o se bera ni yabaki 18 vous n’avez pas 18 ans + hingi gi 18 you had 18 @@ -7366,6 +7469,7 @@ O sa yabaki 18 Você tinha 18 Vous en aviez 18 + Tenías 18 Without @@ -7446,6 +7550,7 @@ Ilma Heb Sega + 'Ñotho Proportion @@ -7528,6 +7633,7 @@ IKa taucoko Proporsje Proportion + Nä'ä da ' Fill @@ -7617,6 +7723,7 @@ Vakalewena Encher Remplir + Llenar Window @@ -7697,6 +7804,7 @@ Ffenestr Katubaleka Varavarankely + Ventana Maximized @@ -7776,6 +7884,7 @@ Maximizada Maximus Fakaʻaongaʻi Lahi Ange + Maximizada Fullscreen @@ -7852,6 +7961,7 @@ Moʻui e ʻAtá Kakato Sikirini taucoko Tela completa + Pantalla nxo̲ge Fast @@ -7951,6 +8061,7 @@ Luath Fast Rapide + Ngutha Medium @@ -8026,6 +8137,7 @@ Sedang Tungatunga Moyenne + Nt'uni Slow @@ -8112,6 +8224,7 @@ Aeglane Araf Vakamalua + Lento Clothes and crafting @@ -8195,6 +8308,7 @@ Vala mo e faʻu Isulu kei na culacula Vêtements et artisanat + Ya 'bitu ne artesanía Desk @@ -8272,6 +8386,8 @@ Stol Sulatanan Bureau + Escritorio + Desiki Furnace @@ -8351,6 +8467,8 @@ Lovo ni bukawaqa Furnace Fournaise + Horno + ئوچاق Choose an item @@ -8417,6 +8535,13 @@ एक वस्तु छनौट गर्नुहोस् एक आयटम निवडा Fili ha meʻa + Da 'ñets'i 'nar 'nar ' + Yan ohun kan + Sceglite un elementu + Veldu hlut + Элементті таңдаңыз + بىر تۈرنى تاللاڭ + Sarudza chinhu You can't breathe water @@ -8514,6 +8639,7 @@ He ʻikai lava ke ke manava vai Sa sega ni rawa mo ceguva na wai Vous ne pouvez pas respirer d’eau + Hindi tsa̲ gi respirar ar dehe You should eat and drink @@ -8612,6 +8738,7 @@ Fe ddylech chi fwyta ac yfed ʻOku totonu ke ke kai mo inu E dodonu mo kana ka gunu + Ñuni da ne beber Pay attention! Lava... @@ -8702,6 +8829,7 @@ Tokanga! Ko e ha... Raica matua! Ta... Prestar atenção! Lava... + Da Ntheti! Lava... You were drawn to death @@ -8802,6 +8930,7 @@ Naʻe tohoakiʻi koe ki he mate O a dreti yani ki na mate Faites attention! Lave.. + Gi sentís atraído ir nge ar muerte Toadstool is poisonous @@ -8901,6 +9030,7 @@ Na Toastool e sautanilewa Sapo é venenoso Crapaud est toxique + Toadstool ar venenoso Fly @@ -8980,6 +9110,9 @@ Itealaich Fly Voler + Volar + چىۋىن + Bhururuka Create @@ -9066,6 +9199,7 @@ Tauyavutaka Criar Creo + Da t'ot' Sewing machine @@ -9145,6 +9279,7 @@ Peiriant gwnio Misini tuitui Misini ni culacula + Máquina ar coser Macerator @@ -9205,6 +9340,9 @@ Manderay Макоратор Fili ha meʻa + Macerador + MareTor + Macorator Stone furnace @@ -9284,6 +9422,7 @@ Lovo bukawaqa Vyberte položku Four en pierre + Horno Nunu̲ Items @@ -9363,6 +9502,7 @@ IYaya PRAECIPUUS Objets + Xeni Nthuts'i Wooden box @@ -9446,6 +9586,7 @@ Puha papa Kato kau Boîte en bois + Caja ar xithe̲ Box @@ -9527,6 +9668,7 @@ Blwch Kato Arca + Caja Mobile phone @@ -9611,6 +9753,7 @@ Telefoni toʻotoʻó Talevoni veikauyaki Telefone celular + Teléfono móvil Rocket @@ -9687,6 +9830,9 @@ Kasomuni Kuwitis Rocket + Cohete + Rọkẹti + Roketi Charger @@ -9764,6 +9910,7 @@ Gwefrydd Vakau kaukauwa Pòschè + Cargador Mining machine @@ -9844,6 +9991,7 @@ Peiriant mwyngloddio Misini keli Misini ni Cakava + Máquina minera Radio @@ -9897,6 +10045,7 @@ Arust-Radio Радио À la radio + Thuhu Folder with music @@ -9977,6 +10126,7 @@ Ffolder gyda cherddoriaeth Foulutā ʻoku ʻi ai ha ngaahi fasi Faile kei na ivakatagi + Carpeta ko 'me̲i Shelf @@ -10056,6 +10206,7 @@ Prateleira Akazu Andel + Estante Composter @@ -10128,6 +10279,7 @@ Dèanadair Komposter Хувь + Compostador Rabigoncraft - The Most of My World @@ -10225,6 +10377,7 @@ Rabigoncraft - Na Levu Duadua ni Noqu Vuravura Rabigoncraft - A Maior parte do Meu Mundo Rabigoncraft - cea mai mare parte a lumii mele + Rabigoncraft — ar dätä xeni ma ximha̲i Creative @@ -10306,6 +10459,7 @@ Creadigol Dauvakasama vou Pasta com música + Creativo Add new world @@ -10389,6 +10543,7 @@ Kuria na vuravura vou Adicionar um novo mundo Créatif + Añadir ar 'ra'yo je̲ya ar ximha Hide spoiler @@ -10482,6 +10637,7 @@ Esconder spoiler Ocultar a spoiler Cacher spoiler + Ocultar spoiler Create portable world @@ -10576,6 +10732,7 @@ Tauyavutaka e dua na vuravura veikauyaki Criar mundo portátil Créer un monde portable + Da t'ot'e ximha̲i portátil Deletes the whole world @@ -10677,6 +10834,7 @@ Deletes e mamani kotoa Bokoca e vuravura taucoko Supprime le monde entier + Elimina nga̲tho ar ximha̲i Where to save the world? @@ -10766,6 +10924,8 @@ Ble i achub y byd? Ko e fē feituʻu ke fakahaofi ai ʻa e māmaní? Evei me vakabulai kina na vuravura? + Kde zachrániť svet? + ¿Hogem'bu̲ salvar jar ximha̲i? Remove @@ -10851,6 +11011,7 @@ Tynnu Vagalalataka Supprimer + Da hñäki Help with GeDo @@ -10938,6 +11099,7 @@ Help gyda GeDo Tokoni ʻi he GeDo Veivuke ena GeDo + Ayuda ko GeDo Realistic @@ -11014,6 +11176,9 @@ Realistig Bula Mo Dina ʻOiaʻiʻo + Realista + Ojulowo + رېئاللىق Large @@ -11105,6 +11270,7 @@ Levu Grande Grande + Dätä Small @@ -11197,6 +11363,7 @@ Lailai Realista Petite taille + Pequeño Research @@ -11276,6 +11443,8 @@ Vakadidike Investigação Investigatio + Nthoni + A ricerca Author @@ -11353,6 +11522,7 @@ Autor Awdur Dauvolaivola + Autor Company @@ -11433,6 +11603,7 @@ Cwmni Kabani L’entreprise + Compañía Version @@ -11508,6 +11679,7 @@ Verso Companhia La version + Versión Licence @@ -11586,6 +11758,7 @@ Ngaahi Konga ʻOku Lava Kisi ni tukuna Licence + Licencia Website @@ -11663,6 +11836,7 @@ Situs Webside Site Web (en) + Sitio web Author's email @@ -11751,6 +11925,7 @@ ʻImeili ʻa e tokotaha faʻu tohi Imeli nei Koya e Vola Courriel de l’auteur + Correo electrónico ar autor Date of publication @@ -11832,6 +12007,7 @@ Tikinisiga e tabaki kina Data de publicação Date de publication + Pa ar he̲'mi Programmed in @@ -11913,6 +12089,7 @@ Fakapolokalamaʻi ʻi he Parokaramutaki ena Programmé en + Programado jar With the help of MonoGame @@ -12010,6 +12187,7 @@ ʻI he tokoni ʻa MonoGame Ena veivuke nei Monogame Avec l’aide de MonoGame + Ko ar mfa̲ts'i MonoGame Public domain @@ -12075,6 +12253,13 @@ सार्वजनिक डोमेन Kelekele ʻo e kakaí ISoqosoqo raraba + Dominio público + Ìwọbí gbogbo eniyan + Duminiu publicu + Almenningssvæði + Қоғамдық домен + ئاممىۋى ساھە + Ruzhinji Domain Made in @@ -12157,6 +12342,8 @@ Caka ena Feito em Fabriqué en + 'Yo̲t'e jar + ياسالدى Visual Studio Community 2019 @@ -12264,6 +12451,7 @@ Vakaiʻi pe te u fakaʻaongaʻi e polokalama fakamuimuitaha ʻo e vaʻinga Dikeva kevaka me'u vakayagataka na ilavelave vou ni qito Vérifiez si j’utilise la dernière version du jeu + Comprueba nu'bu̲ di usando ar ngäts'i versión ar 'ñeni Tau @@ -12295,6 +12483,7 @@ Tao Тау Tau + Talu Register @@ -12374,6 +12563,7 @@ Cofrestrwch Rejisita S’inscrire + Registro Switch to GG account @@ -12456,6 +12646,7 @@ Fetongi ki he GG Account Veisau ki na akaude GG Mudar para conta GG + Mpa̲ti ar nu GG Sign in @@ -12537,6 +12728,7 @@ Mewngofnodi Curuiloma Entrar + Gi du̲i sesión Choose a world @@ -12634,6 +12826,7 @@ Dewiswch fyd Fili ha māmani Digitaka e dua na vuravura + Gi jwahni 'nar ximha̲i All types @@ -12717,6 +12910,7 @@ Kõik tüübid Pob math Mataqali taucoko + Ya xingu Rabcr world @@ -12806,6 +13000,8 @@ Mamani Rabcr Vuravura vakaiyye Rabcr monde + Ximha̲i Rabcr + Rabcr دۇنياسى Prepare for regeneration @@ -12896,6 +13092,7 @@ Paratowch ar gyfer adfywio Teuteu ke toe fakafoʻou Vakarautaki mo ni se qai tauyavutaki tale + Hoki ar pa ar regeneración The following settings cannot be changed @@ -12995,6 +13192,7 @@ He ʻikai lava ʻo liliu ʻa e ngaahi feituʻu ko ʻeni Ena sega ni rawa ni veisautaki na ituvatuva oqo As configurações a seguir não podem ser alteradas + Hingi ar tsa̲ da mpa̲ti da ku̲hu̲ configuración Left mouse button @@ -13086,6 +13284,7 @@ IBulukau imawi ni mouse Botão do mouse esquerdo Bouton gauche de la souris + Botón izquierdo ar t'u̲ngu Right mouse button @@ -13177,6 +13376,7 @@ IBulukau imatau ni mouse Prepare-se para a regeneração Bouton droit de la souris + Botón derecho ar t'u̲ngu Save + Optimize @@ -13260,6 +13460,7 @@ Maroroya na iSataqomaki Salvar + otimizar Enregistrer Optimiser + Guardar Optimizar Hides/shows player @@ -13351,6 +13552,7 @@ Vunitaka/vakaraitaka na misini Esconde/mostra o jogador Cache/montre le joueur + Oculta yá gi 'ñudi ar reproductor Hides/shows inventory @@ -13442,6 +13644,7 @@ Vunia/vakaraitaka na itukutuku vakaivola Esconde/mostra inventário Cache/affiche l’inventaire + Oculta yá gi 'ñudi ar inventario Opens the debug @@ -13539,6 +13742,7 @@ Fakaava ʻa e Debug E dolava na vakavinakataki Abre o depuração + Gi xoki ar depuración The following settings can be changed @@ -13636,6 +13840,7 @@ Gellir newid y gosodiadau canlynol ʻE lava ʻo liliu ʻa e ngaahi feituʻu ko ʻeni Sa rawa me veisautaki na ituvatuva oqo + Ar tsa̲ da mpa̲ti da ku̲hu̲ configuración Breaking blocks, killing animals @@ -13729,6 +13934,7 @@ Torri blociau, lladd anifeiliaid Maumauʻi e ngaahi konga papa, tamateʻi e fanga monumanu Buloko ca, vakamatei manumanu + Rompiendo bloques, matando me̲ti Adding blocks, eating, drinking, opening machines @@ -13820,6 +14026,7 @@ Ychwanegu blociau, bwyta, yfed, agor peiriannau Tanaki atu ha ngaahi konga papa, kai, inu, misini fakaava Vakuri ni buloko, kana, gunu, misini idola + Agregar bloques, ñuni, beber, abrir máquinas Walking @@ -13905,6 +14112,7 @@ Ambulante Ambulatio Marche + Andante ERROR, nickname %nick% cannot be used @@ -13995,6 +14203,7 @@ Load e ngaahi ʻelemeniti ʻo e vaʻinga Vakavodoki ni gacagaca ni qito Chargement d’éléments de jeu + Carga ar xe̲ni ar 'ñeni Loading was successful @@ -14076,6 +14285,7 @@ Naʻe lava lelei hono load e loading Sa rawa vinaka na vakavodoki Le chargement a été un succès + Ar carga ar realizó correctamente We've detected errors, check Data @@ -14158,6 +14368,7 @@ Detectamos erros, verificamos dados Keitou sa raica na cala, raica na iTukutuku Nous avons détecté des erreurs, vérifier les données + Di detectado errores, compruebe datos One of elements has an error @@ -14238,6 +14449,7 @@ ʻOku ʻi ai ha fehalaaki ʻi he taha ʻo e ngaahi ʻelemeniti E dua na gacagaca e cala L’un des éléments a une erreur + 'Na ya xe̲ni pe̲ts'i 'nar error There are %count% errors with elements @@ -14319,6 +14531,7 @@ घटकांसह% count% त्रुटी आहेत Existem erros %count% com elementos Il y a %count% d’erreurs avec les éléments + Jawa errores % count % ko ya xe̲ni Error @@ -14488,6 +14701,7 @@ Etalaj Famoronana Erreur + Elaboración Flying mode @@ -14568,6 +14782,8 @@ ICakacaka ni vuka Modo de voo Mode sa paglupad + Modo di nsa̲ni + Ipo Flying Right ctrl @@ -14650,6 +14866,7 @@ IMatau ctrl Erro Ctrl droite + Ctrl derecho Left ctrl @@ -14730,6 +14947,7 @@ Ctrl iMawi Esquerda Ctrl Kite ctrl + Ctrl izquierdo Left alt @@ -14811,6 +15029,7 @@ Alt esquerda Linker alt Esquerda Alt + Alt izquierdo Spacebar @@ -14883,6 +15102,9 @@ Космос Tau Barre d’espace + Barra xí espaciadora + Aaye aaye + Spaziu Left shift @@ -14966,6 +15188,7 @@ Turno à esquerda Kite chanjman Décalage vers la gauche + Desplazamiento ar izquierda Right shift @@ -15049,6 +15272,7 @@ Sifi ena imatau Turno certo Virage à droite + Desplazamiento ar derecha Backspace @@ -15104,6 +15328,10 @@ Pulbada Efterstân Baya + Retroceso + Ẹhin eniyan + Артқа бөртпе + Backparess Application @@ -15185,6 +15413,7 @@ Aplicação Applicatio Demande d’admission + Nt'ot'e Right @@ -15266,6 +15495,7 @@ Direita Dereito Droit + Derecha Left @@ -15346,6 +15576,7 @@ Toʻohemá IMawi Gauche + Izquierda Up @@ -15428,6 +15659,7 @@ Elu Vers le haut + Nu'bu mañä Down @@ -15508,6 +15740,7 @@ E Ra Abaixo Vers le bas + Abajo Page Up @@ -15587,6 +15820,8 @@ Página Para Cima Page up Page vers le haut + Ndi página + Page up Page Down @@ -15667,6 +15902,7 @@ Stran dol Stranica dolje Page vers le bas + Ar ñäñho página Enter @@ -15745,6 +15981,7 @@ Binnenkomen Ući Entrez + Entrar Home @@ -15825,6 +16062,7 @@ ITikotiko Home Accueil + Hogar End @@ -15903,6 +16141,8 @@ Diwedd Ngataʻangá Vakacavari + Ngäts'i + Kupera Delete @@ -15981,6 +16221,7 @@ Toʻo Bokoca Supprimer + Borrar Insert @@ -16060,6 +16301,7 @@ Fakahū Makehe Vakacuruma Insérer + Insertar Esc @@ -16162,6 +16404,9 @@ Shafi shafi Кыстыр Onglet + Pestaña + Taabu + بەتكۈچ Del @@ -16203,6 +16448,8 @@ Deli Дель Del + Ya ar + Жою д @@ -16269,19 +16516,32 @@ 五倍 - Ex. 1 Solve the equation 2*x-%num%=0 and type the number in the box - Př. 1 Vyřešte rovnici 2*x-%num%=0 a číslo napište do pole - Př. 1 Vyřešte rovnicu 2*x-%num%=0 a číslo napište do pole - Př. 1 Veřešte rovnicô 2*x-%num%=0 a čislo napište do pole - Bsp. 1 Lösen Sie die Gleichung 2*x-%num%=0 und geben Sie die Zahl in das Feld ein - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力します - Pr. 1 Vyriešte rovnicu 2*x-%num%=0 a do poľa zadajte číslo - Ex. 1 Résolvez l'équation 2*x-%num%=0 et tapez le nombre dans la case - Es. 1 Risolvi l'equazione 2*x-%num%=0 e digita il numero nella casella - Ej. 1 Resuelve la ecuación 2*x-%num%=0 y escribe el número eng el cuadro - Np. 1 Rozwiąż równanie 2*x-%num%=0 i wpisz liczbę w polu - 例 1 方程式 2*x-%num%=0 ぅ解き、ボックスに数値ぅ入力する - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する + + Ex. 1 Solve the equation 2*x-%num%=0 and type the number in the box + + Př. 1 Vyřešte rovnici 2*x-%num%=0 a číslo napište do pole + + Př. 1 Vyřešte rovnicu 2*x-%num%=0 a číslo napište do pole + + Př. 1 Veřešte rovnicô 2*x-%num%=0 a čislo napište do pole + + Bsp. 1 Lösen Sie die Gleichung 2*x-%num%=0 und geben Sie die Zahl in das Feld ein + + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力します + + Pr. 1 Vyriešte rovnicu 2*x-%num%=0 a do poľa zadajte číslo + + Ex. 1 Résolvez l'équation 2*x-%num%=0 et tapez le nombre dans la case + + Es. 1 Risolvi l'equazione 2*x-%num%=0 e digita il numero nella casella + + Ej. 1 Resuelve la ecuación 2*x-%num%=0 y escribe el número eng el cuadro + + Np. 1 Rozwiąż równanie 2*x-%num%=0 i wpisz liczbę w polu + + 例 1 方程式 2*x-%num%=0 ぅ解き、ボックスに数値ぅ入力する + + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する 例 1 方程式 2*x-%num%=0 ば解き、ボックスに数値ば入力する @@ -16302,8 +16562,10 @@ 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する 例 1 方程式 2*x-%num%=0 解き、ボックスに数値入力する - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する - 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する + + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する + + 例 1 方程式 2*x-%num%=0 を解き、ボックスに数値を入力する Ex. 1 Resolva a equação 2*x-%num%=0 e digite o número na caixa Eks. 1 Løs ligningen 2*x-%num%=0, og skriv tallet i boksen Ex. 1 Resoleu l'equació 2*x-%num%=0 i escriviu el número al quadre @@ -16373,6 +16635,7 @@ ʻEke. 1 fakaleleiʻi ʻa e oma pasikala 2*x-%num%=0 pea taipeʻi ʻa e fika ʻi he puha Ex. Walia na kena ganita 2*x-%num%0 ka taipataka na naba ena kato Ex. 1 Résolvez l’équation 2*x-%num%=0 et tapez le nombre dans la zone + Ej. 1 Resuelve ar ecuación 2*x — % num %=0 ne escribe ar 'bede jar ar cuadro @@ -16490,6 +16753,7 @@ ʻEke. 2 ko e ha ʻa e%smt%? Ex. 2 Na cava na %smt%? Ex. 2 Qu’est-ce que %smt%? + Ej. 2 ¿Temu̲ ar % smt %? Verification of legal age @@ -16579,6 +16843,7 @@ Fakapapauʻi ʻo e taʻu fakalaó Veivakadeitaki ni yabaki vakalawa Vérification de l’âge légal + Verificación ar bätsitho legal voda @@ -16657,6 +16922,7 @@ Vai Wai L’eau + Ar dehe oxid uhličitý @@ -16733,6 +16999,7 @@ Kaponi taiokisaiti Kabonoca na kaboni daiokosaiti L’eau + Dióxido carbono kyselina sírová @@ -16809,6 +17076,7 @@ Sulfuric ʻesiti Veivakasoramataki vakaduriy vaduri ni u Sulfurcic acid + Ácido sulfúrico hydroxid sodný @@ -16881,6 +17149,7 @@ Somu vita na bula Konutai waikawa Sodium Hydroxide + Hidróxido sódico Železo @@ -16959,6 +17228,8 @@ Ukamea Kaukamea Iron + Hierro + Simbi Hydrochloric acid @@ -17034,6 +17305,7 @@ Hydrochloric ʻesiti Acidchloric Na hydrochloric acid + Ácido clorhídrico Zadali jste špatné odpovědi! @@ -17134,6 +17406,7 @@ Kuó ke fakahū a e ngaahi tali halá! O sa vakacuruma na isau cala! Você inseriu as respostas erradas! + Xka introducido ya nthädi equivocadas! Auto se pohybuje konstantní rychlostí %speed%km/h. @@ -17320,6 +17593,10 @@ Amin'ny firy no alehan'ny% ny halavany% km? S = v · t ते किती लांबी% KM प्रवास करते? एस = व्ही टी La voiture se déplace à une vitesse constante de %vitesse%km/h. Dans quel temps se déplace-t-il %longueur%km? s=v·t + Ar coche ar mueve ja 'nar velocidad nzäm'bu̲ % speed%km/h. +¿Temu̲ ar pa jar viaja % length % km? s=v·t + Көлік% жылдамдығы% жылдамдықпен қозғалады. +Қай уақытта% -бен жылдамдықпен жүреді? s = · t Show more @@ -17406,6 +17683,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakaraitaka eso tale na ka Mostrar mais En savoir plus + Mostrar mäs + Mostra più Hide @@ -17489,6 +17768,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cuddio Vunia Esconder + Esconder + Kuvanda Show program details @@ -17579,6 +17860,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dangos manylion y rhaglen Fakaʻasi e fakaikiiki ʻo e polokalama Vakaraitaka na veika matailalai ni parokaramu + Mostrar detalles ar programa Hide program details @@ -17671,6 +17953,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cuddio manylion y rhaglen Fufuuʻi e fakaikiiki ʻo e polokalama Vunia na matailalai ni parokaramu + Ocultar detalles ar programa <Italic>This is just a recommended procedure, you don't have to follow it completely!</Italic> @@ -17865,6 +18148,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ko a dro Você ficou sem ar Vous avez manqué d’air + Gi quedaste hinda ndähi Apparatus for air production @@ -17956,6 +18240,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Veiqaravi me baleta na tabaivola ni vuka Aparelho para produção aérea Appareil pour la production d’air + Aparatos pa ar producción ar ndähi You need a spacesuit to survive @@ -18055,6 +18340,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t O gadreva e dua na vanualala mo bula tiko kina Você precisa de um traje espacial para sobreviver Vous avez besoin d’une combinaison spatiale pour survivre + Necesitas 'nar nthe espacial pa sobrevivir Worldwide @@ -18136,6 +18422,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vuravura Raraba Mundial Dans le monde entier + Jar nxoge ximhai Constructed @@ -18218,6 +18505,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tara Construído Construit + Construido Asian @@ -18297,6 +18585,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maisia Asiático Asiatique + Asiático African @@ -18375,6 +18664,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻAfilika Vaka-Aferika Africano + Africano American @@ -18453,6 +18743,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Amerika Americano Américain + Americano European @@ -18529,6 +18820,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Europeu Gikan sa Oropa L’europe + Europeo Australian @@ -18605,6 +18897,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻAositelēlia Ositerelia Australie + Australiano Germanic @@ -18683,6 +18976,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vaka-Jamani Germânico Germanique + Germánico + گېرمان تىلى Slavic @@ -18756,6 +19051,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lapokan Slavic Slave + Eslavo Romance @@ -18904,6 +19200,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Zafè Селтик Celtique + Celta + Cellic Baltic @@ -18978,6 +19276,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Baltički Baleti Baltique + Báltico Finno-Ugric @@ -19036,6 +19335,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Finno-ugric Finno-ugrik Финно-Угрик + Fino-Ugrio + Finno-ugric + Finno-Likric + Finno-dougric Other @@ -19123,6 +19426,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Meʻa Kehe Eso Tale Outro + Ma'na Building world... @@ -19205,6 +19509,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Construindo mundo... Tarai cake ni vuravura... Construire un monde... + Construyendo ximha̲i... Moravia @@ -19241,6 +19546,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t मोराभिया मोराविया Molovia + Moravia + Оқ , @@ -19372,8 +19679,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fakamatala fakafoʻituitui ITukutuku vakayaloyalo Perfil de gráficos + Perfil gráfico - Basic Základní @@ -19449,6 +19756,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Osnovni BASIC Na asali + Básico Expanded @@ -19530,6 +19838,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakarabailevutaki Expansus Élargi + Ampliado Advanced @@ -19610,6 +19919,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Toso i Liu Pasiuna Avancé + Avanzado Startup items @@ -19689,6 +19999,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Eitemau cychwyn Ngaahi meʻa ki hono kamataʻ Veika me vakasotari + Xe̲ni inicio General @@ -19764,6 +20075,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Jenaral Itens de inicialização Généralités + Nxoge Skin colour @@ -19846,6 +20158,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Keyago Geral Couleur de la peau + Njät'i ar piel Hair @@ -19925,6 +20238,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Louʻulu Drauniulu Pelo + Ma xtä Hair type @@ -20005,6 +20319,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Math o wallt Faʻahinga ʻo e ʻ Mataqali drauniulu + Ar klase ar xtä Hair colour @@ -20085,6 +20400,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lliw gwallt Louʻulu colour Tiko na uca ni ulu + Njät'i xtä Eyes @@ -20166,6 +20482,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ongo matá Mata Olho + Da̲ Eyes type @@ -20249,6 +20566,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mataqali mata vakacava Eagen type Type d’yeux + Ar klase ar da̲ Eyes colour @@ -20331,6 +20649,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lliw llygaid Mata colour Ka ni mata + Ar njät'i da̲ Moustache @@ -20412,6 +20731,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mwstas ISogi Ni Vakadewa Moustache + Bigote Moustache type @@ -20495,6 +20815,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Faʻahinga Moustache Mataqali vakadewa vosa Tipo bigode + Ar klase bigote Moustache colour @@ -20577,6 +20898,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lliw mwstas Tiko na kena vakadewa Moustache + Ar njät'i bigote Colour @@ -20655,6 +20977,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Värv Lliw Tiko na Kena Ka + Ar njät'i Kid @@ -20732,6 +21055,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bern De jennest Zaman + T'olo t'äxi + بالا + Mwana Teenager @@ -20806,6 +21132,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Taʻu Hongofulu Yabaki tinivakacaca Teenager + Adolescente + Teenger Adult @@ -20882,6 +21210,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Oedolyn Kakai Lalahí Uabula + Adulto Shadow @@ -20960,6 +21289,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻAta Yaloyalo Sjenka + Sombra See the graphics control panel for more options @@ -21043,6 +21373,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Consulte o painel de controle gráfico para obter mais opções Raica na ituvatuva ni lewa ni droini me baleta e levu tale na digidigi Consultez le panneau de configuration graphiques pour plus d’options + Consulte panel control gráficos da uni mäs opciones Control panel is opening.|It takes a few seconds...||Not opening?|Check "NVIDIA Display Constrainer LS" service. @@ -21127,6 +21458,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kei te whakatuwherahia te Paewhiri Mana. | He hēkona he hēkona ... || Kāore i te whakatuwhera? Sa dola tiko na sala ni lewa.| Ena taura e vica na sekodi...|| Sega ni dolavi?| Raica na veiqaravi "NVIDIA Display Constrainer LS" Le panneau de commande s’ouvre.| Cela prend quelques secondes... || Ne pas ouvrir?| Cochez le service « NVIDIA Display Constrainer LS ». + Panel control ar opening.| Tarda 'ra ya 'na̲te ya mfe̲ts'i... || ¿Hingi abres? | Compruebe hontho "NVIDIA Display Constrainer LS". Graphics control panel @@ -21207,6 +21539,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Penolo pule ki hono puleʻi ʻo e fakatataa Mataveivosaki ni lewai ni ka vakayaloyalo Panneau de contrôle graphique + Panel control gráficos + Graphics Control Panel You can't play this world @@ -21290,6 +21624,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t O sega ni rawa ni vakatagitaka na vuravura oqo Você não pode jogar este mundo Vous ne pouvez pas jouer à ce monde + Hindi tsa̲ 'ñeni ma nuna ar ximha̲i This world was created by old version, so it isn't compatible with this version @@ -21373,6 +21708,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t A tauyavutaki na vuravura oqo mai na kena ivakadewa makawa, ia e sega ni veiraurau kei na kena icakacaka oqo Este mundo foi criado por versão antiga, por isso não é compatível com esta versão Ce monde a été créé par l’ancienne version, il n’est donc pas compatible avec cette version + Nuna ar ximha̲i bí creado ir nge ar versión 'be̲t'o, nä'ä hingi ar compatible ko nuna ar versión Seal @@ -21453,6 +21789,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Meʻa Fakamaʻ Vauci Sceau + Foca Unseal @@ -21524,6 +21861,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tidak sihat Teʻikai Lava ʻo Foʻ Desserrer + Desprecintar + Aise + Unseeal + كۆرۈنمەيدۇ + Zvisingaonekwi Error during loading game @@ -21605,6 +21947,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fehalaaki lolotonga hono load e vaʻingá Cala ena gauna ni vakavodoki ni qito Erro durante o jogo de carregamento + Error Nxoge ar carga ar 'ñeni Report bad translation @@ -21687,6 +22030,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lipooti e liliu ʻoku kovi Ripotetaka na vakadewa cala Relatar tradução ruim + Reportar 'nar nts'oki traducción Write down what is currently showing @@ -21768,6 +22112,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vola na veika e vakaraitaka tiko ena gauna oqo Anote o que está mostrando atualmente Notez ce qui s’affiche actuellement + Anote nä'ä da gi 'ñudi 'bu̲'bya Write down what should show @@ -21848,6 +22193,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hiki e meʻa ʻoku totonu ke ne fakahaaʻi maí Vola na veika me vakaraitaki Notez ce qui devrait montrer + Escriba nä'ä da mostrar Write down where is it @@ -21929,6 +22275,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vola evei na vanua e tiko kina Anote onde está Notez ce qui devrait montrer + Gi 'yot'i hogem'bu̲ 'bu̲i Error, text is too long @@ -22011,6 +22358,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fehalaaki, ʻoku fuʻu lōloa e fakamatalá Error, sa rui balavu na itukutuku Erro, texto é muito longo + Error, ar texto ar me̲ na ya'bu̲ Enter text in the text boxes or click "Cancel" @@ -22092,6 +22440,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakacuruma na itukutuku ena kato ni text se kiliki ena "Cancel" Digite texto nas caixas de texto ou clique em "Cancelar" Entrez du texte dans les zones de texte ou cliquez sur « Annuler » + Ingrese texto ja ya cuadros texto wa 'yot'e clic jar hmä "Cancelar" Brightness at night @@ -22170,6 +22519,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Disgleirdeb yn y nos Ngingila ʻi he poʻuli Caudre ena bogi + Brillo 'bu̲ ya nxui Min @@ -22275,6 +22625,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maks Marnet Max + Máximo Czech-Moravian @@ -22332,6 +22683,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t चेक-मोरावियन Teʻikai Lava ʻo Foʻ Tchéthan-Morave + Checo-Moravia + Czech-Moruvian + Ceco-Moravie + Tékkneska-Moravian + Чех-моравия + چېخ مورا + Czech-moravian Oceanic @@ -22402,6 +22760,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Moana Okeanski Kadagatan + Oceánico + Omi okun + ئوكيان Japanese @@ -22479,6 +22840,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Japaneaidd Faka-Siapani Vaka-Japani + Japonés Used fonts @@ -22560,6 +22922,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fakaʻaongaʻi e faiʻanga papitaiso Tobu vakayagataki Usus fonts + Ya 'mui mbo usadas + Fonti utilizati Korean @@ -22636,6 +23000,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kōlea Vaka-Korea Kororo Korean + Coreano Traditional Chinese @@ -22714,6 +23079,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tsieineaidd Traddodiadol Faka-Siaina Angamahení Vaka-Jaina Dina + Txino pa mahä'mu̲ Japanese @@ -22791,6 +23157,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t जपानी Faka-Siapani Vaka-Japani + Japonés < Go to the category @@ -22872,6 +23239,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t < Lako ki na iwasewase Japonês < Aller à la catégorie + < ga ma jar categoría Arabic @@ -22948,6 +23316,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Faka-ʻAlepea Arapea Onye anabik + Árabe Unknown item @@ -23030,6 +23399,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Meʻa ʻoku ʻikai ʻ ITukutuku sega ni kilai Élément inconnu + 'Nar 'mu̲i desconocido Stone axe @@ -23113,6 +23483,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maka axe Se qai tu ena vatu Pedra ax + Hacha Nunu̲ Stone shovel @@ -23193,6 +23564,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sāvolo maká Isivi vatu Pelle en pierre + Pala Nunu̲ Stone pickaxe @@ -23275,6 +23647,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Picareta de pedra Lapis pickaxe Pioche en pierre + Pico Nunu̲ + Okuta wẹwẹ Iron axe @@ -23357,6 +23731,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ukamea axe Veisuri kaukamea Iron Ax + Hacha hierro Iron shovel @@ -23438,6 +23813,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Isivi kaukamea Machado de ferro Pelle de fer + Pala hierro Iron pickaxe @@ -23517,6 +23893,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t IMoce kaukamea Chitoliro cha Iron Pioche en fer + Pico hierro + Iron PickAxe Bronze hammer @@ -23599,6 +23977,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ituki Varasa Bronze Hammer Marteau en bronze + Martillo bronce Iron hammer @@ -23678,6 +24057,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hamala ukamea Ituki kaukamea Hammer de ferro + Martillo hierro Copper shears @@ -23761,6 +24141,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fekauʻaki ʻa e kopa Ituki kaukamea Cisailles de cuivre + Cizallas cobre Bronze shears @@ -23844,6 +24225,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fekau polonise Vkoti varasa Cisailles de cuivre + Tijeras bronce Iron shears @@ -23925,6 +24307,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fekau ukamea Koti kaukamea Cisailles de fer + Cizallas hierro + Simbi Shears Copper saw @@ -24004,6 +24388,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Naʻe sio ʻa kopa Kulîlka Saw Raica na Kopa + T'o̲ho̲ cobre Bronze saw @@ -24082,6 +24467,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Naʻe sio ʻa polonise Raica varasa Scie en bronze + T'o̲ho̲ bronce + Bronze show + Bronze akaona Iron saw @@ -24162,6 +24550,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Baƙin ƙarfe gani Raica na kaukamea Scie à fer + T'o̲ho̲ hierro Electric drill @@ -24239,6 +24628,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dril trydan Malaʻe ʻuhila Vakatovotovo livaliva + Taladro eléctrico + توكلۇق مانېۋىر Electric saw @@ -24316,6 +24707,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Gwelodd drydan Naʻe fakatokangaʻi ʻ Laurai ena livaliva + Sierra eléctrica + توك كۆردى Stone knife @@ -24397,6 +24790,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cyllell garreg Hele maka Isele vatu + Jwai Nunu̲ Iron knife @@ -24479,6 +24873,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hele ukamea Isele kaukamea Couteau de fer + Jwai hierro Copper knife @@ -24561,6 +24956,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hele kopa Isele ni Kopa Couteau en cuivre + Jwai cobre Bronze knife @@ -24643,6 +25039,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hele polonise Isele Varasa Couteau en bronze + Jwai bronce Lighter @@ -24723,6 +25120,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mamada Isqueiro Briquet + Encendedor Electric torch @@ -24803,6 +25201,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Foʻi ama ʻuhila Cina livaliva Torche électrique + Antorcha eléctrica Torch @@ -24885,6 +25284,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tuhulu Cina livaliva Lòchran + Antorcha Bottle of water @@ -24964,6 +25364,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hina vai Tavaya wai Bouteille d’eau + Xito ar dehe Bottle of oil @@ -25046,6 +25447,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tavaya waiwai Garrafa de óleo Bouteille d’huile + Xito asete Bucket of water @@ -25128,6 +25530,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kane vai Vokete wai Seau d’eau + Cubo ar dehe Bucket of oil @@ -25209,6 +25612,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vokete waiwai Balde de óleo Seau d’huile + Cubo asete Stone hoe @@ -25290,6 +25694,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Loma ni vatu Lapis hoe Houe en pierre + Azada Nunu̲ Copper hoe @@ -25370,6 +25775,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Opai Copper Hoe Houe en cuivre + Azada cobre Bronze hoe @@ -25450,6 +25856,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Varasa BRONZE HOE Houe en bronze + Azada bronce Iron hoe @@ -25529,6 +25936,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Eisen Hoe Puthaw nga hoe Izigere + Azada hierro + تۆمۈر تۇياق Battery @@ -25606,6 +26015,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Puha ʻuhila Vakau uca Batile + Bateriya Gun @@ -25687,6 +26097,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pištolj Igwa Arme à feu + Pistola Air tank @@ -25767,6 +26178,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tangike ʻea Vuka ni cagi Réservoir d’air + Tanque ar ndähi Double air tank @@ -25847,6 +26259,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tangike ʻea fakamokomoko Loma ni macawa vakarua Réservoir d’air double + Doble tanque ndähi Discharged electric drill @@ -25927,6 +26340,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tukuange e ʻuhila Vakatovotovo livaliva vakagalalataki Broca elétrica descarregada + Taladro eléctrico descargado Discharged electric saw @@ -26006,6 +26420,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Llif trydan wedi'i ryddhau Naʻe fakatokangaʻi ʻe he ʻuhila Vagalalataka na kena livaliva + Sierra eléctrica descargada Discharged electric torch @@ -26087,6 +26502,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ffagl drydan wedi'i rhyddhau Tukuange ha foʻi ama ʻuhila Cina vakasina kei na livaliva vakagalalataki + Antorcha eléctrica descargada Discharged lighter @@ -26167,6 +26583,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tukuange maʻamaʻa ange Vakagalalataki kei na mamada Plus léger déchargé + Encendedor descargado Burnt stick @@ -26248,6 +26665,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vaʻakau tutu Kau kama Vara queimada + Palo quemado Egg @@ -26328,6 +26746,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Foʻimoa Yaloka Egg + T'axi Boiled egg @@ -26411,6 +26830,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Haka e foʻimoa Yaloka sa katakatataki Œuf à la coque + T'axi ndä Bottle @@ -26489,6 +26909,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Potel Foʻi hina Tavaya + Xito Mobile @@ -26565,6 +26986,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Woyenda Мобиль Appareils mobiles + Móvil + Nhare Few sticks @@ -26646,6 +27069,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vica ga na kau Poucos paus Peu de bâtons + Pocos palos Bucket @@ -26727,6 +27151,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kane Vokete Cubo + Balde Non burned bowl @@ -26806,6 +27231,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bowlen heb ei llosgi ʻIkai tutu e poulu Bilo kama + Tazón hindi quemado Bowl @@ -26883,6 +27309,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Poulu Oseni Nnukwu efere + Tazón + Bowl + Ndiro Mushroom soup @@ -26965,6 +27394,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cawl madarch Mushroom supo Supu karou + Sopa champiñones Vegetable Soup @@ -27049,6 +27479,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Supu Ni Kakana Draudrau Sopa vegetal Soupe de légumes + Sopa k'ani Hand axe @@ -27129,6 +27560,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bwyell law Nima axe Tuaka ni liga + Hacha ar 'ye̲ Iron axe head @@ -27211,6 +27643,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ulu ni ulu ni dua na kaurikamea Cabeça de machado de ferro Tête de hache en fer + Cabezal hacha hierro Iron shovel head @@ -27291,6 +27724,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu savolo ukamea Ulu ni isivi kaukamea Tête de pelle en fer + Cabezal pala hierro Iron hoe head @@ -27371,6 +27805,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ukamea Hoi Aironi uluna Tête de houe en fer + Cabezal azada hierro Iron pickaxe head @@ -27451,6 +27886,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pickaxe e ʻulu ukamea Uluna ni tomi aironi Tête de pioche en fer + Cabezal pico hierro Ammo @@ -27510,6 +27946,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ийтэй ʻAmmo Emosi + Munición + Munizione Sulfur dust @@ -27590,6 +28028,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sulfur efu Kuvu ni soso mai na sosovu ni Pó de enxofre + Polvo azufre Gunpowder @@ -27667,6 +28106,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Powdwr gwn Daiu ʻAmmo + Pólvora + مىلتىق Saltpeter @@ -27731,6 +28172,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Salainn Soupeter Nnu + Salitre + Salpperter + Saltpetill + تۇز + Salpeter Sulfur ore @@ -27809,6 +28255,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mwyn sylffwr Sulfur e vaʻa Oa ni Dausa vakayagataki vakady + Mineral azufre Saltpeter ore @@ -27887,6 +28334,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Minério de saltpeter Saltpeter Ore Nnu nnu + Mineral salitre + Salpeter ore Anorthosite @@ -27948,6 +28397,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Saltpeter Emosi Anorthosite + Anortosita + Ọkan Anterite + Unorthosite + Antorthosite + Anotorhosite Basalt @@ -27999,6 +28453,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Basalt Bastal Базальт + Basalto + Ọmọ ilu Limestone @@ -28076,6 +28532,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ka-ni-vaka-ra Anapog Lacho + Caliza Rhyolite @@ -28137,6 +28594,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rhenalite Ридолит Rhyolite + Riolita + Rholite + Rima + راھەك Gneiss @@ -28187,6 +28648,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Gneissearbh Ganyu Gneiss + Gneis + Onimọn + گىلاس Sandstone @@ -28263,6 +28727,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tywodfaen Makalahe Si'erau + Arenisca Schist @@ -28318,6 +28783,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Шист Sīsū Arenito + Esquisto + Seweh + شەيتان + Skist Gabbro @@ -28362,6 +28831,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Габбро Gabro Gabbro + Gabro + Gabro Diorit @@ -28407,6 +28878,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Di ike Диорит Diorit + Die Dolomite @@ -28471,6 +28943,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dolomita Tolomite Dolomite + Dolomita + Ṣi dolomite Mudstone @@ -28539,6 +29013,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mudstreet Балчык таш Mudstone + Nunu̲ ar barro + Mudtstone + لاي تېشى Flint @@ -28605,6 +29082,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ƙyalli FLUTnt Флинт + Pedernal Olive @@ -28678,6 +29156,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Oibliú Oliveira Olive + Aceituna Dirt @@ -28758,6 +29237,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUli Duka Salachar + Suciedad Sand @@ -28832,6 +29312,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Gainmheach Sab Sable + Arena + SANDA Lava @@ -28881,6 +29363,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lawa Лава Lava + Apata Stone rubble @@ -28961,6 +29444,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Veve maka Tikitiki ni vatu Escombros de pedra + Escombros Nunu̲ Gravel @@ -29039,6 +29523,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Graean Maka Qereqere + Grava + Grazia + شېغىل Snow @@ -29117,6 +29604,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Eira Sinou Snow + Xija Ice @@ -29195,6 +29683,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ayis Aila Glace + Hielo Clay @@ -29271,6 +29760,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Clai Keleí Tè glèz + Arcilla + Arcilla Oak wood @@ -29351,6 +29842,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pren derw ʻOke Uti Kau ni oki + Robledal Spruce wood @@ -29433,6 +29925,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kau ni Takasa Madeira de abeto Bois d’épinette + Zaa abeto Linden wood @@ -29514,6 +30007,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Linden Uti Vakatagitaka na vuka Madeira linden + Zaa tilo Pine wood @@ -29594,6 +30088,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pren pinwydd Papa paini Pine kau + Zaa pino Apple wood @@ -29676,6 +30171,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Apple Uti Kau ni Apple Madeira de maçã + Zaa mänsanä Cherry wood @@ -29757,6 +30253,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Madeira de cereja Cherry Igiti Bois de cerisier + Cerezo Plum wood @@ -29840,6 +30337,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Palamu Uti Na kau e ra ni "Plum" Bois de prune + Zaa ciruelo Lemon wood @@ -29919,6 +30417,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pren lemon Lemani Uti Kau ni Moli + Zaa limón Orange wood @@ -29999,6 +30498,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fefie lanu moli Buka roka moli Bois d’orange + Zaa naranja Snow layer @@ -30078,6 +30578,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kuta ʻa Sinou ITaqe ni ucacevata Snower Snow + Capa xija Oil @@ -30157,6 +30658,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Olew Lolo Waiwai + Asete Apple leaves @@ -30238,6 +30740,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mavahe ʻa e Apple Drau ni Apple Folhas da Apple + Hojas mänsanä Lemon leaves with lemons @@ -30318,6 +30821,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku mavahe ʻa lemani mo lemani Biubiu ena moli ni moli Feuilles de citron avec des citrons + Hojas limón ko limones Linden leaves @@ -30397,6 +30901,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drau ni 1997 ena 20 Linden sai Liniteni mavahe + Hojas tilo + لىندېن يوپۇرماق Oak leaves @@ -30476,6 +30982,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dail derw Mavahe ʻa e ʻoke Biubiu mai na oki + Hojas roble Orange leaves @@ -30556,6 +31063,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lauʻiʻakau lanu moli Drauna moli Feuilles orange + Hojas naranja Spruce leaves @@ -30637,6 +31145,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drau ni Kasa ni Rawa ka Spruce mavahe Feuilles d’épinette + Hojas abeto Plum leaves with plums @@ -30721,6 +31230,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku mavahe ʻa e palamu mo e plums E rau vakalimu na plum ena drauna Feuilles de prune avec prunes + Hojas ciruela ko ciruelas Plum leaves @@ -30805,6 +31315,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mavahe ʻa e palamu Na drau ni "Plum" e so na drauna Feuilles de prune + Hojas ciruela Pine leaves @@ -30884,6 +31395,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dail pinwydd Lauʻiʻakau paini Drauna na PINE + Hojas pino Orange leaves with oranges @@ -30964,6 +31476,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lauʻi moli mo e moli Drauna moli kei na moli Feuilles d’orange avec des oranges + Hojas naranja ko naranjas Apple leaves with apples @@ -31047,6 +31560,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drau na apolo kei na apolo Apple sai com maçãs Feuilles de pomme avec des pommes + Hojas mänsanä ko ya mänsanä Cherry leaves @@ -31126,6 +31640,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dail ceirios Mavahe ʻa Seli Drau ni Cherry + Hojas cerezo Cherry leaves with cherries @@ -31206,6 +31721,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku mavahe ʻa Seli mo e fuaʻi Seli Rau lako mai na Cherry kei na jeri Feuilles de cerisier avec des cerises + Hojas cereza ko cerezas Lemon leaves @@ -31284,6 +31800,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dail lemon Mavahe ʻa lemani Rau na lako ni Moli + Hojas limón Kapok fibre @@ -31365,6 +31882,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kapok Kapok Fiber Fibre kapok + Fibra kapok Willow leaves @@ -31444,6 +31962,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lauʻiʻakau uilou Drau ni Willow Willow sai + Hojas sauce + Willow foglie Willow wood @@ -31523,6 +32043,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Uilou Uti Kau ni Ue WILLOW WOOD + Zaa sauce Mangrove leaves @@ -31603,6 +32124,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tongo leaves Draunikau ni turaganiyava Folhas de manguezais + Hojas manglar Mangrove wood @@ -31683,6 +32205,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tongo Uti Io na buka ni sa iyava Madeira de manguezais + Zaa manglar Eucalyptus leaves @@ -31762,6 +32285,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rau ota ʻOku Mavahe ʻa Thesus Feuilles d’eucalyptus + Hojas eucalipto + EUCALYPTPUS Eucalyptus wood @@ -31842,6 +32367,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t 2012 Eucalyptus Wood Bois d’eucalyptus + Zaa eucalipto Olive leaves with olives @@ -31923,6 +32449,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rau lako na olive ena olive Folhas de oliva com azeitonas Feuilles d’olivier avec olives + Hojas olivo ko aceitunas Olive leaves @@ -32004,6 +32531,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drau ni olive Folhas de azeitona Feuilles d’olivier + Hojas olivo Olive wood @@ -32085,6 +32613,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Madeira de oliva Madeira de oliva Bois d’olivier + Zaa olivo Rubber tree leaves @@ -32166,6 +32695,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sa lako na vunikau rapa Folhas de seringueiras Feuilles d’arbre à caoutchouc + Hojas zaa ar caucho Rubberwood @@ -32238,6 +32768,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t RobaWood Robaod Bois d’hévéa + Zaa caucho + Robawood Acacia leaves @@ -32318,6 +32850,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Biubiu mai Nacia Acácia sai Feuilles d’acacia + Hojas acacia + Osacia love Acacia wood @@ -32398,6 +32932,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Na kau keiCia Madeira acácia Bois d’Acacia + Zaa acacia Kapok leaves flowering @@ -32479,6 +33014,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sa susu mai kapok Kapok deixa a floração Les feuilles de Kapok fleurissent + Floración ya hojas Kapok Kapok leaves fibre @@ -32559,6 +33095,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kapok mavahe mei he kalava Biubiu mai Kapok Kapok deixa fibra + Kapok he̲gi fibra Kapok leaves @@ -32640,6 +33177,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Folhas kapok Kapok mavahe Départs de Kapok + Hojas de Kapok Kapok wood @@ -32721,6 +33259,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Madeira Kapok Kau e Kapok Bois de Kapok + Zaa Kapok Willow sapling @@ -32796,6 +33335,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Na-eme njem sapling Таллау үсенте Gaule de saule + Bätsi sauce + Sallow sapling + Willow Sapling Mangrove sapling @@ -32872,6 +33414,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mangrotro nga sapling Mangovers sapling Manggrove Sapling + Bätsi manglar + Manghove sapling + Mangrove Sapling Eucalyptus sapling @@ -32945,6 +33490,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Eucalyptus Spling Eucalyptus Sapling Gaule d’eucalyptus + Tsoño eucalipto + Sauplingsptus sapling + Eucalyptus Sapling Olive sapling @@ -33025,6 +33573,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Olibo nga sapling Olive Sapling Jeune arbre d’olive + Bätsi aceituna Rubber tree sapling @@ -33106,6 +33655,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Noqu vunikau rapa Muda de seringueira Gaules d’arbres à caoutchouc + Bätsi zaa ar caucho Acacia sapling @@ -33183,6 +33733,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Acacia Sapling Acacia Sapling Gaule d’acacia + Retoño acacia Kapok sapling @@ -33254,6 +33805,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sapling sapling Kapok Sapling Капок үтерү + Maoño Kapok Desert grass with dirt @@ -33335,6 +33887,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Musie toafa mo e kelekele Co ni Vanua Dravuisiga kei na qele Grama do deserto com sujeira + Pasto desierto ko ar ximha̲i Forest grass with dirt @@ -33417,6 +33970,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Co ni veikau kei na qele Grama da floresta com sujeira Herbe forestière avec de la saleté + Pasto mboza ko ar ximha̲i Hills grass with dirt @@ -33499,6 +34053,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Veidelana kei na qele Grama das colinas com sujeira Herbe de collines avec de la saleté + Pasto colinas ko ar ximha̲i Jungle grass with dirt @@ -33580,6 +34135,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Musie he vaotaa mo e kelekele Veikau kei na qele Grama da selva com sujeira + Pasto selva ko ar ximha̲i Plains grass with dirt @@ -33661,6 +34217,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Musie tokalelei mo e kelekele Veico buca kei na qele Grama das planícies com sujeira + Llanuras ya pasto ko ar ximha̲i Clay grass with clay @@ -33741,6 +34298,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Musie ʻumea mo e ʻumea Co vaka na tete Herbe d’argile avec de l’argile + Pasto arcilla ko arcilla Compost grass @@ -33822,6 +34380,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Co vakasomuni taucoko Grama de adubo Compost d’herbe + Pasto compost Gravel background @@ -33900,6 +34459,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Daku ni kena qereqere Gravel Istorik Gravel Background + Ts'o̲e grava Anorthosite background @@ -33979,6 +34539,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fundo anorthosite Anstialite nga background Fond d’anorthosite + Ts'o̲e anortosita + Notorhosite ئارقا كۆرۈنۈشى Basalt background @@ -34056,6 +34618,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fundo basalto Bustant Background Basalt + Ts'o̲e basalto + ئاساسىي تەگلىك Clay background @@ -34134,6 +34698,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ang background sa Clay Ajil background Fond d’argile + Ts'o̲e arcilla + Sfondi di argilla Diorit background @@ -34214,6 +34780,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Diorit Istorik Dior Arrière-plan Diorit + Antecedentes de Diorit + Diorit ئارقا كۆرۈنۈشى Dolomite background @@ -34290,6 +34858,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dolomite puipuituʻa ITuvaki mai vei Do surete Ang background sa Dolomite + Ts'o̲e dolomita + DOLOMITE ئارقا كۆرۈنۈشى Flint background @@ -34368,6 +34938,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fundo de Flint Takong Background Spotcent + Ts'o̲e pedernal Gabbro background @@ -34446,6 +35017,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Gabbro Pozadina Background gablo Fond gabbro + Ts'o̲e Gabbro + Gabbro ئارقا كۆرۈنۈشى Gneiss background @@ -34524,6 +35097,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Amavu n'amavuko Gneiss fiaviany Arrière-plan de Gneiss + Antecedentes gneis + گىلاس ئارقا كۆرۈنۈشى Limestone background @@ -34604,6 +35179,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fundo calcário Kalkè background Fond calcaire + Ts'o̲e Nunu̲ ar caliza Mudstone background @@ -34683,6 +35259,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fundo de pedra de lama Mudstone Pozadina Mudstone Latina + Ts'o̲e Nunu̲ barro Red sand background @@ -34762,6 +35339,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cefndir tywod coch Puipuituʻa ʻo e ʻoneʻone Nuku damudamu + Ts'o̲e arena nthe̲ni Regolite background @@ -34842,6 +35420,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fundo regolite Regolitna pozadina Fond de Regolite + Ts'o̲e regolite Rhyolite background @@ -34920,6 +35499,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fundo de rhyolite Rhyolit pozadina Background sa rhyolite + Ts'o̲e riolita + Rhyolite تەگلىك Sandstone background @@ -34998,6 +35579,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sandstone puipuituʻa Daku ni kena daku ni sitaucoko Bautgay sa Sandstone + Ts'o̲e arenisca Schist background @@ -35077,6 +35659,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Antecedentes cistos Schist Pozadina Scholis + Antecedentes esquisto Coal ore background @@ -35156,6 +35739,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cefndir mwyn glo Puipuituʻa ʻo e ukamea malala Waqanitoa e dakuna + Ts'o̲e mineral thehñä Copper ore background @@ -35235,6 +35819,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cefndir mwyn copr Puipuituʻa ʻo e kopa Dakuna ni opa kei na kopa + Ts'o̲e mineral cobre Tin ore background @@ -35316,6 +35901,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t E dakuna na tin ore Fundo de minério de lata Fond de minerai d’étain + Ts'o̲e mineral estaño Iron ore background @@ -35395,6 +35981,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cefndir mwyn haearn Puipuituʻa ukamea Dakuna aironi + Ts'o̲e mineral hierro Aluminium ore background @@ -35474,6 +36061,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium e ukamea mei mui Dakuna ni kaukamea e cake Fond de minerai d’aluminium + Ts'o̲e mineral aluminio Silver ore background @@ -35555,6 +36143,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Puipuituʻa ʻo e ukamea siliva Daku ni oa siliva Fond de minerai d’argent + Ts'o̲e mineral ár t'axi Gold ore background @@ -35635,6 +36224,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Puipuituʻa ʻo e lanu koula Dakuna koula Fond de minerai d’or + Ts'o̲e mineral k'axt'i Sulfur background @@ -35714,6 +36304,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cefndir sylffwr Sulfur puipuituʻa Daku ni Syagi kece sara vakad + Ts'o̲e azufre Saltpeter background @@ -35793,6 +36384,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dakuna na Saltpeter Fundo saltpeter Saltpeter Jan nou koumanse + Ts'o̲e salitre + تۇز سۈكۈتتىكى تەگلىك Roof1 @@ -35869,6 +36462,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Delavuvu1 Telhado1 Ban1 + Techo1 + Denga1 Roof2 @@ -35943,6 +36538,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Delavuvu2 Telhado2 Ban2 + Techo2 + Denga2 Stone rubble background @@ -36023,6 +36620,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maumau maka mei mui Tikitiki ni vatu e dakuna Fundo de escombros de pedra + Ts'o̲e escombros Nunu̲ Sand background @@ -36103,6 +36701,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Nuku mai muri Baba Sab background + Ts'o̲e arena Dirt background @@ -36183,6 +36782,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cefndir baw Puipuituʻa ʻuli ITuvaki qele + Ts'o̲e suciedad Glass @@ -36261,6 +36861,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t GLASS Fitaratra + Vidrio Bricks @@ -36339,6 +36940,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ngaahi Pilisí IKa bulokotaki Briques + Ladrillos + BRICHI Plank @@ -36409,6 +37012,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maƙilci Plak Тактасы + Tabla + Plankan Desk @@ -36484,6 +37089,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mesa Stol Sulatanan + Escritorio + Desiki Door @@ -36560,6 +37167,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drws Matapaá Katuba + Goxthi + Gonhi Ladder @@ -36637,6 +37246,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Scalae Leer Lalupa + 'Rede Flag @@ -36713,6 +37323,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fuka Kuila Flaagi + Bandera + Asia Rope @@ -36789,6 +37401,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rhaff Maea Dali + Cuerda + Tambo Hay block @@ -36862,6 +37476,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bloc y Gelli Konga moe moa Buloko co madu + Bloque heno Advanced space background @@ -36943,6 +37558,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Daku ni vanua lala lala Fundo espacial avançado Arrière-plan de l’espace avancé + Ts'o̲e espacial avanzado Advanced space window @@ -37026,6 +37642,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Katubaleka ni lomanibai e balavu Janela espacial avançada Fenêtre d’espace avancée + Ventana espacio ya dätä jä'i Advanced space block @@ -37107,6 +37724,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lomanibai ni vanua lala Bloco espacial avançado Bloc d’espace avancé + Bloque espacial avanzado Advanced space floor @@ -37188,6 +37806,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Buturara ni maliwa lala e liu Piso espacial avançado Plancher d’espace avancé + Piso espacio avanzado Advanced space block 1 @@ -37269,6 +37888,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lomanibai 1 ni lomanibai e liu Bloco espacial avançado 1 Bloc d’espace avancé 1 + Bloque espacial avanzado 1 Advanced space block 2 @@ -37349,6 +37969,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bloco espacial avançado 2 Advanced Space Block 2 Bloc d’espace avancé 2 + Bloque espacial avanzado 2 Advanced space block 3 @@ -37429,6 +38050,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lomanibai 3 ni vanua e balavu cake Bloco espacial avançado 3 Bloc d’espace avancé 3 + Bloque espacial avanzado 3 Advanced space block 4 @@ -37509,6 +38131,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vanua lala e liu 4 Bloco espacial avançado 4 Bloc d’espace avancé 4 + Bloque espacial avanzado 4 Windmill @@ -37581,6 +38204,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Melin wynt Kasamunitaka Galingan nga gipatuyok sa hangin + Ju̲ni 'Yomu̲ndähi + Mhepo Watermill @@ -37657,6 +38282,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vesiveski Melin ddŵr Vale ni wai + Ju̲ni ar dehe Solar panel @@ -37735,6 +38361,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakawawa me Serauni Solar Panel Jelor + Panel solar Oxygen machine @@ -37815,6 +38442,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Misini ʻokisikena Misini ni Okosio Máquina de oxigênio + Máquina oxígeno Miner @@ -37888,6 +38516,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mèinnear Kaikeri Miner + Minero + Agbẹ + Steinefni Macerator @@ -37945,6 +38576,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dayala Manderay Макоратор + Macerador + MareTor + Macorator Lamp @@ -38021,6 +38655,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mama Cina Lâmpada + Lámpara Radio @@ -38075,6 +38710,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Arust-Radio Радио À la radio + Thuhu Label @@ -38153,6 +38789,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Labeelu Ярлык L’étiquette + Etiqueta Rocket @@ -38229,6 +38866,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kasomuni Kuwitis Rocket + Cohete + Rọkẹti + Roketi Electric furnace @@ -38308,6 +38948,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ffwrnais drydan Afi kakaha Lovo livaliva + Horno eléctrico Stone furnace @@ -38389,6 +39030,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lovo bukawaqa Forno de pedra Four en pierre + Horno Nunu̲ Shelf @@ -38467,6 +39109,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Prateleira Akazu Andel + Estante Advanced box @@ -38546,6 +39189,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Blwch uwch Puha fakalakalaka Kato ni torocake + Caja ya dätä jä'i Wooden box @@ -38626,6 +39270,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Puha papa Kato kau Boîte en bois + Caja ar xithe̲ Charger @@ -38702,6 +39347,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maka Vakau kaukauwa Pòschè + Cargador Banana @@ -38771,6 +39417,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Foʻi Siaine Jaina Banana + Plátano Cherry @@ -38840,6 +39487,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Seriz Ceri Чия ликеры + Cereza Lemon @@ -38913,6 +39561,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Líomóid Limon Лимон + Limón Orange @@ -38988,6 +39637,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lanu Moli Seninawana Orange + Nthe̲ns' Plum @@ -39060,6 +39710,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Plum Prin Караҗимеш + Ciruela + Pruglieghja Apple @@ -39132,6 +39784,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mansanas Pòm Aful + Thuhme jo'xi + Epli + Apuro Rashberry @@ -39184,6 +39839,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rasberry Рашбарри Rashberry + Rashbere + Rashry Strawberry @@ -39255,6 +39912,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rōpere Ierdbei 'Āpono + Fresa Blueberries @@ -39330,6 +39988,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Blueberry Bluuberi Bleuets + Arándanos + Blueberries Cooked meat @@ -39410,6 +40070,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cig wedi'i goginio Kakanoʻi manu feimeʻatokoni Lewe ni manumanu sa kakana + Ngo̲ cocida Meat @@ -39488,6 +40149,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kakanoʻi man Lewe ni manumanu Meat + Ngo̲ Fish @@ -39567,6 +40229,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ika Ika Poissons + Da̲Jwä Cooked fish @@ -39646,6 +40309,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pysgod wedi'u coginio Ika feimeʻatokoni Ika sa saqa + Da̲Jwä ndä Coal dust @@ -39725,6 +40389,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Llwch glo Efu ʻo e malala Kuvu ni soso + Polvo thehñä Bronze dust @@ -39804,6 +40469,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Llwch efydd Efu polonise Kuvu ni parasa + Polvo bronce Gold dust @@ -39887,6 +40553,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kuvu ni soso koula Pó de ouro Poussière d’or + Polvo k'axt'i Iron dust @@ -39966,6 +40633,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Llwch haearn Efu ukamea Kuvu ni soso kaukamea + Polvo hierro Silver dust @@ -40045,6 +40713,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Efu siliva Kuvu ni siliva Poussière d’argent + Polvo ya t'axi Copper dust @@ -40124,6 +40793,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Llwch copr Efu ʻo e kopa Kuvu ni Kopa + Polvo cobre Tin dust @@ -40206,6 +40876,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kuvu ni soso na Tin Pó de lata Poussière d’étain + Polvo estaño Aluminium dust @@ -40286,6 +40957,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium efu Kuvu ni ivakadinadina ni qai Poussière d’aluminium + Polvo aluminio Sawdust @@ -40355,6 +41027,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Igisaku Gawos Sciure de bois + Aserrín + Saudust Bronze ingot @@ -40432,6 +41106,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polonise ingot ISogo Varasa Duhu + Lingote bronce + Bronze ingott Gold ingot @@ -40515,6 +41191,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t GOLD INGOT Ingot volamena Lingot d’or + Lingote k'axt'i + ئالتۇن غۇۋا Iron ingot @@ -40590,6 +41268,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t IRON INGOT Iron inot IRON INGOT + Lingote hierro + تۆمۈر ingott Tin ingot @@ -40662,6 +41342,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cinot Калай Ингот Lingot d’étain + Lingote estaño + Tyin ingot Silver ingot @@ -40742,6 +41424,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ingot de prata Volafotsy Ingot Lingot d’argent + Lingote ya t'axi + كۈمۈش ingot Copper ingot @@ -40822,6 +41506,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kopa ingot Kopa e kepa Lingote de cobre + Lingote cobre Aluminium ingot @@ -40898,6 +41583,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t I-Aluminium Ingot IYogo ni iYlovakasinadina Lingot d’aluminium + Lingote aluminio + Aluminiomu inget Iron plate @@ -40978,6 +41665,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Peleti ukamea Peleti kaukamea Plaque de fer + Placa hierro Bronze plate @@ -41058,6 +41746,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Peleti polonise Peleti Varasa Plaque de bronze + Placa bronce Aluminium plate @@ -41138,6 +41827,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium peleti Peleti ni iVakasaqa Plaque d’aluminium + Placa aluminio Copper plate @@ -41217,6 +41907,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Plât copr Peleti kopa Peleti ni Kopa + Placa cobre Gold plate @@ -41300,6 +41991,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Placa de ouro Placa de ouro Plaque d’or + Placa k'axt'i Coal rock @@ -41382,6 +42074,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vatu ni qilaiso Rocha de carvão Roches de charbon + Roca thehñä Gold rock @@ -41464,6 +42157,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rocha de ouro Gold Rock Roche d’or + Roca k'axt'i Tin rock @@ -41543,6 +42237,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tin Rock Tin nkume Roche d’étain + Roca estaño Silver rock @@ -41624,6 +42319,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vatu siliva Pedra de prata Roche argentée + Roca plateada Iron rock @@ -41703,6 +42399,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maka ukamea Vatu kaukamea Iron Rock + Roca hierro Copper rock @@ -41781,6 +42478,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maka kopa Vatu ni Kopa Copper Rock + Roca cobre Ash @@ -41858,6 +42556,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Uyi Lavenona Cendres + 'Bospi Coal wood @@ -41938,6 +42637,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pren glo Fefie malala Buka waqa + Zaa thehñä Aluminium rock @@ -42017,6 +42717,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium maka Vatu ni iVakasinati Roche d’aluminium + Roca aluminio Coal ore @@ -42094,6 +42795,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ukamea malala Qilaiso waqa Karbon ore + Mineral thehñä + Carbone di carboli Gold ore @@ -42174,6 +42877,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ko e vaʻa koula Oa koula Minerai d’or + Mineral ar k'axt'i Tin ore @@ -42251,6 +42955,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Minério de lata Kaukamea tini Minerai d’étain + Mineral estaño + Tin ire Silver ore @@ -42331,6 +43037,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ukamea siliva Oa siliva Minerai d’argent + Mineral ya t'axi Iron ore @@ -42407,6 +43114,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mwyn haearn Ukamea ukamea Oa kaukamea + Mineral hierro Copper ore @@ -42486,6 +43194,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kopa kopa Orepa Minerai de fer + Mineral cobre Aluminium ore @@ -42564,6 +43273,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium ukamea Kaukamea baleta na iVakasinati Minerai d’aluminium + Mineral aluminio Saphirite @@ -42624,6 +43334,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sapurite Сафирит Saphirite + ستۇفIRTHER + Safirite Diamond @@ -42699,6 +43411,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Diyama Diamond Dyaman + Diamante + Okuta iyebiye + Daimani Emerald @@ -42766,6 +43481,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t I-emerald Smaragd Emerald + Esmeralda + Empirald + Esmeralda Ruby @@ -42826,6 +43544,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ribi Jan yaƙutu Рубин + Rubí + Ohun mere + ياقۇت Small stone rock @@ -42906,6 +43627,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kiʻi foʻi maka maka siʻisi Vatu lailai Petite roche de pierre + T'olo roca Nunu̲ Big stone rock @@ -42986,6 +43708,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fuʻu maka lahi Vatu vatu levu Pedra grande + Nar dätä hño roca Nunu̲ Medium stone rock @@ -43070,6 +43793,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maka Lotoloto Vatu veimama Rocha de pedra média + Roca Nunu̲ ar mediana Bulb @@ -43147,6 +43871,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ISerau ni Icaka Kûberik Laame + Bombilla + Bulb Circuit @@ -43223,6 +43949,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sirkwy Ogbo Circuit + Circuito + Opo ara Battery @@ -43300,6 +44028,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Puha ʻuhila Vakau uca Batile + Bateriya Advanced circuit @@ -43381,6 +44110,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cylched uwch Vahaʻa taimi ʻo e tau Sala ni veiqaravi e liu + Circuito avanzado Brick @@ -43459,6 +44189,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fale Pilisí Buloko Bärelen + Ladrillo + Brick Nail @@ -43539,6 +44271,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Nāʻale Fantsika Ongle + Uña Cloth @@ -43617,6 +44350,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Brethyn Konga tupenu ISulu + Tela Yarn @@ -43692,6 +44426,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Edafedd Kulasi IWase ni Muani + Hilo + يىنى Mud ingot @@ -43771,6 +44507,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Inot mwd Pelepela ingot Na dabibi + Lingote barro + Mud Ingot Condenser @@ -43841,6 +44579,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t IRairai Iti Ogometsa Inav + Condensador + Ile ede + Condensore Diode @@ -43896,6 +44637,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Amarya Diodi Diode + Diodo + Diod + Dide Bare label @@ -43974,6 +44718,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakatakilakilataki sega ni vakalepale Rótulo nu Op bleate etiket + Etiqueta desnuda + Etichetta Bare Motor @@ -44105,6 +44851,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rezistância Neach-reusanta Rezistance + قايتا كىرىش Tranzistor @@ -44147,6 +44894,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tannzistor Transzistor Tranzistor + Tranzisticro + Tranlizortor Silicium @@ -44204,6 +44953,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Silium Olicum Silicium + Silicio + Silikum + Ifihanllium + سىلىس Rod @@ -44278,6 +45031,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Baton Kāla Rulu Tige + Barra xí Plastic @@ -44352,6 +45106,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pelesitiki Palasitika Plasitiki + Plástico Paper @@ -44428,6 +45183,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pepa Pepa Charta + He̲'mi Oak sapling @@ -44503,6 +45259,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Oak Sapling Oak Sa Sapling Gaules de chêne + Retoño roble + Oak Sapling Linden sapling @@ -44576,6 +45334,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Linden Sapling Linden Sapling Linden Sapling + Maoño tilo + Linden Sapling Pine sapling @@ -44652,6 +45412,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Uri ni paini Pine Sapling Pine Sapling + Bätsi pino + Pepling + Pine Sapling Apple sapling @@ -44725,6 +45488,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Apple Sapling Apple Sapling Apple Sapling + Ar nts'olo ora mänsanä + Sapling apple + Apple Sapling Lemon sapling @@ -44801,6 +45567,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Líomóid sapling Sapling lemon Jeune arbre de pomme + Bätsi limón + Lemon Sapling + Lemon Kugonesa Cherry sapling @@ -44874,6 +45643,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cherry Sapling SPLY SAPLE Gaules de cerises + Tsoño cereza + Cherry Sapling Plum sapling @@ -44950,6 +45721,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Plum Sapling Piom sapling Jeune arbre de prune + Bätsi ciruela + Plum Sapling + Ifihan Spruce sapling @@ -45023,6 +45797,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t SPruce Sapling Sapling Sapling Gaules d’épinette + Reoño abeto + Spruce Sapling Orange sapling @@ -45101,6 +45877,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Muda laranja Orange nga sapling Zoranj sapling + Bätsi nthe̲ns'i Dandelion @@ -45163,6 +45940,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dandelien Dieан डँडेलियन + Diente Lyon + Danulion Rose plant @@ -45243,6 +46022,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rose Leve plant Plante de rose + Planta rosas Orchid @@ -45306,6 +46086,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Orchidee Orchid Oca + Orquídea Violet @@ -45373,6 +46154,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bege Ungu Violet + Violeta + بىنەپشە Strawberry plant @@ -45453,6 +46236,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tei ena vakasigade Ierdbei plant Fraisier + Planta fresa Raspberry plant @@ -45531,6 +46315,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Raspberry ʻakau Tei senikau vakasigalia Plante de framboisier + Planta frambuesa Blueberry plant @@ -45611,6 +46396,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fuʻu ʻakau fuamelie Na vunikau ni Buluberi Plante de myrtille + Planta arándanos Big cactus @@ -45690,6 +46476,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cactus lalahi Vosa drode lelevu Big Cactus + Cactus dätä + Big CACTO Small cactus @@ -45771,6 +46559,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fanga kiʻi cactus iiki Yatu e lailai ka lailai Cacto pequeno + Cactus pequeño Sugar cane @@ -45850,6 +46639,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ko e vaʻa suka Toqa na dovu Cana-de-açúcar + Caña t'axu̲t'afi + CANE DI U SUCCEL Onion @@ -45927,6 +46718,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Onioni Onioni Mionana + De̲nxi Onion plant @@ -46005,6 +46797,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t To ʻa e onioni Tei ni Onioni Plante d’oignon + Planta de̲nxi Carrot plant @@ -46084,6 +46877,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Carrot ʻakau Noqu kau kareti Plante de carotte + Planta zanahoria Carrot @@ -46161,6 +46955,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kareti Currot Karot + Zanahoria Plant peas @@ -46242,6 +47037,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kau ni itei Ervilhas vegetais Pois végétaux + Planta guisantes Peas @@ -46315,6 +47111,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pea Erwten Pereti + Guisantes + Pomi Toadstool @@ -46376,6 +47174,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Todstool ToadStool Crapauds + Taba + To aistool Boletus @@ -46427,6 +47227,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Boleetus Boleto Cèpe + Igun + Болеттік + بوغۇزراق Champignon @@ -46482,6 +47285,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Danari Оргил гацар Champignon + Champiñón + Juggignon + Aṣajumọ + Champrignon Coral @@ -46553,6 +47360,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kagaangan Koral Haran-dranomasina + Ilẹkẹ Seaweed @@ -46631,6 +47439,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Icyatsi Lato Algues + Algas marinas + دېڭىز يۈسۈنى Flax @@ -46700,6 +47510,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Llin Tupenu Flaake + Lino + O flax Desert grass @@ -46780,6 +47592,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Glaswellt anial Musie toafa Co ni Vanua dravuisiga + Pasto ar desierto Forest grass @@ -46861,6 +47674,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Co ni veikau Grama florestal Herbe forestière + Pasto jar mboza Hills grass @@ -46940,6 +47754,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Musie he ʻotu moʻunga Veidelana Herbe de collines + Pasto ya colinas + تاغلىق ئوت-چۆپ Jungle grass @@ -47019,6 +47835,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Glaswellt y jyngl Musie he vaotaa Veikau + Pasto ar selva Plains grass @@ -47099,6 +47916,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Co na bucabuca Grama das planícies Grass sa Kapatagan + Pasto ya llanuras Heater @@ -47174,6 +47992,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kāre Initan Appareil de chauffage + Calentador Alore @@ -47227,6 +48046,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Udo Kasa Alore + Fẹran + Olore Wheat seeds @@ -47306,6 +48127,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hadau gwenith Ngaahi tengaʻi uite Sorenikau witi + Semillas trigo Seeds @@ -47383,6 +48205,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hadau Sorenikau Semences + Semillas + Sementi Flax seeds @@ -47464,6 +48288,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ngaahi tengaʻi ʻakau Sorenikau flax Sementes de linho + Semillas lino + Sementi di lapa Wheat straw @@ -47545,6 +48371,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mohuku uite Sitoro ni witi Paille de blé + Paja trigo Hay @@ -47618,6 +48445,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ingirici Ahihia kporo nku Foin + Heno + HAY Leaf @@ -47696,6 +48525,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drauni draunivola Levél növényen List + Hoja + Foglie Stick @@ -47772,6 +48603,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t I Kau Grudar Palica + Palo + Ọkọ + Standa + تاياق Sticks @@ -47854,6 +48689,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Varas Stokken Bâtons + Palos Rubber @@ -47930,6 +48766,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ulapapeni Rapa Reberi + Caucho Chicken @@ -48012,6 +48849,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cyw Iâr Moa Toa + Pollo Rabbit @@ -48091,6 +48929,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cwningen Lapisi Rapete + Kwa Compost @@ -48239,6 +49078,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Peiriant gwnio Misini tuitui Misini ni culacula + Máquina ar coser Bronze hoe head @@ -48320,6 +49160,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu polonise Ulu ni varasa Tête de houe en bronze + Yá ñä ar azada bronce Copper hoe head @@ -48401,6 +49242,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e kopa Hoi Uluna na Kopa Tête de houe en cuivre + Cabezal azada cobre Bucket for rubber @@ -48480,6 +49322,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kane ki he ulapapeni Vokete ni rapa Seau pour caoutchouc + Cucharón pa caucho + Bucket per gomma Resin @@ -48549,6 +49393,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Whare Ferbinster Kākoʻo + Resina + Resin Formal shoes @@ -48628,6 +49474,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Esgidiau ffurfiol Su totonu Vava e dau vakaivakarau + Ze̲xthi formales Pumps @@ -48701,6 +49548,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻŪ pasí Pamu Pompen + Bombas + پومپى Sneakers @@ -48769,6 +49618,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakasatanivola SOneakers Skoene + Ze̲xthi deportivos + Masaga Space boots @@ -48848,6 +49699,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Esgidiau gofod Puti vavaa Vava balavu ni galala + Botas espaciales + Stivali Spaziali Jeans @@ -48903,6 +49756,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Maens Pataloha jeans Jeans + Vaqueros Shorts @@ -49056,6 +49910,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Talausese vavaa Isina galala Pantalons d’espace + Ze̲xjo espaciales Army trousers @@ -49142,6 +49997,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ituu ni mataivalu Calças do exército Pantalon de l’armée + Ze̲xjo ar Ejército Skirt @@ -49220,6 +50076,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Siketi Skirt Siket + Falda + FALLZA + Sketi T-Shirt @@ -49290,6 +50149,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t T-shirt T-shirt T-shirt + Camiseta Spacesuit top @@ -49369,6 +50229,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Spacesuit Top Орон зайны дээд Haut de la combinaison spatiale + Top nthe espacial Dress @@ -49451,6 +50312,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ISulusulu Rigar mata Tenue vestimentaire + Vestido Shirt @@ -49525,6 +50387,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sote Tunica Himd + Pahni + Ṣẹẹti + Camicetta Cap @@ -49597,6 +50462,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kalori Kaskèt Хивс + Gorro Hat @@ -49676,6 +50542,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hata Ad Hula + Fu̲i + Filẹ Crown @@ -49754,6 +50622,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kalauni ISala vakatui Crown + Corona Space helmet @@ -49831,6 +50700,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tata vavaa Isala ni kena galala SPACE Helmet + Casco espacial + Cascu spaziale Underpants @@ -49910,6 +50781,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fobhrístí Fo-thalamh Sous-fants + Calzoncillos Boxer Shorts @@ -49987,6 +50859,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kas meca ni Kisi leleka Bermudão Boxer Shorts + Bóxer Panties @@ -50058,6 +50931,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Calcinha Kayan gini Panty + Bragas Swimsuit @@ -50125,6 +50999,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Na Kaunise Tale Culaith snámha Kaukauranga + Ñhe nsaha + Ewe + SWUMSTU Bikini down @@ -50203,6 +51080,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bikini hifo E cake kei Kasini Bikini Down + Bikini abajo Bra @@ -50265,6 +51143,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bra Rigar mama Efe ara + Sujetador Bikini top @@ -50341,6 +51220,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bikini Top Bikini Top Bikini Top + Top bikini + Bikini Top Army coat @@ -50420,6 +51301,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kote ni Mataivalu Sinina sa army Manteau de l’armée + Däx'yo ar ejército Coat @@ -50498,6 +51380,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Côt Kote Kote + Däx'yo + Aṣọ fakopọ Denim jacket @@ -50577,6 +51461,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Saketi tangakali Jakete vavaku Veste en denim + Chaqueta vaquera Formal jacket @@ -50655,6 +51540,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Siaced ffurfiol Saketi fakahaofi totonu Jakete vakaivola + Chaqueta formal Short jacket @@ -50733,6 +51619,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Siaced fer Saketi nounou Jakete leleka + Chaqueta corta Backpack @@ -50808,6 +51695,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Taistil le mála droma Gibaba nga sudlanan Jaqueta curta + Mochila White dye @@ -50890,6 +51778,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dromuni vulavula Corante branco Colorant blanc + Tinte nt'axi Yellow dye @@ -50971,6 +51860,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lanu engeenga Dromodromo Colorant jaune + Tinte nk'axt'i Gold dye @@ -51053,6 +51943,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dromuni koula Corante de ouro Colorant d’or + Tinte dorado Orange dye @@ -51135,6 +52026,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Roka moli Corante amarelo Colorant orange + Tinte nthe̲ns'i Red dye @@ -51216,6 +52108,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lanu kulokula Damudamu ni samu Colorant rouge + Tinte xí nthe̲ni Dark red dye @@ -51298,6 +52191,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Serauni damudamu butobuto Corante vermelho escuro Colorant rouge foncé + Tinte xí nthe̲ni nk'a'mi Pink dye @@ -51380,6 +52274,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dromuni piqi Corante rosa Colorant rose + Tinte rosa Purple dye @@ -51462,6 +52357,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Drodoka ni drodoka Corante roxo Colorant pourpre + Tinte púrpura Light blue dye @@ -51544,6 +52440,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Corante roxo Udayi okhanyayo okhanyayo Colorant bleu clair + Tinte k'angi majwäni Blue dye @@ -51624,6 +52521,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lliw glas Lanu pulu Drowa ni karakarawa + Tinte k'angi Dark blue dye @@ -51706,6 +52604,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Udayi omnyama okwesibhakabhaka Rangi ya rangi ya bluu Colorant bleu foncé + Tinte k'angi nk'a'mi Teal dye @@ -51788,6 +52687,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ni nina a soli Corante de teal Colorant sarcelle + Tinte xí azulado Light green dye @@ -51869,6 +52769,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Lanu mata ʻo e mama Mosi drokadroka ni cina Colorant vert clair + Tinte nk'ants'i Green dye @@ -51951,6 +52852,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dromuni drokadroka Corante verde Colorant vert + Tinte xí Dark green dye @@ -52033,6 +52935,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Serauni drokadroka loaloa Corante verde escuro Colorant vert foncé + Tinte nk'a'mi Brown dye @@ -52115,6 +53018,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Roka via damudamu Corante marrom Colorant brun + Tinte marrón Light grey dye @@ -52198,6 +53102,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Serau ni cina Corante cinza claro Colorant gris clair + Tinte nxo̲ge ar 'bospi majwäni Grey dye @@ -52281,6 +53186,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Beri serau Corante cinza Colorant gris + Tinte nxo̲ge ar 'bospi Dark grey dye @@ -52364,6 +53270,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Nomu vosa serau loaloa Corante cinza escuro Colorant gris foncé + Tinte nxo̲ge ar 'bospi nk'a Black dye @@ -52446,6 +53353,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dromuni loaloa Corante preto Colorant noir + Tinte mpothe Army dye @@ -52528,6 +53436,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Wase ni mataivalu Corante do exército Colorant de l’armée + Tinte ar ejército Magenta dye @@ -52608,6 +53517,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Magenta Bei ni kulakula Colorant Magenta + Tinte magenta + Maggenta dye Rose quartz dye @@ -52689,6 +53600,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dromuni ni mata Corante de quartzo rosa Colorant de quartz rose + Tinte cuarzo rosa + Round Crendz Dye Spring green dye @@ -52771,6 +53684,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ni vulaitubutubu a drokadroka ni vulaitubutubu Corante verde da primavera Colorant vert de printemps + Tinte xí primaveral Violet dye @@ -52851,6 +53765,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku lanu ʻa Vāleti Vori ni vukuna o Violet Colorant violet + Tinte violeta Olive dye @@ -52933,6 +53848,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t A qai vakau na olive Corante de oliva Colorant d’olive + Tinte oliva Test tube @@ -53012,6 +53928,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Foʻi tiupi sivi IGacagaca ni vakatovotovo Tube tat-test + Tubo ensayo Copper pickaxe @@ -53091,6 +54008,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Digia o Kopa Copper Pickaxe Pioche en cuivre + Pico cobre Copper axe @@ -53173,6 +54091,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aeris Axe de cobre Hache en cuivre + Hacha cobre + Pobre ax Copper shovel @@ -53252,6 +54172,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Savolo ʻo e kopa Isivi ni Kopa Pelle en cuivre + Pala cobre + Pala di coper Gold hammer @@ -53333,6 +54255,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ituki koula Gold Hammer Marteau d’or + Martillo k'axt'i Steel hammer @@ -53414,6 +54337,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hamala sitila Ituki sitila Marteau d’acier + Martillo asero Aluminium hammer @@ -53495,6 +54419,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium Hammer Ituki ni iVakatakata Marteau en aluminium + Martillo aluminio Copper hammer @@ -53576,6 +54501,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Itukituki ni Kopa Hammer de cobre Marteau de cuivre + Martillo cobre Gold knife @@ -53660,6 +54586,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hele koula Isele koula Couteau en or + Jwai k'axt'i Gold hoe @@ -53740,6 +54667,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Qasi Koula Bulawan nga hoe Houe en or + Azada k'axt'i Gold shovel @@ -53820,6 +54748,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Savolo koula Siviyu koula Pelle en or + Pala k'axt'i Gold pickaxe @@ -53899,6 +54828,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pickaxe koula Idiki koula Pioche d’or + Pico k'axt'i + Goolu picpaxe Gold shears @@ -53983,6 +54914,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fekau koula Koti koula Cisailles d’or + Tijeras k'axt'i Gold saw @@ -54062,6 +54994,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Saw Gold Raica na koula Scie à or + T'o̲ho̲ k'axt'i + ئالتۇن Steel pickaxe @@ -54142,6 +55076,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tomi sitila Steel Pickaxe Pioche en acier + Pico asero Aluminium saw @@ -54222,6 +55157,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium dît Rau na ivakaso ni ivakatatabu Scie en aluminium + T'o̲ho̲ aluminio Aluminium shears @@ -54305,6 +55241,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium fefine IKa ni tini vakasaqa e Cake Cisailles d’aluminium + Cizallas aluminio + Aluminium Shears Aluminium knife @@ -54387,6 +55325,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium hele Isele ni ivakaso loma ni ivaka Couteau en aluminium + Jwai aluminio Aluminium hoe @@ -54468,6 +55407,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminum hoe IVakatakata ni Yalovinaka Houe en aluminium + Azada aluminio Aluminium shovel @@ -54548,6 +55488,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sivi Oonumi Aluminium Shovel Pelle en aluminium + Pala aluminio Steel shovel @@ -54629,6 +55570,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Savolo ukamea Isivi sitila Pelle d’acier + Pala asero Steel hoe @@ -54710,6 +55652,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hoi sitila Sitila Houe en acier + Azada asero Steel knife @@ -54792,6 +55735,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hele ukamea Isele sitila Couteau en acier + Jwai asero Steel shears @@ -54876,6 +55820,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fekau ukamea Vkoti sitila Cisailles d’acier + Cizallas asero Steel saw @@ -54957,6 +55902,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Naʻe mamata ʻa e ukame ITuvatuva ni sitila Scie en acier + T'o̲ho̲ asero Aluminium pickaxe @@ -55033,6 +55979,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium Pickaxe IVakatakata ni Baleta na iVakatakata Pioche en aluminium + Pico aluminio Gold axe @@ -55114,6 +56061,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ni sa vakaivolataki koula Gold Axe Hache d’or + Hacha k'axt'i Aluminium axe @@ -55195,6 +56143,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Bwyell alwminiwm IQamu ni baleta na ivakasamu Hache en aluminium + Hacha aluminio Barrel @@ -55272,6 +56221,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Hina Kasa iO Tonne + Barri + Barrica + تۇڭ Bronze shears head @@ -55353,6 +56305,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu 30 polonise Vkoti varasa Tête de cisaillement de bronze + Cabezal cizallas bronce Copper shears head @@ -55435,6 +56388,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e kopa E kotiva na ului ki na kopa na kopa Tête de cisaillement de cuivre + Cabezal cizallas cobre Gold shears head @@ -55518,6 +56472,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Uluna na vkoti koula Cabeça de tesoura de ouro Tête de cisaillement d’or + Cabezal tijeras k'axt'i Iron shears head @@ -55601,6 +56556,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Uluna na koti kaukamea Cabeça de tesoura de ferro Tête de cisaillement de fer + Cabezal cizallas hierro Steel shears head @@ -55683,6 +56639,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu fekauʻaki mo e ukamea Uluna ni koti sitila Tête de cisaillement d’acier + Cabezal cizallas asero Aluminium shears head @@ -55765,6 +56722,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium e ʻulu fekauʻaki Ulu ni koti ni ikaloulou Tête de cisaillement d’aluminium + Cabezal cizallas aluminio Copper axe head @@ -55847,6 +56805,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Axe e ʻulu ʻo e kopa Ulu ni ulu ni kopa Tête de hache en cuivre + Cabezal hacha cobre Bronze axe head @@ -55929,6 +56888,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polonise axe ʻulu Ulu ni ulu ni varasa Tête de hache en bronze + Yá ñä ar hacha bronce Gold axe head @@ -56011,6 +56971,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu axe koula ILiuliu ni mota koula Tête de hache en or + Yá ñä ar hacha k'axt'i Iron axe head @@ -56094,6 +57055,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ulu ni ulu ni dua na kaurikamea Cabeça de machado de ferro Tête de hache en fer + Cabezal hacha hierro Steel axe head @@ -56177,6 +57139,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ulu ni ulu ni sitila Cabeça de machado de aço Tête de hache en acier + Cabezal hacha asero Aluminium axe head @@ -56259,6 +57222,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium axe ʻulu Ulu ni sikamu baleta na ivovo ni ivovo Tête de hache en aluminium + Cabezal hacha aluminio Copper pickaxe head @@ -56337,6 +57301,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pickaxe e ʻulu ʻo e kopa Uluna ni kopa Tête de pioche en cuivre + Cabezal pico cobre + Rame di pickaxe Bronze pickaxe head @@ -56417,6 +57383,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polonise pickaxe ʻulu Uluna ni veiqiki varasa Tête de pioche en bronze + Yá ñä ar pico bronce Gold pickaxe head @@ -56497,6 +57464,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu pickaxe koula Uluna ni tomi koula Tête de pioche en or + Yá ñä ar pico k'axt'i Iron pickaxe head @@ -56577,6 +57545,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pickaxe e ʻulu ukamea Uluna ni tomi aironi Tête de pioche en fer + Cabezal pico hierro Steel pickaxe head @@ -56656,6 +57625,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Pickaxe e ʻulu ukamea Uluna ni tomi sitila Tête de pioche en acier + Cabezal pico asero + Head Blackaxe Steel Aluminium pickaxe head @@ -56736,6 +57707,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium pickaxe ʻulu Na ulu ni bese ni ivakacemoce Tête de pioche en aluminium + Cabezal pico aluminio Copper shovel head @@ -56817,6 +57789,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu savolo ʻo e kopa Isivi ni Kopa Tête de pelle en cuivre + Cabezal pala cobre Bronze shovel head @@ -56898,6 +57871,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e savolo polonise ILiuliu ni isivi varasa Tête de pelle en bronze + Yá ñä ar pala bronce Gold shovel head @@ -56980,6 +57954,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Uluna ni sasivi koula Cabeça de pá de ouro Tête de pelle en or + Yá ñä ar pala dorada Iron shovel head @@ -57061,6 +58036,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu savolo ukamea Ulu ni isivi kaukamea Tête de pelle en fer + Cabezal pala hierro Steel shovel head @@ -57142,6 +58118,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu savolo ukamea ILiuliu ni sitila Tête de pelle en acier + Cabezal pala asero Aluminium shovel head @@ -57223,6 +58200,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium e ʻulu ʻo e savolo Ulu ni isivi ni ivotavota Tête de pelle en aluminium + Cabezal pala aluminio Bronze hoe head @@ -57304,6 +58282,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu polonise Ulu ni varasa Tête de houe en bronze + Yá ñä ar azada bronce Gold hoe head @@ -57385,6 +58364,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu hoi koula Uluna koula Tête de houe en or + Cabezal azada k'axt'i Iron hoe head @@ -57466,6 +58446,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ukamea Hoi Aironi uluna Tête de houe en fer + Cabezal azada hierro Steel hoe head @@ -57546,6 +58527,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ukamea Hoi Ulu ni sitila Tête de houe en acier + Cabezal azada asero + A testa di u sguardu Aluminium hoe head @@ -57627,6 +58610,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium e ʻulu ʻo e Hoi Ulu ni ivotavota ni ivotavota Tête de houe en aluminium + Cabezal azada aluminio Steel axe @@ -57709,6 +58693,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sitila axe Dua na itukutuku sitila Hache d’acier + Hacha asero Bronze shovel @@ -57790,6 +58775,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Siviyasa Varasa Machado de aço Pelle en bronze + Pala bronce Bronze pickaxe @@ -57867,6 +58853,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polonise pickaxe IMosiki varasa Pioche en bronze + Pico bronce Copper knife head @@ -57947,6 +58934,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e hele kopa Ulu ni isele ni Kopa Tête de couteau en cuivre + Yá ñä ar jwai cobre Bronze knife head @@ -58027,6 +59015,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e hele polonise Ulu ni isele Varasa Tête de couteau en bronze + Yá ñä ar jwai bronce Gold knife head @@ -58107,6 +59096,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e hele koula Uluna ni isele koula Tête de couteau en or + Yá ñä ar jwai k'axt'i Iron knife head @@ -58187,6 +59177,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e hele ukamea Uluna ni isele kaukamea Tête de couteau en fer + Yá ñä jwai hierro Steel knife head @@ -58268,6 +59259,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e hele ukamea Ulu ni isele sitila Tête de couteau en acier + Yá ñä jwai asero Aluminium knife head @@ -58348,6 +59340,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Aluminium e hele Ulu ni isele ni ivakadinadina Tête de couteau en aluminium + Cabezal jwai aluminio Steel ingot @@ -58429,6 +59422,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sitila Steel Ingot Lingot d’acier + Lingote asero Christmas star @@ -58507,6 +59501,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fetuʻu ʻo e Kilisimasi Kalokalo ni Siganisucu Poinsétia + Flor de Pascua + روژدېستۋو بايرىمى Continue @@ -58586,6 +59582,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tomana Tale Permaneo Continúa + Da 'ño Gift code @@ -58665,6 +59662,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cod rhodd Kouti ʻo e meʻaʻ IVakatakilakila ni iLoloma + Código nt'uni Acheavements @@ -58742,6 +59740,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Emezuru Zava-bita Acheavements + Logros + Awọn aṣeyọri + مۇۋەپپەقىيەت + Kubudirira Exit @@ -58823,6 +59825,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakasuka Sair (Il sort.) + Salida Stone age @@ -58902,6 +59905,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Taʻu motuʻa maka Yabaki ni vatu Doba kamenná + Bätsitho Nunu̲ Pick up an stone rock @@ -58982,6 +59986,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Codwch graig garreg Toʻo hake ha foʻi maka Tomika cake e dua na vatu + Recoge 'nar roca Nunu̲ Bronze age @@ -59063,6 +60068,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Idade do Bronze Doba bronzová Âge du bronze + Bätsitho Bronce Create a bronze ingot @@ -59142,6 +60148,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Creu ingot efydd Faʻu ha ingot polonise Bulia e dua na ibulibuli varasa + Da t'ot'e 'nar lingote bronce Iron age @@ -59223,6 +60230,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Idade do Ferro Doba železná Âge du fer + Bätsitho Hierro Create an iron tool @@ -59302,6 +60310,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Creu teclyn haearn Faʻu ha meʻangaue ukamea Bulia e dua na iyaya kaukamea + Da t'ot'e 'nar herramienta hierro Future age @@ -59381,6 +60390,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Taʻu Motuʻa He Kaha Yabaki ni mataka Idade do futuro + Bätsitho futura + Età futuru Fly with rocket @@ -59461,6 +60472,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Puna mo e misaile Vuka ena ka e tiko kina na tukuna e dua na ka Voe com foguete + Vuela ko cohete Achievement detail @@ -59542,6 +60554,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Matailalai ni rawa ka Detalhes da realização Détail de la réalisation + Detalle ar logro Game Jolt nick @@ -59606,6 +60619,14 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sosamu ni Qito Jogo Jolt nick Jeu Jolt nick + 'Ñeni ar Jolt nick + Game jolt nick + Ere Jolt Nick + Game Jolt Nick + Game Jolt Nick + Ойын Жольба Ник + ئويۇن jolt nick + Game Jolt Nick Game Jolt Tokem @@ -59688,6 +60709,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Presentéiert d'Säit of Swichtsje Submit + Pe̲hni + Sottumissione Share as Game Jolt Trophy @@ -59769,6 +60792,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Wasea ni da Dau Togi Kasau Compartilhe como Troféu Game Jolt Partager en tant que trophée Game Jolt + T'uni komongu Trofeo Game Jolt Gift is opening... @@ -59850,6 +60874,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sa dola tu na iloloma... O presente está abrindo... Gift s’ouvre... + Ar nt'uni ar xi abriendo... Gift was already opened @@ -59930,6 +60955,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Naʻe ʻosi fakaava ʻa e meʻaʻofá Sa dolavi oti tu na iloloma O presente já foi aberto + Ar nt'uni ya xki abierto Gift was already opened @@ -60010,6 +61036,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Naʻe ʻosi fakaava ʻa e meʻaʻofá Sa dolavi oti tu na iloloma O presente já foi aberto + Ar nt'uni ya xki abierto This version is old, gift code cannot be used @@ -60089,6 +61116,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mae'r fersiwn hon yn hen, ni ellir defnyddio cod rhodd ʻOku motuʻa ʻa e tatau ko ʻeni, he ʻikai lava ke fakaʻaongaʻi e kouti meʻaʻofa E makawa na kena ivakamacala oqo, sega ni rawa ni vakayagataki na vosa ivakatakilakila ni isolisoli + Nuna ar versión xí antigua, código nt'uni hingi ar tsa̲ da utilizar state: acquired @@ -60169,6 +61197,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ituvaki e rawati: laveti Estado: Adquirido État : acquis + Dätä: hñä state: not acquired @@ -60249,6 +61278,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Siteiti: ʻikai maʻu Ituvaki: sega ni volitaki État : non acquis + Dätä: hindi adquirido Close @@ -60328,6 +61358,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Caewch Tāpuni Sogota + Cerrar Trophy is sending... @@ -60409,6 +61440,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku ʻoatu ʻe ipu Outland... Na togi e vakauta mai... Troféu está enviando... + Trofeo xi enviando... Trophy cannot be send. @@ -60490,6 +61522,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t He ʻikai lava ke ʻave ipu Outland. E sega ni rawa ni vakau na begi. Troféu não pode ser enviado. + Ar trofeo hingi ar tsa̲ da pe̲hni. The award can only be used in adventure mode, otherwise it would be too easy @@ -60573,6 +61606,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ena rawa walega ni vakayagataki na icovi ena icakacaka ni vakadidike, ke sega ena rawarawa O prêmio só pode ser usado no modo aventura, caso contrário seria muito fácil Le prix ne peut être utilisé qu’en mode aventure, sinon ce serait trop facile + Ar premio ar Honto ar tsa̲ da zu̲di ja ar modo aventura, ar nä'ä contrario ge xki hei Angel hair @@ -60653,6 +61687,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻUlu ʻo e ʻangelo Drauniulu ni agilosi Cheveux d’ange + Ma xtä anxe̲ + Capelli anghjulu Christmas ball @@ -60733,6 +61769,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo ni Siganisucu Blar sa Pasko Bal de Noël + Hnei 'nar ar pa 'mu̲i + Ball di Natale Blue christmas ball @@ -60817,6 +61855,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo karakarawa ni Siganisucu Bola de Natal azul Bal de Noël bleu + Nuhni ar pa 'mu̲i k'angi Yellow christmas ball @@ -60899,6 +61938,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Foʻi pulu Kilisimasi engeenga Polo dromodromo ni Siganisucu Bola de Natal amarela + Nuhni ar pa 'mu̲i amarilla + Ballu di Natale giallu Orange christmas ball @@ -60983,6 +62024,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo moli ni siganisucu Bola de Natal laranja Bal de Noël orange + Hnei 'nar pa 'mu̲i nthe̲ns'i Red christmas ball @@ -61065,6 +62107,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo ni Siganisucu damudamu Bola de Natal vermelha Bal de Noël rouge + Bola nthe̲ni ar pa 'mu̲i + Ballo di Natale Rossu Pink christmas ball @@ -61147,6 +62191,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo piqi ni Siganisucu Bola de Natal rosa Bal de Noël rose + Hnei 'nar pa 'mu̲i rosa + Rosa ballata di Natale Purple christmas ball @@ -61229,6 +62275,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo ni Siganisucu lokaloka Bola de Natal roxa Bal de Noël violet + Hnei 'nar pa 'mu̲i morado + Purple BUTLE DI Natale Light green christmas ball @@ -61312,6 +62360,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo drokadroka ni Siganisucu Bola de Natal verde claro Bal de Noël vert clair + Nuhni ar pa 'mu̲i nk'ants'i Teal christmas ball @@ -61394,6 +62443,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Polo ni siganisucu ni Teal Baile de Natal de Teal Bal de Noël sarcelle + Nuhni ar pa 'mu̲i njät'i xí Azulado + رومال روژدېستۋو بايرىمى Fly mode in creative @@ -61477,6 +62528,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Modo mosca em criativo I-Fly Mode e-Creative Mode vol en mode créatif + Modo Volar creatividad Show/hide dev info @@ -61560,6 +62612,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakaraitaka/vunia na itukutuku ni dev Mostrar/ocultar informações de dev Afficher/masquer les informations de développement + Mostrar yá ocultar ungumfädi nte Nelze rozpoznat ip @@ -61641,6 +62694,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ip sega ni kilai Ip não reconhecido Ip non reconnue + IP hindi reconocida Nelze rozpoznat port @@ -61721,6 +62775,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻIkai lava ʻo ʻiloʻi ʻa e pooti Sega ni rawa ni kidava na gacagaca Incapaz de reconhecer porto + Hingi ar tsa̲ da reconocer ar puerto Nelze rozpoznat adresu serveru @@ -61801,6 +62856,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻIkai lava ke fakaleleiʻi e tuʻasila ʻo e server Sega ni rawa ni wali na itikotiko ni seva Impossible de résoudre l’adresse du serveur + Hingi ar tsa̲ da resolver jar 'mui ar servidor Nelze se připojit @@ -61881,6 +62937,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sega ni rawa ni sema Incapaz de se conectar Ayikwazi ukunxibelelana + Hingi ar tsa̲ da conectar Server nenalezen @@ -61960,6 +63017,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ni ddaethpwyd o hyd i'r gweinydd ʻIkai maʻu ʻa e server Sega ni kune na seva + Servidor hindi encontrado Server se nenašel v časovém intervalu @@ -62040,6 +63098,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Naʻe ʻikai maʻu ʻa e server ʻi he taimi ʻoku tuʻu ai A sega ni kune na seva ena gauna taucoko Le serveur n’a pas été trouvé dans l’intervalle de temps + Hingi ar bí nthe̲hu̲ ar servidor jar intervalo ya pa Neplatná adresa serveru @@ -62120,6 +63179,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻIkai tonu ʻa e tuʻasila ʻo ITikotiko ni seva sega ni vakabau Adresse de serveur non valide + 'Mui ar servidor hindi válida Server není dostupný @@ -62201,6 +63261,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻIkai maʻu e server E sega na seva Le serveur n’est pas disponible + Ar servidor hingi 'bu̲i disponible Nelze odeslat k serveru požadavek o odeslání informací @@ -62282,6 +63343,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sega ni rawa ni vakau na kerekere ni itukutuku ki na server Não é possível enviar solicitação de informações ao servidor Impossible d’envoyer une demande d’informations au serveur + Hingi ar tsa̲ da pe̲hni zohni 'nehe ungumfädi ja ar servidor Server byl neočekávaně vypnut @@ -62363,6 +63425,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sogota sega ni namaki na seva O servidor foi desligado inesperadamente Le serveur s’est arrêté de manière inattendue + Ar servidor ar apagó inesperadamente Nelze získat data @@ -62443,6 +63506,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻIkai lava ke maʻu e fakamatalá Sega ni rawa ni tauri na itukutuku Impossible d’obtenir des données + Hingi ar xi uni datos Připojení existuje, ale získané data nemají správný typ @@ -62524,6 +63588,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku ʻi ai e fehokotakiʻanga, ka ʻoku ʻikai ko e faʻahinga totonu ʻa e fakamatala ʻoku maʻu E tiko na isema, ia na itukutuku a soli mai e sega ni vaka na mataqali dodonu La connexion existe, mais les données obtenues ne sont pas du type correct + Ar conexión nuna ar dängo, pe ya datos obtenidos hingi ya klase ar na za Obdrženy vadné data @@ -62604,6 +63669,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Derbyniwyd data gwael Fakamatala kovi kuo maʻu ITukutuku ca e ciqomi + Datos incorrectos recibidos Nelze odeslat serveru požadavek o poskytnutí informací @@ -62685,6 +63751,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sega ni rawa ni vakau na kerekere ni itukutuku ki na server Não é possível enviar solicitação de informações ao servidor Impossible d’envoyer une demande d’informations au serveur + Hingi ar tsa̲ da pe̲hni zohni 'nehe ungumfädi ja ar servidor Hra je pro jinou verzi - %name% @@ -62765,6 +63832,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ko e vaʻinga ki ha version kehe - %name% Na qito e baleta e dua tale na mataqali -%name% O jogo é para uma versão diferente - %name% + Ar 'ñeni ar pa 'nar versión diferente — % name % Server je plný @@ -62844,6 +63912,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku fonu ʻa e server Sa sinai na seva Server je plný + Ar servidor xí lleno Neznámá chyba zamezující připojení @@ -62923,6 +63992,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Gwall atal cysylltiad anhysbys ʻIkai ʻiloʻi ʻa e fehalaaki ʻi he Cala ni itatarovi ni isema sega ni kilai + Error prevención conexión desconocida Postel @@ -63000,6 +64070,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Gwely Mohenga IDavodavo + Nt'ots' Země @@ -63077,6 +64148,9 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Māmani Vuravura La Terre + Ha̲i + E Terra + يەر Měsíc @@ -63155,6 +64229,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mahina Vula Mjesec + Zänä Mars @@ -63197,6 +64272,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Whārangi Ma Mars Mars + Marte + Mars Vesmírná stanice @@ -63277,6 +64354,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tauʻanga lelue Vanua ni galala Estação espacial + Estación espacial Slunce @@ -63360,6 +64438,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Laʻaa Matanisiga Sun + Hyadi Merkur @@ -63432,6 +64511,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Mali Mea Mercury U-u + Mercurio + مېركۇرى Venuše @@ -63479,6 +64560,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Venusi Sus Mūū + Venere Venere + Wenu "Nemáte dostatek materiálu @@ -63639,6 +64722,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t para criar" « Vous n’avez pas assez de matériel pour créer « + "Hingi gi 'ñehe xingu hñei + pa da t'ot'e" Phobos @@ -63689,6 +64774,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ohbob Onyinyo Phobos + Fobos + Fhostos Jupiter @@ -63741,6 +64828,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Iau Jupitit Jupiter + Júpiter + Jupita Io @@ -63771,6 +64860,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Би Io Io + Io + Ио Europa @@ -63826,6 +64917,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Eupa EUROPA Ievu + Ẹja fun Euroa Ganymed @@ -63879,6 +64971,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Ganmede Ganylde Ganyuny + Ganímedes + Mọebiti + Ganymeode + GanyMede Callisto @@ -63925,6 +65021,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Okustisto Callisto Callisto + Spelisto Saturn @@ -63985,6 +65082,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sarki 'Ōpiha Diteen + Saturno + A Saturn Titan @@ -64029,6 +65128,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tije Tihan Titan + Titán + TITAN Uran @@ -64075,6 +65176,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t I-Uranus Түз хагас Uranus + Urano + Utonis Titania @@ -64119,6 +65222,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Titanya Tithia Titania + Titannia Neptun @@ -64183,6 +65287,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Nepta Nepune Neptune + Neptuno + Nepune Proteus @@ -64229,6 +65335,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Kariya Автоматта रूप बदलनेवाला प्राणी + Amuduro + Próteus + بۇرۇن قوغدىغۇچى + Protedy Triton @@ -64265,6 +65375,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Tsindo Kāleʻa Triton Triton, + Tritón Pluto @@ -64318,6 +65429,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Wann een Pluto Pliuto Plorin + Plutón + PRIUTO Charon @@ -64367,6 +65480,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Si chron Onye bụ Charon Canton de Charon + Caronte + Fira na + Charon + Chron + Chron Eris @@ -64456,6 +65574,8 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dynomia Doysnomia Disnomia + Disnomia + DiSnomia Žádné @@ -64536,6 +65656,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sega ni dua Ninguno Aucune + Ninguno Informace o GeDo tagech @@ -64615,6 +65736,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Gwybodaeth am dagiau GeDo Fakamatala fekauʻaki mo e geDo tags IVakamacala me baleta na GeDo tags + Ungumfädi dige ya etiquetas GeDo Informace o tagách @@ -64694,6 +65816,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fakaʻilongaʻi e fakamatalá IVakatakilakila ni iVakamacala Informações da tag + Nuna ar etiqueta Skrýt informace o tagách @@ -64775,6 +65898,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vunia na itukutuku ni itoka Ocultar informações da tag Masquer les informations de balise + Ocultar ungumfädi etiquetas za xxx dosaďte typy stylů @@ -64856,6 +65980,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sosomitaka na mataqali 100 Substituir tipos de estilo xxx para xxx Substituer xxx types de style pour xxx + Da hñäki guto ya xingu ya estilo xxx ya xxx Tagy se nesmí překrývat @@ -64935,6 +66060,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Rhaid i dagiau beidio â gorgyffwrdd Kuo pau ke ʻoua naʻa fehulunaki ʻa e ngaahi fakaʻ Me kakua ni vakaisaumi na itoka + Ya etiquetas hingi tsa superponer ar V tagu se nesmí být tag @@ -65015,6 +66141,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t E sega ni dodonu me dua na itoka ena itoka Não deve haver nenhuma etiqueta na etiqueta Il ne doit pas y avoir d’étiquette dans l’étiquette + Hingi da porke ni 'na jar etiqueta ja ar etiqueta Text v tagách by neměl obsahovat symboly &l; a &g;, můžete je napsat pomocí &l; nebo &r; @@ -65095,6 +66222,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻOku ʻikai totonu ke kau ʻi he fakamatala ʻi he tags ha ngaahi fakaʻilonga Na itukutuku ena veivakatakilakila me kakua ni tiko kina na ivakatakilakila O texto nas tags não deve conter símbolos + Texto ya etiquetas hingi da contener símbolos Všechny typy tagů @@ -65175,6 +66303,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Faʻahinga fakaʻilonga kotoa pe Mataqali ivakatakilakila taucoko Tous les types de balises + Nga̲tho ar klase ar etiquetas White, bílá na bílé je špatně vidět @@ -65256,6 +66385,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t E dredre na raica na vulavula, vulavula ena vulavula Branco, branco no branco é difícil de ver Blanc, blanc sur blanc est difficile à voir + Nt'axi, nt'axi sobre nt'axi xí hñembi ar nu'i Barevné efekty @@ -65335,6 +66465,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Effeithiau lliw Ngaahi ola ʻo e lanu Revurevu ni roka + Efectos ar njät'i Typ textu @@ -65412,6 +66543,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Math o destun Faʻahinga Fakaleá Mataqali itukutuku volai + Ar klase ar texto Symboly @@ -65489,6 +66621,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Symbolau Ngaahi Fakaʻilongá IVakatakarakara + Símbolos Skrýt symboly @@ -65568,6 +66701,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cuddio symbolau Fūfuuʻi ʻa e ngaahi fakataip Vunia na ivakatakarakara + Ocultar símbolos Více o rozšíření Link @@ -65649,6 +66783,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakalevutaki ni isema Ocultar símbolos En savoir plus sur l’extension Link + Mäs dige ar extensión Link Skrýt více o rozšíření Link @@ -65730,6 +66865,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vunitaka vakalevu na isema Esconda mais sobre a extensão Link Masquer plus d’infos sur l’extension Link + Ocultar mäs dige ar extensión Link Nebezpečná url @@ -65809,6 +66945,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Url beryglus URL fakatuʻutamaki Url Rerevaki + URL peligrosa Nebezpečná url se tváří jako odkaz na stránku, ale skutečně není @@ -65890,6 +67027,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Na url rerevaki e vaka e dua na isema ki na dua na tabana, ia e sega dina ni A url perigosa parece um link para uma página, mas realmente não é L’URL dangereuse ressemble à un lien vers une page, mais ce n’est vraiment pas le cas + Ar url peligrosa mä 'nar enlace ja 'nar página, pe realmente nä'ä Hingar Chybně napsaná url (chybí http) @@ -65970,6 +67108,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sipela hala URL (ʻikai ʻasi e http) Url sipelitaki cala (yali na http) Url mal escrito (faltando http) + URL mal ko ('be̲di http) Rozšíření tagů @@ -66049,6 +67188,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Estyniadau tag Fakaloloaʻi ʻo e tag IVakatakilakila ni iVakatakilakila + Extensiones etiquetas Skrýt rozšíření tagů @@ -66128,6 +67268,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Cuddio estyniadau tagiau Fūfuuʻi ʻa e tag fakaloloaʻí Vunia na isema ni itoka + Ocultar extensiones etiqueta Červeně označený symbol je svislá čára (pravý Alt + W) @@ -66209,6 +67350,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Na ivakatakilakila ni damudamu sa laini donu (Alt W imatau) O símbolo marcado em vermelho é uma linha vertical (direita Alt W) Le symbole marqué en rouge est une ligne verticale (alt W à droite) + Ar ár nt'udi marcado rojo ge 'nar 'ñu vertical (Alt W derecha) špatně @@ -66288,6 +67430,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ʻikai ke sai Sega ni vinaka Faible + Pobremente odkaz @@ -66368,6 +67511,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fehokotakiʻanga Isema Lien + Enlace Tab (5 mezer) @@ -66449,6 +67593,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t IBulukau (5 na vanualala) Guia (5 espaços) Onglet (5 espaces) + Pestaña (5 espacios) Hide all types of tags @@ -66531,6 +67676,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Fufuuʻi ʻa e faʻahinga fakaʻilonga kotoa pe Vunia na mataqali ivakatakilakila kece sara Ocultar todos os tipos de tags + Ocultar nga̲tho ar klase ar etiquetas Papoušek @@ -66608,6 +67754,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Parradhl Kākā Paroti + Loro Devanagari @@ -66639,6 +67786,7 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Dalankagari Nivanagari Devanagari + Evanagari Lemonade @@ -66698,6 +67846,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t नींबू पानी निम्बूको शरवत लेमोनेड + Limonada + Ohun mimu ti a fi orombo ṣe + Sítrónusæti + Лимонад + لىمون Minimal @@ -66749,6 +67902,12 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t किमान Lailai Minime + Mínimo + Ayọkuro + Minimu + Азайт + Micimal + Mashoma Low @@ -66812,6 +67971,14 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t E ra Mínimo Faible + Hñets'i' + Kurang + Lọ silẹ + Bassa + Lágt + Аласа + تۆۋەن + Zvakaderera Medium @@ -66870,6 +68037,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Veimama Média Moyenne + Nt'uni + Laarin + MEDIUM + Miðlungs + Амал + ئوتتۇراھال + Pakati Best @@ -66930,6 +68104,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t सर्वोत्तम Vinaka Duadua Le meilleur + Mäs xi hño + Paling apik + Dara julọ + U megliu + Ең жақсы + ئەڭ ياخشى + Zvakanakisa Graphics card note @@ -66996,6 +68177,14 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t IDusidusi ni kadi Melhor Note de la carte graphique + Hñeti ar tarheta 'ra + Cathetan kertu grafis + Akọsilẹ kaadi kika + Nota di carte Grafica + Grafík kort athugasemd + Графикалық карта Ескерту + گرافىك كارتا خاتىرىسى + Graphics kadhi noti It looks like you have another more powerful graphics card, @@ -67061,6 +68250,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t यस्तो देखिन्छ कि तपाईंसँग अर्को अधिक शक्तिशाली ग्राफिक्स कार्ड छ, असे दिसते की आपल्याकडे आणखी एक शक्तिशाली ग्राफिक्स कार्ड आहे, E kena irairai ni tiko tale e dua na kadi kaukauwa cake ni droini, + Gi ne gi gi tarheta 'ra mäs potente, + Katon kaya sampeyan duwe kertu grafis liyane, + O dabi pe o ni kaadi awọn aworan ti o lagbara diẹ sii, + Sembra chì avete una altra carta grafica più potente, + Það lítur út fyrir að þú hafir aðra öflugri skjákort, + Сізде тағы бір қуатты графикалық карта бар сияқты, + قارىماققا يەنە بىر كۈچلۈك گرافىك كارتىسى بار, but now it is probably used slower. @@ -67126,6 +68322,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t पण आता ते कदाचित हळूवारपणे वापरले जाते. Ia oqo ena rairai vakayagataki vakamalua cake. Mas agora é provavelmente usado mais devagar. + Pe nu'bya probablemente ar usa xí lentamente. + Nanging saiki bisa uga digunakake luwih alon. + Ṣugbọn ni bayi o ṣee ṣe pe o ti losokepupo. + Ma avà hè probabilmente utilizatu più lento. + En nú er það líklega notað hægar. + Бірақ қазір ол баяу қолданған шығар. + ئەمما ھازىر بەلكىم ئاستا بولۇشى مۇمكىن. Currently Using gpu: @@ -67192,6 +68395,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Vakayagataki tiko ena Gauna Oqo na igacagaca: Atualmente usando gpu: Actuellement en utilisant gpu: + 'Bu̲'bya usando gpu: + Saiki nggunakake GPU: + Lọwọlọwọ lilo GPU: + Attualmente aduprendu GPU: + Nú með GPU: + Қазіргі уақытта GPU пайдалану: + ھازىر GPU نى ئىشلىتىۋاتىدۇ: @@ -67246,6 +68456,10 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Igig vnet Vignettinging Vinhetas + Viñeteado + Vigneto + Дама + Vignting Fog @@ -67310,6 +68524,12 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t धुके Kabu Nevoeiro + 'Mo̲ngui + Kabut + Ikuuku + Þokur + Тұман + تۇمان Waving elements @@ -67376,6 +68596,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Veiyaloyalo veiyaloyalo Elementos acenando Ondulation d’éléments + Ar xe̲ni ondulantes + Unsur waving + Awọn eroja ti n jade + Elevendu elementi + Waving Elements + Толқын элементтері + ئامانەت پۇل Interaction mess @@ -67440,6 +68667,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t संवाद मेस Cala ni veitaratara Désordre d’interaction + Lío interacción + Kekacoan interaksi + Ifiweranṣẹ ibaraenisọrọ + Mess di interazzione + Samskipti Mess + Өзара әрекеттесу + ئۆز-ئارا تەسىر كۆرسىتىش Clouds @@ -67506,6 +68740,12 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t O Nuvem Nuages + Nubes + Awan + Awọsanma + Ský + Бұлт + بۇلۇت None @@ -67571,6 +68811,12 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Sega ni dua Nuvem Aucune + Ninguno + Ora ana + Ko si + Nimu + Enginn + Ештеме Fancy @@ -67624,6 +68870,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t फॅन्सी Taleitaki Fantasia + Capricho + Apik + Ímynda sér + Қиял + ئېسىل @@ -67635,6 +68886,19 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Supersampling Supersampling + Presadzovať + スーパーサンプリング + Supermuestreo + Superínaming + Dépassement + Superampling + SupersAmplinging + Суперечки + СуперсаМПЛинг + Superserapling + SUPPERSAMPLING + Сырттар + دەرىجىدىن تاشقىرى 1/x @@ -67704,6 +68968,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Draunikau lutu Upscaling AA Feuilles qui tombent + Caída hojas + Godhonge tiba + Jade leaves + Foglie chì cascanu + Fallandi lauf + Құлаған жапырақтары + يوپۇرماق Multisampling @@ -67746,6 +69017,11 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t Veimatanitu Cokovata Multisampling Échantillonnages multiples + Multimuestreo + Mustitamling + Multisamlost + Көп шабындық + كۆپ قاراش Fancy background @@ -67812,6 +69088,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ITuvaki talei e muri Fundo chique Arrière-plan de fantaisie + Ts'o̲e fantasía + Latar mburi apik + Atilẹyi + Fondo di fantasia + Ímynda bakgrunn + Қиял + Feancy تەبىرى Better snow and rain @@ -67879,6 +69162,13 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t चांगले बर्फ आणि पाऊस E vinaka cake na uca kei na uca Meilleure neige et meilleure pluie + Hño nieve ne 'ye + Salju lan udan sing luwih apik + Yinyin ti o dara julọ ati ojo + Megliu neve è pioggia + Betri snjór og rigning + Қар мен жаңбыр жақсы + تېخىمۇ ياخشى قار ۋە يامغۇر Animations @@ -67941,6 +69231,12 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t अॅनिमेशन IVakatakata Animations + Animaciones + Animasi + Awọn ohun orin + Teiknimyndir + Анимациялар + Amartions Graphics @@ -68000,6 +69296,12 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t ग्राफिक्स ITuvatuva Graphiques + Grafismo + Grafis + Ẹda aworan + Grafík + Графика + گرافىك Spruce leaves with snow @@ -68066,16 +69368,74 @@ Dans quel temps se déplace-t-il %longueur%km? s=v·t बर्फ सह spruce पाने Drauni uca cevata Feuilles d’épinette avec de la neige + Hojas abeto ko ya xija + Idea minterake salju salju + Spruce leaves pẹlu egbon + Spruce foglie cun neve + Spruce fer með snjó + Қарлыған шырша жапырақтары + قار بىلەن قەۋەت - Invert mouse scroll Obrátit posun kolečkem + Invert Mouse Scroll + Odwróć przewijanie myszy + Maus-Bildlauf umkehren + マウススクロールを反転する + Invertir ar desplazamiento ar t'u̲ngu + Invertir ratón de desplazamiento + Inverti il rotolo del mouse + Inverser la souris Scroll + Inverta rolagem de mouse + Invert Mouse Scroll + Inverteix el desplaçament del ratolí + Превъртане на мишката. \ T + Вклучување на глувчето + Muris volumen invertunt + Inversigu muskoleton + Käännä hiiri selaus + Scrolla luch inbhéartaithe + Інвертувати мишу прокрутку + Инверт Миш скрола + Invert Mouse Scroll + Gulung tikus mouse + Pertart Aba + Invertisce u scorrimentu di u mouse + Invert Mouse Scroll + Тінтуірді айналдыру + چاشقىنەكنىڭ چەكلىمىسى Some settings will be applied after restart. Některé nastavení bude aplikováno až po znovuspuštění. Nekery nastaveni bode aplikováné až po znovospoštěni. + Po reštarte sa použijú niektoré nastavenia. + Niektóre ustawienia zostaną zastosowane po ponownym uruchomieniu. + Einige Einstellungen werden nach dem Neustart angewendet. + 再起動後にいくつかの設定が適用されます。 + Ra configuraciones ar aplicarán 'mefa xta ar reinicio. + Algunas configuraciones se aplicarán después de reiniciar. + Alcune impostazioni verranno applicate dopo il riavvio. + Certains paramètres seront appliqués après le redémarrage. + Algumas configurações serão aplicadas após o reinício. + Nogle indstillinger vil blive anvendt efter genstart. + Alguns paràmetres s'aplicaran després de reiniciar. + След рестартиране ще се прилагат някои настройки. + Некои поставки ќе се применуваат по рестартирање. + Quidam occasus erit applicari post sileo. + Iuj agordoj estos aplikitaj post rekomenco. + Joitakin asetuksia sovelletaan uudelleenkäynnistyksen jälkeen. + Cuirfear roinnt suíomhanna i bhfeidhm tar éis atosú. + Деякі налаштування будуть застосовані після перезапуску. + Неке поставке ће се примењивати након поновног покретања. + Néhány beállítás újraindítás után kerül alkalmazásra. + Sawetara setelan bakal ditrapake sawise miwiti maneh. + Diẹ ninu awọn eto yoo lo lẹhin tun bẹrẹ. + Alcune paràmetri seranu applicati dopu à a riavvia. + Sumar stillingar verða beittar eftir að endurræsa. + Кейбір параметрлер қайта іске қосқаннан кейін қолданылады. + قايتا قوزغىتىلغاندىن كېيىن بەزى تەڭشەكلەر قوللىنىلىدۇ. \ No newline at end of file From 05a587eaa8f2eb58e8a205dea09225a7cf582f20 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sun, 16 Jan 2022 20:23:26 +0100 Subject: [PATCH 33/55] ssaa better implementation --- rabcrClient/FormError.cs | 2 + rabcrClient/GameBar.cs | 50 ++ rabcrClient/InterLogic/Global/Global.cs | 2 +- .../GameStates/Game/Singleplayer.cs | 783 ++++++++++++------ .../GameStates/Menu/MenuSetting.cs | 67 +- rabcrClient/rabcrClient.csproj | 1 + 6 files changed, 611 insertions(+), 294 deletions(-) create mode 100644 rabcrClient/GameBar.cs diff --git a/rabcrClient/FormError.cs b/rabcrClient/FormError.cs index 6057e74..3d9771d 100644 --- a/rabcrClient/FormError.cs +++ b/rabcrClient/FormError.cs @@ -29,6 +29,8 @@ public partial class FormError : Form { } private void buttonSend_Click(object sender, EventArgs e) { + buttonSend.Enabled=false; + buttonSend.BackColor=System.Drawing.Color.Gray; // DialogResult dr=MessageBox.Show(text+Environment.NewLine+Environment.NewLine+details+Environment.NewLine+ex.Message, cap, MessageBoxButtons.YesNo, MessageBoxIcon.Error); // if (dr==DialogResult.Yes) { ManagementObjectSearcher searcher = new("SELECT * FROM Win32_DisplayConfiguration"); diff --git a/rabcrClient/GameBar.cs b/rabcrClient/GameBar.cs new file mode 100644 index 0000000..9111176 --- /dev/null +++ b/rabcrClient/GameBar.cs @@ -0,0 +1,50 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace rabcrClient { + class GameBar { + public float Value{ + get => barValue; + set { SetBarValue(value); } + } + float barValue=-10; + Texture2D texture; + + Vector2 PosNor, PosGray; + Rectangle RecNor, RecGray; + int Pos; + + public GameBar(Texture2D tex, int pos) { + texture=tex; + Pos=pos; + } + + void SetBarValue(float newBarValue) { + if ((int)newBarValue!=(int)barValue) { + int rndValue=(int)newBarValue; + PosNor = new Vector2(Global.WindowWidth/*-150*/-36-Pos, 8+rndValue); + PosGray = new Vector2(Global.WindowWidth/*-150*/-36-Pos, 8); + + RecNor = new Rectangle(0, rndValue, 32, 32-rndValue); + RecGray = new Rectangle(0, 0, 32, rndValue); + } + barValue=newBarValue; + // if (barValue<0f) barValue=0f; + //else if (barValue>32f) barValue=32f; + } + + public void Resize() { + int rndValue=(int)barValue; + PosNor = new Vector2(Global.WindowWidth/*-150*/-36-Pos, 8+rndValue); + PosGray = new Vector2(Global.WindowWidth/*-150*/-36-Pos, 8); + + RecNor = new Rectangle(0, rndValue, 32, 32-rndValue); + RecGray = new Rectangle(0, 0, 32, rndValue); + } + + public void Draw() { + Rabcr.spriteBatch.Draw(texture, PosGray, RecGray, Color.Gray); + Rabcr.spriteBatch.Draw(texture, PosNor, RecNor, Color.White); + } + } +} diff --git a/rabcrClient/InterLogic/Global/Global.cs b/rabcrClient/InterLogic/Global/Global.cs index 2a440cc..66526ac 100644 --- a/rabcrClient/InterLogic/Global/Global.cs +++ b/rabcrClient/InterLogic/Global/Global.cs @@ -10,7 +10,7 @@ static class Global { public static int WindowWidthHalf=300; public static int WindowHeightHalf=250; - public static int WorldDifficulty; + public static int WorldDifficulty; // 0==surival 1==text 2==Creative public static bool HasSoundGraphics=true; public static bool ChangedSettings; diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs index 96e0e16..6f0ea3a 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs @@ -19,7 +19,7 @@ class SinglePlayer: Screen { Vector2 EarthShakeP1, EarthShakeP2, EarthShakePA; #region Varibles SoundEffectInstance SoundWind, SoundRain; - float sampling; + float SuperSamplingActing=-1; float scrollBuffer=0f; enum Precipitation : byte { None, @@ -770,10 +770,10 @@ static Color snowTopTexture, // Bars - barEatTexture, - barWaterTexture, - barOxygenTexture, - barHeartTexture, + //barEatTexture, + //barWaterTexture, + //barOxygenTexture, + //barHeartTexture, // Textures blocks //rocks0Texture, @@ -1266,7 +1266,7 @@ const int float WindowXPlayer, WindowYPlayer; - RenderTarget2D sunLightTarget, modificatedLightTarget, targetGame, targetGame2; + RenderTarget2D sunLightTarget, modificatedLightTarget, targetGame, targetGame2, targetGame4; readonly BlendState Multiply = new() { AlphaSourceBlend=Blend.Zero, @@ -1302,11 +1302,13 @@ const int #endregion #region Bars - float barWater = 16; - float barEat = 16; - float barOxygen=0; - float barHeart=16; - float barEnergy=0; + //float barWater = 16; + //float barEat = 16; + //float barOxygen=0; + //float barHeart=16; + //float barEnergy=0; + + GameBar barWater, barEat, barOxygen, barHeart, barEnergy; #endregion #region Debug @@ -1404,26 +1406,25 @@ readonly Color for (int i2=0; i2 pathToWorld=dir+"\\"; RasterizerState rasterizerState; const float noon=(dayEnd-(dayStart+1))*hour; + + void SetSuperSampling() { + // No SSAA + if (Setting.UpScalingSuperSapling==1f) { + SuperSamplingActing=1f; + return; + } + + // Pixelizer SSAA + if (Setting.UpScalingSuperSapling<1f) { + SuperSamplingActing=1f/Setting.Zoom; + targetGame?.Dispose(); + targetGame=new RenderTarget2D(Graphics, + (int)(Global.WindowWidth*SuperSamplingActing), + (int)(Global.WindowHeight*SuperSamplingActing), + false, + SurfaceFormat.Color, + DepthFormat.Depth24, + 1, + RenderTargetUsage.PlatformContents); + return; + } + + float maxUpscaling=20f; + if (Graphics.GraphicsProfile==GraphicsProfile.HiDef) { + float scale = 8192f/Global.WindowWidth; + if (scale=Setting.UpScalingSuperSapling) { + SuperSamplingActing=2f; + targetGame?.Dispose(); + targetGame=new RenderTarget2D( + Graphics, + Global.WindowWidth*2, + Global.WindowHeight*2, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + return; + } else { + SuperSamplingActing=1f; + targetGame?.Dispose(); + return; + } + } + + if (Setting.UpScalingSuperSapling==4f) { + if (maxUpscaling>=4f) { + SuperSamplingActing=4f; + + targetGame?.Dispose(); + targetGame=new RenderTarget2D( + Graphics, + Global.WindowWidth*4, + Global.WindowHeight*4, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + + targetGame2?.Dispose(); + targetGame2=new RenderTarget2D( + Graphics, + Global.WindowWidth*2, + Global.WindowHeight*2, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + return; + } else { + if (maxUpscaling>=2f) { + SuperSamplingActing=2f; + + targetGame?.Dispose(); + targetGame=new RenderTarget2D( + Graphics, + Global.WindowWidth*2, + Global.WindowHeight*2, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + + targetGame2?.Dispose(); + return; + } else { + SuperSamplingActing=1f; + targetGame?.Dispose(); + targetGame2?.Dispose(); + return; + } + } + } + + //if (Setting.UpScalingSuperSapling==8f) { + // if (maxUpscaling>=Setting.UpScalingSuperSapling) { + // SuperSamplingActing=Setting.UpScalingSuperSapling; + + // targetGame?.Dispose(); + // targetGame=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*8, + // Global.WindowHeight*8, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame2?.Dispose(); + // targetGame2=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*4, + // Global.WindowHeight*4, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame4?.Dispose(); + // targetGame4=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*2, + // Global.WindowHeight*2, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + // return; + // } else { + // if (maxUpscaling>=4f) { + // SuperSamplingActing=4f; + // targetGame?.Dispose(); + // targetGame=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*4, + // Global.WindowHeight*4, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame2?.Dispose(); + // targetGame2=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*2, + // Global.WindowHeight*2, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame4?.Dispose(); + // } else if (maxUpscaling>=2f) { + // SuperSamplingActing=2f; + // targetGame?.Dispose(); + // targetGame=new RenderTarget2D( + // Graphics, + // (int)(Global.WindowWidth*SuperSamplingActing), + // (int)(Global.WindowHeight*SuperSamplingActing), + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame2?.Dispose(); + // targetGame4?.Dispose(); + // return; + // } else { + // SuperSamplingActing=1f; + // targetGame?.Dispose(); + // targetGame2?.Dispose(); + // targetGame4?.Dispose(); + // return; + // } + // } + //} + } + public unsafe override void Init() { invertedMouseValue = Setting.InvertedMouse ? -1 : 1; - sampling=(Setting.UpScalingSuperSapling<=0) ? 1f/Setting.Zoom :Setting.UpScalingSuperSapling; + // SuperSamplingActing=(Setting.UpScalingSuperSapling<=0) ? 1f/Setting.Zoom :Setting.UpScalingSuperSapling; //Setting.UpScalingSuperSapling=1.00001f; // Setting.Multisapling=16; @@ -2286,12 +2498,12 @@ readonly Color invRashberryTexture=GetDataTexture("Plants/ForInventory/Rashberry"); invBlueberryTexture=GetDataTexture("Plants/ForInventory/Blueberry"); flaxInvTexture=GetDataTexture("Plants/ForInventory/Flax"); - barEnergyTexture=GetDataTexture("Bars/Lightning"); - scrollbarUpTexture=GetDataTexture("Buttons/Scrollbar/Top"); + + scrollbarUpTexture=GetDataTexture("Buttons/Scrollbar/Top"); scrollbarBetweenTexture=GetDataTexture("Buttons/Scrollbar/Center"); scrollbarDownTexture=GetDataTexture("Buttons/Scrollbar/Bottom"); - radioInvTexture=GetDataTexture("Blocks/ForInventory/Radio"); - sunTexture = GetDataTexture("Particles/Sun"); + radioInvTexture=GetDataTexture("Blocks/ForInventory/Radio"); + sunTexture = GetDataTexture("Particles/Sun"); fishTexture0 = GetDataTexture("Animals/Fish/Fish0"); fishTexture1 = GetDataTexture("Animals/Fish/Fish1"); @@ -2309,11 +2521,12 @@ readonly Color destructionTexture = GetDataTexture("Animations/destruction"); TextureMoon = GetDataTexture("Animations/Moon"); - barEatTexture= GetDataTexture("Bars/Eat"); - barWaterTexture = GetDataTexture("Bars/Water"); - barOxygenTexture = GetDataTexture("Bars/Oxygen"); - barHeartTexture = GetDataTexture("Bars/Heart"); + //barEatTexture= + //barWaterTexture = + //barOxygenTexture = + //barHeartTexture = + #endregion #region Player @@ -2673,10 +2886,14 @@ readonly Color lightsLamp=new List(); #endregion + barEnergy=new GameBar(GetDataTexture("Bars/Lightning"),4+4*36); + barEat=new GameBar(GetDataTexture("Bars/Eat"), 4+3*36); + barWater=new GameBar(GetDataTexture("Bars/Water"), 4+2*36); + barOxygen= new GameBar(GetDataTexture("Bars/Oxygen"), 4+1*36); + barHeart=new GameBar(GetDataTexture("Bars/Heart"), 4+0*36); + #region Set basic - ZoomMatrix = Matrix.CreateScale(Setting.Zoom*sampling, Setting.Zoom*sampling, 0); - ZoomMatrixNoUpScaling = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); - if (sampling!=1f) MatrixUpScaling = Matrix.CreateScale(sampling, sampling, 0); + // else MatrixUpScaling = Matrix.CreateScale(1f, 1f, 0); newKeyboardState = Keyboard.GetState(); newMouseState = Mouse.GetState(); @@ -2752,11 +2969,12 @@ readonly Color time =int.Parse(sr.ReadLine()); if (time>dayLenght)time=0; colorAlpha = Color.White; - barWater = float.Parse(sr.ReadLine()); - barEat = float.Parse(sr.ReadLine()); - barHeart = float.Parse(sr.ReadLine()); - barOxygen = float.Parse(sr.ReadLine()); - + barWater.Value = float.Parse(sr.ReadLine()); + barEat.Value = float.Parse(sr.ReadLine()); + barHeart .Value = float.Parse(sr.ReadLine()); + barOxygen.Value = float.Parse(sr.ReadLine()); + barEnergy.Value = float.Parse(sr.ReadLine()); + PlayerX = int.Parse(sr.ReadLine()); PlayerY = int.Parse(sr.ReadLine()); @@ -2788,6 +3006,12 @@ readonly Color precipitation=FastRandom.Bool(); changeRain=FastRandom.Int(1250); + + barEnergy.Value=0; + barEat.Value=0; + barWater.Value=0; + barOxygen.Value=0; + barHeart.Value=16; } if (File.Exists(pathToWorld+@"\Clothes.bin")) { @@ -2990,13 +3214,9 @@ readonly Color return *(float*)&n; } } - for (; i=hour*dayStart && time<=hour*(dayStart+1)) { // dayAlpha=(((time-hour*7f)/hour/2f))+1f; @@ -3315,6 +3529,21 @@ readonly Color // Graphics.RasterizerState.MultiSampleAntiAlias=Setting.Multisapling>1; Graphics.PresentationParameters.MultiSampleCount = Setting.Multisapling; GraphicsManager.ApplyChanges(); + SetSuperSampling(); + ZoomMatrix = Matrix.CreateScale(Setting.Zoom*SuperSamplingActing, Setting.Zoom*SuperSamplingActing, 0); + ZoomMatrixNoUpScaling = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); + + if (SuperSamplingActing!=1f) MatrixUpScaling = Matrix.CreateScale(SuperSamplingActing, SuperSamplingActing, 0); + Translation = ZoomMatrix*Matrix.CreateTranslation(new Vector3( + Global.WindowWidthHalf*SuperSamplingActing, + Global.WindowHeightHalf*SuperSamplingActing, + 0)); + + TranslationNoOpMultisapling = ZoomMatrixNoUpScaling*Matrix.CreateTranslation(new Vector3( + Global.WindowWidthHalf, + Global.WindowHeightHalf, + 0)); + //Debug.WriteLine("GraphicsProfile: "+Graphics.GraphicsProfile); // if ((int)Setting.AnimationsGame==(int)Setting.GameAnimations.NormalQuality) { @@ -3334,8 +3563,8 @@ readonly Color // } - weatherWindowWidth=(int)(Global.WindowWidth*sampling)+5; - weatherWindowHeight=(int)(Global.WindowHeight*sampling)+3; + weatherWindowWidth=(int)(Global.WindowWidth*SuperSamplingActing)+5; + weatherWindowHeight=(int)(Global.WindowHeight*SuperSamplingActing)+3; } public override void Shutdown() { @@ -3401,11 +3630,14 @@ readonly Color cpuUsage?.Dispose(); modificatedLightTarget.Dispose(); - if (sampling!=1f) targetGame.Dispose(); - if (sampling==4f) targetGame2.Dispose(); + targetGame?.Dispose(); + targetGame2?.Dispose(); + targetGame4?.Dispose(); sunLightTarget.Dispose(); TextureSunGradient?.Dispose(); Debug.WriteLine("EndOf Saving"); + + } public override unsafe void Update(GameTime gameTime) { @@ -3739,27 +3971,27 @@ readonly Color bool swmove=false; // bool swim; if (canbreatheDuringSwimming) { - barOxygen--; - if (barOxygen<0)barOxygen=0; + barOxygen.Value--; + if (barOxygen.Value<0f) barOxygen.Value=0f; } else { - if (barOxygen>32) { - barHeart+=.08f; - if (barHeart>32) Die(Lang.Texts[161]); - }else barOxygen+=0.05f; + if (barOxygen.Value>32f) { + barHeart.Value+=.08f; + if (barHeart.Value>32f) Die(Lang.Texts[161]); + }else barOxygen.Value+=0.05f; } if (newKeyboardState.IsKeyDown(Setting.KeyJump)) { if (CheckLadder()) { PlayerY--; - barEnergy+=0.01f; - barWater+=0.01f; + barEnergy.Value+=0.01f; + barWater.Value+=0.01f; gravitySpeed=-2f; } else if (swimming) { PlayerY--; - barEnergy+=0.01f; - barWater+=0.01f; + barEnergy.Value+=0.01f; + barWater.Value+=0.01f; gravitySpeed=-1f; swmove=true; } else { @@ -3768,7 +4000,7 @@ readonly Color gravitySpeed=-7; PlayerY--; - barEnergy+=0.05f; + barEnergy.Value+=0.05f; } } } @@ -3786,7 +4018,7 @@ readonly Color if (keyLeft != keyRight) { if (keyLeft) { // move - if (barEnergy<31) { + if (barEnergy.Value<31f) { if (newKeyboardState.IsKeyDown(Setting.KeyRun)) { needSpeed=4; // barEnergy-=0.02f; @@ -3795,7 +4027,7 @@ readonly Color speedDir=-1; } else { // move - if (barEnergy<31) { + if (barEnergy.Value<31f) { if (newKeyboardState.IsKeyDown(Setting.KeyRun)) { needSpeed=4; // barEnergy-=0.02f; @@ -3821,7 +4053,7 @@ readonly Color if (speed>0) { swmove=true; - if (barEnergy<36+0.02f*speed)barEnergy+=0.018f*speed; + if (barEnergy.Value<36+0.02f*speed) barEnergy.Value+=0.018f*speed; //right if (speedDir==1) { @@ -4068,7 +4300,7 @@ readonly Color // } // } - if (barEnergy>32) barEnergy=32; + if (barEnergy.Value>32f) barEnergy.Value=32f; PlayerGravity(); } @@ -4706,8 +4938,10 @@ readonly Color || lb.Id==(ushort)BlockId.LemonLeavesWithLemons || lb.Id==(ushort)BlockId.MangroveLeaves + || lb.Id==(ushort)BlockId.AcaciaLeaves + ) { - FallingLeave fl=new(rch*16+FastRandom.Int16(), rh*16+FastRandom.Int16(), /*FastRandom.Float(),*/windRirectionRight,precipitation, new Rectangle(0,0,2,2+FastRandom.Int2())){ + FallingLeave fl=new(rch*16+FastRandom.Int16(), rh*16+FastRandom.Int16(), /*FastRandom.Float(),*/windRirectionRight, precipitation, new Rectangle(0,0,2,2+FastRandom.Int2())){ texture=lb.Texture }; FallingLeaves.Add(fl); @@ -4744,7 +4978,7 @@ readonly Color while (text.Length*13>750) text=text.Substring(0,text.Length-1); if (newText!=text || textWriting==null) { int xx=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); - while (text.Length*13>750) text=text.Substring(0,text.Length-1); + while (text.Length*13>750) text=text.Substring(0, text.Length-1); int m = BitmapFont.bitmapFont18.MeasureTextSingleLineX(text); textWriting=new TextWithMeasure(text,xx-m/2+5,Global.WindowHeightHalf-55-50+5+5/*,BitmapFont.bitmapFont18*/); @@ -4755,11 +4989,9 @@ readonly Color inventory=0; diserpeard=255; - // DInt m=; - int texts= BitmapFont.bitmapFont18.MeasureTextSingleLineX(text)/2; int x=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); - gedo=new GeDo(text,x-texts+20-10,Global.WindowHeightHalf-40-50-3); + gedo=new GeDo(text, x-texts+20-10,Global.WindowHeightHalf-40-50-3); textWriting=null; } } @@ -5527,17 +5759,17 @@ readonly Color #endregion #region bars - if (barEnergy<=32) { - if (barEnergy>0) { - if (barEat>=0) { - if (barWater>=0) { - barEat+=0.0006f; - barWater+=0.0008f; - barEnergy-=0.04f; + if (barEnergy.Value<=32f) { + if (barEnergy.Value>0f) { + if (barEat.Value>=0f) { + if (barWater.Value>=0f) { + barEat.Value+=0.0006f; + barWater.Value+=0.0008f; + barEnergy.Value-=0.04f; - if (barEat<0) barEat=0; - if (barWater>32) barWater=32; - if (barEnergy<0) barEnergy=0; + if (barEat.Value<0f) barEat.Value=0f; + if (barWater.Value>32f) barWater.Value=32f; + if (barEnergy.Value<0f) barEnergy.Value=0f; } } } @@ -5549,26 +5781,25 @@ readonly Color if (Temperature<0) { if (wind) { for (int i=0; i<(weatherWindowWidth+600)/300; i++){ - int addSide=Global.WindowHeightHalf; if (windRirectionRight) { if ((actualRainForce*0.25f+0.5f)*rainWaveForce < FastRandom.Float()) { if (Setting.BetterSnowAndRain) { if (FastRandom.Bool()) snowDotsSmall.Add( new ParticleSnowSmall(gravity+0.2f) { - Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide), Y=-10 }, + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+Global.WindowHeightHalf), Y=-10 }, HSpeed=windForce*0.5f }); else snowDots2.Add( new ParticleSnow(FastRandom.Float()*0.5f+0.5f, gravity+0.2f) { - Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide), Y=-10 }, + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+Global.WindowHeightHalf), Y=-10 }, HSpeed=windForce*0.5f }); } else { if (FastRandom.Bool()) snowDots2.Add( new ParticleSnow(FastRandom.Float()*0.5f+0.5f, gravity+0.2f) { - Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide), Y=-10 }, + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+Global.WindowHeightHalf), Y=-10 }, HSpeed=windForce*0.5f }); } @@ -5579,18 +5810,18 @@ readonly Color if (FastRandom.Bool()) snowDotsSmall.Add( new ParticleSnowSmall(gravity+0.2f) { - Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide)-addSide, Y=-10 }, + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+Global.WindowHeightHalf)-Global.WindowHeightHalf, Y=-10 }, HSpeed=-windForce*0.5f }); else snowDots2.Add( new ParticleSnow(FastRandom.Float()*0.5f+0.5f, gravity+0.2f) { - Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide)-addSide, Y=-10 }, + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+Global.WindowHeightHalf)-Global.WindowHeightHalf, Y=-10 }, HSpeed=-windForce*0.5f }); } else { if (FastRandom.Bool()) snowDots2.Add( new ParticleSnow(FastRandom.Float()*0.5f+0.5f, gravity+0.2f) { - Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+addSide)-addSide, Y=-10 }, + Position=new Vector2 { X=FastRandom.Int(weatherWindowWidth+Global.WindowHeightHalf)-Global.WindowHeightHalf, Y=-10 }, HSpeed=-windForce*0.5f }); } @@ -5628,9 +5859,12 @@ readonly Color } else { if ((actualRainForce*0.25f+0.5f)*rainWaveForce < FastRandom.Float()) { - for (int i=0; i<(Global.WindowWidth+10)/300; i++){ + for (int i=0; i<(Global.WindowWidth+10)/300; i++) { if (Setting.BetterSnowAndRain) - rainDots.Add(new ParticleRain(FastRandom.Float()*0.8f+0.2f, gravity*20f+0.2f) { Position=new Vector2{X=FastRandom.Int(/*848*/weatherWindowWidth+20)-10, Y=-10 },HSpeed=windForce }); + rainDots.Add(new ParticleRain(FastRandom.Float()*0.8f+0.2f, gravity*20f+0.2f) { + Position=new Vector2{X=FastRandom.Int(weatherWindowWidth+20)-10, Y=-10 }, + HSpeed=windForce + }); } } if (Global.HasSoundGraphics) { @@ -5655,7 +5889,7 @@ readonly Color int w=(int)WindowY-8, w2=(int)WindowY/*+*/-8; - for (int x=(terrainStartIndexX>2 ? terrainStartIndexX-2 : terrainStartIndexX); x2 ? terrainStartIndexX-2 : terrainStartIndexX; x32) { - barOxygen=32; - barHeart+=0.3f; - if (barHeart>32) { + barOxygen.Value+=0.25f; + if (barOxygen.Value>32f) { + barOxygen.Value=32f; + barHeart.Value+=0.3f; + if (barHeart.Value>32f) { Die(Lang.Texts[297]); } } } } else { - barHeart+=0.5f; - if (barHeart>32) { + barHeart.Value+=0.5f; + if (barHeart.Value>32f) { Die(Lang.Texts[299]); } } @@ -6358,25 +6592,25 @@ readonly Color } #region Bars - if (barEat<5 && barWater<5) { - barHeart-=.06f; - if (barHeart<0) barHeart=0; + if (barEat.Value<5f && barWater.Value<5f) { + barHeart.Value-=.06f; + if (barHeart.Value<0f) barHeart.Value=0f; } - if (barEat>25 && barWater>25) { - barHeart+=.06f; - if (barHeart>32) Die(Lang.Texts[162]); + if (barEat.Value>25 && barWater.Value>25f) { + barHeart.Value+=.06f; + if (barHeart.Value>32f) Die(Lang.Texts[162]); } if (DetectLava) { - barHeart+=.06f; - if (barHeart>32) Die(Lang.Texts[163]); + barHeart.Value+=.06f; + if (barHeart.Value>32f) Die(Lang.Texts[163]); } - if (barEnergy>31) { + if (barEnergy.Value>31f) { if (FastRandom.Bool_33_333Percent()/* Int(3)==1*/) { - barHeart+=.01f; - if (barHeart>32) Die(Lang.Texts[164]); + barHeart.Value+=.01f; + if (barHeart.Value>32f) Die(Lang.Texts[164]); } } #endregion @@ -6518,7 +6752,7 @@ readonly Color string m=Lang.Texts[28]; string respawntext=Lang.Texts[29]+" "+(int)((timerStayDied/(60/2)+1)); int meas=BitmapFont.bitmapFont18.MeasureTextSingleLineX(m); - textDie=new Text(m,Global.WindowWidthHalf-meas/2,Global.WindowHeightHalf-60,BitmapFont.bitmapFont18); + textDie=new Text(m, Global.WindowWidthHalf-meas/2, Global.WindowHeightHalf-60, BitmapFont.bitmapFont18); textDie.Draw(spriteBatch); int textDieInfom=BitmapFont.bitmapFont18.MeasureTextSingleLineX(diedInfo); @@ -6538,7 +6772,7 @@ readonly Color // Draw full lights Graphics.SetRenderTarget(sunLightTarget); Graphics.Clear(black); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, sampling==1f ? camera : cameraNoOpMultisapling); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, SuperSamplingActing==1f ? camera : cameraNoOpMultisapling); foreach (Rectangle r in lightsFull) spriteBatch.Draw(lightMaskLineTexture, r, Color.White); @@ -6553,7 +6787,7 @@ readonly Color spriteBatch.End(); // Draw high light - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, sampling==1f ? camera : cameraNoOpMultisapling); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, SuperSamplingActing==1f ? camera : cameraNoOpMultisapling); foreach (Rectangle r in lightsHalf) spriteBatch.Draw(lightMaskLineTexture, r, Color.White); @@ -6629,10 +6863,10 @@ readonly Color #endregion #region Draw game - if (sampling==1f) { - Graphics.SetRenderTarget(null/*targetGame*/); + if (SuperSamplingActing==1f) { + Graphics.SetRenderTarget(null); Graphics.Clear(Color.Transparent); - } else Graphics.SetRenderTarget(/*null*/targetGame); + } else Graphics.SetRenderTarget(targetGame); #region Draw background if (changeRain<10) { @@ -6837,7 +7071,7 @@ readonly Color if (Setting.SnowAndRain) { if (/*rain*/actualRainForce>0f) { // int x, y; - if (sampling!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, null, null, null, MatrixUpScaling/*CameraMatrixNoZoom(out int x, out int y)*/); + if (SuperSamplingActing!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, null, null, null, MatrixUpScaling/*CameraMatrixNoZoom(out int x, out int y)*/); else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); int cx=0; int cy=0; @@ -6880,8 +7114,7 @@ readonly Color } } #endregion - // Graphics.SetRenderTarget(null/*targetGame*/); - //Graphics.Clear(Color.Transparent); + if (Setting.WavingElements) { if (wind) { int x=0; @@ -6947,8 +7180,7 @@ readonly Color foreach (FallingLeave fl in FallingLeaves) fl.Draw(); foreach (GunShot gs in GunShots) gs.Draw(); - - + // Draw items foreach (Item i in DroppedItems) i.DrawItem(); @@ -6992,7 +7224,7 @@ readonly Color //EffectFog.Parameters["Octaves"].SetValue(3); - if (sampling==1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, effect: EffectFog); + if (SuperSamplingActing==1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, effect: EffectFog); else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, null, null, effect: EffectFog, MatrixUpScaling); EffectFog.Techniques[0].Passes[0].Apply(); @@ -7021,7 +7253,7 @@ readonly Color } } - if (sampling==1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap); + if (SuperSamplingActing==1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap); else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, transformMatrix: MatrixUpScaling); spriteBatch.Draw(pixel, Fullscreen, FogColor*oc*0.2f); @@ -7032,7 +7264,7 @@ readonly Color #region Weather Foreground if (actualRainForce>0f) { - if (sampling!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, MatrixUpScaling/*CameraMatrixNoZoom(out int x, out int y)*/); + if (SuperSamplingActing!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, MatrixUpScaling/*CameraMatrixNoZoom(out int x, out int y)*/); else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); Rabcr.spriteBatch=spriteBatch; //if (Temperature<0f) { @@ -7806,18 +8038,17 @@ readonly Color } spriteBatch.End(); - if (sampling<1f){ + if (SuperSamplingActing<1f) { Graphics.SetRenderTarget(null); spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.PointWrap); spriteBatch.Draw(targetGame, Fullscreen, color: Color.White); spriteBatch.End(); - }else if (sampling==2f){ + } else if (SuperSamplingActing==2f) { Graphics.SetRenderTarget(null); - spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); + spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, samplerState: SamplerState.LinearWrap); spriteBatch.Draw(targetGame, Fullscreen, color: Color.White); spriteBatch.End(); - }else if (sampling >= 4f) { - //var targetGame2=targetGame; + } else if (SuperSamplingActing == 4f) { Graphics.SetRenderTarget(targetGame2); spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); spriteBatch.Draw(targetGame, new Rectangle(0,0, Global.WindowWidth*2, Global.WindowHeight*2), color: Color.White); @@ -7827,11 +8058,27 @@ readonly Color spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); spriteBatch.Draw(targetGame2, Fullscreen, color: Color.White); spriteBatch.End(); - } + } + //else if (SuperSamplingActing == 8f) { + // //Graphics.SetRenderTarget(targetGame2); + // //spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); + // //spriteBatch.Draw(targetGame, new Rectangle(0, 0, Global.WindowWidth*4, Global.WindowHeight*4), color: Color.White); + // //spriteBatch.End(); + + // //Graphics.SetRenderTarget(targetGame4); + // //spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); + // //spriteBatch.Draw(targetGame2, new Rectangle(0, 0, Global.WindowWidth*2, Global.WindowHeight*2), color: Color.White); + // //spriteBatch.End(); + + // Graphics.SetRenderTarget(null); + // spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); + // spriteBatch.Draw(targetGame/*4*/, Fullscreen, color: Color.White); + // spriteBatch.End(); + // } // Draw lighting on game - spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: /*BlendState.Additive*/Multiply, samplerState: SamplerState.PointWrap); - spriteBatch.Draw(texture: modificatedLightTarget, Fullscreen/*position: Vector2Zero*//*new Rectangle(0,0,(int)(Global.WindowWidth*upscalingMultisapling),(int)(Global.WindowHeight*upscalingMultisapling))*/, color: Color.White); + spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: Multiply, samplerState: SamplerState.PointWrap); + spriteBatch.Draw(texture: modificatedLightTarget, Fullscreen, color: Color.White); spriteBatch.End(); #endregion @@ -7850,7 +8097,7 @@ readonly Color EffectVignetting.Parameters["HSize"].SetValue(HSize); EffectVignetting.Parameters["Intensity"].SetValue(0.1f); - if (sampling==1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, effect: EffectVignetting); + if (SuperSamplingActing==1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, effect: EffectVignetting); else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, effect: EffectVignetting/*, MatrixUpScaling*/); //spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearClamp, null, null, EffectVignetting, Setting.UpScalingSuperSapling!=1f ? MatrixUpScaling : null); @@ -7869,26 +8116,32 @@ readonly Color Rabcr.spriteBatch=spriteBatch; #region Draw Bars if (Global.WorldDifficulty!=2) { - int barE=(int)barEnergy, barO=(int)barOxygen, barW=(int)barWater, barEa=(int)barEat, barH=(int)barHeart; - // Energy bar - spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8),new Rectangle(0,0,32,barE),ColorGray); - spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36,8+barE),new Rectangle(0,barE,32,32-barE),Color.White); + barEat.Draw(); + barOxygen.Draw(); + barEnergy.Draw(); + barHeart.Draw(); + barWater.Draw(); + + //int barE=(int)barEnergy, barO=(int)barOxygen, barW=(int)barWater, barEa=(int)barEat, barH=(int)barHeart; + //// Energy bar + //spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36, 8), new Rectangle(0,0,32,barE),ColorGray); + //spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36, 8+barE), new Rectangle(0,barE,32,32-barE),Color.White); - // Oxygen bar - spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8),new Rectangle(0,0,32,barO),ColorGray); - spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8+barO),new Rectangle(0,barO,32,32-barO),Color.White); + //// Oxygen bar + //spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8), new Rectangle(0,0,32,barO),ColorGray); + //spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8+barO), new Rectangle(0,barO,32,32-barO), Color.White); - // Water bar - spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8),new Rectangle(0,0,32,barW),ColorGray); - spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8+barW),new Rectangle(0,barW,32,32-barW),Color.White); + //// Water bar + //spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8),new Rectangle(0,0,32,barW),ColorGray); + //spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8+barW),new Rectangle(0,barW,32,32-barW),Color.White); - // Eat bar - spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8),new Rectangle(0,0,32,barEa),ColorGray); - spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8+barEa),new Rectangle(0,barEa,32,32-barEa),Color.White); + //// Eat bar + //spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8),new Rectangle(0,0,32,barEa),ColorGray); + //spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8+barEa),new Rectangle(0,barEa,32,32-barEa),Color.White); - // Heart bar - spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8), new Rectangle(0,0,32,barH),ColorGray); - spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8+barH), new Rectangle(0,barH,32,32-barH),Color.White); + //// Heart bar + //spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8), new Rectangle(0,0,32,barH),ColorGray); + //spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8+barH), new Rectangle(0,barH,32,32-barH),Color.White); } #endregion @@ -9199,16 +9452,24 @@ readonly Color if (dontDoGame) return; SetCaptionInventory(); - + SetSuperSampling(); Translation= ZoomMatrix*Matrix.CreateTranslation(new Vector3( - Global.WindowWidthHalf*sampling /*+ Global.WindowWidth * (float)opurtinicMultisapling*/, - Global.WindowHeightHalf*sampling /*+ Global.WindowHeight * (float)opurtinicMultisapling*/, + Global.WindowWidthHalf*SuperSamplingActing /*+ Global.WindowWidth * (float)opurtinicMultisapling*/, + Global.WindowHeightHalf*SuperSamplingActing /*+ Global.WindowHeight * (float)opurtinicMultisapling*/, 0)); - if (sampling!=1){ + if (SuperSamplingActing!=1){ TranslationNoOpMultisapling=ZoomMatrixNoUpScaling*Matrix.CreateTranslation(new Vector3(Global.WindowWidthHalf, Global.WindowHeightHalf, 0)); } + if (Global.WorldDifficulty==0) { + barEat.Resize(); + barWater.Resize(); + barHeart.Resize(); + barEnergy.Resize(); + barOxygen.Resize(); + } + Fullscreen=new Rectangle(0, 0, Global.WindowWidth, Global.WindowHeight); CreateGradientTexture(); sunLightTarget?.Dispose(); @@ -9216,15 +9477,16 @@ readonly Color modificatedLightTarget?.Dispose(); modificatedLightTarget=new RenderTarget2D(Graphics, Global.WindowWidth, Global.WindowHeight/*,true,SurfaceFormat.Color,DepthFormat.Depth16,8,RenderTargetUsage.PlatformContents*/); - if (sampling!=1f) { - targetGame?.Dispose(); - targetGame=new RenderTarget2D(Graphics, (int)(Global.WindowWidth*sampling), (int)(Global.WindowHeight*sampling), false, SurfaceFormat.Color, DepthFormat.Depth16, Setting.Multisapling, RenderTargetUsage.PlatformContents/*,true,SurfaceFormat.Color,DepthFormat.Depth16,8,RenderTargetUsage.PlatformContents*/); - - if (sampling==4f) { - targetGame2?.Dispose(); - targetGame2=new RenderTarget2D(Graphics, (int)(Global.WindowWidth*2), (int)(Global.WindowHeight*2), false, SurfaceFormat.Color, DepthFormat.Depth16, Setting.Multisapling, RenderTargetUsage.PlatformContents/*,true,SurfaceFormat.Color,DepthFormat.Depth16,8,RenderTargetUsage.PlatformContents*/); - } - } + //if (SuperSamplingActing!=1f) { + // targetGame?.Dispose(); + // targetGame=new RenderTarget2D(Graphics, (int)(Global.WindowWidth*SuperSamplingActing), (int)(Global.WindowHeight*SuperSamplingActing), false, SurfaceFormat.Color, DepthFormat.Depth16, Setting.Multisapling, RenderTargetUsage.PlatformContents/*,true,SurfaceFormat.Color,DepthFormat.Depth16,8,RenderTargetUsage.PlatformContents*/); + + // if (SuperSamplingActing==4f) { + // targetGame2?.Dispose(); + // targetGame2=new RenderTarget2D(Graphics, (int)(Global.WindowWidth*2), (int)(Global.WindowHeight*2), false, SurfaceFormat.Color, DepthFormat.Depth16, Setting.Multisapling, RenderTargetUsage.PlatformContents/*,true,SurfaceFormat.Color,DepthFormat.Depth16,8,RenderTargetUsage.PlatformContents*/); + // } + //} + if (Global.WorldDifficulty==2) { if (inventory==InventoryType.Creative) { @@ -9652,8 +9914,8 @@ readonly Color leaves.Id=newLeavesId; leaves.Texture=leavesTexture; - barEnergy+=0.02f; - if (barEnergy>32) barEnergy=32; + barEnergy.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; } void DropItemFromLeaves(ushort newLeavesId, ushort itemId, Texture2D leavesTexture) { DropItemToPos(new ItemNonInvBasic(itemId), mousePosRoundX, mousePosRoundY); @@ -9662,8 +9924,8 @@ readonly Color leaves.Id=newLeavesId; leaves.Texture=leavesTexture; - barEnergy+=0.02f; - if (barEnergy>32) barEnergy=32; + barEnergy.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; } } } @@ -9678,8 +9940,8 @@ readonly Color m.Grow=125; m.Growing=true; m.Update(); - barEnergy+=0.02f; - if (barEnergy>32) barEnergy=32; + barEnergy.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; return; case (ushort)BlockId.Strawberry: @@ -9687,8 +9949,8 @@ readonly Color m.Grow=125; m.Growing=true; m.Update(); - barEnergy+=0.02f; - if (barEnergy>32) barEnergy=32; + barEnergy.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; return; case (ushort)BlockId.Rashberry: @@ -9696,8 +9958,8 @@ readonly Color m.Grow=125; m.Growing=true; m.Update(); - barEnergy+=0.02f; - if (barEnergy>32) barEnergy=32; + barEnergy.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; return; } } @@ -9708,8 +9970,8 @@ readonly Color #region Drink Water if (chunk.IsTopBlocks[y]) { if (chunk.TopBlocks[y].Id==(ushort)BlockId.WaterBlock) { - barWater--; - if (barWater<0)barWater=0; + barWater.Value--; + if (barWater.Value<0f)barWater.Value=0f; return; } } @@ -9728,26 +9990,26 @@ readonly Color || chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockJungle || chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockPlains) { chunk.SolidBlocks[y]=SolidBlockFromId((ushort)BlockId.Dirt, mousePosRoundVector); - barEnergy+=0.02f; - barWater+=0.02f; - if (barEnergy>32) barEnergy=32; - if (barWater>32) barWater=32; + barEnergy.Value+=0.02f; + barWater.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; + if (barWater.Value>32f) barWater.Value=32f; RemovePartTool(); return; } else if (chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockClay) { chunk.SolidBlocks[y]=SolidBlockFromId((ushort)BlockId.Clay, mousePosRoundVector); - barEnergy+=0.02f; - barWater+=0.02f; - if (barEnergy>32) barEnergy=32; - if (barWater>32) barWater=32; + barEnergy.Value+=0.02f; + barWater.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; + if (barWater.Value>32f) barWater.Value=32f; RemovePartTool(); return; } else if (chunk.SolidBlocks[y].Id == (ushort)BlockId.GrassBlockCompost) { chunk.SolidBlocks[y]=SolidBlockFromId((ushort)BlockId.Compost, mousePosRoundVector); - barEnergy+=0.02f; - barWater+=0.02f; - if (barEnergy>32) barEnergy=32; - if (barWater>32) barWater=32; + barEnergy.Value+=0.02f; + barWater.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; + if (barWater.Value>32f) barWater.Value=32f; RemovePartTool(); return; } @@ -9804,8 +10066,8 @@ readonly Color leaves.Id=newLeavesId; leaves.Texture=newLeavesTexture; - barEnergy+=0.02f; - if (barEnergy>32) barEnergy=32; + barEnergy.Value+=0.02f; + if (barEnergy.Value>32f) barEnergy.Value=32f; InventoryRemoveSelectedItem(); } } @@ -10324,11 +10586,11 @@ readonly Color timerStayDied=255; died=true; - barHeart=0; - barOxygen=0; - barWater=0; - barEnergy=0; - barEat=0; + barHeart.Value=0f; + barOxygen.Value=0f; + barWater.Value=0f; + barEnergy.Value=0f; + barEat.Value=0f; } } @@ -16543,7 +16805,7 @@ readonly Color //if (Setting.Scale.Without==Setting.currentScale) { // camera=Matrix.CreateTranslation(new Vector3(-((int)(WindowCenterX*Setting.Zoom+0.5f))/Setting.Zoom, -((int)(WindowCenterY*Setting.Zoom+0.5f))/Setting.Zoom, 0)) * Translation; -if (sampling!=1f) { + if (SuperSamplingActing!=1f) { cameraNoOpMultisapling=Matrix.CreateTranslation( new Vector3( -(((int)(WindowCenterX*Setting.Zoom+0.5f))/Setting.Zoom)+EarthShakePA.X, @@ -16592,7 +16854,7 @@ readonly Color Matrix CameraMatrixNoZoom(out int xx, out int yy) { // if (Setting.Scale.Without==Setting.currentScale) { - float z=sampling*Setting.Zoom; + float z=SuperSamplingActing*Setting.Zoom; //if (Setting.Zoom<2.5)z=1*upscalingMultisapling; //else z=2; @@ -16602,7 +16864,7 @@ readonly Color weatherWindowWidth=(int)(Global.WindowWidth*z/**upscalingMultisapling*/)+5; weatherWindowHeight=(int)(Global.WindowHeight*z/**upscalingMultisapling*/)+5; - return Matrix.CreateTranslation(new Vector3(-(int)(WindowCenterX+0.5f), -(int)(WindowCenterY+0.5f), 0)) * Matrix.CreateScale(z, z, 0)*Matrix.CreateTranslation(new Vector3(Global.WindowWidthHalf * sampling, Global.WindowHeightHalf * sampling, 0)); + return Matrix.CreateTranslation(new Vector3(-(int)(WindowCenterX+0.5f), -(int)(WindowCenterY+0.5f), 0)) * Matrix.CreateScale(z, z, 0)*Matrix.CreateTranslation(new Vector3(Global.WindowWidthHalf * SuperSamplingActing, Global.WindowHeightHalf * SuperSamplingActing, 0)); //} //if (Setting.Scale.Proportions==Setting.currentScale) { @@ -19428,18 +19690,18 @@ readonly Color } void ItemEat() { - if (barEat>1) { + if (barEat.Value>1f) { switch (InventoryNormal[boxSelected].Id) { case (ushort)Items.Banana: - barEat -=10; - barWater -=1; + barEat.Value -=10f; + barWater.Value -=1f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Olive: - barEat -=2; - barWater -=0.1f; + barEat.Value -=2f; + barWater.Value -=0.1f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; @@ -19451,133 +19713,133 @@ readonly Color break; case (ushort)Items.Boletus: - barEat -=1.5f; - barWater -=0.1f; + barEat.Value -=1.5f; + barWater.Value -=0.1f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Champignon: - barEat -=1.5f; - barWater -=0.1f; + barEat .Value-=1.5f; + barWater.Value -=0.1f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Lemon: - barEat -=5; - barWater -=3; + barEat.Value -=5f; + barWater.Value -=3f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Orange: - barEat -=9; - barWater -=3; + barEat.Value -=9f; + barWater.Value -=3f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Cherry: - barEat -=2; - barWater -=0.1f; + barEat.Value -=2f; + barWater.Value -=0.1f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.BucketWater: - barEat -=0.01f; - barWater -=20; + barEat.Value -=0.01f; + barWater.Value -=20f; DropItemToPos(new ItemNonInvBasic((ushort)Items.Bucket,1), PlayerX, PlayerY); InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Dandelion: - barEat -=2; - barWater -=0.01f; + barEat.Value -=2f; + barWater.Value -=0.01f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Plum: - barEat -=5; - barWater -=0.05f; + barEat.Value -=5f; + barWater.Value -=0.05f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Rashberry: - barEat -=2; - barWater -=0.3f; + barEat.Value -=2f; + barWater.Value -=0.3f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Apple: - barEat -=12; - barWater--; + barEat.Value -=12f; + barWater.Value--; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics)SoundEffects.Eat.Play(); break; case (ushort)Items.RabbitMeatCooked: - barEat -=30; - barWater -=2; + barEat.Value -=30f; + barWater.Value -=2f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.RabbitMeat: - barEat -=10; - barWater -=1; + barEat.Value -=10; + barWater.Value -=1; if (FastRandom.Bool_20Percent()) { - barHeart +=5; - if (barHeart>32)barHeart=32; + barHeart.Value +=5f; + if (barHeart.Value>32f)barHeart.Value=32f; } InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Strawberry: - barEat -=3; - barWater -=0.5f; + barEat.Value -=3f; + barWater.Value -=0.5f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.WheatSeeds: - barEat--; - barWater -=0.002f; + barEat.Value--; + barWater.Value -=0.002f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.Blueberries: - barEat-=2; - barWater -=0.2f; + barEat.Value-=2f; + barWater.Value -=0.2f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.boiledEgg: - barEat-=2; - barWater -=0.2f; + barEat.Value-=2f; + barWater.Value -=0.2f; InventoryRemoveSelectedItem(); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.BowlWithMushrooms: - barEat-=15; - barWater -=5f; + barEat.Value-=15f; + barWater.Value -=5f; InventoryRemoveSelectedItem(); AddItemToPlayer(new ItemNonInvBasic((ushort)Items.BowlEmpty,1)); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); break; case (ushort)Items.BowlWithVegetables: - barEat-=15; - barWater -=5f; + barEat.Value-=15; + barWater.Value -=5f; InventoryRemoveSelectedItem(); AddItemToPlayer(new ItemNonInvBasic((ushort)Items.BowlEmpty,1)); if (Global.HasSoundGraphics) SoundEffects.Eat.Play(); @@ -19586,18 +19848,18 @@ readonly Color } //drink - if (barWater>1) { + if (barWater.Value>1f) { switch (InventoryNormal[boxSelected].Id) { case (ushort)Items.BottleWater: { ItemInvTool32 bottle=(ItemInvTool32)InventoryNormal[boxSelected]; - float d=barWater-bottle.GetCount/3f; + float d=barWater.Value-bottle.GetCount/3f; if (d<0) { - barWater=0; + barWater.Value=0f; InventoryNormal[boxSelected]=new ItemInvBasic32(bottleEmptyTexture,(ushort)Items.Bottle,1,(int)bottle.posTex.X,(int)bottle.posTex.Y); }else{ - bottle.SetCount=bottle.GetCount-(int)(barWater*3); - barWater=d; + bottle.SetCount=bottle.GetCount-(int)(barWater.Value*3); + barWater.Value=d; } } break; @@ -19605,23 +19867,23 @@ readonly Color case (ushort)Items.BucketWater: { ItemInvTool32 bottle=(ItemInvTool32)InventoryNormal[boxSelected]; - float d=barWater-bottle.GetCount/3f; + float d=barWater.Value-bottle.GetCount/3f; if (d<0) { - barWater=0; + barWater.Value=0f; InventoryNormal[boxSelected]=new ItemInvBasic32(ItemBucketTexture,(ushort)Items.Bucket,1,(int)bottle.posTex.X,(int)bottle.posTex.Y); }else{ - bottle.SetCount=bottle.GetCount-(int)(barWater*3); - barWater=d; + bottle.SetCount=bottle.GetCount-(int)(barWater.Value*3); + barWater.Value=d; } } break; } } - if (barEat>32)barEat=32; - if (barWater>32)barWater=32; - if (barEat<0)barEat=0; - if (barWater<0)barWater=0; + if (barEat.Value>32)barEat.Value=32f; + if (barWater.Value>32)barWater.Value=32f; + if (barEat.Value<0)barEat.Value=0f; + if (barWater.Value<0)barWater.Value=0f; } // Crafting basic @@ -25797,10 +26059,11 @@ string ConvertNormalToAtls(string key) time+"\r\n"+ // dayAlpha+"\r\n"+ - barWater+"\r\n"+ - barEat+"\r\n"+ - barHeart+"\r\n"+ - barOxygen+"\r\n"+ + barWater.Value+"\r\n"+ + barEat.Value+"\r\n"+ + barHeart.Value+"\r\n"+ + barOxygen.Value+"\r\n"+ + barEnergy.Value+"\r\n"+ (int)PlayerX+"\r\n"+ (int)PlayerY+"\r\n"+ diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs index ba56abb..ccc227d 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuSetting.cs @@ -497,33 +497,33 @@ class MenuSetting: MenuScreen { // Upscaling { - float maxUpscaling=20f; - if (Graphics.GraphicsProfile==GraphicsProfile.HiDef){ - float scale = 8192f / GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; - if (scalemaxUpscaling) { - if (Setting.UpScalingSuperSapling==16) Setting.UpScalingSuperSapling=8; - } - if (Setting.UpScalingSuperSapling>maxUpscaling) { - if (Setting.UpScalingSuperSapling==8) Setting.UpScalingSuperSapling=4; - } - if (Setting.UpScalingSuperSapling>maxUpscaling) { - if (Setting.UpScalingSuperSapling==4) Setting.UpScalingSuperSapling=2; - } - - if (Setting.UpScalingSuperSapling>maxUpscaling) { - if (Setting.UpScalingSuperSapling==2) Setting.UpScalingSuperSapling=1; - } + //float maxUpscaling=20f; + //if (Graphics.GraphicsProfile==GraphicsProfile.HiDef){ + // float scale = 8192f / GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; + // if (scalemaxUpscaling) { + // if (Setting.UpScalingSuperSapling==16) Setting.UpScalingSuperSapling=8; + //} + //if (Setting.UpScalingSuperSapling>maxUpscaling) { + // if (Setting.UpScalingSuperSapling==8) Setting.UpScalingSuperSapling=4; + //} + //if (Setting.UpScalingSuperSapling>maxUpscaling) { + // if (Setting.UpScalingSuperSapling==4) Setting.UpScalingSuperSapling=2; + //} + + //if (Setting.UpScalingSuperSapling>maxUpscaling) { + // if (Setting.UpScalingSuperSapling==2) Setting.UpScalingSuperSapling=1; + //} // Setting.UpScalingSuperSapling=1; int index=-1; index = (int)Setting.UpScalingSuperSapling switch { @@ -532,7 +532,7 @@ class MenuSetting: MenuScreen { 1 => 1, 2 => 2, 4 => 3, - // 8 => 4, + // 8 => 4, // 16 => 5, _ => 0, }; @@ -540,9 +540,10 @@ class MenuSetting: MenuScreen { // if (maxUpscaling>=16) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276], Lang.Texts[279], Lang.Texts[1604], Lang.Texts[1605]}; // else if (maxUpscaling>=8) res=new string[]{ Lang.Texts[1607], Lang.Texts[272], Lang.Texts[276], Lang.Texts[279], Lang.Texts[1604]}; // else - if (maxUpscaling>=4) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276], Lang.Texts[279]}; - else if (maxUpscaling>=2) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276]}; - else res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87]}; + /* if (maxUpscaling>=8) */res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276], Lang.Texts[279]/*, Lang.Texts[1604]*/}; + //if (maxUpscaling>=4) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276], Lang.Texts[279]}; + //else if (maxUpscaling>=2) res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87], Lang.Texts[276]}; + //else res=new string[]{ Lang.Texts[1607], Lang.Texts[/*272*/87]}; SettingSwitcher button = new(tex, Lang.Texts[1606], res, index); button.Click += () => { Setting.UpScalingSuperSapling = button.selected switch { @@ -550,11 +551,11 @@ class MenuSetting: MenuScreen { 1 => 1, 2 => 2, 3 => 4, - // 4 => 8, + // 4 => 8, // 5 => 16, _ => -1 }; - if (Setting.UpScalingSuperSapling>maxUpscaling) Setting.UpScalingSuperSapling=1; + // if (Setting.UpScalingSuperSapling>maxUpscaling) Setting.UpScalingSuperSapling=1; Global.ChangedSettings = true; }; settings.Add(button); diff --git a/rabcrClient/rabcrClient.csproj b/rabcrClient/rabcrClient.csproj index 2e4192a..0490a7b 100644 --- a/rabcrClient/rabcrClient.csproj +++ b/rabcrClient/rabcrClient.csproj @@ -79,6 +79,7 @@ FormError.cs + From f8a164261592f3677617cf62b7d1a3c110bf45c5 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Mon, 17 Jan 2022 07:29:22 +0100 Subject: [PATCH 34/55] monitor 8bit better --- rabcrClient/Default/Effects/Vignetting.fx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rabcrClient/Default/Effects/Vignetting.fx b/rabcrClient/Default/Effects/Vignetting.fx index c82ecb6..3744c2a 100644 --- a/rabcrClient/Default/Effects/Vignetting.fx +++ b/rabcrClient/Default/Effects/Vignetting.fx @@ -12,6 +12,10 @@ struct VertexShaderOutput { float2 TextureCoordinates : TEXCOORD0; }; +float rand(float2 vec) { + return frac(sin(dot(vec, float2(56, 78))) * 1000.0); +} + float4 MainPS(VertexShaderOutput input) : COLOR { float x; float y; @@ -22,7 +26,8 @@ float4 MainPS(VertexShaderOutput input) : COLOR { if (input.TextureCoordinates.y < 0.5f) y = (0.5f-input.TextureCoordinates.y) * HSize; else y = (input.TextureCoordinates.y - 0.5f) * HSize; - return float4(0, 0, 0, Intensity * (y*y + x*x)); + + return float4(0, 0, 0, Intensity * (y * y + x * x) + rand(input.TextureCoordinates.xy)/256); } technique SpriteDrawing { From 623da13f6948ae3235f544a52eb46f473c50fd94 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Mon, 17 Jan 2022 07:29:33 +0100 Subject: [PATCH 35/55] optimize --- rabcrClient/InterLogic/TextDrawer.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rabcrClient/InterLogic/TextDrawer.cs b/rabcrClient/InterLogic/TextDrawer.cs index b7d2959..04f0962 100644 --- a/rabcrClient/InterLogic/TextDrawer.cs +++ b/rabcrClient/InterLogic/TextDrawer.cs @@ -1482,10 +1482,9 @@ public static BitmapFont } public bool IsArabic(string s){ - if (Lang.IsArabic){ - + if (Lang.IsArabic) { return true; - }else{ + } else { foreach (char ch in s) { switch (ch) { case 'ى': return true; @@ -1499,7 +1498,7 @@ public static BitmapFont public class Glyph { public Rectangle DrawRectangle; - // public int Code; + // public int Code; public char Char; public int X, Y, W, H; public bool visible; From 109bc8a65efc21a0de86d99f2caa27828c5cc2bd Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Mon, 17 Jan 2022 07:29:56 +0100 Subject: [PATCH 36/55] add screen size --- rabcrClient/FormError.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/rabcrClient/FormError.cs b/rabcrClient/FormError.cs index 3d9771d..d971860 100644 --- a/rabcrClient/FormError.cs +++ b/rabcrClient/FormError.cs @@ -170,6 +170,7 @@ public partial class FormError : Form { text+="Graphics card: "+graphicsCard+"\r\n"; text+="Ram: "+(total/1024/1024)+"MB\r\n"; text+="CultureInfo: "+CultureInfo.InstalledUICulture.Name+"\r\n"; + text+="Screen: "+System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width+"x"+System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height+"px\r\n"; text+="\r\n"; text+="\r\n"; text+="Error time: "+errorTime.ToLongDateString()+"\r\n"; From 4b1c8aaf77ab013e1eb437677969fb2e73f4a1d0 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:41:22 +0100 Subject: [PATCH 37/55] add compost wwith snow (before on simple dirt with snow) --- .../Blocks/GrassBlocks/CompostWithSnow.png | Bin 0 -> 754 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 rabcrClient/Default/Textures/Blocks/GrassBlocks/CompostWithSnow.png diff --git a/rabcrClient/Default/Textures/Blocks/GrassBlocks/CompostWithSnow.png b/rabcrClient/Default/Textures/Blocks/GrassBlocks/CompostWithSnow.png new file mode 100644 index 0000000000000000000000000000000000000000..2e908ad22dfe86fc01fbbbe53622af9683318fd2 GIT binary patch literal 754 zcmVm+f&zC>nF9{*Qzg%2g$g+$v1^_U|D5VG?#u!2f zAtXr>=Uj4K7eeT|uA(TM^Z$@6%ZxDqfFwzbF$f`qkWvaU#t=e;kmEQILPAIb5<+m! z9mhckH5vc_r4$1IT-TLlxnX4(1^_@+RR|&H93j+j7D70VgE9WQ#5tdunlh@VT2EqP zV!|+tKp;RVHBFOJN+}HngM<*yIR*eg2n&V6%9oF%w!HBvKRQ|l0MzSsMNul1%DcC( zZOie5+a@O`g%FT2mdRwMr>C9Lw$B@fHb|$_jaQUXltn?2JNiSbK1|dr7VQ3pZ z;u@TkPfip?=^7r{{Je;O<(g;7p6;gBj)UW(rPR=PGAvUyJwM-{)Hc^M9u*gk%a(1i z%E8F+ZM&Ykb?@Qo_q1--3tO3xFN{yms48@iKkPcJT}zxB^>UqJ%l3Q8QK{Gx(ahpL zVMeGqNjN;*nneUU24zRTv%&>Oz zj%jvwY1Lvy*RwuYbqnb90Ni!(}gPx!N~iaYY#AwvP6lwfXT! k&!YhXv43T0277#e05YO}tGt$4VE_OC07*qoM6N<$f_~amjsO4v literal 0 HcmV?d00001 From 979c66ff27cda375e3417e73efda783a04b6d0d0 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:41:54 +0100 Subject: [PATCH 38/55] updated --- rabcrClient/Functions/FastMath.cs | 12 +++++++++--- rabcrClient/InterLogic/Global/Setting.cs | 6 +++++- rabcrClient/InterLogic/ItemInv.cs | 22 +++++++++++++++++++++- rabcrClient/RabcrData.mgcb | 12 ++++++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/rabcrClient/Functions/FastMath.cs b/rabcrClient/Functions/FastMath.cs index d12a5d7..fbdd4fb 100644 --- a/rabcrClient/Functions/FastMath.cs +++ b/rabcrClient/Functions/FastMath.cs @@ -57,7 +57,13 @@ static class FastMath { float dx=x1-x2, dy=y1-y2; return (int)System.Math.Sqrt(dx*dx+dy*dy); } - /// + + public static int Distance(int x1, int y1, int x2, int y2) { + float dx=x1-x2, dy=y1-y2; + return (int)System.Math.Sqrt(dx*dx+dy*dy); + } + + /// /// Smooth linear function /// /// If it's distance*sqrt(2)>comp @@ -110,8 +116,8 @@ static class FastMath { return x; } - public static int Abs(int input) => input>=0 ? input: -input; + public static int Abs(int input) => input>=0 ? input : -input; - public static float Abs(float input) => input>=0f ? input: -input; + public static float Abs(float input) => input>=0f ? input : -input; } } diff --git a/rabcrClient/InterLogic/Global/Setting.cs b/rabcrClient/InterLogic/Global/Setting.cs index 663c2a6..7b86d9c 100644 --- a/rabcrClient/InterLogic/Global/Setting.cs +++ b/rabcrClient/InterLogic/Global/Setting.cs @@ -74,7 +74,7 @@ public enum FogTypes:byte { public static bool BetterSnowAndRain=true; public static float SlideChangeTimeInTicks => 0.006f/slideChangeTime; - public static GraphicsProfile GraphicsProfile =GraphicsProfile.Reach; + public static GraphicsProfile GraphicsProfile =GraphicsProfile.HiDef; public static float NightBrightness=0.6f; public static float slideChangeTime=0.05f; @@ -103,6 +103,10 @@ public enum FogTypes:byte { public static bool InvertedMouse=false; #endregion + //void SetDefault(){ + // Rabcr.Graphics.Adapter. + //} + public static void CreateSettings() { // Debug.WriteLine("Creating new settings"); try { diff --git a/rabcrClient/InterLogic/ItemInv.cs b/rabcrClient/InterLogic/ItemInv.cs index 3c05384..18f0400 100644 --- a/rabcrClient/InterLogic/ItemInv.cs +++ b/rabcrClient/InterLogic/ItemInv.cs @@ -629,7 +629,7 @@ class ItemInvFood16: ItemInv { } } - public ItemInvFood16(Texture2D tex, ushort id, int count, int maxcount, float descay, float descayMax, int x, int y){ + public ItemInvFood16(Texture2D tex, ushort id, int count, int maxcount, float descay, float descayMax, int x, int y) { posTex=new Rectangle(x, y, 32, 32); DescayMaximum=descayMax; GetCount=count; @@ -669,6 +669,26 @@ class ItemInvFood16: ItemInv { bar3=new Rectangle(x+1+v, y+29, 30-v, 3); } + public ItemInvFood16(Texture2D tex, ushort id, int count, int x, int y) { + posTex=new Rectangle(x, y, 32, 32); + DescayMaximum=GameMethods.FoodMaxDescay(id); + GetCount=count; + Id=id; + Texture=tex; + CountMaximum=GameMethods.FoodMaxCount(id); + + // Descay + GetDescay=0; + int d=(int)(GetDescay/DescayMaximum*255); + colorDescay=new Color((uint)((255 << 24) | (d << 8) | (255-d))); + + // Count + int v=(int)((GetCount/(float)CountMaximum*30)+0.49f); + bar1= new Rectangle(x, y+28, 32, 5); + bar2=new Rectangle(x+1, y+29, v, 3); + bar3=new Rectangle(x+1+v, y+29, 30-v, 3); + } + public ItemInvFood16(Texture2D tex, ushort id, int count, int maxcount, float descay, float descayMax) { posTex=new Rectangle(0, 0, 32, 32); DescayMaximum=descayMax; diff --git a/rabcrClient/RabcrData.mgcb b/rabcrClient/RabcrData.mgcb index 0d01879..c0084d8 100644 --- a/rabcrClient/RabcrData.mgcb +++ b/rabcrClient/RabcrData.mgcb @@ -1709,6 +1709,18 @@ /processorParam:TextureFormat=Color /build:Default/Textures/Blocks/GrassBlocks/Compost.png +#begin Default/Textures/Blocks/GrassBlocks/CompostWithSnow.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Default/Textures/Blocks/GrassBlocks/CompostWithSnow.png + #begin Default/Textures/Blocks/GrassBlocks/Desert.png /importer:TextureImporter /processor:TextureProcessor From 1bd63b34856680f5715cd4a59a576bfbdb5670f6 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:42:20 +0100 Subject: [PATCH 39/55] fix wood --- rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs index 01a26f8..85e21e5 100644 --- a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs +++ b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs @@ -2947,7 +2947,7 @@ public enum WorldSize : byte{ break; case 1: - TreeKapok(pos, terrainHeight); + TreeKapok(pos-1, terrainHeight); break; case 2: @@ -4256,14 +4256,14 @@ public enum WorldSize : byte{ unsafe void Save(string name) { world++; - List bytes=new List(); - List bytesLiveObject = new List { + List bytes=new(); + List bytesLiveObject = new() { (byte)LiveObjects.Count, (byte)(LiveObjects.Count>>8), (byte)(LiveObjects.Count>>16) }; - List tmpBytes=new List(); + List tmpBytes=new(); for (int x=0; x Date: Fri, 21 Jan 2022 14:42:36 +0100 Subject: [PATCH 40/55] add heater placement --- rabcrClient/InterLogic/Game/GameMethods.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/rabcrClient/InterLogic/Game/GameMethods.cs b/rabcrClient/InterLogic/Game/GameMethods.cs index a18373f..7acac07 100644 --- a/rabcrClient/InterLogic/Game/GameMethods.cs +++ b/rabcrClient/InterLogic/Game/GameMethods.cs @@ -1311,6 +1311,7 @@ public static ushort TopBlockFromItem(ushort item) (ushort)Items.Alore => (ushort)BlockId.Alore, (ushort)Items.PlantRose => (ushort)BlockId.Rose, (ushort)Items.PlantViolet => (ushort)BlockId.Violet, + (ushort)Items.Heater => (ushort)BlockId.Heather, (ushort)Items.Dandelion => (ushort)BlockId.Dandelion, (ushort)Items.PlantOrchid => (ushort)BlockId.Orchid, (ushort)Items.CactusBig => (ushort)BlockId.CactusBig, From 4ab0a1299154af38a56be40bd4aa9b9d02b0698d Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:42:48 +0100 Subject: [PATCH 41/55] cleanup --- .../InterLogic/Graphics/Screen/Rabcr.cs | 50 +++++++------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs index 9bf3cbb..429b56c 100644 --- a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs +++ b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs @@ -2,15 +2,12 @@ using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Microsoft.Xna.Framework.Media; using System; -using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.IO; using System.Windows.Forms; using Color = Microsoft.Xna.Framework.Color; -using Keys = Microsoft.Xna.Framework.Input.Keys; using MessageBox = System.Windows.Forms.MessageBox; namespace rabcrClient { @@ -22,7 +19,6 @@ public class Rabcr : Game { public static Game Game; public static Texture2D Pixel; public static Texture2D Pixel2; - // public static FastRandom random; public static SpriteBatch spriteBatch; static bool exiting=false; static bool saved=false; @@ -33,8 +29,6 @@ public class Rabcr : Game { public Rabcr() { newMouseState=new MouseState(); - //Activated += ActivateMyGame; - //Deactivated += DeactivateMyGame; bool runWithArgs=Environment.GetCommandLineArgs().Length>=3; Game=this; @@ -109,9 +103,7 @@ public class Rabcr : Game { if (!Directory.Exists(Setting.Path))Directory.CreateDirectory(Setting.Path); // if (!Directory.Exists(Setting.Path+"\\Logs"))Directory.CreateDirectory(Setting.Path+"\\Logs"); if (!Directory.Exists(Setting.Path+"\\Worlds"))Directory.CreateDirectory(Setting.Path+"\\Worlds"); - // if (!Directory.Exists(Setting.Path+"\\Servers"))Directory.CreateDirectory(Setting.Path+"\\Servers"); - - //Log.Init(); + if (!Directory.Exists(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData")) { switch (System.Globalization.CultureInfo.CurrentCulture.EnglishName){ @@ -147,9 +139,7 @@ public class Rabcr : Game { } #endregion - // Setting.Multisapling=16; - // Setting.UpScalingSuperSapling=1f; - + GraphicsManager = new GraphicsDeviceManager(this); Graphics=GraphicsManager.GraphicsDevice; @@ -160,9 +150,9 @@ public class Rabcr : Game { GraphicsManager.PreparingDeviceSettings += new EventHandler(graphics_PreparingDeviceSettings); void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) { if (Setting.GraphicsProfile==GraphicsProfile.HiDef) { - try{ + try { e.GraphicsDeviceInformation.GraphicsProfile = Setting.GraphicsProfile; - }catch{ + } catch { Setting.GraphicsProfile=GraphicsProfile.Reach; e.GraphicsDeviceInformation.GraphicsProfile = Setting.GraphicsProfile; } @@ -170,19 +160,10 @@ public class Rabcr : Game { e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount=Setting.Multisapling; // // e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval - Debug.WriteLine("MultiSampleCount: " + e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount); + // Debug.WriteLine("MultiSampleCount: " + e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount); } GraphicsManager.PreferMultiSampling = Setting.Multisapling>1 /*|| Setting.Multisapling==0*/; - // GraphicsManager.GraphicsDevice..BeforeDeviceCreated += Graphics_BeforeDeviceCreated; - // Graphics.PresentationParameters.MultiSampleCount = 8; - // GraphicsManager.PreferMultiSampling = true; - - - // void Graphics_BeforeDeviceCreated(object sender, PresentationParameters e) - // { - // e.MultiSampleCount = 16; - // } - + try { GraphicsManager.ApplyChanges(); } catch{ } @@ -193,11 +174,12 @@ public class Rabcr : Game { content=Content; (Pixel = new Texture2D(GraphicsDevice, 1, 1)).SetData(new[] { Color.White }); - (Pixel2 = new Texture2D(GraphicsDevice, 2, 2)).SetData(new[] { Color.White,Color.White,Color.White,Color.White }); - - // random=new FastRandom(); + (Pixel2 = new Texture2D(GraphicsDevice, 2, 2)).SetData(new[] { Color.White, Color.White, Color.White, Color.White }); - Window.Position=new Microsoft.Xna.Framework.Point((int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width/6f),(int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/7f)); + Window.Position=new Microsoft.Xna.Framework.Point( + (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width/6f), + (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/7f) + ); { Form MyGameForm = (Form)Control.FromHandle(Window.Handle); MyGameForm.LocationChanged+=Window_ClientSizeChanged; @@ -291,12 +273,14 @@ public class Rabcr : Game { } void MyGameForm_FormClosing(object sender, FormClosingEventArgs e) { - Console.WriteLine("Closing game"); + Debug.WriteLine("Closing screen"); exiting=true; screen.Shutdown(); - if (Global.ChangedSettings || !File.Exists(Setting.Path+@"\Setting.bin")) {Setting.SaveSetting(); if (exiting) saved=true;} - else { + if (Global.ChangedSettings || !File.Exists(Setting.Path+@"\Setting.bin")) { + Setting.SaveSetting(); + if (exiting) saved=true; + } else { saved=true; } @@ -326,7 +310,7 @@ public class Rabcr : Game { } } - if (resize){ + if (resize) { GraphicsManager.ApplyChanges(); if (screen!=null) screen.Resize(); } From 8e61ae080d3b02116109699d8a87326159c3559f Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:54:18 +0100 Subject: [PATCH 42/55] clean up --- rabcrClient/InterLogic/TextDrawer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rabcrClient/InterLogic/TextDrawer.cs b/rabcrClient/InterLogic/TextDrawer.cs index 04f0962..920efad 100644 --- a/rabcrClient/InterLogic/TextDrawer.cs +++ b/rabcrClient/InterLogic/TextDrawer.cs @@ -1114,7 +1114,8 @@ public static BitmapFont // } // // } // }else{ - using (FileStream fileStream = new FileStream(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"/RabcrData/Default/Fonts/Font "+Lang.Languages[Setting.CurrentLanguage].FontFile+" "+size+".png", FileMode.Open)){ + + using (FileStream fileStream = new(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"/RabcrData/Default/Fonts/Font "+Lang.Languages[Setting.CurrentLanguage].FontFile+" "+size+".png", FileMode.Open)){ // Bitmap=Rabcr.Game.Content.Load("Default/Fonts/font"+size); /*BitmapFont.bitmapFont16.*/Bitmap=Texture2D.FromStream(Rabcr.Game.GraphicsDevice, fileStream); From ae321e6377101530b606d8bf4160955bd9d24018 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:54:28 +0100 Subject: [PATCH 43/55] clean up --- rabcrClient/InterLogic/TextDrawer.cs | 370 ++++++--------------------- 1 file changed, 82 insertions(+), 288 deletions(-) diff --git a/rabcrClient/InterLogic/TextDrawer.cs b/rabcrClient/InterLogic/TextDrawer.cs index 920efad..9420374 100644 --- a/rabcrClient/InterLogic/TextDrawer.cs +++ b/rabcrClient/InterLogic/TextDrawer.cs @@ -24,11 +24,11 @@ public class Text { font=f; X=x; Y=y; - if (IsDevanagari(txt)){ + if (IsDevanagari(txt)) { BuildTextDevanagari(txt); return; } - if (IsArabic(txt)){ + if (IsArabic(txt)) { BuildTextArabic(txt); return; } @@ -109,8 +109,7 @@ public class Text { posx+=g.DrawRectangle.Width+g.X+g.W-3; // Devanagari special character - if (chs[ch]=='媪') {posx-=14-3/*+3+3*/; } //ि - // if (chs[ch]=='媪') {posx-=14-3/*+3+3*/; } //ि + if (chs[ch]=='媪') { posx-=14-3; } //ि } else { posx+=g.W; } @@ -142,7 +141,6 @@ public class Text { } #endif } - Debug.WriteLine(""); Chars=tmpChs.ToArray(); Length=Chars.Length; @@ -211,10 +209,7 @@ public class Text { case 'ۆ': return true; case 'ں': return true; case 'گ': return true; - // case 'ﻢ': return true; - // case 'ء': return true; } - // Debug.WriteLine(ch+" is not arabic"); return false; } @@ -270,10 +265,7 @@ public class Text { } #endif } - //Debug.WriteLine(" "); Chars=tmpChs.ToArray(); - //X=x; - //Y=y; Length=Chars.Length; } @@ -462,7 +454,9 @@ public class Text { 'ھ' => true, 'ں' => false, 'ے' => false, + #if DEBUG _ => throw new Exception("Missing arabic letter " + ch), + #endif }; #if DEBUG @@ -525,11 +519,12 @@ public class Text { 'ى' => true, 'ة' => true, 'ە' => true, + #if DEBUG _ => throw new Exception("Missing arabic letter " + ch), + #endif }; -#if DEBUG -#else +#if !DEBUG return true; #endif } @@ -539,7 +534,7 @@ public class Text { // Detect if is arabic bool isArabic=false; foreach (char c in txt) { - if (IsArabicChar(c)){ + if (IsArabicChar(c)) { isArabic=true; break; } @@ -554,48 +549,36 @@ public class Text { txt=txt.Replace(((char)1575).ToString()+((char)1604).ToString(),"\uFEFB"); txt=txt.Replace(((char)1573).ToString()+((char)1604).ToString(),"\uFEF9"); //ل ا ء <- ل إ - // Debug.WriteLine(txt); char[] chs=txt.ToCharArray(); char[] _out=new char[chs.Length]; if (chs.Length<2) return txt.ToCharArray(); // start - int ch /*= 0*/; + int ch; if (IsArabicChar(chs[1])) { if (HaveInitialForm(chs[1])) _out[0]=(char)ArabicFinalFormConventer((int)chs[0]); else _out[0]=chs[0]; } else _out[0]=chs[0]; for (ch = 1; ch "+chs[ch]+" s:"+s+" e:"+e); } ch=chs.Length-1; + // end if (IsArabicChar(chs[chs.Length-1-1])) { if (HaveFinalForm(chs[chs.Length-1-1])) _out[ch]=(char)ArabicInitialFormConventer((int)chs[ch]); else _out[ch]=chs[ch]; }else _out[ch]=chs[ch]; - return /*new string(*/_out/*)*/; + return _out; } #endregion @@ -697,14 +680,13 @@ public class Text { DrawingChar dch=Chars[Length-1]; return dch.Pos.X-Chars[0].Pos.X+dch.Rectangle.Width; } - if (/*Chars.*/Length==1) return Chars[0].Rectangle.Width; + if (Length==1) return Chars[0].Rectangle.Width; return 0; } #endregion #region Change Pos public void ChangePosition(int newX, int newY) { - // if (newX!=X || newY!=Y) { int deltaX=newX-X, deltaY=newY-Y; @@ -815,7 +797,7 @@ public class TextWithMeasure { Y=y; List tmpChs=new(); - char[] chs=Text.BuildArabicText(txt);//txt.ToCharArray(); + char[] chs=Text.BuildArabicText(txt); int posx=x; Glyph g; NewLines=1; @@ -836,13 +818,7 @@ public class TextWithMeasure { ); posx+=g.DrawRectangle.Width+g.X+g.W; } else { - if (chs[i]=='\n')NewLines++; - //tmpChs.Add( - // new DrawingChar{ - // //Pos=new Vector2(posx+g.X,y+g.Y), - // //Rectangle=g.DrawRectangle, - // } - //); + if (chs[i]=='\n') NewLines++; posx+=g.W; } @@ -855,8 +831,8 @@ public class TextWithMeasure { #if DEBUG // Unknown char - if (add)continue; - if (chs[i]=='\r')continue; + if (add) continue; + if (chs[i]=='\r') continue; for (int gg = 0; gg tmpChs=new(); - char[] chs=Text.BuildArabicText(txt);//txt.ToCharArray(); + char[] chs=Text.BuildArabicText(txt); int posx=x; Glyph g; @@ -980,11 +960,7 @@ class DynamicText{ } else { tmpChs.Add( new Glyph{ - // X=g.X, - // Y=g.Y, W=g.W, - // H=g.H, - // DrawRectangle=g.DrawRectangle, visible=false } ); @@ -1074,22 +1050,20 @@ public static BitmapFont for (int i=0; i2){ - // if (Environment.GetCommandLineArgs()[1]=="/Message"){ - // using (FileStream fileStream = new FileStream(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"/RabcrData/Default/Fonts/Font latin 18.png", FileMode.Open)){ - //// Bitmap=Rabcr.Game.Content.Load("Default/Fonts/font"+size); - // /*BitmapFont.bitmapFont16.*/Bitmap=Texture2D.FromStream(Rabcr.Game.GraphicsDevice, fileStream); - - // // fileStream.Dispose(); - // } // - // } - // }else{ using (FileStream fileStream = new(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"/RabcrData/Default/Fonts/Font "+Lang.Languages[Setting.CurrentLanguage].FontFile+" "+size+".png", FileMode.Open)){ - // Bitmap=Rabcr.Game.Content.Load("Default/Fonts/font"+size); - /*BitmapFont.bitmapFont16.*/Bitmap=Texture2D.FromStream(Rabcr.Game.GraphicsDevice, fileStream); - - // fileStream.Dispose(); - }// } // GC.Collect(); - //GC.WaitForPendingFinalizers(); - // string[] lines = strs/*((string)Properties.Resources.ResourceManager.GetObject("FontInfo"+size+".txt"))*/./*; .FontInfo.*/Split('*'); - //// string[] lines=Properties.Resources.ResourceManager.GetString("FontInfo"+size+".txt")./*; .FontInfo.*/Split('*'); - // foreach (string line in lines){ - // if (line=="")break; - // string[] info=line.Split('|'); - // if (info.Length==3) { - // Glyphs.Add( - // new Glyph{ - // Code=int.Parse(info[0]), - // // DrawRectangle=new Rectangle(int.Parse(info[1]),int.Parse(info[2]),int.Parse(info[3]),int.Parse(info[4])), - // // X=int.Parse(info[5]), - // //Y=int.Parse(info[6]), - // W=int.Parse(info[1]), - // H=int.Parse(info[2]), - // visible=false, - // } - // ); - // } else { - // Glyphs.Add( - // new Glyph{ - // Code=int.Parse(info[0]), - // DrawRectangle=new Rectangle(int.Parse(info[1]),int.Parse(info[2]),int.Parse(info[3]),int.Parse(info[4])), - // X=int.Parse(info[5]), - // Y=int.Parse(info[6]), - // W=int.Parse(info[7]), - // H=int.Parse(info[8]), - // visible=true, - // } - // ); - // } - // } - w3dots=MeasureTextSingleLineX("..."); + Bitmap=Texture2D.FromStream(Rabcr.Game.GraphicsDevice, fileStream); + } + w3dots=MeasureTextSingleLineX("..."); } -#region Measure Width and Height - //public DInt MeasureText(string txt){ - // if (txt==null)// { - // //X=0; - // //Y=0; - // return new DInt{ X=0, Y=0 }; - // //} - - // char[] chs=txt.ToCharArray(); - - // if (txt.Contains('\n')){ - // int maxX=0; - // int X=0; - - // for (int i = 0; ic=='\n')+1) }/*(maxX,MeasureTextSingleLineY*(txt.Count(c=>c=='\n')+1))*/; - // } else { - // int X= 0, Y = 0; - // for (int i = 0; i MeasureTextSingleLineY*(txt.Count(c=>c=='\n')+1); -#endregion + #endregion -#region Draw text + #region Draw text public void DrawText(SpriteBatch sb, string str, int x, int y) { if (str==null) return; @@ -1382,32 +1216,6 @@ public static BitmapFont } } - //public void DrawTextMultiline(SpriteBatch sb, string str, int x, int y) { - // if (str==null) return; - - // char[] chs=str.ToCharArray(); - // int posx=x, posy=0; - - // Glyph g; - // for (int ch = 0; chnoncombined parts) - List<(bool,string)> DevanagariWords=new List<(bool, string)>(); + List<(bool,string)> DevanagariWords=new(); bool WasLastDevanagari=false; int lastpos=-1; @@ -1574,20 +1380,18 @@ class RenderEnngineDevanagari { DevanagariWords.Add((WasLastDevanagari,input.Substring(lastpos))); Output=""; + // Parse devanagari words into syllables foreach ((bool, string) h in DevanagariWords) { if (h.Item1) { string[] Syllables=ToSyllables(h.Item2); - foreach (string s in Syllables) Output+=/*"s"+*/s/*+"e"*/; + foreach (string s in Syllables) Output+=s; } else { - Output+=/*"S"+*/h.Item2/*+"E"*/; + Output+=h.Item2; } } - //string LastSyllable=""; - //bool Devanagari; - string[] ToSyllables(string txt){ List Syllables=null; string LastSyllable=""; @@ -1625,78 +1429,68 @@ class RenderEnngineDevanagari { } } if (make) { - string g=s.Replace(r.Item1[0],r.Item2); - g=g.Replace(r.Item1[1].ToString(),""); + string g=s.Replace(r.Item1[0], r.Item2); + g=g.Replace(r.Item1[1].ToString(), ""); return r.Item2.ToString(); } } - if (s.Contains('ा')){ //f + if (s.Contains('ा')) { //f return s.Replace('ा'.ToString(),"发"); } - if (s.Contains('ो')){ //T´ + if (s.Contains('ो')) { //T´ return s.Replace('ो'.ToString(),"飞"); } - if (s.Contains('ी')){ // o + obraceny f + if (s.Contains('ी')) { // o + obraceny f return s.Replace('ी'.ToString(),"汉"); } - if (s.Contains('ु')){ // o + obraceny f + if (s.Contains('ु')) { // o + obraceny f return s.Replace('ु'.ToString(),"习"); } if (s.Contains('ू')){ // o + obraceny f return s.Replace('ू'.ToString(),"韦"); } - if (s.Contains('्')){ // o + obraceny f + if (s.Contains('्')) { // o + obraceny f return s.Replace('्'.ToString(),"专"); } - if (s.Contains('े')){ // o + obraceny f + if (s.Contains('े')) { // o + obraceny f return s.Replace('े'.ToString(),"车"); } - if (s.Contains('ं')){ // tečka nad + if (s.Contains('ं')) { // tečka nad return s.Replace('ं'.ToString(),"见"); } - if (s.Contains('ै')){ // dvojte carka nad + if (s.Contains('ै')) { // dvojte carka nad return s.Replace('ै'.ToString(),"齿"); } - if (s.Contains('ृ')){ //m ृ + if (s.Contains('ृ')) { //m ृ return s.Replace('ृ'.ToString(),"义"); } - if (s.Contains('ॄ')){ //m ॄ + if (s.Contains('ॄ')) { //m ॄ return s.Replace('ॄ'.ToString(),"宾"); } - if (s.Contains('ॢ')){ //m ॢ + if (s.Contains('ॢ')) { //m ॢ return s.Replace('ॢ'.ToString(),"继"); } - if (s.Contains('ॣ')){ // o + obraceny f + if (s.Contains('ॣ')) { // o + obraceny f return s.Replace('ॣ'.ToString(),"历"); } - if (s.Contains('ॅ')){ //m ॅ + if (s.Contains('ॅ')) { //m ॅ return s.Replace('ॅ'.ToString(),"妇"); } - if (s.Contains('ॉ')){ // o + obraceny f + if (s.Contains('ॉ')) { // o + obraceny f return s.Replace('ॉ'.ToString(),"焕"); } - - if (s.Contains('ौ')){ //m ौ o + obraceny f + if (s.Contains('ौ')) { //m ौ o + obraceny f return s.Replace('ौ'.ToString(),"头"); } // f+o - if (s.Contains('ि')){ - string o=s.Replace('ि'.ToString(),""); + if (s.Contains('ि')) { + string o=s.Replace('ि'.ToString(), ""); return '媪'+o; } - // 'ि' } return s; } } - - - - - //class Replace{ - // public char[] From; - // public char To; - //} - } - } \ No newline at end of file + } + } \ No newline at end of file From 0874658ccca0ab369c8d6583849516824c481445 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:54:42 +0100 Subject: [PATCH 44/55] separate in class --- rabcrClient/GameBar.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rabcrClient/GameBar.cs b/rabcrClient/GameBar.cs index 9111176..0489f44 100644 --- a/rabcrClient/GameBar.cs +++ b/rabcrClient/GameBar.cs @@ -5,14 +5,16 @@ namespace rabcrClient { class GameBar { public float Value{ get => barValue; - set { SetBarValue(value); } + set { + SetBarValue(value); + } } float barValue=-10; - Texture2D texture; + readonly Texture2D texture; Vector2 PosNor, PosGray; Rectangle RecNor, RecGray; - int Pos; + readonly int Pos; public GameBar(Texture2D tex, int pos) { texture=tex; From ff8b438bfcd3a5ee3be2c4c5caf8b2bbe7d915e5 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:55:09 +0100 Subject: [PATCH 45/55] byte ti int --- rabcrClient/ClothesTypes.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rabcrClient/ClothesTypes.cs b/rabcrClient/ClothesTypes.cs index 965a051..3b6053b 100644 --- a/rabcrClient/ClothesTypes.cs +++ b/rabcrClient/ClothesTypes.cs @@ -57,7 +57,7 @@ public class ClothesTypeHelmet{ public bool ShinkHair; public Color Color; } - public enum HandClothSize : byte{ + public enum HandClothSize : int{ None=0, Half=18/2, NearlyFull=18-4, From 246aefdabea662a6cc0780583266d41683686db8 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:55:29 +0100 Subject: [PATCH 46/55] updated --- .../GameStates/Game/Singleplayer.cs | 907 ++++++++++-------- 1 file changed, 500 insertions(+), 407 deletions(-) diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs index 6f0ea3a..ae18280 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs @@ -21,6 +21,7 @@ class SinglePlayer: Screen { SoundEffectInstance SoundWind, SoundRain; float SuperSamplingActing=-1; float scrollBuffer=0f; + Texture2D TextureGrassBlockSnowCompost; enum Precipitation : byte { None, Snowing, @@ -1086,7 +1087,7 @@ const int bool notNeedScafander; float PlayerX, PlayerY; - + int PlayerXInt, PlayerYInt; int playerImg; int playerState; int distanceToGround=0; @@ -1506,11 +1507,13 @@ readonly Color public SinglePlayer(string dir) => pathToWorld=dir+"\\"; RasterizerState rasterizerState; const float noon=(dayEnd-(dayStart+1))*hour; - + Color black50=new Color(0,0,0,50); + Matrix transformMatrixS; void SetSuperSampling() { // No SSAA if (Setting.UpScalingSuperSapling==1f) { SuperSamplingActing=1f; + SetOther(); return; } @@ -1526,6 +1529,7 @@ readonly Color DepthFormat.Depth24, 1, RenderTargetUsage.PlatformContents); + SetOther(); return; } @@ -1558,10 +1562,12 @@ readonly Color 1, RenderTargetUsage.PlatformContents ); + SetOther(); return; } else { SuperSamplingActing=1f; targetGame?.Dispose(); + SetOther(); return; } } @@ -1593,6 +1599,7 @@ readonly Color 1, RenderTargetUsage.PlatformContents ); + SetOther(); return; } else { if (maxUpscaling>=2f) { @@ -1611,15 +1618,34 @@ readonly Color ); targetGame2?.Dispose(); + SetOther(); return; } else { SuperSamplingActing=1f; targetGame?.Dispose(); targetGame2?.Dispose(); + SetOther(); return; } } } + + void SetOther() { + ZoomMatrix = Matrix.CreateScale(Setting.Zoom*SuperSamplingActing, Setting.Zoom*SuperSamplingActing, 0); + ZoomMatrixNoUpScaling = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); + + if (SuperSamplingActing!=1f) MatrixUpScaling = Matrix.CreateScale(SuperSamplingActing, SuperSamplingActing, 0); + Translation = ZoomMatrix*Matrix.CreateTranslation(new Vector3( + Global.WindowWidthHalf*SuperSamplingActing, + Global.WindowHeightHalf*SuperSamplingActing, + 0)); + + TranslationNoOpMultisapling = ZoomMatrixNoUpScaling*Matrix.CreateTranslation(new Vector3( + Global.WindowWidthHalf, + Global.WindowHeightHalf, + 0)); + + } //if (Setting.UpScalingSuperSapling==8f) { // if (maxUpscaling>=Setting.UpScalingSuperSapling) { @@ -1766,7 +1792,7 @@ readonly Color #region Load textures TextureTestTube=GetDataTexture(@"Items\Dye\TestTube"); - + TextureGrassBlockSnowCompost=GetDataTexture(@"Blocks\GrassBlocks\CompostWithSnow"); TextureChristmasBall=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBall"); TextureChristmasBallYellow=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallYellow"); TextureChristmasBallOrange=GetDataTexture(@"Items/Decorations/CristmasBalls/ChristmasBallOrange"); @@ -2969,14 +2995,30 @@ readonly Color time =int.Parse(sr.ReadLine()); if (time>dayLenght)time=0; colorAlpha = Color.White; + + barWater.Value = float.Parse(sr.ReadLine()); + if (barWater.Value<0) barWater.Value=0; + if (barWater.Value>32) barWater.Value=32; + barEat.Value = float.Parse(sr.ReadLine()); - barHeart .Value = float.Parse(sr.ReadLine()); + if (barEat.Value<0) barWater.Value=0; + if (barEat.Value>32) barWater.Value=32; + + barHeart.Value = float.Parse(sr.ReadLine()); + if (barHeart.Value<0) barWater.Value=0; + if (barHeart.Value>32) barWater.Value=32; + barOxygen.Value = float.Parse(sr.ReadLine()); + if (barOxygen.Value<0) barWater.Value=0; + if (barOxygen.Value>32) barWater.Value=32; + barEnergy.Value = float.Parse(sr.ReadLine()); + if (barEnergy.Value<0) barWater.Value=0; + if (barEnergy.Value>32) barWater.Value=32; - PlayerX = int.Parse(sr.ReadLine()); - PlayerY = int.Parse(sr.ReadLine()); + PlayerX = PlayerXInt = int.Parse(sr.ReadLine()); + PlayerY = PlayerYInt = int.Parse(sr.ReadLine()); windForce= float.Parse(sr.ReadLine()); wind=bool.Parse(sr.ReadLine()); @@ -2999,7 +3041,7 @@ readonly Color AchievementFutureAge=bool.Parse(sr.ReadLine()); } - SetPlayerPos(PlayerX, PlayerY); + SetPlayerPos(PlayerXInt, PlayerYInt); } else { SetPlayerPos(FastRandom.Int(TerrainLength*16), 600); time=(int)(6.5f*hour); @@ -3530,19 +3572,19 @@ readonly Color Graphics.PresentationParameters.MultiSampleCount = Setting.Multisapling; GraphicsManager.ApplyChanges(); SetSuperSampling(); - ZoomMatrix = Matrix.CreateScale(Setting.Zoom*SuperSamplingActing, Setting.Zoom*SuperSamplingActing, 0); - ZoomMatrixNoUpScaling = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); + //ZoomMatrix = Matrix.CreateScale(Setting.Zoom*SuperSamplingActing, Setting.Zoom*SuperSamplingActing, 0); + //ZoomMatrixNoUpScaling = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); - if (SuperSamplingActing!=1f) MatrixUpScaling = Matrix.CreateScale(SuperSamplingActing, SuperSamplingActing, 0); - Translation = ZoomMatrix*Matrix.CreateTranslation(new Vector3( - Global.WindowWidthHalf*SuperSamplingActing, - Global.WindowHeightHalf*SuperSamplingActing, - 0)); - - TranslationNoOpMultisapling = ZoomMatrixNoUpScaling*Matrix.CreateTranslation(new Vector3( - Global.WindowWidthHalf, - Global.WindowHeightHalf, - 0)); + //if (SuperSamplingActing!=1f) MatrixUpScaling = Matrix.CreateScale(SuperSamplingActing, SuperSamplingActing, 0); + // Translation = ZoomMatrix*Matrix.CreateTranslation(new Vector3( + // Global.WindowWidthHalf*SuperSamplingActing, + // Global.WindowHeightHalf*SuperSamplingActing, + //0)); + + //TranslationNoOpMultisapling = ZoomMatrixNoUpScaling*Matrix.CreateTranslation(new Vector3( + // Global.WindowWidthHalf, + // Global.WindowHeightHalf, + //0)); //Debug.WriteLine("GraphicsProfile: "+Graphics.GraphicsProfile); @@ -3620,7 +3662,7 @@ readonly Color bytes.AddRange(BitConverter.GetBytes(x.X)); bytes.AddRange(BitConverter.GetBytes(x.Y)); } - File.WriteAllBytes(pathToWorld+@"\"+world+"DroppedItems.bin",bytes.ToArray()); + File.WriteAllBytes(pathToWorld+@"\"+world+"DroppedItems.bin", bytes.ToArray()); } #endregion @@ -3657,11 +3699,11 @@ readonly Color mouseRightRelease=false; if (newMouseState.LeftButton==ButtonState.Pressed) { - MousePos.mouseLeftDown = mouseLeftDown=true; + MousePos.mouseLeftDown = mouseLeftDown=true; if (oldMouseState.LeftButton==ButtonState.Released) mouseLeftPress=true; } else { MousePos.mouseLeftDown= mouseLeftDown=false; - if (oldMouseState.LeftButton==ButtonState.Pressed) MousePos.mouseLeftRelease=mouseLeftRelease=true; + if (oldMouseState.LeftButton==ButtonState.Pressed) MousePos.mouseLeftRelease=mouseLeftRelease=true; } if (newMouseState.RightButton==ButtonState.Pressed) { @@ -3671,9 +3713,9 @@ readonly Color mouseRightDown=false; if (oldMouseState.RightButton==ButtonState.Pressed) mouseRightRelease=true; } - if (changePosition){ + if (changePosition) { mousePosChanged=true; - }else{ + } else { if (newMouseState.X==oldMouseState.X) { if (newMouseState.Y==oldMouseState.Y) { mousePosChanged=false; @@ -3689,8 +3731,8 @@ readonly Color mousePosRoundX=mousePosDiv16.X*16; mousePosRoundY=mousePosDiv16.Y*16; - MousePos.mouseRealPosX= mouseRealPosX=newMouseState.X; - MousePos.mouseRealPosY= mouseRealPosY=newMouseState.Y; + MousePos.mouseRealPosX = mouseRealPosX=newMouseState.X; + MousePos.mouseRealPosY = mouseRealPosY=newMouseState.Y; mousePosRoundVector.X=mousePosRoundX; mousePosRoundVector.Y=mousePosRoundY; @@ -3766,8 +3808,10 @@ readonly Color debug = true; } catch { + #if Debug System.Windows.Forms.MessageBox.Show("Chyba při inicializaci PerformanceCounter, Informace pro vývojáře budou skryty","ERROR"); - debug=false; + #endif + debug = false; } } } @@ -3775,42 +3819,44 @@ readonly Color if (oldKeyboardState.IsKeyDown(Keys.F2)) { if (newKeyboardState.IsKeyUp(Keys.F2)) { - if (showInventory) showInventory=false; else showInventory=true; + showInventory = !showInventory; + //if (showInventory) showInventory=false; else showInventory=true; } } if (oldKeyboardState.IsKeyDown(Keys.F3)) { if (newKeyboardState.IsKeyUp(Keys.F3)) { - if (showPlayer) showPlayer=false; else showPlayer=true; + showPlayer = !showPlayer; + // if (showPlayer) showPlayer=false; else showPlayer=true; } } if (newKeyboardState.IsKeyDown(Setting.KeyExit)) { if (oldKeyboardState.IsKeyUp(Setting.KeyExit)) { - if (inventory==InventoryType.Normal){ + if (inventory==InventoryType.Normal) { inventory=InventoryType.GameMenu; if (Constants.AnimationsControls) animationInvBack=0; else animationInvBack=100; { - int xx = Global.WindowWidthHalf-300+10+200+10+4; + float xx = Global.WindowWidthHalf-300+10+200+10+4; // Continue game - buttonContinue.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60-2+50); + buttonContinue.Position=new Vector2(xx, Global.WindowHeightHalf-232+1+30+60-2+50); // Exit game - buttonExit.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60-2+50); + buttonExit.Position=new Vector2(xx, Global.WindowHeightHalf-232+1+30+60+60-2+50); // Acheavements - buttonAcheavements.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60+60-2+50); + buttonAcheavements.Position=new Vector2(xx, Global.WindowHeightHalf-232+1+30+60+60+60-2+50); // Use a gift code - buttonUseGiftCode.Position=new Vector2(xx,Global.WindowHeightHalf-232+1+30+60+60+60+60-2+50); + buttonUseGiftCode.Position=new Vector2(xx, Global.WindowHeightHalf-232+1+30+60+60+60+60-2+50); buttonClose.Position.X=Global.WindowWidthHalf+150-32; buttonClose.Position.Y=Global.WindowHeightHalf-232+1+50; } - textOpenInventory=new Text(Lang.Texts[114], Global.WindowWidthHalf-300-2+10+100+50, Global.WindowHeightHalf-234+10-3+50,BitmapFont.bitmapFont18); + textOpenInventory=new Text(Lang.Texts[114], Global.WindowWidthHalf-300-2+10+100+50, Global.WindowHeightHalf-234+10-3+50, BitmapFont.bitmapFont18); } else { // Double Ecs press if (inventory==InventoryType.GameMenu) { @@ -3870,11 +3916,12 @@ readonly Color EarthShakeTimeInnerPer=5+FastRandom.Int(10); }// EarthShakeTime--; - float divider=EarthShakeTime%EarthShakeTimeInnerPer; - float deltaX=(EarthShakeP2.X-EarthShakeP1.X)/divider; - float deltaY=(EarthShakeP2.Y-EarthShakeP1.Y)/divider; - if (float.IsInfinity(deltaX))deltaX=0; - if (float.IsInfinity(deltaY))deltaY=0; + float divider=(EarthShakeTime%EarthShakeTimeInnerPer); + if (divider!=0) divider=1/divider; else divider=0; + float deltaX=(EarthShakeP2.X-EarthShakeP1.X) * divider; + float deltaY=(EarthShakeP2.Y-EarthShakeP1.Y) * divider; + if (float.IsInfinity(deltaX)) deltaX=0; + if (float.IsInfinity(deltaY)) deltaY=0; EarthShakePA.X=(EarthShakeP1.X+deltaX)*(EarthShakeTime/100f); EarthShakePA.Y=(EarthShakeP1.Y+deltaY)*(EarthShakeTime/100f); //EarthShakeP2=new DInt(FastRandom.Float()*EarthShakeActualSize, FastRandom.Float()*EarthShakeActualSize); @@ -3893,7 +3940,7 @@ readonly Color if (boxSelected!=0) boxSelected--; } else if (boxSelected<4) boxSelected++; scrollBuffer=0; - } else scrollBuffer+= newMouseState.ScrollWheelValue - previousScrollValue; + } else scrollBuffer += newMouseState.ScrollWheelValue - previousScrollValue; } else { if (newMouseState.ScrollWheelValue - previousScrollValue<0) { if (Setting.InvertedMouse) { @@ -3931,27 +3978,32 @@ readonly Color if (rocket) { if (rocketDown) PlayerY+=8; else PlayerY-=10; + PlayerYInt=(int)PlayerY; } else if (fly) { if (newKeyboardState.IsKeyDown(Keys.Up)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY -=10; - else PlayerY -=3; + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY-=10; + else PlayerY-=3; + PlayerYInt=(int)PlayerY; } if (newKeyboardState.IsKeyDown(Keys.Down)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY +=10; - else PlayerY +=3; + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY+=10; + else PlayerY+=3; + PlayerYInt=(int)PlayerY; } if (newKeyboardState.IsKeyDown(Keys.Right)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift))PlayerX +=10; - else PlayerX +=3; - BiomePlayer=GetBiomeByPos((int)(PlayerX/16)); + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX+=10; + else PlayerX+=3; + PlayerXInt=(int)PlayerX; + BiomePlayer=GetBiomeByPos(PlayerXInt/16); } if (newKeyboardState.IsKeyDown(Keys.Left)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift))PlayerX -=10; + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX-=10; else PlayerX -=3; - BiomePlayer=GetBiomeByPos((int)(PlayerX/16)); + PlayerXInt=(int)PlayerX; + BiomePlayer=GetBiomeByPos(PlayerXInt/16); } } else { if (changePosition) { @@ -3959,7 +4011,7 @@ readonly Color canbreatheDuringSwimming=!CheckWaterUp(); waterDown=CheckWaterDown(); DetectLava=CheckLava(); - BiomePlayer=GetBiomeByPos((int)(PlayerX/16)); + BiomePlayer=GetBiomeByPos(PlayerXInt/16); changePosition=false; @@ -3970,7 +4022,7 @@ readonly Color } bool swmove=false; // bool swim; - if (canbreatheDuringSwimming) { + if (canbreatheDuringSwimming && !swimming) { barOxygen.Value--; if (barOxygen.Value<0f) barOxygen.Value=0f; } else { @@ -3984,12 +4036,13 @@ readonly Color if (newKeyboardState.IsKeyDown(Setting.KeyJump)) { if (CheckLadder()) { PlayerY--; - + PlayerYInt--; barEnergy.Value+=0.01f; barWater.Value+=0.01f; gravitySpeed=-2f; } else if (swimming) { PlayerY--; + PlayerYInt--; barEnergy.Value+=0.01f; barWater.Value+=0.01f; gravitySpeed=-1f; @@ -3999,7 +4052,7 @@ readonly Color if (gravitySpeed==0) { gravitySpeed=-7; PlayerY--; - + PlayerYInt--; barEnergy.Value+=0.05f; } } @@ -4039,13 +4092,15 @@ readonly Color if (speed>needSpeed) { speed=needSpeed; + // ?????????????????????? PlayerX=(int)PlayerX; + PlayerXInt=(int)PlayerX; } - }else{ + } else { needSpeed=0; if (speed>needSpeed) { speed-=acceleration*1.8f; - }else { + } else { speed=0; playerState=0; } @@ -4057,11 +4112,11 @@ readonly Color //right if (speedDir==1) { - float x=DetectSolidBlocksRight(PlayerX+speed,PlayerY); + float x=DetectSolidBlocksRight(PlayerX+speed, PlayerY); // No limited blocks if (x==int.MinValue) { - PlayerX+=speed; + PlayerX += speed; playerState=2; if (walkingSoundDuration<0) { @@ -4074,6 +4129,7 @@ readonly Color //Stop moving player // Console.WriteLine("b touch Playerx"+PlayerX); PlayerX=(int)(PlayerX+speed-x-0.05f); + //Console.WriteLine("a touch Playerx"+PlayerX); speed=0; playerState=0; @@ -4304,6 +4360,8 @@ readonly Color PlayerGravity(); } + // PlayerXInt=(int)PlayerX; + // PlayerYInt=(int)PlayerY; #endregion if (diserpeard>0) diserpeard--; @@ -4322,7 +4380,7 @@ readonly Color notshot=false; ammo.SetCount=ammo.GetCount-1; if (ammo.GetCount==0) InventoryNormal[boxSelected]=itemBlank; - if (In(mouseRealPosX, mouseRealPosY, Global.WindowWidth,Global.WindowHeight)) { + if (In(mouseRealPosX, mouseRealPosY, Global.WindowWidth, Global.WindowHeight)) { if (Game.IsActive) CreateShot(); } break; @@ -4544,7 +4602,7 @@ readonly Color case BlockType.Top: { Terrain chunk=terrain[destroyBlockX]; - if (chunk.IsTopBlocks[destroyBlockY]){ + if (chunk.IsTopBlocks[destroyBlockY]) { switch (destroingBlockType) { case (ushort)BlockId.Lamp: lightsLamp.Remove((MashineBlockBasic)chunk.TopBlocks[destroyBlockY]); @@ -4687,15 +4745,15 @@ readonly Color if (i1.GetCount>0){ if (PlayerX-mousePos.X>0) { DroppedItems.Add(new Item{ - X = (int)PlayerX-11-16-1, - Y = (int)PlayerY-22, + X = PlayerXInt-11-16-1, + Y = PlayerYInt-22, item=new ItemNonInvBasic(i1.Id,1/*i1.GetCount*/), Texture=i1.Texture, }); } else { - DroppedItems.Add(new Item { - X = (int)PlayerX+11+1, - Y = (int)PlayerY-22, + DroppedItems.Add(new Item { + X = PlayerXInt+11+1, + Y = PlayerYInt-22, item=new ItemNonInvBasic(i1.Id,1/*i1.GetCount*/), Texture=i1.Texture, }); @@ -4708,15 +4766,15 @@ readonly Color if (PlayerX-mousePos.X>0) { DroppedItems.Add(new Item{ - X = (int)PlayerX-11-16-1, - Y = (int)PlayerY-22, + X = PlayerXInt-11-16-1, + Y = PlayerYInt-22, item=new ItemNonInvFood(i1.Id,i1.GetCount,i1.CountMaximum,i1.GetDescay,i1.DescayMaximum), Texture=i1.Texture, }); } else { DroppedItems.Add(new Item{ - X =(int)PlayerX+11+1, - Y=(int)PlayerY-22, + X = PlayerXInt+11+1, + Y = PlayerYInt-22, item=new ItemNonInvFood(i1.Id,i1.GetCount,i1.CountMaximum,i1.GetDescay,i1.DescayMaximum), Texture=i1.Texture, }); @@ -4726,17 +4784,17 @@ readonly Color return; case ItemInvBasicColoritzed32NonStackable i1: - if ((int)PlayerX-mousePos.X>0) { + if (PlayerX-mousePos.X>0) { DroppedItems.Add(new Item{ - X =(int)PlayerX-11-16-1, - Y=(int)PlayerY-22, + X = PlayerXInt-11-16-1, + Y = PlayerYInt-22, item=new ItemNonInvBasicColoritzedNonStackable(i1.Id,i1.color), Texture=i1.Texture, }); } else { DroppedItems.Add(new Item{ - X =(int)PlayerX+11+1, - Y=(int)PlayerY-22, + X = PlayerXInt+11+1, + Y = PlayerYInt-22, item=new ItemNonInvBasicColoritzedNonStackable(i1.Id,i1.color), Texture=i1.Texture, }); @@ -4746,17 +4804,17 @@ readonly Color return; case ItemInvNonStackable16 i1: - if ((int)PlayerX-mousePos.X>0) { + if (PlayerX-mousePos.X>0) { DroppedItems.Add(new Item{ - X =(int)PlayerX-11-16-1, - Y=(int)PlayerY-22, + X = PlayerXInt-11-16-1, + Y = PlayerYInt-22, item=new ItemNonInvNonStackable(i1.Id), Texture=i1.Texture, }); } else { DroppedItems.Add(new Item{ - X =(int)PlayerX+11+1, - Y=(int)PlayerY-22, + X = PlayerXInt+11+1, + Y = PlayerYInt-22, item=new ItemNonInvNonStackable(i1.Id), Texture=i1.Texture, }); @@ -4768,15 +4826,15 @@ readonly Color case ItemInvNonStackable32 i1: if (PlayerX-mousePos.X>0) { DroppedItems.Add(new Item { - X =(int)PlayerX-11-16-1, - Y=(int)PlayerY-22, + X = PlayerXInt-11-16-1, + Y = PlayerYInt-22, item=new ItemNonInvNonStackable(i1.Id), Texture=i1.Texture, }); } else { DroppedItems.Add(new Item { - X =(int)PlayerX+11+1, - Y=(int)PlayerY-22, + X = PlayerXInt+11+1, + Y = PlayerYInt-22, item=new ItemNonInvNonStackable(i1.Id), Texture=i1.Texture, }); @@ -4907,6 +4965,7 @@ readonly Color }else{ if (lb.Id==(ushort)BlockId.OakLeaves || lb.Id==(ushort)BlockId.LindenLeaves + //|| lb.Id==(ushort)BlockId.SpruceLeavesWithSnow || lb.Id==(ushort)BlockId.AppleLeaves || lb.Id==(ushort)BlockId.AppleLeavesWithApples @@ -4977,7 +5036,7 @@ readonly Color text =TextEdit(text); while (text.Length*13>750) text=text.Substring(0,text.Length-1); if (newText!=text || textWriting==null) { - int xx=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); + int xx=Global.WindowWidthHalf+(PlayerXInt-(int)WindowCenterX); while (text.Length*13>750) text=text.Substring(0, text.Length-1); int m = BitmapFont.bitmapFont18.MeasureTextSingleLineX(text); @@ -4990,7 +5049,7 @@ readonly Color diserpeard=255; int texts= BitmapFont.bitmapFont18.MeasureTextSingleLineX(text)/2; - int x=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); + int x=Global.WindowWidthHalf+(PlayerXInt-(int)WindowCenterX); gedo=new GeDo(text, x-texts+20-10,Global.WindowHeightHalf-40-50-3); textWriting=null; } @@ -5554,8 +5613,8 @@ readonly Color Save(); rocket=true; rocketDown=false; - PlayerX=selectedMashine.X; - PlayerY=selectedMashine.Y; + PlayerX = PlayerXInt = selectedMashine.X; + PlayerY = PlayerYInt = selectedMashine.Y; inventory=0; File.WriteAllText(pathToWorld+"UseRocket.txt",""); Terrain chunk=terrain[selectedMashine.X]; @@ -6065,7 +6124,7 @@ readonly Color break; case (ushort)BlockId.GrassBlockCompost: - chunk.SolidBlocks[chunk.LightPosFull]=new NormalBlock(TextureGrassBlockSnow, (ushort)BlockId.GrassBlockSnowCompost, new Vector2(rid*16, chunk.LightPosFull*16)); + chunk.SolidBlocks[chunk.LightPosFull]=new NormalBlock(TextureGrassBlockSnowCompost, (ushort)BlockId.GrassBlockSnowCompost, new Vector2(rid*16, chunk.LightPosFull*16)); break; case (ushort)BlockId.GrassBlockPlains: @@ -6090,73 +6149,75 @@ readonly Color } } - int rH=FastRandom.Int(125); - if (rH>=chunk.StartSomething) { - if (chunk.IsTopBlocks[rH]) { - ushort id =chunk.TopBlocks[rH].Id; - if (GameMethods.IsLeave(id)) { - switch (id) { - case (ushort)BlockId.SpruceLeaves: - { - LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; - lb.Texture=spruceLeavesWithSnowTexture; - lb.Id=(ushort)BlockId.SpruceLeavesWithSnow; - } - break; - case (ushort)BlockId.AppleBranches: - { - LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; - lb.Texture=TextureBranchesSnow; - lb.Id=(ushort)BlockId.AppleBranchesSnow; - } - break; + for (int u=0; u<2; u++){ + int rH=FastRandom.Int(125); + if (rH>=chunk.StartSomething) { + if (chunk.IsTopBlocks[rH]) { + ushort id =chunk.TopBlocks[rH].Id; + if (GameMethods.IsLeave(id)) { + switch (id) { + case (ushort)BlockId.SpruceLeaves: + { + LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; + lb.Texture=spruceLeavesWithSnowTexture; + lb.Id=(ushort)BlockId.SpruceLeavesWithSnow; + } + break; + case (ushort)BlockId.AppleBranches: + { + LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; + lb.Texture=TextureBranchesSnow; + lb.Id=(ushort)BlockId.AppleBranchesSnow; + } + break; - case (ushort)BlockId.CherryBranches: - { - LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; - lb.Texture=TextureBranchesSnow; - lb.Id=(ushort)BlockId.CherryBranchesSnow; - } - break; + case (ushort)BlockId.CherryBranches: + { + LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; + lb.Texture=TextureBranchesSnow; + lb.Id=(ushort)BlockId.CherryBranchesSnow; + } + break; - case (ushort)BlockId.OakBranches: - { - LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; - lb.Texture=TextureBranchesSnow; - lb.Id=(ushort)BlockId.OakBranchesSnow; - } - break; + case (ushort)BlockId.OakBranches: + { + LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; + lb.Texture=TextureBranchesSnow; + lb.Id=(ushort)BlockId.OakBranchesSnow; + } + break; - case (ushort)BlockId.LindenBranches: - { - LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; - lb.Texture=TextureBranchesSnow; - lb.Id=(ushort)BlockId.LindenBranchesSnow; - } - break; + case (ushort)BlockId.LindenBranches: + { + LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; + lb.Texture=TextureBranchesSnow; + lb.Id=(ushort)BlockId.LindenBranchesSnow; + } + break; - case (ushort)BlockId.WillowBranches: - { - LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; - lb.Texture=TextureBranchesSnow; - lb.Id=(ushort)BlockId.WillowBranchesSnow; - } - break; + case (ushort)BlockId.WillowBranches: + { + LeavesBlock lb = (LeavesBlock)chunk.TopBlocks[rH]; + lb.Texture=TextureBranchesSnow; + lb.Id=(ushort)BlockId.WillowBranchesSnow; + } + break; + } + // chunk.StartSomething--; + //chunk.IsTopBlocks[chunk.StartSomething]=true; + //chunk.TopBlocks[chunk.StartSomething]=new NormalBlock(snowTopTexture, (ushort)BlockId.SnowTop, new Vector2(rid*16, chunk.StartSomething*16)); } - // chunk.StartSomething--; - //chunk.IsTopBlocks[chunk.StartSomething]=true; - //chunk.TopBlocks[chunk.StartSomething]=new NormalBlock(snowTopTexture, (ushort)BlockId.SnowTop, new Vector2(rid*16, chunk.StartSomething*16)); } } - } - if (chunk.IsSolidBlocks[chunk.StartSomething]) { - chunk.StartSomething--; - chunk.IsTopBlocks[chunk.StartSomething]=true; - chunk.TopBlocks[chunk.StartSomething]=new NormalBlock(snowTopTexture, (ushort)BlockId.SnowTop, new Vector2(rid*16, chunk.StartSomething*16)); + if (chunk.IsSolidBlocks[chunk.StartSomething]) { + chunk.StartSomething--; + chunk.IsTopBlocks[chunk.StartSomething]=true; + chunk.TopBlocks[chunk.StartSomething]=new NormalBlock(snowTopTexture, (ushort)BlockId.SnowTop, new Vector2(rid*16, chunk.StartSomething*16)); + } } - } + } } } } @@ -6238,6 +6299,7 @@ readonly Color if (PlayerY>0) { rocket=false; PlayerY=0; + PlayerYInt=0; InventoryAddOne((ushort)Items.Rocket); File.Delete(pathToWorld+"UseRocket.txt"); } @@ -6769,60 +6831,44 @@ readonly Color #region Draw lighting - // Draw full lights + // Draw full lights = to terrain Graphics.SetRenderTarget(sunLightTarget); Graphics.Clear(black); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, SuperSamplingActing==1f ? camera : cameraNoOpMultisapling); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.LinearClamp, transformMatrix: transformMatrixS); foreach (Rectangle r in lightsFull) spriteBatch.Draw(lightMaskLineTexture, r, Color.White); for (int x = terrainStartIndexX>1 ? terrainStartIndexX-2:terrainStartIndexX; x1 ? terrainStartIndexX-2:terrainStartIndexX; x1 ? terrainStartIndexX-2:terrainStartIndexX; x=terrainStartIndexX*16) { @@ -6858,7 +6904,7 @@ readonly Color } } - if (playerLight) spriteBatch.Draw(lightMaskRoundTexture, new Rectangle((int)PlayerX-48*2+8, (int)PlayerY-48*2+8, 96*2, 96*2), lampColorLight); + if (playerLight) spriteBatch.Draw(lightMaskRoundTexture, new Rectangle(PlayerXInt-48*2+8, PlayerYInt-48*2+8, 96*2, 96*2), lampColorLight); spriteBatch.End(); #endregion @@ -7031,9 +7077,6 @@ readonly Color EffectClouds.Parameters["SunAngle"].SetValue(new Vector2((float)Math.Cos(angle)*adder/TextureClouds.Width, (float)Math.Sin(angle)*adder/TextureClouds.Height)); - - // Biome biome=GetBiomeByPos((int)(PlayerX/16)); - if (BiomePlayer.Name!=BiomeCurrent || BiomePlayer.Name==Biome.None) { ColorLastBiome=ColorBiome; TicksPlayerChangedBiome=60; @@ -7069,9 +7112,9 @@ readonly Color #region Background weather if (Setting.SnowAndRain) { - if (/*rain*/actualRainForce>0f) { - // int x, y; - if (SuperSamplingActing!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, null, null, null, MatrixUpScaling/*CameraMatrixNoZoom(out int x, out int y)*/); + if (actualRainForce>0f) { + + if (SuperSamplingActing!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, transformMatrix: MatrixUpScaling); else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); int cx=0; int cy=0; @@ -7090,24 +7133,21 @@ readonly Color #endregion #region Sun & moon - - // if ((int)Setting.AnimationsGame>=(int)Setting.GameAnimations.LowQuality) - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp/*SamplerState.PointClamp*/, DepthStencilState.Default, rasterizerState/*RasterizerState.CullNone*/, null, camera); - // else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap/*SamplerState.PointClamp*/, DepthStencilState.Default, RasterizerState.CullNone, null, camera); - float sunAngle=0; + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, rasterizerState, transformMatrix: camera); + if (Setting.SunAndMoon) { if (time>6.5f*hour && time<18.5f*hour) { - /*float*/ sunAngle=((time-6.5f*hour)/(12*hour))*FastMath.PI+FastMath.PI; // 0 až 1 + float sunAngle=((time-6.5f*hour)/(12*hour))*FastMath.PI+FastMath.PI; // 0 to 1 float c=(Global.WindowWidthHalf18.5f*hour) { - /*float*/ sunAngle=((time-18.5f)/(6f*hour)*FastMath.PI)+FastMath.PI; // 0 až 1 + } else if (time>18.5f*hour) { + float sunAngle=((time-18.5f)/(6f*hour)*FastMath.PI)+FastMath.PI; // 0 to 1 byte colorch=(byte)(1-(dayAlpha-0.5f)*4f*255); float c=(Global.WindowWidthHalfterrainStartIndexY? chunk.StartSomething: terrainStartIndexY; - - for (int y = starts[x]/*chunk.StartSomething>terrainStartIndexY? chunk.StartSomething: terrainStartIndexY*/; yterrainStartIndexY ? chunk.StartSomething : terrainStartIndexY; - //blocks[y].Draw(); - if (chunk.IsBackground[y]) chunk.Background[y]?.Draw(); + for (int y = starts[x]; yterrainStartIndexY? chunk.StartSomething: terrainStartIndexY*/; y0f) { - if (SuperSamplingActing!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, MatrixUpScaling/*CameraMatrixNoZoom(out int x, out int y)*/); + if (SuperSamplingActing!=1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, transformMatrix: MatrixUpScaling); else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); Rabcr.spriteBatch=spriteBatch; - //if (Temperature<0f) { - // Color c=Color.White*actualRainForce; - // foreach (ParticleSnow r in snowDots2) - // r.Draw(x, y, c); - //} else { - // if (Setting.BetterSnowAndRain) - // foreach (ParticleRain r in rainDots2) r.DrawBetterQuality(x, y,actualRainForce); - // else foreach (ParticleRain r in rainDots2) r.Draw(x, y, actualRainForce); - //} - int x=0,y=0; - // x = ((int)(WindowCenterX + 0.5f)) - (int)(Global.WindowWidthHalf / Setting.Zoom); - // y = ((int)(WindowCenterY + 0.5f)) - (int)(Global.WindowHeightHalf / Setting.Zoom); + + int x=0, y=0; + if (Temperature<0f) { Color c=Color.White*actualRainForce; - foreach (ParticleSnow r in snowDots2) - r.Draw(x, y, c); + foreach (ParticleSnow r in snowDots2) r.Draw(x, y, c); } else { - if (Setting.BetterSnowAndRain) - foreach (ParticleRain r in rainDots2) r.DrawBetterQuality(x, y,actualRainForce); + if (Setting.BetterSnowAndRain) foreach (ParticleRain r in rainDots2) r.DrawBetterQuality(x, y, actualRainForce); else foreach (ParticleRain r in rainDots2) r.Draw(x, y, actualRainForce); } spriteBatch.End(); @@ -7293,19 +7326,18 @@ readonly Color #endregion - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, transformMatrix: camera); + #region SolidBlocks - for (int x = terrainStartIndexX; xterrainStartIndexY? chunk.StartSomething: terrainStartIndexY*/; y Rectangle curImg=new(playerImg/22*39, 0, 39, 20); - Vector2 vector=new(PlayerX-11-15-3, PlayerY+8); - Vector2 vectorHead=new(PlayerX-11+46/2, PlayerY+8); - Vector2 vectorChest=new(PlayerX-11-22+44, PlayerY+8+2-3+2); + Vector2 vector=new(PlayerXInt-11-15-3, PlayerYInt+8); + Vector2 vectorHead=new(PlayerXInt-11+46/2, PlayerYInt+8); + Vector2 vectorChest=new(PlayerXInt-11-22+44, PlayerYInt+8+2-3+2); Vector2 rameno=new(vector.X-11+2+1+27/2-2+7+20, vector.Y-39/2+12-1+38/2); handAngle=swimmingTicks*2*FastMath.PI; @@ -7604,7 +7636,7 @@ readonly Color switch (playerState) { default: { - Vector2 vector=new((int)PlayerX-11, (int)PlayerY-(int)(39*0.5f)); + Vector2 vector=new(PlayerXInt-11, PlayerYInt-(int)(39*0.5f)); Vector2 pointing=new(mouseRealPosX-Global.WindowWidthHalf, mouseRealPosY-Global.WindowHeightHalf); Vector2 rameno=new(vector.X-11+2+1+27/2-2, vector.Y-39/2+12-1+38/2); @@ -7662,67 +7694,151 @@ readonly Color if (ClothesHead!=null) spriteBatch.Draw(ClothesHead.TextureStatic, vector, ClothesHead.Color); if (ClothesChestTop == null) { - if (ClothesChest == null)DrawItemInHand(null, Color.White, 0); + if (ClothesChest == null) DrawItemInHand(null, Color.White, 0); else DrawItemInHand(ClothesChest?.Texture2DClothHand, ClothesChest.Color, (int)ClothesChest?.handSize); } else DrawItemInHand(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color, (int)ClothesChestTop.handSize); void DrawItemInHand(Texture2D texCloth, Color colorCloth, int size) { - Rectangle recHand= new(0,0,4,HandSize-size), recCloth=new(0,0,4,size); + Rectangle + recHand= new(0, 0, 4, HandSize-size), + recCloth=new(0,0,4,size); Vector2 vecOrigin=new(2,2-size); - spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); - if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None, 1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None, 1f); // Right rameno.X+=17; - spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, 0, vecOrigin, 1, SpriteEffects.None,1f); - if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, 0, Vector2_2, 1, SpriteEffects.None,1f); + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, 0, vecOrigin, 1, SpriteEffects.None, 1f); + if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, 0, Vector2_2, 1, SpriteEffects.None, 1f); rameno.X-=17; if (InventoryNormal[boxSelected]!=null){ if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new( + Vector2 recItem=new( (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), - (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), - 8, - 8 + (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4) + //8, + //8 ); switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + texture: i.Texture, + position: recItem, + sourceRectangle: null, + color: Color.White, + rotation: 0f, + scale: 0.5f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f + ); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + texture: i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvBasicColoritzed32NonStackable i: - spriteBatch.Draw(i.Texture, recItem, i.color); + spriteBatch.Draw( + texture: i.Texture, + recItem, + sourceRectangle: null, + i.color, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + texture: i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; #if DEBUG @@ -7739,7 +7855,7 @@ readonly Color case 2://-> { Rectangle curImg=new((playerImg/20)*20, 0, 20, 39); - Vector2 vector=new(PlayerX-11, PlayerY-39/2); + Vector2 vector=new(PlayerXInt-11, PlayerYInt-39/2); Vector2 rameno=new(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); int ticks=gameTime.TotalGameTime.Milliseconds; @@ -7882,9 +7998,8 @@ readonly Color case 1://<- { Rectangle curImg=new((playerImg/20)*20, 0, 20, 39); - // Rectangle curImg2=new Rectangle((playerImg2/20)*20, 0, 20, 39); - Vector2 vector=new(PlayerX-11, PlayerY-39/2); + Vector2 vector=new(PlayerXInt-11, PlayerYInt-39/2); Vector2 rameno=new(vector.X-11+2+1+27/2-2+7, vector.Y-39/2+12-1+38/2+1); int ticks=gameTime.TotalGameTime.Milliseconds; @@ -8059,60 +8174,40 @@ readonly Color spriteBatch.Draw(targetGame2, Fullscreen, color: Color.White); spriteBatch.End(); } - //else if (SuperSamplingActing == 8f) { - // //Graphics.SetRenderTarget(targetGame2); - // //spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); - // //spriteBatch.Draw(targetGame, new Rectangle(0, 0, Global.WindowWidth*4, Global.WindowHeight*4), color: Color.White); - // //spriteBatch.End(); - - // //Graphics.SetRenderTarget(targetGame4); - // //spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); - // //spriteBatch.Draw(targetGame2, new Rectangle(0, 0, Global.WindowWidth*2, Global.WindowHeight*2), color: Color.White); - // //spriteBatch.End(); - - // Graphics.SetRenderTarget(null); - // spriteBatch.Begin(sortMode: SpriteSortMode.Immediate, samplerState: SamplerState.LinearWrap); - // spriteBatch.Draw(targetGame/*4*/, Fullscreen, color: Color.White); - // spriteBatch.End(); - // } // Draw lighting on game spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: Multiply, samplerState: SamplerState.PointWrap); - spriteBatch.Draw(texture: modificatedLightTarget, Fullscreen, color: Color.White); + spriteBatch.Draw(texture: sunLightTarget, Fullscreen, color: Color.White); spriteBatch.End(); #endregion #region Vignetting if (Setting.Vignetting) { - //spriteBatch.End(); float WSize, HSize; if (Global.WindowWidth>Global.WindowHeight) { - WSize= ((Global.WindowHeight+Global.WindowWidth)/4f)/Global.WindowHeightHalf; - HSize= 1f; + WSize = ((Global.WindowHeight+Global.WindowWidth)/4f)/Global.WindowHeightHalf; + HSize = 1f; } else { - WSize=1f; - HSize=((Global.WindowHeight+Global.WindowWidth)/4f) / Global.WindowWidthHalf; + WSize = 1f; + HSize = ((Global.WindowHeight+Global.WindowWidth)/4f) / Global.WindowWidthHalf; } EffectVignetting.Parameters["WSize"].SetValue(WSize); EffectVignetting.Parameters["HSize"].SetValue(HSize); EffectVignetting.Parameters["Intensity"].SetValue(0.1f); if (SuperSamplingActing==1f) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, effect: EffectVignetting); - else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, effect: EffectVignetting/*, MatrixUpScaling*/); + else spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, effect: EffectVignetting); - //spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearClamp, null, null, EffectVignetting, Setting.UpScalingSuperSapling!=1f ? MatrixUpScaling : null); EffectVignetting.Techniques[0].Passes[0].Apply(); spriteBatch.Draw(pixel, Fullscreen, Color.White); spriteBatch.End(); - - // spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera); } #endregion #region Draw inv if (showInventory) { - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap/*,DepthStencilState.Default,RasterizerState.CullNone,null,null*/); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap); Rabcr.spriteBatch=spriteBatch; #region Draw Bars if (Global.WorldDifficulty!=2) { @@ -8121,27 +8216,6 @@ readonly Color barEnergy.Draw(); barHeart.Draw(); barWater.Draw(); - - //int barE=(int)barEnergy, barO=(int)barOxygen, barW=(int)barWater, barEa=(int)barEat, barH=(int)barHeart; - //// Energy bar - //spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36, 8), new Rectangle(0,0,32,barE),ColorGray); - //spriteBatch.Draw(barEnergyTexture,new Vector2(Global.WindowWidth-150-36, 8+barE), new Rectangle(0,barE,32,32-barE),Color.White); - - //// Oxygen bar - //spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8), new Rectangle(0,0,32,barO),ColorGray); - //spriteBatch.Draw(barOxygenTexture,new Vector2(Global.WindowWidth-150,8+barO), new Rectangle(0,barO,32,32-barO), Color.White); - - //// Water bar - //spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8),new Rectangle(0,0,32,barW),ColorGray); - //spriteBatch.Draw(barWaterTexture,new Vector2(Global.WindowWidth-114,8+barW),new Rectangle(0,barW,32,32-barW),Color.White); - - //// Eat bar - //spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8),new Rectangle(0,0,32,barEa),ColorGray); - //spriteBatch.Draw(barEatTexture,new Vector2(Global.WindowWidth-78,8+barEa),new Rectangle(0,barEa,32,32-barEa),Color.White); - - //// Heart bar - //spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8), new Rectangle(0,0,32,barH),ColorGray); - //spriteBatch.Draw(barHeartTexture,new Vector2(Global.WindowWidth-40,8+barH), new Rectangle(0,barH,32,32-barH),Color.White); } #endregion @@ -8157,7 +8231,8 @@ readonly Color if (Command()){ ///text="";diserpeard=0; }else{ - text="Unknown command";diserpeard=255; + text="Unknown command"; + diserpeard=255; } } //if (text.StartsWith("*time-set ")) { @@ -8205,7 +8280,7 @@ readonly Color } int meas=BitmapFont.bitmapFont18.MeasureTextSingleLineX(gedo.Text); int texts=meas/2; - int x=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); + int x=Global.WindowWidthHalf+(PlayerXInt-(int)WindowCenterX); gedo.SetPos(x-texts+20-10-5,Global.WindowHeightHalf-40-50-4); if (diserpeard>100) { spriteBatch.Draw(messageLeft,new Vector2(x-texts-10,Global.WindowHeightHalf-55-50), Color.White); @@ -8244,7 +8319,7 @@ readonly Color #region Writing message case InventoryType.Typing: { - int xx=Global.WindowWidthHalf+((int)PlayerX-(int)WindowCenterX); + int xx=Global.WindowWidthHalf+(PlayerXInt-(int)WindowCenterX); int half=textWriting.MeasureX/2; spriteBatch.Draw(messageLeft,new Vector2(xx-half-10,Global.WindowHeightHalf-55-50), Color.White); @@ -8436,8 +8511,9 @@ readonly Color spriteBatch.Draw(furnaceStoneTexture, new Rectangle(Global.WindowWidthHalf-300+4, Global.WindowHeightHalf-200+2+4, 200, 200),new Rectangle(energy>0 ?0 :16,0,16,16), Color.White); spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-2, Global.WindowHeightHalf-200+2+4-6,202+2,5),black); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1, Global.WindowHeightHalf-200+2+4-5,(int)(energy*2.02*100),3),Color.Green); - spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1+(int)(energy*2.02*100),Global.WindowHeightHalf-200+2+4-5,202-(int)(energy*2.02*100),3),Color.Red); + int Ebar=(int)(energy*2.02*100); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1, Global.WindowHeightHalf-200+2+4-5, Ebar,3), Color.Green); + spriteBatch.Draw(pixel,new Rectangle(Global.WindowWidthHalf-300+4-1+Ebar, Global.WindowHeightHalf-200+2+4-5, 202-Ebar, 3), Color.Red); textOpenInventory.Draw(spriteBatch); DrawInventoryWithMoving(); @@ -9871,7 +9947,7 @@ readonly Color #region Get food if (chunk.IsTopBlocks[y]) { - if (Global.WorldDifficulty!=1 || FastMath.DistanceInt(mousePosDiv16.X,mousePosDiv16.Y,PlayerX,PlayerY) < 8*16){ + if (Global.WorldDifficulty!=1 || FastMath.DistanceInt(mousePosDiv16.X, mousePosDiv16.Y, PlayerXInt, PlayerYInt) < 8*16) { switch (chunk.TopBlocks[y].Id) { case (ushort)BlockId.BucketWithLatex: DropItemFromLeaves((ushort)BlockId.BucketForRubber, (ushort)Items.Resin,TextureBucketForRubber); @@ -10081,7 +10157,7 @@ readonly Color return; } - if (FastMath.Distance(mousePosRoundX, mousePosRoundY, PlayerX, PlayerY) < 5*16) { + if (FastMath.Distance(mousePosRoundX, mousePosRoundY, PlayerXInt, PlayerYInt) < 5*16) { if (chunk.IsTopBlocks[y]) { switch (chunk.TopBlocks[y].Id) { case (ushort)BlockId.Desk: @@ -10221,7 +10297,7 @@ readonly Color #endregion #region Place block - if (FastMath.DistanceInt(mousePosRoundX,mousePosRoundY,(int)PlayerX, (int)PlayerY) new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, (ushort)BlockId.GrassBlockSnowPlains => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, (ushort)BlockId.GrassBlockSnowClay => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, - (ushort)BlockId.GrassBlockSnowCompost => new NormalBlock { Texture = TextureGrassBlockSnow, Id = type, Position = position }, + (ushort)BlockId.GrassBlockSnowCompost => new NormalBlock { Texture = TextureGrassBlockSnowCompost, Id = type, Position = position }, // Artifical (ushort)BlockId.Roof1 => new NormalBlock { Texture = roof1Texture, Id = type, Position = position }, (ushort)BlockId.Roof2 => new NormalBlock { Texture = roof2Texture, Id = type, Position = position }, @@ -16620,10 +16704,10 @@ readonly Color #region Player bool CheckLadder() { - int yFrom=(int)PlayerY/16, - yTo=((int)PlayerY+39/2+16)/16, - xFrom=((int)PlayerX-16)/16, - xTo=((int)PlayerX+22)/16; + int yFrom=PlayerYInt/16, + yTo=(PlayerYInt+39/2+16)/16, + xFrom=(PlayerXInt-16)/16, + xTo=(PlayerXInt+22)/16; if (yFrom<0)yFrom=0; if (yTo>124)yTo=124; @@ -16644,17 +16728,17 @@ readonly Color } bool CheckWater() { - for (int x=((int)PlayerX-16)/16; x<((int)PlayerX+22)/16; x++) { + for (int x=(PlayerXInt-16)/16; x<(PlayerXInt+22)/16; x++) { Terrain chunk=terrain[x]; - for (int y=((int)PlayerY)/16; y<((int)PlayerY+39/2+16)/16; y++) { + for (int y=(PlayerYInt)/16; y<(PlayerYInt+39/2+16)/16; y++) { if (y>0 && y<125 && x>0 && x1) return true; + if (((Water)chunk.TopBlocks[y]).GetMass>15) return true; } if (chunk.TopBlocks[y].Id==(ushort)BlockId.WaterSalt) { - if (((Water)chunk.TopBlocks[y]).GetMass>1) return true; + if (((Water)chunk.TopBlocks[y]).GetMass>15) return true; } } } @@ -16664,10 +16748,10 @@ readonly Color } bool CheckWaterDown() {//!!! walking on waves - for (int x=((int)PlayerX-16)/16; x<((int)PlayerX+22)/16; x++) { + for (int x=(PlayerXInt-16)/16; x<(PlayerXInt+22)/16; x++) { Terrain chunk=terrain[x]; - for (int y=((int)PlayerY+39/2+16-1)/16; y<((int)PlayerY+39/2+16+16+1)/16; y++) { + for (int y=(PlayerYInt+39/2+16-1)/16; y<(PlayerYInt+39/2+16+16+1)/16; y++) { if (y>0 && y<125 && x>0 && x0 && y<125 && x>0 && x124)Yto=124; @@ -16723,10 +16808,10 @@ readonly Color distanceToGround=100000; - int Yfrom=((int)PlayerY+20-16)/16, - Yto=((int)PlayerY+20-16)/16+6, - Xfrom=((int)PlayerX-11)/16, - Xto=((int)PlayerX+11+16)/16; + int Yfrom=(PlayerYInt+20-16)/16, + Yto=(PlayerYInt+20-16)/16+6, + Xfrom=(PlayerXInt-11)/16, + Xto=(PlayerXInt+11+16)/16; if (Yfrom<0)Yfrom=0; if (Yto>124)Yto=124; @@ -16736,8 +16821,8 @@ readonly Color // if (chunk!=null) { for (int y = Yfrom; y=0) { - for (int xx = ((int)PlayerX-11)/16; xx<(PlayerX+11/*+16*/)/16; xx++) { + for (int xx = (PlayerXInt-11)/16; xx<(PlayerXInt+11/*+16*/)/16; xx++) { Terrain chunk=terrain[xx]; if (chunk!=null) { if (chunk.IsSolidBlocks[yy]) { gravitySpeed=0; - blocks.Add(new DInt(xx,yy)); + blocks.Add(new DInt(xx, yy)); break; } } @@ -16779,6 +16864,9 @@ readonly Color if (distanceToGround<=6 && gravitySpeed>0) { PlayerY+=distanceToGround; + PlayerYInt=(int)PlayerY; + + PlayerYInt+=distanceToGround; changePosition=true; @@ -16790,11 +16878,13 @@ readonly Color gravitySpeed+=gravity/5f; if (gravitySpeed>1)gravitySpeed=1; PlayerY+=(int)gravitySpeed; + PlayerYInt=(int)PlayerY; changePosition=true; } else { gravitySpeed+=gravity; if (gravitySpeed>6)gravitySpeed=6; PlayerY+=(int)gravitySpeed; + PlayerYInt=(int)PlayerY; changePosition=true; } } @@ -16829,6 +16919,8 @@ readonly Color ) ) * Translation; // } + + transformMatrixS=SuperSamplingActing==1f ? camera : cameraNoOpMultisapling; return; //} @@ -16891,8 +16983,11 @@ readonly Color PlayerX=x; PlayerY=y; - WindowXPlayer = PlayerX-1; - WindowYPlayer =PlayerY-1; + PlayerXInt=(int)PlayerX; + PlayerYInt=(int)PlayerY; + + WindowXPlayer = PlayerX-1f; + WindowYPlayer = PlayerY-1f; WindowX=(int)x-Global.WindowWidthHalf; WindowY=(int)y-Global.WindowHeightHalf; @@ -17477,11 +17572,11 @@ readonly Color void InvDrop() { if (mouseRealPosX list) { foreach (Item i in list) { - if (i.X>PlayerX-11-16) { - if (i.XPlayerY-20) { - if (i.YPlayerXInt-11-16) { + if (i.XPlayerYInt-20) { + if (i.Y=TerrainLength)max=TerrainLength; - int start=(int)PlayerX/16-blocks; + int start = PlayerXInt/16-blocks; if (start<0)start=0; - + Terrain chunk; for (int ix=start; ix Date: Sat, 22 Jan 2022 11:22:32 +0100 Subject: [PATCH 47/55] hand item pos --- rabcrClient/InterLogic/Game/GameMethods.cs | 94 +++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/rabcrClient/InterLogic/Game/GameMethods.cs b/rabcrClient/InterLogic/Game/GameMethods.cs index 7acac07..5317d51 100644 --- a/rabcrClient/InterLogic/Game/GameMethods.cs +++ b/rabcrClient/InterLogic/Game/GameMethods.cs @@ -201,7 +201,98 @@ public class CraftingOut { } static class GameMethods { + public static Vector2 EditMouseItemPos(ushort id){ + switch (id) { + case (ushort)Items.PickaxeAluminium: return new Vector2(8, 8); + case (ushort)Items.PickaxeBronze: return new Vector2(8, 8); + case (ushort)Items.PickaxeCopper: return new Vector2(8, 8); + case (ushort)Items.PickaxeGold: return new Vector2(8, 8); + case (ushort)Items.PickaxeIron: return new Vector2(8, 8); + case (ushort)Items.PickaxeSteel: return new Vector2(8, 8); + case (ushort)Items.PickaxeStone: return new Vector2(8, 8); + + case (ushort)Items.ShovelAluminium: return new Vector2(8, 8); + case (ushort)Items.ShovelBronze: return new Vector2(8, 8); + case (ushort)Items.ShovelCopper: return new Vector2(8, 8); + case (ushort)Items.ShovelGold: return new Vector2(8, 8); + case (ushort)Items.ShovelIron: return new Vector2(8, 8); + case (ushort)Items.ShovelSteel: return new Vector2(8, 8); + case (ushort)Items.ShovelStone: return new Vector2(8, 8); + + case (ushort)Items.HoeAluminium: return new Vector2(8, 8); + case (ushort)Items.HoeBronze: return new Vector2(8, 8); + case (ushort)Items.HoeCopper: return new Vector2(8, 8); + case (ushort)Items.HoeGold: return new Vector2(8, 8); + case (ushort)Items.HoeIron: return new Vector2(8, 8); + case (ushort)Items.HoeSteel: return new Vector2(8, 8); + case (ushort)Items.HoeStone: return new Vector2(8, 8); + + case (ushort)Items.KnifeAluminium: return new Vector2(8, 8); + case (ushort)Items.KnifeBronze: return new Vector2(8, 8); + case (ushort)Items.KnifeCopper: return new Vector2(8, 8); + case (ushort)Items.KnifeGold: return new Vector2(8, 8); + case (ushort)Items.KnifeIron: return new Vector2(8, 8); + case (ushort)Items.KnifeSteel: return new Vector2(8, 8); + + case (ushort)Items.SawAluminium: return new Vector2(10, 6); + case (ushort)Items.SawBronze: return new Vector2(10, 6); + case (ushort)Items.SawCopper: return new Vector2(10, 6); + case (ushort)Items.SawGold: return new Vector2(10, 6); + case (ushort)Items.SawIron: return new Vector2(10, 6); + case (ushort)Items.SawSteel: return new Vector2(10, 6); + + case (ushort)Items.AxeAluminium: return new Vector2(8, 8); + case (ushort)Items.AxeBronze: return new Vector2(8, 8); + case (ushort)Items.AxeCopper: return new Vector2(8, 8); + case (ushort)Items.AxeGold: return new Vector2(8, 8); + case (ushort)Items.AxeIron: return new Vector2(8, 8); + case (ushort)Items.AxeSteel: return new Vector2(8, 8); + + + case (ushort)Items.HammerAluminium: return new Vector2(8, 8); + case (ushort)Items.HammerBronze: return new Vector2(8, 8); + case (ushort)Items.HammerCopper: return new Vector2(8, 8); + case (ushort)Items.HammerGold: return new Vector2(8, 8); + case (ushort)Items.HammerIron: return new Vector2(8, 8); + case (ushort)Items.HammerSteel: return new Vector2(8, 8); + + case (ushort)Items.ElectricDrill: return new Vector2(9, 9); + case (ushort)Items.ElectricDrillOff: return new Vector2(9, 9); + case (ushort)Items.ElectricSaw: return new Vector2(9, 9); + case (ushort)Items.ElectricSawOff: return new Vector2(9, 9); + case (ushort)Items.Gun: return new Vector2(3, 3); + case (ushort)Items.TorchElectricON: return new Vector2(3, 3); + + case (ushort)Items.ShearsAluminium: return new Vector2(6, 4); + case (ushort)Items.ShearsBronze: return new Vector2(6, 4); + case (ushort)Items.ShearsCopper: return new Vector2(6, 4); + case (ushort)Items.ShearsGold: return new Vector2(6, 4); + case (ushort)Items.ShearsIron: return new Vector2(6, 4); + case (ushort)Items.ShearsSteel: return new Vector2(6, 4); + } + return Vector2.Zero; + } + + public static float EditMouseItemScale(ushort id){ + switch (id) { + case (ushort)Items.Gun: return 0.35f; + case (ushort)Items.TorchElectricON: return 0.35f; + } + return 0.5f; + } + public static bool EditMouseItemFlip(ushort id){ + switch (id) { + case (ushort)Items.HammerAluminium: return true; + case (ushort)Items.HammerBronze: return true; + case (ushort)Items.HammerCopper: return true; + case (ushort)Items.HammerGold: return true; + case (ushort)Items.HammerIron: return true; + case (ushort)Items.HammerSteel: return true; + case (ushort)Items.Gun: return true; + } + return false; + } public static bool IsHalfShadowBlock(ushort id) => id switch { @@ -1392,7 +1483,8 @@ public static ushort MobFromItem(ushort item) (ushort)BlockId.GrassBlockPlains, (ushort)BlockId.RedSand, (ushort)BlockId.Regolite, - (ushort)BlockId.Cobblestone + (ushort)BlockId.Cobblestone, + (ushort)BlockId.Compost }; public static bool IsFallingBlock(ushort blockId) { From c69b6639884829cba0c7485fb1be6b05f55e23fc Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:22:57 +0100 Subject: [PATCH 48/55] add soundeffect load --- rabcrClient/InterLogic/Graphics/Screen/Screen.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rabcrClient/InterLogic/Graphics/Screen/Screen.cs b/rabcrClient/InterLogic/Graphics/Screen/Screen.cs index 5956b5b..243b11f 100644 --- a/rabcrClient/InterLogic/Graphics/Screen/Screen.cs +++ b/rabcrClient/InterLogic/Graphics/Screen/Screen.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using Microsoft.Xna.Framework.Media; +using Microsoft.Xna.Framework.Audio; namespace rabcrClient { public abstract class Screen: IDisposable { @@ -35,6 +36,7 @@ public abstract class Screen: IDisposable { public virtual void Resize() { } public Texture2D GetDataTexture(string path) => Content.Load(fastloadtexturespath+path); + public SoundEffect GetDataSoundEffect(string path) => Content.Load(Setting.StyleName+"/SoundEffects/"+path); public Song GetDataSong(string path) => Content.Load(Setting.StyleName+"/Songs/"+path); From c5d6ba1c1b4b0a2ca66220f950dbcd850ce5350c Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:23:18 +0100 Subject: [PATCH 49/55] smooth lights --- rabcrClient/InterLogic/Graphics/Background.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rabcrClient/InterLogic/Graphics/Background.cs b/rabcrClient/InterLogic/Graphics/Background.cs index a322207..32f8b7a 100644 --- a/rabcrClient/InterLogic/Graphics/Background.cs +++ b/rabcrClient/InterLogic/Graphics/Background.cs @@ -387,9 +387,9 @@ readonly Texture2D #region Draw lighting Graphics.SetRenderTarget(fogTarget); Graphics.Clear(Color.Black); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive,SamplerState.PointClamp, null, null, null, camera); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.LinearClamp, null, null, null, camera); - for (int x= startIndex; x Date: Sat, 22 Jan 2022 11:23:39 +0100 Subject: [PATCH 50/55] updated --- .../GameStates/Game/Singleplayer.cs | 1510 +++++++++-------- 1 file changed, 846 insertions(+), 664 deletions(-) diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs index ae18280..f51a78a 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs @@ -11,13 +11,143 @@ namespace rabcrClient { class SinglePlayer: Screen { + + #region Varibles + Color FogColor=Color.Transparent; + RasterizerState rasterizerState; + const float noon=(dayEnd-(dayStart+1))*hour; + Color black50=new(0,0,0,50); + int invertedMouseValue; + #region Weather changes + void StopRaining() { + if (Global.HasSoundGraphics) { + if (SoundRain.IsLooped){ + SoundRain.IsLooped=false; + SoundRain.Stop(); + } + } + } + + void StartRaining() { + if (Global.HasSoundGraphics) { + if (!SoundRain.IsLooped){ + SoundRain.Play(); + SoundRain.IsLooped=true; + } + } + } + + void StopSnowing() { + + } + + void StartSnowing() { + for (int i2=0; i2 pathToWorld=dir+"\\"; - RasterizerState rasterizerState; - const float noon=(dayEnd-(dayStart+1))*hour; - Color black50=new Color(0,0,0,50); - Matrix transformMatrixS; - void SetSuperSampling() { - // No SSAA - if (Setting.UpScalingSuperSapling==1f) { - SuperSamplingActing=1f; - SetOther(); - return; - } - - // Pixelizer SSAA - if (Setting.UpScalingSuperSapling<1f) { - SuperSamplingActing=1f/Setting.Zoom; - targetGame?.Dispose(); - targetGame=new RenderTarget2D(Graphics, - (int)(Global.WindowWidth*SuperSamplingActing), - (int)(Global.WindowHeight*SuperSamplingActing), - false, - SurfaceFormat.Color, - DepthFormat.Depth24, - 1, - RenderTargetUsage.PlatformContents); - SetOther(); - return; - } - - float maxUpscaling=20f; - if (Graphics.GraphicsProfile==GraphicsProfile.HiDef) { - float scale = 8192f/Global.WindowWidth; - if (scale=Setting.UpScalingSuperSapling) { - SuperSamplingActing=2f; - targetGame?.Dispose(); - targetGame=new RenderTarget2D( - Graphics, - Global.WindowWidth*2, - Global.WindowHeight*2, - false, - SurfaceFormat.Color, - DepthFormat.Depth24Stencil8, - 1, - RenderTargetUsage.PlatformContents - ); - SetOther(); - return; - } else { - SuperSamplingActing=1f; - targetGame?.Dispose(); - SetOther(); - return; - } - } - - if (Setting.UpScalingSuperSapling==4f) { - if (maxUpscaling>=4f) { - SuperSamplingActing=4f; - - targetGame?.Dispose(); - targetGame=new RenderTarget2D( - Graphics, - Global.WindowWidth*4, - Global.WindowHeight*4, - false, - SurfaceFormat.Color, - DepthFormat.Depth24Stencil8, - 1, - RenderTargetUsage.PlatformContents - ); - - targetGame2?.Dispose(); - targetGame2=new RenderTarget2D( - Graphics, - Global.WindowWidth*2, - Global.WindowHeight*2, - false, - SurfaceFormat.Color, - DepthFormat.Depth24Stencil8, - 1, - RenderTargetUsage.PlatformContents - ); - SetOther(); - return; - } else { - if (maxUpscaling>=2f) { - SuperSamplingActing=2f; - - targetGame?.Dispose(); - targetGame=new RenderTarget2D( - Graphics, - Global.WindowWidth*2, - Global.WindowHeight*2, - false, - SurfaceFormat.Color, - DepthFormat.Depth24Stencil8, - 1, - RenderTargetUsage.PlatformContents - ); - - targetGame2?.Dispose(); - SetOther(); - return; - } else { - SuperSamplingActing=1f; - targetGame?.Dispose(); - targetGame2?.Dispose(); - SetOther(); - return; - } - } - } - - void SetOther() { - ZoomMatrix = Matrix.CreateScale(Setting.Zoom*SuperSamplingActing, Setting.Zoom*SuperSamplingActing, 0); - ZoomMatrixNoUpScaling = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); - - if (SuperSamplingActing!=1f) MatrixUpScaling = Matrix.CreateScale(SuperSamplingActing, SuperSamplingActing, 0); - Translation = ZoomMatrix*Matrix.CreateTranslation(new Vector3( - Global.WindowWidthHalf*SuperSamplingActing, - Global.WindowHeightHalf*SuperSamplingActing, - 0)); - - TranslationNoOpMultisapling = ZoomMatrixNoUpScaling*Matrix.CreateTranslation(new Vector3( - Global.WindowWidthHalf, - Global.WindowHeightHalf, - 0)); - - } - - //if (Setting.UpScalingSuperSapling==8f) { - // if (maxUpscaling>=Setting.UpScalingSuperSapling) { - // SuperSamplingActing=Setting.UpScalingSuperSapling; - - // targetGame?.Dispose(); - // targetGame=new RenderTarget2D( - // Graphics, - // Global.WindowWidth*8, - // Global.WindowHeight*8, - // false, - // SurfaceFormat.Color, - // DepthFormat.Depth24, - // 1, - // RenderTargetUsage.PlatformContents - // ); - - // targetGame2?.Dispose(); - // targetGame2=new RenderTarget2D( - // Graphics, - // Global.WindowWidth*4, - // Global.WindowHeight*4, - // false, - // SurfaceFormat.Color, - // DepthFormat.Depth24, - // 1, - // RenderTargetUsage.PlatformContents - // ); - - // targetGame4?.Dispose(); - // targetGame4=new RenderTarget2D( - // Graphics, - // Global.WindowWidth*2, - // Global.WindowHeight*2, - // false, - // SurfaceFormat.Color, - // DepthFormat.Depth24, - // 1, - // RenderTargetUsage.PlatformContents - // ); - // return; - // } else { - // if (maxUpscaling>=4f) { - // SuperSamplingActing=4f; - // targetGame?.Dispose(); - // targetGame=new RenderTarget2D( - // Graphics, - // Global.WindowWidth*4, - // Global.WindowHeight*4, - // false, - // SurfaceFormat.Color, - // DepthFormat.Depth24, - // 1, - // RenderTargetUsage.PlatformContents - // ); - - // targetGame2?.Dispose(); - // targetGame2=new RenderTarget2D( - // Graphics, - // Global.WindowWidth*2, - // Global.WindowHeight*2, - // false, - // SurfaceFormat.Color, - // DepthFormat.Depth24, - // 1, - // RenderTargetUsage.PlatformContents - // ); - - // targetGame4?.Dispose(); - // } else if (maxUpscaling>=2f) { - // SuperSamplingActing=2f; - // targetGame?.Dispose(); - // targetGame=new RenderTarget2D( - // Graphics, - // (int)(Global.WindowWidth*SuperSamplingActing), - // (int)(Global.WindowHeight*SuperSamplingActing), - // false, - // SurfaceFormat.Color, - // DepthFormat.Depth24, - // 1, - // RenderTargetUsage.PlatformContents - // ); + ushort destroingBlockType; - // targetGame2?.Dispose(); - // targetGame4?.Dispose(); - // return; - // } else { - // SuperSamplingActing=1f; - // targetGame?.Dispose(); - // targetGame2?.Dispose(); - // targetGame4?.Dispose(); - // return; - // } - // } - //} - } + const int DistanceBlockEdit=200; + #endregion + + #region Fonts + //SpriteFont spriteFont_small, + // spriteFont_small_italic, + // spriteFont_medium; + #endregion + + #region Colors + readonly Color + color_r200_g200_b200_a100= new((byte)200,(byte)200,(byte)200,(byte)100), + color_r0_g0_b0_a200 = new((byte)0,(byte)0,(byte)0,(byte)200), + color_r10_g140_b255 = new((byte)10,(byte)140,(byte)255), + color_r128_g128_b128= new((byte)128,(byte)128,(byte)128), + color_r128_g128_b128_a128= new((byte)128,(byte)128,(byte)128,(byte)128), + color_r150_g150_b150= new((byte)150,(byte)150,(byte)150), + color_r0_g0_b0_a100 = new((byte)0,(byte)0,(byte)0,(byte)100), + color_r255_g0_b0_a100 = new((byte)255, (byte)0, (byte)0, (byte)100), + color_r200_g200_b200=new((byte)200, (byte)200, (byte)200), + lampColorLight=new((byte)255, (byte)255, (byte)220, (byte)255); + #endregion + + #region Other + int walkingSoundDuration; + // Vector2 vector_x0_y4; + #endregion + #endregion + public SinglePlayer(string dir) => pathToWorld=dir+"\\"; public unsafe override void Init() { invertedMouseValue = Setting.InvertedMouse ? -1 : 1; // SuperSamplingActing=(Setting.UpScalingSuperSapling<=0) ? 1f/Setting.Zoom :Setting.UpScalingSuperSapling; //Setting.UpScalingSuperSapling=1.00001f; // Setting.Multisapling=16; - + SoundEffects.Shot=GetDataSoundEffect("Shot"); FallingLeaves=new List(); Particles=new List(); WavingPlants=new List(); @@ -3430,7 +3198,7 @@ readonly Color colorAlpha=new Color(dayAlpha, dayAlpha, dayAlpha, dayAlpha); if (world=="Space station") { - PlayerX=1500*16; + PlayerXInt=1500*16; changePosition=true; } @@ -3547,7 +3315,7 @@ readonly Color } - BiomePlayer=GetBiomeByPos((int)(PlayerX*divider_16)); + BiomePlayer=GetBiomeByPos((int)(PlayerXInt*divider_16)); BiomeCurrent=BiomePlayer.Name; GC.Collect(); @@ -3890,6 +3658,7 @@ readonly Color } } #endregion + if (precipitation) { float bef=Temperature; Temperature=GetTemperature(BiomePlayer.Name); @@ -3976,33 +3745,33 @@ readonly Color } if (rocket) { - if (rocketDown) PlayerY+=8; - else PlayerY-=10; - PlayerYInt=(int)PlayerY; + if (rocketDown) PlayerYInt+=8; + else PlayerYInt-=10; + PlayerY=PlayerYInt; } else if (fly) { if (newKeyboardState.IsKeyDown(Keys.Up)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY-=10; - else PlayerY-=3; - PlayerYInt=(int)PlayerY; + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerYInt-=10; + else PlayerYInt-=3; + PlayerY=PlayerYInt; } if (newKeyboardState.IsKeyDown(Keys.Down)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerY+=10; - else PlayerY+=3; - PlayerYInt=(int)PlayerY; + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerYInt+=10; + else PlayerYInt+=3; + PlayerY=PlayerYInt; } if (newKeyboardState.IsKeyDown(Keys.Right)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX+=10; - else PlayerX+=3; - PlayerXInt=(int)PlayerX; + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerXInt+=10; + else PlayerXInt+=3; + PlayerY=PlayerYInt; BiomePlayer=GetBiomeByPos(PlayerXInt/16); } if (newKeyboardState.IsKeyDown(Keys.Left)) { - if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerX-=10; - else PlayerX -=3; - PlayerXInt=(int)PlayerX; + if (newKeyboardState.IsKeyDown(Keys.LeftShift) || newKeyboardState.IsKeyDown(Keys.RightShift)) PlayerXInt-=10; + else PlayerXInt -=3; + PlayerY=PlayerYInt; BiomePlayer=GetBiomeByPos(PlayerXInt/16); } } else { @@ -4014,23 +3783,18 @@ readonly Color BiomePlayer=GetBiomeByPos(PlayerXInt/16); changePosition=false; - - //swimmingTicks+=0.016f; - //if (swimmingTicks>1)swimmingTicks-=1; - if (Setting.WavingElements) FindPlants(); } bool swmove=false; - // bool swim; + if (canbreatheDuringSwimming && !swimming) { barOxygen.Value--; if (barOxygen.Value<0f) barOxygen.Value=0f; } else { - if (barOxygen.Value>32f) { barHeart.Value+=.08f; if (barHeart.Value>32f) Die(Lang.Texts[161]); - }else barOxygen.Value+=0.05f; + } else barOxygen.Value+=0.05f; } if (newKeyboardState.IsKeyDown(Setting.KeyJump)) { @@ -4093,8 +3857,8 @@ readonly Color if (speed>needSpeed) { speed=needSpeed; // ?????????????????????? - PlayerX=(int)PlayerX; - PlayerXInt=(int)PlayerX; + // PlayerXInt=(int)PlayerXInt; + // PlayerXInt=(int)PlayerX; } } else { needSpeed=0; @@ -4112,11 +3876,11 @@ readonly Color //right if (speedDir==1) { - float x=DetectSolidBlocksRight(PlayerX+speed, PlayerY); + float x=DetectSolidBlocksRight(PlayerXInt+speed, PlayerYInt); // No limited blocks if (x==int.MinValue) { - PlayerX += speed; + PlayerXInt += (int)speed; playerState=2; if (walkingSoundDuration<0) { @@ -4128,7 +3892,7 @@ readonly Color } else { //Stop moving player // Console.WriteLine("b touch Playerx"+PlayerX); - PlayerX=(int)(PlayerX+speed-x-0.05f); + PlayerXInt=(int)(PlayerXInt+speed-x-0.05f); //Console.WriteLine("a touch Playerx"+PlayerX); speed=0; @@ -4139,11 +3903,11 @@ readonly Color //left } else { - float x=DetectSolidBlocksLeft(PlayerX-speed,PlayerY); + float x=DetectSolidBlocksLeft(PlayerXInt-speed, PlayerYInt); // No limited blocks if (x==int.MinValue) { - PlayerX-=speed; + PlayerXInt-=(int)speed; playerState=1; if (walkingSoundDuration<0) { if (Global.HasSoundGraphics) { @@ -4154,7 +3918,7 @@ readonly Color } else { //Stop moving player - PlayerX=(int)(PlayerX-speed+x+0.5f+16); + PlayerXInt=(int)(PlayerXInt-speed+x+0.5f+16); speed=0; @@ -4174,7 +3938,7 @@ readonly Color // playerImg2+=(int)(speed*5); //if (playerImg2>=420) playerImg2=0; } - if (swmove){ + if (swmove) { if (waterDown){ swimmingTicks+=0.016f; if (swimmingTicks>1)swimmingTicks-=1; @@ -4554,24 +4318,31 @@ readonly Color chunk.RefreshLightingRemoveSolid(destroyBlockX, destroyBlockY); - //if (destroingBlockType==(ushort)BlockId.Dirt - //|| destroingBlockType==(ushort)BlockId.GrassBlockDesert - //|| destroingBlockType==(ushort)BlockId.GrassBlockForest - //|| destroingBlockType==(ushort)BlockId.GrassBlockHills - //|| destroingBlockType==(ushort)BlockId.GrassBlockJungle - //|| destroingBlockType==(ushort)BlockId.GrassBlockClay - //|| destroingBlockType==(ushort)BlockId.GrassBlockCompost - //|| destroingBlockType==(ushort)BlockId.Compost - //|| destroingBlockType==(ushort)BlockId.GrassBlockPlains) { - // DestroyGrassUp(destroyBlockX, destroyBlockY-1); - - // if (Global.WorldDifficulty!=2) { - // chunk.Background[destroyBlockY]=new NormalBlock(backgroundDirtTexture, (ushort)BlockId.BackDirt, new Vector2(destroyBlockX*16, destroyBlockY*16)); - // chunk.IsBackground[destroyBlockY]=true; - // } - //} - - if (destroingBlockType==(ushort)BlockId.Sand) DestroySandUp(destroyBlockX, destroyBlockY-1); + if (destroingBlockType == (ushort)BlockId.Dirt + || destroingBlockType == (ushort)BlockId.GrassBlockDesert + || destroingBlockType == (ushort)BlockId.GrassBlockForest + || destroingBlockType == (ushort)BlockId.GrassBlockHills + || destroingBlockType == (ushort)BlockId.GrassBlockJungle + || destroingBlockType == (ushort)BlockId.GrassBlockClay + || destroingBlockType == (ushort)BlockId.GrassBlockCompost + || destroingBlockType == (ushort)BlockId.Compost + || destroingBlockType == (ushort)BlockId.GrassBlockSnowClay + || destroingBlockType == (ushort)BlockId.GrassBlockSnowCompost + || destroingBlockType == (ushort)BlockId.GrassBlockSnowDesert + || destroingBlockType == (ushort)BlockId.GrassBlockSnowForest + || destroingBlockType == (ushort)BlockId.GrassBlockSnowHills + || destroingBlockType == (ushort)BlockId.GrassBlockSnowJungle + || destroingBlockType == (ushort)BlockId.GrassBlockSnowPlains + || destroingBlockType == (ushort)BlockId.GrassBlockPlains) { + DestroyGrassUp(destroyBlockX, destroyBlockY - 1); + + //if (Global.WorldDifficulty != 2) { + // chunk.Background[destroyBlockY] = new NormalBlock(backgroundDirtTexture, (ushort)BlockId.BackDirt, new Vector2(destroyBlockX * 16, destroyBlockY * 16)); + // chunk.IsBackground[destroyBlockY] = true; + //} + } + + if (destroingBlockType==(ushort)BlockId.Sand) DestroySandUp(destroyBlockX, destroyBlockY-1); if (destroyBlockY>0) CheckBlockFallling(destroyBlockX, destroyBlockY-1); @@ -4743,7 +4514,7 @@ readonly Color InventoryNormal[boxSelected]=itemBlank; } if (i1.GetCount>0){ - if (PlayerX-mousePos.X>0) { + if (PlayerXInt-mousePos.X>0) { DroppedItems.Add(new Item{ X = PlayerXInt-11-16-1, Y = PlayerYInt-22, @@ -4764,7 +4535,7 @@ readonly Color case ItemInvFood16 i1: i1.SetCount=i1.GetCount-1; - if (PlayerX-mousePos.X>0) { + if (PlayerXInt-mousePos.X>0) { DroppedItems.Add(new Item{ X = PlayerXInt-11-16-1, Y = PlayerYInt-22, @@ -4784,7 +4555,7 @@ readonly Color return; case ItemInvBasicColoritzed32NonStackable i1: - if (PlayerX-mousePos.X>0) { + if (PlayerXInt-mousePos.X>0) { DroppedItems.Add(new Item{ X = PlayerXInt-11-16-1, Y = PlayerYInt-22, @@ -4804,7 +4575,7 @@ readonly Color return; case ItemInvNonStackable16 i1: - if (PlayerX-mousePos.X>0) { + if (PlayerXInt-mousePos.X>0) { DroppedItems.Add(new Item{ X = PlayerXInt-11-16-1, Y = PlayerYInt-22, @@ -4824,7 +4595,7 @@ readonly Color return; case ItemInvNonStackable32 i1: - if (PlayerX-mousePos.X>0) { + if (PlayerXInt-mousePos.X>0) { DroppedItems.Add(new Item { X = PlayerXInt-11-16-1, Y = PlayerYInt-22, @@ -4851,13 +4622,13 @@ readonly Color #endregion #region Player pos in Window - if (PlayerX > TerrainLength*16-Global.WindowWidth) SetPlayerPos(Global.WindowWidth, PlayerY); - if (PlayerX < Global.WindowWidth) SetPlayerPos(TerrainLength*16-Global.WindowWidth, PlayerY); + if (PlayerXInt > TerrainLength*16-Global.WindowWidth) SetPlayerPos(Global.WindowWidth, PlayerYInt); + if (PlayerXInt < Global.WindowWidth) SetPlayerPos(TerrainLength*16-Global.WindowWidth, PlayerYInt); float min=4; - if (PlayerX-WindowCenterX>min || PlayerY-WindowCenterY>min || PlayerX-WindowCenterX<-min || PlayerY-WindowCenterY<-min) { - float _WindowXPlayer=WindowXPlayer+(PlayerX-WindowCenterX)*divider_16; - float _WindowYPlayer=WindowYPlayer+(PlayerY-WindowCenterY)*divider_16; + if (PlayerXInt-WindowCenterX>min || PlayerYInt-WindowCenterY>min || PlayerXInt-WindowCenterX<-min || PlayerYInt-WindowCenterY<-min) { + float _WindowXPlayer=WindowXPlayer+(PlayerXInt-WindowCenterX)*divider_16; + float _WindowYPlayer=WindowYPlayer+(PlayerYInt-WindowCenterY)*divider_16; if (_WindowXPlayer==WindowXPlayer) { if (_WindowYPlayer==WindowYPlayer) { @@ -4956,10 +4727,9 @@ readonly Color if (chunk.IsTopBlocks[rh]) { Block block=chunk.TopBlocks[rh]; if (block is LeavesBlock lb){ - if (lb.Id==(ushort)BlockId.SpruceLeaves || lb.Id==(ushort)BlockId.SpruceLeavesWithSnow){ - FallingLeave fl=new(rch*16+FastRandom.Int16(), rh*16+FastRandom.Int16(), /*FastRandom.Float(),*/windRirectionRight,precipitation, new Rectangle(0,0,2+FastRandom.Int2(),1)){ + if (lb.Id==(ushort)BlockId.SpruceLeaves || lb.Id==(ushort)BlockId.SpruceLeavesWithSnow) { + FallingLeave fl=new(rch*16+FastRandom.Int16(), rh*16+FastRandom.Int16(), windRirectionRight, precipitation, new Rectangle(0,0,2+FastRandom.Int2(),1)) { texture=lb.Texture, - //Color=lb.Color, }; FallingLeaves.Add(fl); }else{ @@ -5000,7 +4770,7 @@ readonly Color || lb.Id==(ushort)BlockId.AcaciaLeaves ) { - FallingLeave fl=new(rch*16+FastRandom.Int16(), rh*16+FastRandom.Int16(), /*FastRandom.Float(),*/windRirectionRight, precipitation, new Rectangle(0,0,2,2+FastRandom.Int2())){ + FallingLeave fl=new(rch*16+FastRandom.Int16(), rh*16+FastRandom.Int16(), windRirectionRight, precipitation, new Rectangle(0,0,2,2+FastRandom.Int2())){ texture=lb.Texture }; FallingLeaves.Add(fl); @@ -5013,11 +4783,18 @@ readonly Color if (FallingLeaves.Count>0) { for (int i = 0; i0) { + if (PlayerYInt>0) { rocket=false; PlayerY=0; PlayerYInt=0; @@ -6304,7 +6081,7 @@ readonly Color File.Delete(pathToWorld+"UseRocket.txt"); } } else { - if (PlayerY<=-10000) { + if (PlayerYInt<=-10000) { Save(); SaveSettings(); @@ -6557,12 +6334,12 @@ readonly Color DescayInventory(InventoryNormal); DescayInventory(InventoryClothes); - int totalammo=TotalItemsInInventoryItemBasic16((ushort)Items.Ammo); + int totalammo=TotalItemsInInventoryForAllTypes((ushort)Items.Ammo); if (totalammo>99)totalammo=99; if (totalammo==0) totalammo=1; foreach (ItemInv d in InventoryNormal) { if (d.Id==(ushort)Items.Gun) { - ItemInvBasic16 gun=(ItemInvBasic16)d; + ItemInvTool32 gun=(ItemInvTool32)d; gun.SetCount=totalammo; } } @@ -6868,7 +6645,7 @@ readonly Color //spriteBatch.Draw(sunLightTarget, Fullscreen, colorAlpha); //spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, camera); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, cameraNoOpMultisapling/*camera*/); foreach (MashineBlockBasic m in lightsLamp) { if (m.Position.X>=terrainStartIndexX*16) { @@ -7698,158 +7475,167 @@ readonly Color else DrawItemInHand(ClothesChest?.Texture2DClothHand, ClothesChest.Color, (int)ClothesChest?.handSize); } else DrawItemInHand(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color, (int)ClothesChestTop.handSize); - void DrawItemInHand(Texture2D texCloth, Color colorCloth, int size) { - Rectangle - recHand= new(0, 0, 4, HandSize-size), - recCloth=new(0,0,4,size); - Vector2 vecOrigin=new(2,2-size); - - spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None, 1f); - if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None, 1f); - - // Right - rameno.X+=17; - spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, 0, vecOrigin, 1, SpriteEffects.None, 1f); - if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, 0, Vector2_2, 1, SpriteEffects.None, 1f); - rameno.X-=17; - - if (InventoryNormal[boxSelected]!=null){ - if (InventoryNormal[boxSelected].Id!=0) { - Vector2 recItem=new( - (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), - (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4) - //8, - //8 - ); - - switch (InventoryNormal[boxSelected]) { - case ItemInvBasic16 i: - spriteBatch.Draw( - texture: i.Texture, - position: recItem, - sourceRectangle: null, - color: Color.White, - rotation: 0f, - scale: 0.5f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f - ); - break; - - case ItemInvBasic32 i: - spriteBatch.Draw( - texture: i.Texture, - recItem, - sourceRectangle: null, - Color.White, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f); - break; - - case ItemInvBasicColoritzed32NonStackable i: + void DrawItemInHand(Texture2D texCloth, Color colorCloth, int size) { + Rectangle + recHand= new(0, 0, 4, HandSize-size), + recCloth=new(0,0,4,size); + Vector2 vecOrigin=new(2,2-size); + // Right + rameno.X += 17; + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, 0, vecOrigin, 1, SpriteEffects.None, 1f); + if (texCloth != null) spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, 0, Vector2_2, 1, SpriteEffects.None, 1f); +rameno.X -= 17; + spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None, 1f); + if (texCloth != null) spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None, 1f); + + + + + + + if (InventoryNormal[boxSelected] != null) { + if (InventoryNormal[boxSelected].Id != 0) { + Vector2 recItem=new( + ((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4, + ((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4 + ); + if (SuperSamplingActing==1f){ + recItem.X=(int)(recItem.X+0.5f); + recItem.Y=(int)(recItem.Y+0.5f); + } + switch (InventoryNormal[boxSelected]) { + case ItemInvBasic16 i: + spriteBatch.Draw( + texture: i.Texture, + position: recItem, + sourceRectangle: null, + color: Color.White, + rotation: 0f, + scale: 0.5f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f + ); + break; + + case ItemInvBasic32 i: + spriteBatch.Draw( + texture: i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); + break; + + case ItemInvBasicColoritzed32NonStackable i: + spriteBatch.Draw( + texture: i.Texture, + recItem, + sourceRectangle: null, + i.color, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); + break; + + case ItemInvFood16 i: + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); + break; + + case ItemInvFood32 i: + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); + break; + + case ItemInvNonStackable32 i: + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); + break; + + case ItemInvNonStackable16 i: + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); + break; + + case ItemInvTool16 i: + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); + break; + + case ItemInvTool32 i: + { + Vector2 editpos=GameMethods.EditMouseItemPos(InventoryNormal[boxSelected].Id); + float scale=GameMethods.EditMouseItemScale(InventoryNormal[boxSelected].Id); spriteBatch.Draw( texture: i.Texture, - recItem, - sourceRectangle: null, - i.color, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f); - break; - - case ItemInvFood16 i: - spriteBatch.Draw( - i.Texture, - recItem, - sourceRectangle: null, - Color.White, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f); - break; - - case ItemInvFood32 i: - spriteBatch.Draw( - i.Texture, - recItem, - sourceRectangle: null, - Color.White, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f); - break; - - case ItemInvNonStackable32 i: - spriteBatch.Draw( - i.Texture, - recItem, - sourceRectangle: null, - Color.White, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f); - break; - - case ItemInvNonStackable16 i: - spriteBatch.Draw( - i.Texture, - recItem, - sourceRectangle: null, - Color.White, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f); - break; - - case ItemInvTool16 i: - spriteBatch.Draw( - i.Texture, - recItem, - sourceRectangle: null, - Color.White, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, - layerDepth: 0f); - break; - - case ItemInvTool32 i: - spriteBatch.Draw( - texture: i.Texture, - recItem, + new Vector2((handAngle>FastMath.PI || handAngle<=0) ? (recItem.X-(32*scale-editpos.X)+16*scale) : (recItem.X-editpos.X), recItem.Y-editpos.Y), sourceRectangle: null, - Color.White, - scale: 0.5f, - rotation: 0f, - origin: Vector2.Zero, - effects: SpriteEffects.None, + Color.White, + scale: scale, + rotation: 0f, + origin: Vector2.Zero, + effects: (handAngle>FastMath.PI || handAngle<=0) != GameMethods.EditMouseItemFlip(InventoryNormal[boxSelected].Id) ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth: 0f); - break; + //Debug.WriteLine(handAngle); + } + break; - #if DEBUG - default: throw new Exception("Unknown category"); - #endif - } - } - } + #if DEBUG + default: throw new Exception("Unknown category"); + #endif + } + } + } - } - } + } + } break; case 2://-> @@ -7929,48 +7715,128 @@ readonly Color if (InventoryNormal[boxSelected]!=null){ if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new( - (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), - (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), - 8, - 8 + Vector2 recItem=new( + ((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4, + ((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4 ); switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + texture: i.Texture, + position: recItem, + sourceRectangle: null, + color: Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.5f, + effects: SpriteEffects.None, + layerDepth: 0f + ); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.25f, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvBasicColoritzed32NonStackable i: - spriteBatch.Draw(i.Texture, recItem, i.color); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + i.color, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.25f, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.5f, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.25f, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.25f, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.5f, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.5f, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + rotation: 0f, + origin: Vector2.Zero, + scale: 0.25f, + effects: SpriteEffects.None, + layerDepth: 0f); break; #if DEBUG @@ -7987,7 +7853,7 @@ readonly Color spriteBatch.Draw(TextureHand, rameno, recHand, new Color((byte)(Setting.ColorSkin.R*0.75f), (byte)(Setting.ColorSkin.G*0.75f), (byte)(Setting.ColorSkin.B*0.75f),(byte)255), -handAngle, vecOrigin, 1, SpriteEffects.None,1f); - recCloth=new Rectangle(0,0,4,size); + recCloth=new Rectangle(0,0,4,size); if (texCloth!=null) { spriteBatch.Draw(texCloth, rameno, recCloth, new Color((byte)(colorCloth.R*0.75f),(byte)(colorCloth.G*0.75f),(byte)(colorCloth.B*0.75f),(byte)255), -handAngle, Vector2_2, 1, SpriteEffects.None,1f); } @@ -8064,57 +7930,137 @@ readonly Color if (ClothesChestTop == null) { if (ClothesChest == null) DrawItemInHandTop(null, Color.White, 0); - else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color,(int)ClothesChest.handSize); - } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color,(int)ClothesChestTop.handSize); + else DrawItemInHandTop(ClothesChest.Texture2DClothHand, ClothesChest.Color, (int)ClothesChest.handSize); + } else DrawItemInHandTop(ClothesChestTop.Texture2DClothHand, ClothesChestTop.Color, (int)ClothesChestTop.handSize); void DrawItemInHandTop(Texture2D texCloth, Color colorCloth, int size){ spriteBatch.Draw(TextureHand, rameno, recHand, Setting.ColorSkin, handAngle, vecOrigin, 1, SpriteEffects.None,1f); - if (texCloth!=null)spriteBatch.Draw(texCloth, rameno, recCloth/*new Rectangle(0,0,4,size)*/, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); + if (texCloth!=null) spriteBatch.Draw(texCloth, rameno, recCloth, colorCloth, handAngle, Vector2_2, 1, SpriteEffects.None,1f); - if (InventoryNormal[boxSelected]!=null){ + if (InventoryNormal[boxSelected]!=null) { if (InventoryNormal[boxSelected].Id!=0) { - Rectangle recItem=new( - (int)(((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4), - (int)(((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4), - 8, - 8 + Vector2 recItem=new( + ((float)Math.Cos(handAngle+FastMath.PIHalf)*(HandSize-4))+rameno.X-4, + ((float)Math.Sin(handAngle+FastMath.PIHalf))*(HandSize-4)+rameno.Y-4 ); switch (InventoryNormal[boxSelected]) { case ItemInvBasic16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f + ); break; case ItemInvBasic32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvBasicColoritzed32NonStackable i: - spriteBatch.Draw(i.Texture, recItem, i.color); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + i.color, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvFood16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvFood32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvNonStackable32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvNonStackable16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvTool16 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.5f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; case ItemInvTool32 i: - spriteBatch.Draw(i.Texture, recItem, Color.White); + spriteBatch.Draw( + i.Texture, + recItem, + sourceRectangle: null, + Color.White, + scale: 0.25f, + rotation: 0f, + origin: Vector2.Zero, + effects: SpriteEffects.None, + layerDepth: 0f); break; #if DEBUG @@ -12281,7 +12227,7 @@ readonly Color { Terrain chunk=terrain[X]; chunk.IsBackground[Y]=true; - chunk.Background[Y]=new NormalBlock(backgroundGneissTexture, (ushort)BlockId.BackGneiss, new Vector2(X16, Y16)); + chunk.Background[Y]=BackBlockFromId((ushort)BlockId.BackGneiss, new Vector2(X16, Y16)); } return; @@ -13310,7 +13256,7 @@ readonly Color void Destroy(int x, int y) { float destrustionSlow; { - float distance=FastMath.DistanceInt(mousePosRoundX, mousePosRoundY, PlayerX, PlayerY); + float distance=FastMath.DistanceInt(mousePosRoundX, mousePosRoundY, PlayerXInt, PlayerYInt); if (distance>DistanceBlockEdit) destrustionSlow=-1; else if (distance0) { + PlayerYInt+=distanceToGround; PlayerY+=distanceToGround; - PlayerYInt=(int)PlayerY; - PlayerYInt+=distanceToGround; + PlayerYInt=(int)PlayerY; changePosition=true; @@ -16980,14 +16926,14 @@ readonly Color } void SetPlayerPos(float x, float y) { + PlayerXInt=(int)x; + PlayerYInt=(int)y; + PlayerX=x; PlayerY=y; - PlayerXInt=(int)PlayerX; - PlayerYInt=(int)PlayerY; - - WindowXPlayer = PlayerX-1f; - WindowYPlayer = PlayerY-1f; + WindowXPlayer = PlayerXInt-1f; + WindowYPlayer = PlayerYInt-1f; WindowX=(int)x-Global.WindowWidthHalf; WindowY=(int)y-Global.WindowHeightHalf; @@ -25191,9 +25137,9 @@ string ConvertNormalToAtls(string key) void CreateShot() { SoundEffects.Shot.Play(); GunShots.Add(new GunShot{ - Angle=(float)Math.Atan2(mousePos.Y-PlayerY, mousePos.X-PlayerX), - X=PlayerX, - Y=PlayerY + Angle=(float)Math.Atan2(mousePos.Y-PlayerYInt, mousePos.X-PlayerXInt), + X=PlayerXInt, + Y=PlayerYInt }); } @@ -25543,7 +25489,7 @@ string ConvertNormalToAtls(string key) } void AddShake(float x, float y) { - float distanceToPlayer=FastMath.Distance(PlayerX, PlayerY, x, y); + float distanceToPlayer=FastMath.Distance(PlayerXInt, PlayerYInt, x, y); //if (distanceToPlayer<20) EarthShakeSize+=7; //if (distanceToPlayer<40) EarthShakeSize+=6; //if (distanceToPlayer<80) EarthShakeSize+=5; @@ -26188,7 +26134,7 @@ string ConvertNormalToAtls(string key) Texture2D tex = b.Texture; for (int i=0; i<8; i++) { - float x=PlayerX+(i-4); + float x=PlayerXInt+(i-4); float z=FastRandom.Float(); Particles.Add(new ParticleMess { Disepeard=50, @@ -26215,7 +26161,7 @@ string ConvertNormalToAtls(string key) Particles.Add(new ParticleMess { Disepeard=50, Texture=tex, - Position=new Vector2(PlayerX+(i-4), d.Y*16-3f), + Position=new Vector2(PlayerXInt+(i-4), d.Y*16-3f), Source=new Rectangle(i, 0, z, z), HSpeed=(i-4)*0.1f, VSpeed= -1.5f - z*0.5f, @@ -27271,9 +27217,245 @@ string ConvertNormalToAtls(string key) to16=new DInt(x*16, fallTo*16/*-16*/) // side=true }); + + DestroyGrassUp(x,y-1); + } + } + } + } + + void SetSuperSampling() { + // No SSAA + if (Setting.UpScalingSuperSapling==1f) { + SuperSamplingActing=1f; + SetOther(); + return; + } + + // Pixelizer SSAA + if (Setting.UpScalingSuperSapling<1f) { + SuperSamplingActing=1f/Setting.Zoom; + targetGame?.Dispose(); + targetGame=new RenderTarget2D(Graphics, + (int)(Global.WindowWidth*SuperSamplingActing), + (int)(Global.WindowHeight*SuperSamplingActing), + false, + SurfaceFormat.Color, + DepthFormat.Depth24, + 1, + RenderTargetUsage.PlatformContents); + SetOther(); + return; + } + + float maxUpscaling=20f; + if (Graphics.GraphicsProfile==GraphicsProfile.HiDef) { + float scale = 8192f/Global.WindowWidth; + if (scale=Setting.UpScalingSuperSapling) { + SuperSamplingActing=2f; + targetGame?.Dispose(); + targetGame=new RenderTarget2D( + Graphics, + Global.WindowWidth*2, + Global.WindowHeight*2, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + SetOther(); + return; + } else { + SuperSamplingActing=1f; + targetGame?.Dispose(); + SetOther(); + return; + } + } + + if (Setting.UpScalingSuperSapling==4f) { + if (maxUpscaling>=4f) { + SuperSamplingActing=4f; + + targetGame?.Dispose(); + targetGame=new RenderTarget2D( + Graphics, + Global.WindowWidth*4, + Global.WindowHeight*4, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + + targetGame2?.Dispose(); + targetGame2=new RenderTarget2D( + Graphics, + Global.WindowWidth*2, + Global.WindowHeight*2, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + SetOther(); + return; + } else { + if (maxUpscaling>=2f) { + SuperSamplingActing=2f; + + targetGame?.Dispose(); + targetGame=new RenderTarget2D( + Graphics, + Global.WindowWidth*2, + Global.WindowHeight*2, + false, + SurfaceFormat.Color, + DepthFormat.Depth24Stencil8, + 1, + RenderTargetUsage.PlatformContents + ); + + targetGame2?.Dispose(); + SetOther(); + return; + } else { + SuperSamplingActing=1f; + targetGame?.Dispose(); + targetGame2?.Dispose(); + SetOther(); + return; } } } + + void SetOther() { + ZoomMatrix = Matrix.CreateScale(Setting.Zoom*SuperSamplingActing, Setting.Zoom*SuperSamplingActing, 0); + ZoomMatrixNoUpScaling = Matrix.CreateScale(Setting.Zoom, Setting.Zoom, 0); + + if (SuperSamplingActing!=1f) MatrixUpScaling = Matrix.CreateScale(SuperSamplingActing, SuperSamplingActing, 0); + Translation = ZoomMatrix*Matrix.CreateTranslation(new Vector3( + Global.WindowWidthHalf*SuperSamplingActing, + Global.WindowHeightHalf*SuperSamplingActing, + 0)); + + TranslationNoOpMultisapling = ZoomMatrixNoUpScaling*Matrix.CreateTranslation(new Vector3( + Global.WindowWidthHalf, + Global.WindowHeightHalf, + 0)); + + } + + //if (Setting.UpScalingSuperSapling==8f) { + // if (maxUpscaling>=Setting.UpScalingSuperSapling) { + // SuperSamplingActing=Setting.UpScalingSuperSapling; + + // targetGame?.Dispose(); + // targetGame=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*8, + // Global.WindowHeight*8, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame2?.Dispose(); + // targetGame2=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*4, + // Global.WindowHeight*4, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame4?.Dispose(); + // targetGame4=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*2, + // Global.WindowHeight*2, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + // return; + // } else { + // if (maxUpscaling>=4f) { + // SuperSamplingActing=4f; + // targetGame?.Dispose(); + // targetGame=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*4, + // Global.WindowHeight*4, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame2?.Dispose(); + // targetGame2=new RenderTarget2D( + // Graphics, + // Global.WindowWidth*2, + // Global.WindowHeight*2, + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame4?.Dispose(); + // } else if (maxUpscaling>=2f) { + // SuperSamplingActing=2f; + // targetGame?.Dispose(); + // targetGame=new RenderTarget2D( + // Graphics, + // (int)(Global.WindowWidth*SuperSamplingActing), + // (int)(Global.WindowHeight*SuperSamplingActing), + // false, + // SurfaceFormat.Color, + // DepthFormat.Depth24, + // 1, + // RenderTargetUsage.PlatformContents + // ); + + // targetGame2?.Dispose(); + // targetGame4?.Dispose(); + // return; + // } else { + // SuperSamplingActing=1f; + // targetGame?.Dispose(); + // targetGame2?.Dispose(); + // targetGame4?.Dispose(); + // return; + // } + // } + //} } } } \ No newline at end of file From 9edc3bb55e300f2d7629ad5fa4219585a4f06aac Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:23:55 +0100 Subject: [PATCH 51/55] updated --- rabcrClient.sln | 10 ++++++++-- rabcrClient/FormError.cs | 9 +++++---- rabcrClient/Relase.cs | 6 +++--- rabcrClient/rabcrClient.csproj | 29 +++++++++++++++++++++++++++-- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/rabcrClient.sln b/rabcrClient.sln index 0afb1f5..92b2b34 100644 --- a/rabcrClient.sln +++ b/rabcrClient.sln @@ -1,18 +1,24 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30320.27 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rabcrClient", "rabcrClient\rabcrClient.csproj", "{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x64.ActiveCfg = Debug|x86 + {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x64.Build.0 = Debug|x86 {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x86.ActiveCfg = Debug|x86 {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x86.Build.0 = Debug|x86 + {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x64.ActiveCfg = Release|x86 + {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x64.Build.0 = Release|x86 {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x86.ActiveCfg = Release|x86 {B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x86.Build.0 = Release|x86 EndGlobalSection diff --git a/rabcrClient/FormError.cs b/rabcrClient/FormError.cs index d971860..66e2c9a 100644 --- a/rabcrClient/FormError.cs +++ b/rabcrClient/FormError.cs @@ -57,10 +57,10 @@ public partial class FormError : Form { "&b="+Release.Date.Replace(" ", "%20") + "&c="+GetOsVersionText()+ "%20"+RuntimeInformation.OSArchitecture + "&d="+ Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")+ - "&e="+Environment.ProcessorCount.ToString() + + // "&e="+Environment.ProcessorCount.ToString() + "&f="+graphicsCard.Replace(" ", "%20") + - "&g="+exception.Message.Replace(" ", "%20") + - "&p="+CultureInfo.InstalledUICulture.Name; + "&g="+exception.Message.Replace(" ", "%20") ; + // "&p="+CultureInfo.InstalledUICulture.Name; // StackTrace StackTrace st=new(exception, true); @@ -68,7 +68,7 @@ public partial class FormError : Form { if (count>1) { - StackFrame sf2=st.GetFrame(1); + StackFrame sf2=st.GetFrame(1); FileInfo fi2 =new(sf2.GetFileName()); string trace="&r="+fi2.Name+"-method: "+sf2.GetMethod().Name.ToString()+ ", line: "+sf2.GetFileLineNumber() +Environment.NewLine; trace=trace.Replace(" ","%20"); @@ -91,6 +91,7 @@ public partial class FormError : Form { // Run WebClient wc=new(); + Console.WriteLine(Release.stringRRE+send); string result=wc.DownloadString(Release.stringRRE+send); //System.Diagnostics.Process.Start(); if (result.StartsWith("O|")){ diff --git a/rabcrClient/Relase.cs b/rabcrClient/Relase.cs index 4315c7b..95d346b 100644 --- a/rabcrClient/Relase.cs +++ b/rabcrClient/Relase.cs @@ -5,16 +5,16 @@ static class Release { public const int VersionMajor = 0, VersionMinor = 1, - VersionBuild = 25, + VersionBuild = 26, VersionRevision = 0; - public const string VersionString = "0.1.25.0"; + public const string VersionString = "0.1.26.0"; // Special name of version public const string VersionSpecialName = ""; // Release date - public const string Date="17.07.2021"; + public const string Date="22.01.2022"; diff --git a/rabcrClient/rabcrClient.csproj b/rabcrClient/rabcrClient.csproj index 0490a7b..9d7b27d 100644 --- a/rabcrClient/rabcrClient.csproj +++ b/rabcrClient/rabcrClient.csproj @@ -40,12 +40,12 @@ full false Publish\ - DEBUG;TRACE;WINDOWS + TRACE;WINDOWS none 4 true Off - false + true MinimumRecommendedRules.ruleset false @@ -67,6 +67,31 @@ rabcrClient.Program + + x64 + bin\x64\Debug\ + + + x64 + bin\x64\Release\ + true + + + bin\x86\Release x86\ + TRACE;WINDOWS + false + pdbonly + AnyCPU + 9.0 + prompt + true + true + + + bin\x64\Release x86\ + true + x64 + From 9ac0a55c6ac723e97a30f584cd586706134ec060 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:24:15 +0100 Subject: [PATCH 52/55] leaves alpha fall to ground --- rabcrClient/Particles.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rabcrClient/Particles.cs b/rabcrClient/Particles.cs index b396a82..dd19f9a 100644 --- a/rabcrClient/Particles.cs +++ b/rabcrClient/Particles.cs @@ -163,6 +163,7 @@ class FallingLeave { public Vector2 Position; public float angle; public float time; + public float alpha=1f; // public float size; // readonly Vector2 vecOrigin; @@ -197,7 +198,7 @@ class FallingLeave { position: /*new Vector2(*/Position/*.X, Position.Y)*/, sourceRectangle: srcrec, effects: SpriteEffects.None, - color: Color.White, + color: Color.White*alpha, scale: /*1f*/0.5f*size+0.5f, rotation: angle, origin: /*vecOrigin*/Vector2.Zero, From 01986ff4595c23c6603c3c5c24e6ca1b69f08854 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 22 Jan 2022 13:52:43 +0100 Subject: [PATCH 53/55] hand restroing animation --- .../GameStates/Game/Singleplayer.cs | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs index f51a78a..38f0331 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs @@ -11,7 +11,7 @@ namespace rabcrClient { class SinglePlayer: Screen { - + float destroyingTime; #region Varibles Color FogColor=Color.Transparent; RasterizerState rasterizerState; @@ -839,7 +839,7 @@ static Color rabbitWalkTexture, sunTexture, - barEnergyTexture, + //barEnergyTexture, plateCopperTexture, plateIronTexture, @@ -1397,7 +1397,7 @@ const int float WindowXPlayer, WindowYPlayer; - RenderTarget2D sunLightTarget, modificatedLightTarget, targetGame, targetGame2, targetGame4; + RenderTarget2D sunLightTarget, modificatedLightTarget, targetGame, targetGame2/*, targetGame4*/; readonly BlendState Multiply = new() { AlphaSourceBlend=Blend.Zero, @@ -3442,7 +3442,7 @@ readonly Color modificatedLightTarget.Dispose(); targetGame?.Dispose(); targetGame2?.Dispose(); - targetGame4?.Dispose(); + //targetGame4?.Dispose(); sunLightTarget.Dispose(); TextureSunGradient?.Dispose(); Debug.WriteLine("EndOf Saving"); @@ -4485,7 +4485,7 @@ readonly Color } destroing=false; } - } else destroing=false; + } else {destroing=false; } } else { if (notshot) { @@ -4496,7 +4496,7 @@ readonly Color } } } - } else destroing=false; + } else {destroing=false;} if (newKeyboardState.IsKeyDown(Setting.KeyDropItem)) { if (oldKeyboardState.IsKeyUp(Setting.KeyDropItem)) { @@ -4771,7 +4771,8 @@ readonly Color ) { FallingLeave fl=new(rch*16+FastRandom.Int16(), rh*16+FastRandom.Int16(), windRirectionRight, precipitation, new Rectangle(0,0,2,2+FastRandom.Int2())){ - texture=lb.Texture + texture=lb.Texture, + color=lb.Color, }; FallingLeaves.Add(fl); } @@ -7423,7 +7424,20 @@ readonly Color Vector2 center=(hand+rameno)/2; handAngle=(float)Math.Atan2(rameno.Y-hand.Y, rameno.X-hand.X)+FastMath.PIHalf; + { + int id=InventoryNormal[boxSelected].Id; + //if (id!=(int)Items.Gun) { + if (destroing){ + destroyingTime+=0.1f; + }else{ + if (destroyingTime<(int)(destroyingTime+0.5f)) { + destroyingTime+=0.1f; + }else destroyingTime=0; + } + handAngle+=(float)Math.Sin(destroyingTime*FastMath.PI); + //} + } // Legs if (ClothesLegs!=null) { if (ClothesLegs.ShowBodyLegs) spriteBatch.Draw(TexturePlayerStaticLegs, vector, Setting.ColorSkin); From d3aa6316b5359a1f4eeb986baf77646fce605085 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 22 Jan 2022 13:52:49 +0100 Subject: [PATCH 54/55] updated --- rabcrClient/FormError.Designer.cs | 4 +- rabcrClient/FormError.cs | 8 +- rabcrClient/InterLogic/Game/GameMethods.cs | 1 + .../InterLogic/Game/Terrain/GenerateWorld.cs | 19 +- rabcrClient/InterLogic/Global/Setting.cs | 2 +- rabcrClient/InterLogic/Graphics/Background.cs | 1357 ++++++++--------- .../InterLogic/Graphics/Screen/Rabcr.cs | 3 +- rabcrClient/Particles.cs | 4 +- rabcrClient/Program.cs | 202 +-- rabcrClient/rabcrClient.csproj | 2 +- 10 files changed, 657 insertions(+), 945 deletions(-) diff --git a/rabcrClient/FormError.Designer.cs b/rabcrClient/FormError.Designer.cs index 860df47..df00f6e 100644 --- a/rabcrClient/FormError.Designer.cs +++ b/rabcrClient/FormError.Designer.cs @@ -51,7 +51,7 @@ partial class FormError { this.buttonSend.TabIndex = 2; this.buttonSend.Text = "Send to developers"; this.buttonSend.UseVisualStyleBackColor = true; - this.buttonSend.Click += new System.EventHandler(this.buttonSend_Click); + this.buttonSend.Click += new System.EventHandler(this.ButtonSend_Click); // // buttonSaveRep // @@ -75,7 +75,7 @@ partial class FormError { this.button3.TabIndex = 2; this.button3.Text = "Close"; this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click); + this.button3.Click += new System.EventHandler(this.Button3_Click); // // label2 // diff --git a/rabcrClient/FormError.cs b/rabcrClient/FormError.cs index 66e2c9a..db4f090 100644 --- a/rabcrClient/FormError.cs +++ b/rabcrClient/FormError.cs @@ -10,8 +10,8 @@ namespace rabcrClient { public partial class FormError : Form { - Exception exception; - DateTime errorTime; + readonly Exception exception; + readonly DateTime errorTime; public FormError(Exception ex, DateTime dt) { InitializeComponent(); exception=ex; @@ -23,12 +23,12 @@ public partial class FormError : Form { MessageBox.Show("Error in code appeard. You can save error detail or send anonymously to developers or just close and do nothing."); } - private void button3_Click(object sender, EventArgs e) { + private void Button3_Click(object sender, EventArgs e) { Close(); Environment.Exit(0); } - private void buttonSend_Click(object sender, EventArgs e) { + private void ButtonSend_Click(object sender, EventArgs e) { buttonSend.Enabled=false; buttonSend.BackColor=System.Drawing.Color.Gray; // DialogResult dr=MessageBox.Show(text+Environment.NewLine+Environment.NewLine+details+Environment.NewLine+ex.Message, cap, MessageBoxButtons.YesNo, MessageBoxIcon.Error); diff --git a/rabcrClient/InterLogic/Game/GameMethods.cs b/rabcrClient/InterLogic/Game/GameMethods.cs index 5317d51..4738b44 100644 --- a/rabcrClient/InterLogic/Game/GameMethods.cs +++ b/rabcrClient/InterLogic/Game/GameMethods.cs @@ -241,6 +241,7 @@ static class GameMethods { case (ushort)Items.SawIron: return new Vector2(10, 6); case (ushort)Items.SawSteel: return new Vector2(10, 6); + case (ushort)Items.AxeStone: return new Vector2(8, 8); case (ushort)Items.AxeAluminium: return new Vector2(8, 8); case (ushort)Items.AxeBronze: return new Vector2(8, 8); case (ushort)Items.AxeCopper: return new Vector2(8, 8); diff --git a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs index 85e21e5..cf7bd34 100644 --- a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs +++ b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs @@ -453,7 +453,7 @@ public enum WorldSize : byte{ GChunk chunk = terrain[x]; - GenCactus cactus = new GenCactus(x, y); + GenCactus cactus = new(x, y); LiveObjects.Add(cactus); int to=y-height; @@ -561,17 +561,18 @@ public enum WorldSize : byte{ for (int x=0; x Rabcr.Game.Content.Load(Setting.StyleName+"\\Textures\\"+path); Matrix CameraMatrix() { - //if (Setting.Scale.Without == Setting.currentScale) - return Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0)) * Translation; - - //if (Setting.Scale.Proportions == Setting.currentScale) { - // float _screenScaleW = Global.WindowWidth / 848f; - // float _screenScaleH = Global.WindowHeight / 560f; - - // if (_screenScaleH > _screenScaleW) { - // return Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0)) * - // MatrixZoom* - // Matrix.CreateScale(_screenScaleW, _screenScaleW, 0) * - // Matrix.CreateTranslation(new Vector3(Global.WindowWidthHalf, Global.WindowHeightHalf, 0)); - // } else { - // return Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0)) * - // MatrixZoom* - // Matrix.CreateScale(_screenScaleH, _screenScaleH, 0) * - // Matrix.CreateTranslation(new Vector3(Global.WindowWidthHalf, Global.WindowHeightHalf, 0)); - // } - //} - - //return Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0)) * - // Matrix.CreateScale(new Vector3(Global.WindowWidth / 848f, Global.WindowHeight / 560f, 0)) * - // MatrixZoom * - // Matrix.CreateTranslation(new Vector3(Global.WindowWidthHalf, Global.WindowHeightHalf, 0)); + return Matrix.CreateTranslation(new Vector3(-WindowCenterX, -WindowCenterY, 0)) * Translation; } bool isDisposed; @@ -584,97 +565,122 @@ readonly Texture2D void Load() { if (File.Exists(Setting.Path+"\\MenuBackground.ter")) { - using (StreamReader sr = new StreamReader(Setting.Path+"\\MenuBackground.ter")) { - for (int pos=0; pos1){ - BBlock block=BackBlockFromId(input, new Vector2(pos*16, lenght*16)); - if (block!=null){ - if (ss>lenght) ss=lenght; - chunk.Background[lenght]=block; - chunk.IsBackground[lenght]=true; - }else chunk.Background[lenght]=new BBlockEmpty(); - } else if (input==1) { - int skip=br.ReadByte(); - int to=lenght+skip; - for (int i=lenght; i 1) { + BBlock block=BackBlockFromId(input, new Vector2(xPos16, lenght*16)); + if (block != null) { + if (ss > lenght) ss = lenght; + chunk.Background[lenght] = block; + chunk.IsBackground[lenght] = true; + } + else { + // default bool value is false, so this code is not need + // chunk.IsBackground[lenght] = false; + } + } + else if (input == 1) { + int skip=br.ReadByte(); + int to=lenght+skip; + for (int i = lenght; i < to; i++) { + // default bool value is false, so this code is not need + // chunk.IsBackground[i] = false; + } + lenght += skip - 1; } + else if (input == 0) { + // default bool value is false, so this code is not need + // chunk.IsBackground[lenght] = false; + } + } - // TopBlocks - for (int lenght=0; lenght1){ - BBlock block=TopBlockFromId(input, new Vector2(pos*16, lenght*16)); - if (block!=null){ - if (ss>lenght) ss=lenght; - chunk.IsTopBlocks[lenght]=true; - chunk.TopBlocks[lenght]=block; - } else { - chunk.TopBlocks[lenght]=new BBlockEmpty(); - } - } else if (input==1) { - int skip=br.ReadByte(); - int to=lenght+skip; - for (int i=lenght; i 1) { + BBlock block=TopBlockFromId(input, new Vector2(xPos16, lenght*16)); + if (block != null) { + if (ss > lenght) ss = lenght; + chunk.IsTopBlocks[lenght] = true; + chunk.TopBlocks[lenght] = block; + } + else { + // default bool value is false, so this code is not need + // chunk.IsTopBlocks[lenght] = false; + } } + else if (input == 1) { + int skip=br.ReadByte(); + int to=lenght+skip; + for (int i = lenght; i < to; i++) { + // default bool value is false, so this code is not need + // chunk.IsTopBlocks[i] = false; + } + lenght += skip - 1; + } + else if (input == 0) { + // default bool value is false, so this code is not need + //chunk.IsTopBlocks[lenght] = false; + } + } - // SolidBlocks - for (int lenght=0; lenght1){ - BBlock block=SolidBlockFromId(input, new Vector2(pos*16, lenght*16)); - if (block!=null){ - if (ss>lenght) ss=lenght; - chunk.SolidBlocks[lenght]=block; - chunk.IsSolidBlocks[lenght]=true; - } else { - // chunk.SolidBlocks[lenght]=new BBlockEmptySolid(){ - // /*Back=*/chunk.Background[lenght]; - // /*Top=*/chunk.TopBlocks[lenght]; - //}; - } - } else if (input==1){ - int skip=br.ReadByte(); - // int to=lenght+skip; - //for (int i=lenght; i 1) { + BBlock block=SolidBlockFromId(input, new Vector2(xPos16, lenght*16)); + if (block != null) { + if (ss > lenght) ss = lenght; + chunk.SolidBlocks[lenght] = block; + chunk.IsSolidBlocks[lenght] = true; + } + else { + // chunk.SolidBlocks[lenght]=new BBlockEmptySolid(){ + // /*Back=*/chunk.Background[lenght]; + // /*Top=*/chunk.TopBlocks[lenght]; //}; } } + else if (input == 1) { + int skip=br.ReadByte(); + // int to=lenght+skip; + //for (int i=lenght; i terrain = new List(); + readonly List terrain = new(); List biomes; bool seabedSand; @@ -836,7 +842,7 @@ public class BGenerateWorld { File.WriteAllText(Setting.Path+"\\MenuBackgroundChunks.txt", (terrain.Count-7).ToString()); Finish=true; #if DEBUG - Console.WriteLine("Vygenerováno za "+(((DateTime.Now-now).TotalMilliseconds)/1000f).ToString(".000")+"s"); + Debug.WriteLine("Vygenerováno za "+(((DateTime.Now-now).TotalMilliseconds)/1000f).ToString(".000")+"s"); #endif } @@ -868,7 +874,6 @@ public class BGenerateWorld { // Water for (int yy = waterHeight; yy - backBlocks=new List(), - solidBlocks= new List(), - topBlocks= new List(); - - byte - backblockzeros = 0, + using FileStream stream = new(Setting.Path + "\\MenuBackground.ter", FileMode.Create, FileAccess.Write); + for (int x = 0; x < terrain.Count - 7; x++) { + BGChunk chunk=terrain[x]; + List + backBlocks=new(), + solidBlocks= new(), + topBlocks= new(); + + byte + backblockzeros = 0, topblockzeros = 0, solidblockzeros = 0; - for (int i=0; i2) { - backBlocks.Add(1); - backBlocks.Add(backblockzeros); - } else { - for (int j = 0; j 2) { + backBlocks.Add(1); + backBlocks.Add(backblockzeros); } + else { + for (int j = 0; j < backblockzeros; j++) backBlocks.Add(0); + } + backblockzeros = 0; + } - backBlocks.Add(chunk.BackBlocks[i]); - - } else backblockzeros++; + backBlocks.Add(chunk.BackBlocks[i]); - //Solid blocks - if (chunk.Blocks[i]!=0) { - if (solidblockzeros!=0) { - if (solidblockzeros>2) { - solidBlocks.Add(1); - solidBlocks.Add(solidblockzeros); - } else { - for (int j = 0; j 2) { + solidBlocks.Add(1); + solidBlocks.Add(solidblockzeros); } - solidBlocks.Add(chunk.Blocks[i]); - } else solidblockzeros++; - - //Top blocks - if (chunk.TopBlocks[i]!=0) { - - if (topblockzeros!=0) { - if (topblockzeros>2) { - topBlocks.Add(1); - topBlocks.Add(topblockzeros); - } else { - for (int j = 0; j2) { - backBlocks.Add(1); - backBlocks.Add(backblockzeros); - } else { - for (int j = 0; j2) { - solidBlocks.Add(1); - solidBlocks.Add(solidblockzeros); - } else { - for (int j = 0; j 2) { + topBlocks.Add(1); + topBlocks.Add(topblockzeros); + } + else { + for (int j = 0; j < topblockzeros; j++) topBlocks.Add(0); + } + topblockzeros = 0; + } - if (topblockzeros>2) { - topBlocks.Add(1); - topBlocks.Add(topblockzeros); - } else { - for (int j = 0; j 2) { + backBlocks.Add(1); + backBlocks.Add(backblockzeros); + } + else { + for (int j = 0; j < backblockzeros; j++) backBlocks.Add(0); + } - stream.Write(backBlocks.ToArray(), 0, backBlocks.Count); - stream.Write(topBlocks.ToArray(), 0, topBlocks.Count); - stream.Write(solidBlocks.ToArray(), 0, solidBlocks.Count); + if (solidblockzeros > 2) { + solidBlocks.Add(1); + solidBlocks.Add(solidblockzeros); + } + else { + for (int j = 0; j < solidblockzeros; j++) solidBlocks.Add(0); + } - //state++; + if (topblockzeros > 2) { + topBlocks.Add(1); + topBlocks.Add(topblockzeros); + } + else { + for (int j = 0; j < topblockzeros; j++) topBlocks.Add(0); } + + stream.WriteByte(chunk.LightPos); + + stream.Write(backBlocks.ToArray(), 0, backBlocks.Count); + stream.Write(topBlocks.ToArray(), 0, topBlocks.Count); + stream.Write(solidBlocks.ToArray(), 0, solidBlocks.Count); + + //state++; } } #region Structures void TreeApple(int x, int y) { treeChange=2+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.AppleWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.AppleWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.AppleWood; - terrain[x+1].BackBlocks[y-3]=(byte)BackBlockId.AppleWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.AppleWood; - terrain[x+1].BackBlocks[y-5]=(byte)BackBlockId.AppleWood; - terrain[x-1].BackBlocks[y-5]=(byte)BackBlockId.AppleWood; - terrain[x+1].BackBlocks[y-6]=(byte)BackBlockId.AppleWood; - terrain[x+2].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x-2].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x+1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x-1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x+2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x-2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x+1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x-1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x+1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x-1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x+1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x-1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; - terrain[x].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.AppleWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.AppleWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.AppleWood; + chunkP1.BackBlocks[y-3]=(byte)BackBlockId.AppleWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.AppleWood; + chunkP1.BackBlocks[y-5]=(byte)BackBlockId.AppleWood; + chunkM1.BackBlocks[y-5]=(byte)BackBlockId.AppleWood; + chunkP1.BackBlocks[y-6]=(byte)BackBlockId.AppleWood; + chunkP2.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkM2.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkP1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkM1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunk0 .TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkP2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkM2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkP1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkM1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunk0 .TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkP1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkM1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunk0 .TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkP1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunkM1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; + chunk0 .TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.AppleLeavesWithApples : (byte)BackBlockId.AppleLeaves; } void TreeOrange(int x, int y) { treeChange=2+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.OrangeWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.OrangeWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.OrangeWood; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.OrangeWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.OrangeWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.OrangeWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.OrangeWood; - terrain[x].BackBlocks[y-5]=(byte)BackBlockId.OrangeWood; - terrain[x].BackBlocks[y-6]=(byte)BackBlockId.OrangeWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.OrangeWood; + chunk0.BackBlocks[y-5]=(byte)BackBlockId.OrangeWood; + chunk0.BackBlocks[y-6]=(byte)BackBlockId.OrangeWood; - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-4]=(byte)BackBlockId.OrangeWood; - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-5]=(byte)BackBlockId.OrangeWood; - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-7]=(byte)BackBlockId.OrangeWood; + if (FastRandom.Bool()) chunkM1.BackBlocks[y-4]=(byte)BackBlockId.OrangeWood; + if (FastRandom.Bool()) chunkP1.BackBlocks[y-5]=(byte)BackBlockId.OrangeWood; + if (FastRandom.Bool()) chunkM1.BackBlocks[y-7]=(byte)BackBlockId.OrangeWood; if (FastRandom.Bool()) { - terrain[x+1].BackBlocks[y-7]=(byte)BackBlockId.OrangeWood; - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-8]=(byte)BackBlockId.OrangeWood; + chunkP1.BackBlocks[y-7]=(byte)BackBlockId.OrangeWood; + if (FastRandom.Bool()) chunkP1.BackBlocks[y-8]=(byte)BackBlockId.OrangeWood; } - terrain[x+1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - - terrain[x].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-1].TopBlocks[y-5]=(byte)BackBlockId.OrangeLeaves; - - terrain[x].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+2].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-2].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - - terrain[x].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+2].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-2].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+1].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-1].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - - terrain[x].TopBlocks[y-8]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+2].TopBlocks[y-8]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-2].TopBlocks[y-8]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x+1].TopBlocks[y-8]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-1].TopBlocks[y-8]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - - terrain[x+1].TopBlocks[y-9]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x-1].TopBlocks[y-9]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; - terrain[x].TopBlocks[y-9]=FastRandom.Int(3)==1 ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunk0 .TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + + chunk0 .TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM1.TopBlocks[y-5]=(byte)BackBlockId.OrangeLeaves; + + chunk0 .TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP2.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM2.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + + chunk0 .TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP2.TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM2.TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP1.TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM1.TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + + chunk0 .TopBlocks[y-8]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP2.TopBlocks[y-8]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM2.TopBlocks[y-8]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkP1.TopBlocks[y-8]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM1.TopBlocks[y-8]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + + chunkP1.TopBlocks[y-9]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunkM1.TopBlocks[y-9]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; + chunk0 .TopBlocks[y-9]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.OrangeLeavesWithOranges : (byte)BackBlockId.OrangeLeaves; } void TreeLemon(int x, int y) { treeChange=2+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.LemonWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.LemonWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.LemonWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.LemonWood; - - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-4]=(byte)BackBlockId.LemonWood; - else terrain[x+1].BackBlocks[y-5]=(byte)BackBlockId.LemonWood; - - terrain[x+1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x-1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - - terrain[x].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x+2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x-2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x+1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x-1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - - terrain[x].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x+2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x-2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x+1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x-1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - - terrain[x].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x+1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; - terrain[x-1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.LemonWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.LemonWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.LemonWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.LemonWood; + + if (FastRandom.Bool()) chunkM1.BackBlocks[y-4]=(byte)BackBlockId.LemonWood; + else chunkP1.BackBlocks[y-5]=(byte)BackBlockId.LemonWood; + + chunkP1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkM1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunk0 .TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + + chunk0 .TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkP2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkM2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkP1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkM1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + + chunk0 .TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkP2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkM2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkP1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkM1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + + chunk0 .TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkP1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; + chunkM1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.LemonLeavesWithLemons : (byte)BackBlockId.LemonLeaves; } void TreeCherry(int x, int y) { treeChange=2+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.CherryWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.CherryWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.CherryWood; - terrain[x-1].BackBlocks[y-3]=(byte)BackBlockId.CherryWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.CherryWood; - terrain[x-1].BackBlocks[y-5]=(byte)BackBlockId.CherryWood; - terrain[x+1].BackBlocks[y-5]=(byte)BackBlockId.CherryWood; - terrain[x-1].BackBlocks[y-6]=(byte)BackBlockId.CherryWood; - terrain[x+1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x-1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x+2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x-2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x+1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x-1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x+2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x-2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x+1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x-1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x+1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x-1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x+1].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x-1].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; - terrain[x].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.CherryWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.CherryWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.CherryWood; + chunkM1.BackBlocks[y-3]=(byte)BackBlockId.CherryWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.CherryWood; + chunkM1.BackBlocks[y-5]=(byte)BackBlockId.CherryWood; + chunkP1.BackBlocks[y-5]=(byte)BackBlockId.CherryWood; + chunkM1.BackBlocks[y-6]=(byte)BackBlockId.CherryWood; + chunkP1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkM1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunk0 .TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkP2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkM2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkP1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkM1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunk0 .TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkP2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkM2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkP1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkM1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunk0 .TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkP1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkM1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunk0 .TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkP1.TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunkM1.TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; + chunk0 .TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.CherryLeavesWithCherries : (byte)BackBlockId.CherryLeaves; } void TreePlum(int x, int y) { treeChange=2+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.PlumWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.PlumWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.PlumWood; - terrain[x-1].BackBlocks[y-3]=(byte)BackBlockId.PlumWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.PlumWood; - terrain[x-1].BackBlocks[y-5]=(byte)BackBlockId.PlumWood; - terrain[x+1].BackBlocks[y-5]=(byte)BackBlockId.PlumWood; - terrain[x-1].BackBlocks[y-6]=(byte)BackBlockId.PlumWood; - terrain[x+1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x-1].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x].TopBlocks[y-3]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x+2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x-2].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x+1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x-1].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x].TopBlocks[y-4]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x+2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x-2].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x+1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x-1].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x].TopBlocks[y-5]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x+1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x-1].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x].TopBlocks[y-6]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; - terrain[x].TopBlocks[y-7]=FastRandom.Int(3)==1 ? (byte)BackBlockId.PlumLeavesWithPlums: (byte)BackBlockId.PlumLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.PlumWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.PlumWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.PlumWood; + chunkM1.BackBlocks[y-3]=(byte)BackBlockId.PlumWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.PlumWood; + chunkM1.BackBlocks[y-5]=(byte)BackBlockId.PlumWood; + chunkP1.BackBlocks[y-5]=(byte)BackBlockId.PlumWood; + chunkM1.BackBlocks[y-6]=(byte)BackBlockId.PlumWood; + chunkP1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkM1.TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunk0 .TopBlocks[y-3]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkP2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkM2.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkP1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkM1.TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunk0 .TopBlocks[y-4]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkP2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkM2.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkP1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkM1.TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunk0 .TopBlocks[y-5]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkP1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunkM1.TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunk0 .TopBlocks[y-6]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums : (byte)BackBlockId.PlumLeaves; + chunk0 .TopBlocks[y-7]=FastRandom.Bool_33_333Percent() ? (byte)BackBlockId.PlumLeavesWithPlums: (byte)BackBlockId.PlumLeaves; } void TreeOakMedium(int x, int y) { treeChange=2+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.OakWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.OakWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.OakWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.OakWood; - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-4]=(byte)BackBlockId.OakWood; - terrain[x].BackBlocks[y-6]=(byte)BackBlockId.OakWood; - terrain[x].BackBlocks[y-5]=(byte)BackBlockId.OakWood; - terrain[x-1].BackBlocks[y-7]=(byte)BackBlockId.OakWood; - terrain[x+1].BackBlocks[y-7]=(byte)BackBlockId.OakWood; - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-8]=(byte)BackBlockId.OakWood; - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-8]=(byte)BackBlockId.OakWood; - if (FastRandom.Bool_20Percent()) terrain[x-2].BackBlocks[y-7]=(byte)BackBlockId.OakWood; - terrain[x+1].TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; - terrain[x+1].TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; - terrain[x+2].TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; - terrain[x-2].TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; - terrain[x+1].TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; - terrain[x+2].TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; - terrain[x-2].TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; - terrain[x+1].TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; - terrain[x+2].TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; - terrain[x-2].TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; - terrain[x+1].TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; - terrain[x-2].TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; - terrain[x+2].TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; - terrain[x+1].TopBlocks[y-9]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-9]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-9]=(byte)BackBlockId.OakLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.OakWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.OakWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.OakWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.OakWood; + if (FastRandom.Bool()) chunkP1.BackBlocks[y-4]=(byte)BackBlockId.OakWood; + chunk0.BackBlocks[y-6]=(byte)BackBlockId.OakWood; + chunk0.BackBlocks[y-5]=(byte)BackBlockId.OakWood; + chunkM1.BackBlocks[y-7]=(byte)BackBlockId.OakWood; + chunkP1.BackBlocks[y-7]=(byte)BackBlockId.OakWood; + if (FastRandom.Bool()) chunkP1.BackBlocks[y-8]=(byte)BackBlockId.OakWood; + if (FastRandom.Bool()) chunkM1.BackBlocks[y-8]=(byte)BackBlockId.OakWood; + if (FastRandom.Bool_20Percent()) chunkM2.BackBlocks[y-7]=(byte)BackBlockId.OakWood; + chunkP1.TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; + chunk0.TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; + chunkP1.TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; + chunk0.TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; + chunkP2.TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; + chunkM2.TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; + chunkP1.TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; + chunk0 .TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; + chunkP2.TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; + chunkM2.TopBlocks[y-6]=(byte)BackBlockId.OakLeaves; + chunkP1.TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; + chunk0 .TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; + chunkP2.TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; + chunkM2.TopBlocks[y-7]=(byte)BackBlockId.OakLeaves; + chunkP1.TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; + chunk0 .TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; + chunkM2.TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; + chunkP2.TopBlocks[y-8]=(byte)BackBlockId.OakLeaves; + chunkP1.TopBlocks[y-9]=(byte)BackBlockId.OakLeaves; + chunk0 .TopBlocks[y-9]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-9]=(byte)BackBlockId.OakLeaves; } void TreePine(int x, int y) { treeChange=3+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-5]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-6]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-7]=(byte)BackBlockId.PineWood; - if (FastRandom.Bool()) terrain[x].BackBlocks[y-8]=(byte)BackBlockId.PineWood; - terrain[x+2].TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; - terrain[x-2].TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; - terrain[x+1].TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; - terrain[x].TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; - terrain[x-1].TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; - terrain[x+2].TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; - terrain[x].TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; - terrain[x-2].TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; - terrain[x].TopBlocks[y-9]=(byte)BackBlockId.PineLeaves; - terrain[x-1].TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; - terrain[x+1].TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-5]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-6]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-7]=(byte)BackBlockId.PineWood; + if (FastRandom.Bool()) chunk0.BackBlocks[y-8]=(byte)BackBlockId.PineWood; + chunkP2.TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; + chunkM2.TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; + chunkP1.TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; + chunk0 .TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; + chunkM1.TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; + chunkP2.TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; + chunk0 .TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; + chunkM2.TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; + chunk0 .TopBlocks[y-9]=(byte)BackBlockId.PineLeaves; + chunkM1.TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; + chunkP1.TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; } void TreePineJunle(int x, int y) { treeChange=3+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-5]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-6]=(byte)BackBlockId.PineWood; - terrain[x].BackBlocks[y-7]=(byte)BackBlockId.PineWood; - terrain[x+2].TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; - terrain[x-2].TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; - terrain[x+1].TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; - terrain[x].TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; - terrain[x-1].TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; - terrain[x].TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; - terrain[x+2].TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; - terrain[x].TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; - terrain[x-2].TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; - terrain[x].TopBlocks[y-9]=(byte)BackBlockId.PineLeaves; - terrain[x-1].TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; - terrain[x+1].TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; - //if (FastRandom.Int(3)==1) { - // terrain[x-2].BackBlocks[y-6]=(byte)BackBlockId.Liana; - // terrain[x-2].BackBlocks[y-6+1]=(byte)BackBlockId.Liana; - // if (FastRandom.Bool()) terrain[x-2].BackBlocks[y-6+2]=(byte)BackBlockId.Liana; - //} - //if (FastRandom.Int(3)==1) { - // terrain[x+2].BackBlocks[y-6]=(byte)BackBlockId.Liana; - // terrain[x+2].BackBlocks[y-6+1]=(byte)BackBlockId.Liana; - // if (FastRandom.Bool()) terrain[x+2].BackBlocks[y-6+2]=(byte)BackBlockId.Liana; - //} - //if (FastRandom.Int(3)==1) { - // //terrain[x+1].BackBlocks[y-122]=(byte)BackBlockId.Liana; - // //terrain[x+1].BackBlocks[y-122+1]=(byte)BackBlockId.Liana; - // if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-7+2]=(byte)BackBlockId.Liana; - //} - //if (FastRandom.Int(3)==1) { - // terrain[x-1].BackBlocks[y-7]=(byte)BackBlockId.Liana; - // terrain[x-1].BackBlocks[y-7+1]=(byte)BackBlockId.Liana; - // if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-7+2]=(byte)BackBlockId.Liana; - //} - //if (FastRandom.Int(3)==1) { - // terrain[x].BackBlocks[y-9]=(byte)BackBlockId.Liana; - // terrain[x].BackBlocks[y-9+1]=(byte)BackBlockId.Liana; - // if (FastRandom.Bool()) terrain[x].BackBlocks[y-9+2]=(byte)BackBlockId.Liana; - //} + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-5]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-6]=(byte)BackBlockId.PineWood; + chunk0.BackBlocks[y-7]=(byte)BackBlockId.PineWood; + chunkP2.TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; + chunkM2.TopBlocks[y-6]=(byte)BackBlockId.PineLeaves; + chunkP1.TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; + chunk0.TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; + chunkM1.TopBlocks[y-7]=(byte)BackBlockId.PineLeaves; + chunk0 .TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; + chunkP2.TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; + chunk0.TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; + chunkM2.TopBlocks[y-8]=(byte)BackBlockId.PineLeaves; + chunk0.TopBlocks[y-9]=(byte)BackBlockId.PineLeaves; + chunkM1.TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; + chunkP1.TopBlocks[y-10]=(byte)BackBlockId.PineLeaves; } void TreeSpruceBig(int x, int y) { treeChange=3+FastRandom.Int(2); - - terrain[x].BackBlocks[y]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.SpruceWood; - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-4]=(byte)BackBlockId.SpruceWood; - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-4]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-5]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-6]=(byte)BackBlockId.SpruceWood; - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-6]=(byte)BackBlockId.SpruceWood; - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-6]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-8]=(byte)BackBlockId.SpruceWood; - terrain[x+2].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x+1].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x-2].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x+2].TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; - terrain[x+1].TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; - terrain[x-2].TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; - terrain[x-2].TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; - terrain[x+1].TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; - terrain[x+2].TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; - terrain[x+1].TopBlocks[y-6]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-6]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-6]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-7]=(byte)BackBlockId.SpruceLeaves; - terrain[x+1].TopBlocks[y-7]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-7]=(byte)BackBlockId.SpruceLeaves; - terrain[x+1].TopBlocks[y-8]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-8]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-8]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-9]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-10]=(byte)BackBlockId.SpruceLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-1]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.SpruceWood; + if (FastRandom.Bool()) chunkP1.BackBlocks[y-4]=(byte)BackBlockId.SpruceWood; + if (FastRandom.Bool()) chunkM1.BackBlocks[y-4]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-5]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-6]=(byte)BackBlockId.SpruceWood; + if (FastRandom.Bool()) chunkP1.BackBlocks[y-6]=(byte)BackBlockId.SpruceWood; + if (FastRandom.Bool()) chunkM1.BackBlocks[y-6]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-8]=(byte)BackBlockId.SpruceWood; + chunkP2.TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunkP1.TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunkM2.TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunkP2.TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; + chunkP1.TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; + chunkM2.TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; + chunkM2.TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; + chunkP1.TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; + chunkP2.TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; + chunkP1.TopBlocks[y-6]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-6]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-6]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-7]=(byte)BackBlockId.SpruceLeaves; + chunkP1.TopBlocks[y-7]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-7]=(byte)BackBlockId.SpruceLeaves; + chunkP1.TopBlocks[y-8]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-8]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-8]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-9]=(byte)BackBlockId.SpruceLeaves; + chunk0 .TopBlocks[y-10]=(byte)BackBlockId.SpruceLeaves; } void TreeLinden(int x, int y) { treeChange=3+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.LindenWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.LindenWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.LindenWood; - terrain[x].BackBlocks[y-4]=(byte)BackBlockId.LindenWood; - terrain[x].BackBlocks[y-5]=(byte)BackBlockId.LindenWood; - - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-4]=(byte)BackBlockId.LindenWood; - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-4]=(byte)BackBlockId.LindenWood; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1], + chunkM2=terrain[x-2], + chunkP2=terrain[x+2]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.LindenWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.LindenWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.LindenWood; + chunk0.BackBlocks[y-4]=(byte)BackBlockId.LindenWood; + chunk0.BackBlocks[y-5]=(byte)BackBlockId.LindenWood; + + if (FastRandom.Bool()) chunkP1.BackBlocks[y-4]=(byte)BackBlockId.LindenWood; + if (FastRandom.Bool()) chunkM1.BackBlocks[y-4]=(byte)BackBlockId.LindenWood; if (FastRandom.Bool()) { - terrain[x-1].BackBlocks[y-5]=(byte)BackBlockId.LindenWood; - if (FastRandom.Bool()) terrain[x-1].BackBlocks[y-5]=(byte)BackBlockId.LindenWood; + chunkM1.BackBlocks[y-5]=(byte)BackBlockId.LindenWood; + if (FastRandom.Bool()) chunkM1.BackBlocks[y-5]=(byte)BackBlockId.LindenWood; } if (FastRandom.Bool()) { - terrain[x+1].BackBlocks[y-5]=(byte)BackBlockId.LindenWood; - if (FastRandom.Bool()) terrain[x+1].BackBlocks[y-5]=(byte)BackBlockId.LindenWood; + chunkP1.BackBlocks[y-5]=(byte)BackBlockId.LindenWood; + if (FastRandom.Bool()) chunkP1.BackBlocks[y-5]=(byte)BackBlockId.LindenWood; } - terrain[x].BackBlocks[y-6]=(byte)BackBlockId.LindenWood; - terrain[x].BackBlocks[y-7]=(byte)BackBlockId.LindenWood; - terrain[x].BackBlocks[y-8]=(byte)BackBlockId.LindenWood; - terrain[x-2].BackBlocks[y-6]=(byte)BackBlockId.LindenWood; - terrain[x+1].TopBlocks[y-4]=(byte)BackBlockId.LindenLeaves; - terrain[x].TopBlocks[y-4]=(byte)BackBlockId.LindenLeaves; - terrain[x-1].TopBlocks[y-4]=(byte)BackBlockId.LindenLeaves; - terrain[x+1].TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; - terrain[x].TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; - terrain[x-1].TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; - terrain[x+2].TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; - terrain[x-2].TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; - terrain[x+1].TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; - terrain[x].TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; - terrain[x-1].TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; - terrain[x+2].TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; - terrain[x-2].TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; - terrain[x+1].TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; - terrain[x].TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; - terrain[x-1].TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; - terrain[x+2].TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; - terrain[x-2].TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; - terrain[x+1].TopBlocks[y-8]=(byte)BackBlockId.LindenLeaves; - terrain[x].TopBlocks[y-8]=(byte)BackBlockId.LindenLeaves; - terrain[x-1].TopBlocks[y-8]=(byte)BackBlockId.LindenLeaves; - terrain[x+1].TopBlocks[y-9]=(byte)BackBlockId.LindenLeaves; - terrain[x].TopBlocks[y-9]=(byte)BackBlockId.LindenLeaves; - terrain[x-1].TopBlocks[y-9]=(byte)BackBlockId.LindenLeaves; - terrain[x].TopBlocks[y-10]=(byte)BackBlockId.LindenLeaves; + chunk0.BackBlocks[y-6]=(byte)BackBlockId.LindenWood; + chunk0.BackBlocks[y-7]=(byte)BackBlockId.LindenWood; + chunk0.BackBlocks[y-8]=(byte)BackBlockId.LindenWood; + chunkM2.BackBlocks[y-6]=(byte)BackBlockId.LindenWood; + chunkP1.TopBlocks[y-4]=(byte)BackBlockId.LindenLeaves; + chunk0.TopBlocks[y-4]=(byte)BackBlockId.LindenLeaves; + chunkM1.TopBlocks[y-4]=(byte)BackBlockId.LindenLeaves; + chunkP1.TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; + chunk0 .TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; + chunkM1.TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; + chunkP2.TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; + chunkM2.TopBlocks[y-5]=(byte)BackBlockId.LindenLeaves; + chunkP1.TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; + chunk0 .TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; + chunkM1.TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; + chunkP2.TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; + chunkM2.TopBlocks[y-6]=(byte)BackBlockId.LindenLeaves; + chunkP1.TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; + chunk0 .TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; + chunkM1.TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; + chunkP2.TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; + chunkM2.TopBlocks[y-7]=(byte)BackBlockId.LindenLeaves; + chunkP1.TopBlocks[y-8]=(byte)BackBlockId.LindenLeaves; + chunk0 .TopBlocks[y-8]=(byte)BackBlockId.LindenLeaves; + chunkM1.TopBlocks[y-8]=(byte)BackBlockId.LindenLeaves; + chunkP1.TopBlocks[y-9]=(byte)BackBlockId.LindenLeaves; + chunk0 .TopBlocks[y-9]=(byte)BackBlockId.LindenLeaves; + chunkM1.TopBlocks[y-9]=(byte)BackBlockId.LindenLeaves; + chunk0 .TopBlocks[y-10]=(byte)BackBlockId.LindenLeaves; } void TreeOakLittle(int x, int y) { treeChange=1+FastRandom.Int(2); - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.OakWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.OakWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.OakWood; - terrain[x+1].TopBlocks[y-3]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-3]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-3]=(byte)BackBlockId.OakLeaves; - terrain[x+1].TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; - terrain[x-1].TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; - terrain[x].TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.OakWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.OakWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.OakWood; + chunkP1.TopBlocks[y-3]=(byte)BackBlockId.OakLeaves; + chunk0.TopBlocks[y-3]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-3]=(byte)BackBlockId.OakLeaves; + chunkP1.TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; + chunk0.TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; + chunkM1.TopBlocks[y-4]=(byte)BackBlockId.OakLeaves; + chunk0.TopBlocks[y-5]=(byte)BackBlockId.OakLeaves; } void TreeSpruceLittle(int x, int y) { treeChange=1+FastRandom.Int(2); - - terrain[x].BackBlocks[y-1]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-2]=(byte)BackBlockId.SpruceWood; - terrain[x].BackBlocks[y-3]=(byte)BackBlockId.SpruceWood; - terrain[x+1].TopBlocks[y-2]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-2]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-2]=(byte)BackBlockId.SpruceLeaves; - terrain[x+1].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x-1].TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; - terrain[x].TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; + BGChunk + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkP1=terrain[x+1]; + + chunk0.BackBlocks[y-1]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-2]=(byte)BackBlockId.SpruceWood; + chunk0.BackBlocks[y-3]=(byte)BackBlockId.SpruceWood; + chunkP1.TopBlocks[y-2]=(byte)BackBlockId.SpruceLeaves; + chunk0.TopBlocks[y-2]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-2]=(byte)BackBlockId.SpruceLeaves; + chunkP1.TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunk0.TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunkM1.TopBlocks[y-3]=(byte)BackBlockId.SpruceLeaves; + chunk0.TopBlocks[y-4]=(byte)BackBlockId.SpruceLeaves; + chunk0.TopBlocks[y-5]=(byte)BackBlockId.SpruceLeaves; } - - //void OreCoal(int y) { - // terrain[pos-10].Blocks[y-1]=(byte)BackBlockId.Coal; - // terrain[pos-10].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10].Blocks[y+1]=(byte)BackBlockId.Coal; - - // terrain[pos-10+1].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10+1].Blocks[y+1]=(byte)BackBlockId.Coal; - - // terrain[pos-10+2].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10+2].Blocks[y+1]=(byte)BackBlockId.Coal; - - // terrain[pos-10+3].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10+3].Blocks[y+1]=(byte)BackBlockId.Coal; - - // terrain[pos-10+4].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10+5].Blocks[y]=(byte)BackBlockId.Coal; - - // terrain[pos-10-1].Blocks[y+1]=(byte)BackBlockId.Coal; - // terrain[pos-10-1].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10-1].Blocks[y-1]=(byte)BackBlockId.Coal; - - // terrain[pos-10-2].Blocks[y+1]=(byte)BackBlockId.Coal; - // terrain[pos-10-2].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10-2].Blocks[y-1]=(byte)BackBlockId.Coal; - - // terrain[pos-10-3].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10-3].Blocks[y-1]=(byte)BackBlockId.Coal; - - // terrain[pos-10-4].Blocks[y]=(byte)BackBlockId.Coal; - // terrain[pos-10-4].Blocks[y-1]=(byte)BackBlockId.Coal; - - // terrain[pos-10-5].Blocks[y]=(byte)BackBlockId.Coal; - //} - - //void OreIron(int y) { - // terrain[pos-10].Blocks[y]=(byte)BackBlockId.OreIron; - // terrain[pos-10].Blocks[y-1]=(byte)BackBlockId.OreIron; - // terrain[pos-10-1].Blocks[y]=(byte)BackBlockId.OreIron; - // terrain[pos-10-1].Blocks[y-1]=(byte)BackBlockId.OreIron; - // terrain[pos-10-1].Blocks[y-2]=(byte)BackBlockId.OreIron; - // terrain[pos-10-1].Blocks[y-3]=(byte)BackBlockId.OreIron; - // terrain[pos-10-1].Blocks[y-4]=(byte)BackBlockId.OreIron; - // terrain[pos-10-1].Blocks[y-5]=(byte)BackBlockId.OreIron; - // terrain[pos-10].Blocks[y+1]=(byte)BackBlockId.OreIron; - // terrain[pos-10].Blocks[y+2]=(byte)BackBlockId.OreIron; - // terrain[pos-10].Blocks[y+3]=(byte)BackBlockId.OreIron; - // terrain[pos-10].Blocks[y+4]=(byte)BackBlockId.OreIron; - // terrain[pos-10].Blocks[y+5]=(byte)BackBlockId.OreIron; - //} - - //void OreGold(int y) { - // terrain[pos-10].Blocks[y]=(byte)BackBlockId.OreGold; - // terrain[pos-10+1].Blocks[y]=(byte)BackBlockId.OreGold; - // terrain[pos-10+2].Blocks[y]=(byte)BackBlockId.OreGold; - // terrain[pos-10-3].Blocks[y]=(byte)BackBlockId.OreGold; - // terrain[pos-10-5].Blocks[y-1]=(byte)BackBlockId.OreGold; - // terrain[pos-10-6].Blocks[y-1]=(byte)BackBlockId.OreGold; - //} - - //void OreCopper(int y) { - // terrain[pos-10].Blocks[y]=(byte)BackBlockId.OreCopper; - // terrain[pos-10].Blocks[y+1]=(byte)BackBlockId.OreCopper; - // terrain[pos-10].Blocks[y+2]=(byte)BackBlockId.OreCopper; - // terrain[pos-10+1].Blocks[y+2]=(byte)BackBlockId.OreCopper; - // terrain[pos-10+1].Blocks[y+3]=(byte)BackBlockId.OreCopper; - // terrain[pos-10+2].Blocks[y+3]=(byte)BackBlockId.OreCopper; - // terrain[pos-10+3].Blocks[y+4]=(byte)BackBlockId.OreCopper; - // terrain[pos-10-1].Blocks[y-1]=(byte)BackBlockId.OreCopper; - // terrain[pos-10-1].Blocks[y-2]=(byte)BackBlockId.OreCopper; - // terrain[pos-10-2].Blocks[y-2]=(byte)BackBlockId.OreCopper; - // terrain[pos-10-2].Blocks[y-3]=(byte)BackBlockId.OreCopper; - // terrain[pos-10-3].Blocks[y-4]=(byte)BackBlockId.OreCopper; - //} - - //void OreTin(int y) { - // terrain[pos-10].Blocks[y]=(byte)BackBlockId.OreTin; - // terrain[pos-10].Blocks[y-1]=(byte)BackBlockId.OreTin; - // terrain[pos-10-1].Blocks[y+1]=(byte)BackBlockId.OreTin; - // terrain[pos-10-1].Blocks[y+2]=(byte)BackBlockId.OreTin; - //} - - //void OreSilver(int y) { - // terrain[pos-10].Blocks[y]=(byte)BackBlockId.OreSilver; - // terrain[pos-10+1].Blocks[y]=(byte)BackBlockId.OreSilver; - // terrain[pos-10+2].Blocks[y]=(byte)BackBlockId.OreSilver; - // terrain[pos-10-3].Blocks[y]=(byte)BackBlockId.OreSilver; - // terrain[pos-10-4].Blocks[y-1]=(byte)BackBlockId.OreSilver; - // terrain[pos-10-6].Blocks[y-1]=(byte)BackBlockId.OreSilver; - //} - - //void OreAliminium(int y) { - // terrain[pos-10].Blocks[y]=(byte)BackBlockId.OreAluminium; - // terrain[pos-10+1].Blocks[y]=(byte)BackBlockId.OreAluminium; - // terrain[pos-10+1].Blocks[y+1]=(byte)BackBlockId.OreAluminium; - // terrain[pos-10+3].Blocks[y+1]=(byte)BackBlockId.OreAluminium; - // terrain[pos-10+2].Blocks[y]=(byte)BackBlockId.OreAluminium; - // terrain[pos-10-3].Blocks[y]=(byte)BackBlockId.OreAluminium; - // terrain[pos-10-4].Blocks[y-1]=(byte)BackBlockId.OreAluminium; - // terrain[pos-10-6].Blocks[y]=(byte)BackBlockId.OreAluminium; - //} - - //void OreOil(int y) { - // if (FastRandom.Bool()) { - // terrain[pos-10+6].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10+5].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // } - - // terrain[pos-10+5].TopBlocks[y]=(byte)BackBlockId.Oil; - - // terrain[pos-10+4].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10+4].TopBlocks[y-1]=(byte)BackBlockId.Oil; - - // terrain[pos-10+3].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10+3].TopBlocks[y-1]=(byte)BackBlockId.Oil; - - // terrain[pos-10+2].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10+2].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // if (FastRandom.Bool()) terrain[pos-10+2].TopBlocks[y+1]=(byte)BackBlockId.Oil; - - // terrain[pos-10+1].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10+1].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // terrain[pos-10+1].TopBlocks[y+1]=(byte)BackBlockId.Oil; - - // terrain[pos-10].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // terrain[pos-10].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10].TopBlocks[y+1]=(byte)BackBlockId.Oil; - - // terrain[pos-10-2].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10-2].TopBlocks[y+1]=(byte)BackBlockId.Oil; - // terrain[pos-10-2].TopBlocks[y+1]=(byte)BackBlockId.Oil; - - // terrain[pos-10-1].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10-1].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // terrain[pos-10-1].TopBlocks[y-2]=(byte)BackBlockId.Oil; - // terrain[pos-10-1].TopBlocks[y+1]=(byte)BackBlockId.Oil; - - // terrain[pos-10-2].TopBlocks[y]=(byte)BackBlockId.Oil; - // terrain[pos-10-2].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // terrain[pos-10-2].TopBlocks[y-2]=(byte)BackBlockId.Oil; - // terrain[pos-10-2].TopBlocks[y+1]=(byte)BackBlockId.Oil; - - // terrain[pos-10-3].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // terrain[pos-10-3].TopBlocks[y+1]=(byte)BackBlockId.Oil; - // terrain[pos-10-3].TopBlocks[y]=(byte)BackBlockId.Oil; - - // terrain[pos-10-4].TopBlocks[y-1]=(byte)BackBlockId.Oil; - // terrain[pos-10-4].TopBlocks[y]=(byte)BackBlockId.Oil; - - // if (FastRandom.Bool()) terrain[pos-10-5].TopBlocks[y]=(byte)BackBlockId.Oil; - //} #endregion } public class BGChunk { - public byte[] Blocks = new byte[Background.MaxIndex]; - public byte[] TopBlocks = new byte[Background.MaxIndex]; - public byte[] BackBlocks = new byte[Background.MaxIndex]; + public byte[] + Blocks = new byte[Background.MaxIndex], + TopBlocks = new byte[Background.MaxIndex], + BackBlocks = new byte[Background.MaxIndex]; public byte LightPos; } public class BTerrain { - public BBlock[] SolidBlocks = new BBlock[rabcrClient.Background.MaxIndex]; - public BBlock[] TopBlocks = new BBlock[rabcrClient.Background.MaxIndex]; - public BBlock[] Background = new BBlock[rabcrClient.Background.MaxIndex]; + public BBlock[] + SolidBlocks = new BBlock[rabcrClient.Background.MaxIndex], + TopBlocks = new BBlock[rabcrClient.Background.MaxIndex], + Background = new BBlock[rabcrClient.Background.MaxIndex]; - public bool[] IsSolidBlocks = new bool[rabcrClient.Background.MaxIndex]; - public bool[] IsTopBlocks = new bool[rabcrClient.Background.MaxIndex]; - public bool[] IsBackground = new bool[rabcrClient.Background.MaxIndex]; + public bool[] + IsSolidBlocks = new bool[rabcrClient.Background.MaxIndex], + IsTopBlocks = new bool[rabcrClient.Background.MaxIndex], + IsBackground = new bool[rabcrClient.Background.MaxIndex]; - public byte LightPos; + public byte LightPos, + StartSomething; public Vector2 LightVec; - public byte StartSomething; public int LightPos16; } @@ -2929,33 +2847,22 @@ public abstract class BBlock { public class BBlockNormal : BBlock{ + public static Color White=Color.White; public Texture2D Texture; public Vector2 Pos; - public static Color White= Color.White; - + public BBlockNormal(){ } - public BBlockNormal(Texture2D texture, Vector2 pos) { - Texture=texture; - Pos=pos; - } + //public BBlockNormal(Texture2D texture, Vector2 pos) { + // Texture=texture; + // Pos=pos; + //} public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Pos, White); } // Top and Back - public class BBlockEmpty: BBlock { - public override void Draw() { } - } - - // Only solid - //public class BBlockEmptySolid : BBlock{ - - // public BBlock Top, Back; - - // public override void Draw() { - // Back.Draw(); - // Top.Draw(); - // } + //public class BBlockEmpty: BBlock { + // public override void Draw() { } //} } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs index 429b56c..311b37a 100644 --- a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs +++ b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs @@ -148,7 +148,8 @@ public class Rabcr : Game { // Graphics.RasterizerState.MultiSampleAntiAlias=true; GraphicsManager.PreparingDeviceSettings += new EventHandler(graphics_PreparingDeviceSettings); - void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) { + + static void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) { if (Setting.GraphicsProfile==GraphicsProfile.HiDef) { try { e.GraphicsDeviceInformation.GraphicsProfile = Setting.GraphicsProfile; diff --git a/rabcrClient/Particles.cs b/rabcrClient/Particles.cs index dd19f9a..8e276fe 100644 --- a/rabcrClient/Particles.cs +++ b/rabcrClient/Particles.cs @@ -170,7 +170,7 @@ class FallingLeave { public float VSpeed; public Rectangle srcrec; - // public Color Color = ; + public Color color = Color.White; readonly float size; public FallingLeave(int x, int y, /*float size,*/ bool leftWind, bool rain, Rectangle src) { @@ -198,7 +198,7 @@ class FallingLeave { position: /*new Vector2(*/Position/*.X, Position.Y)*/, sourceRectangle: srcrec, effects: SpriteEffects.None, - color: Color.White*alpha, + color: color*alpha, scale: /*1f*/0.5f*size+0.5f, rotation: angle, origin: /*vecOrigin*/Vector2.Zero, diff --git a/rabcrClient/Program.cs b/rabcrClient/Program.cs index 4a774a5..2a5360c 100644 --- a/rabcrClient/Program.cs +++ b/rabcrClient/Program.cs @@ -7,9 +7,9 @@ public static class Program { [STAThread] static void Main(string[] args) { -#if !DEBUG + #if !DEBUG try{ -#endif + #endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); @@ -29,14 +29,6 @@ public static class Program { Setting.Path=args[1]+"\\"+Setting.Name+"\\"; new Rabcr().Run(); //} - } else if (args.Length==4 && (args[2].ToLower()=="geft"||args[2].ToLower()=="geftgames") && args[3].StartsWith("%") && args[3].Replace("%", "")==DateTime.Now.Day.ToString()) { - // if (BanStateProcedure()){ - // Global.Logged=true; - // Global.OnlineAccount=false; - Setting.Name="Geft"; - Setting.Path=args[1]+"\\"+Setting.Name+"\\"; - using var game = new Rabcr(); game.Run(); - // } } else ShowError("Zkontrolujte si dvojté uvozovky v argumentu programu"); break; @@ -86,61 +78,6 @@ public static class Program { // } } - //bool BanStateProcedure() { - // string cc= RegionInfo.CurrentRegion.TwoLetterISORegionName; - - // if (Rabcr.IsBannedCountry=IfBanedCountry()){ - // string day=SomeImportantDay(); - // if (day==null){ - // if ((Rabcr.random=new FastRandom()).Int(10)==1) { - // FormBanCountry fbc=new FormBanCountry(null); - // fbc.ShowDialog(); - // return fbc.RunGame; - // }else return true; - // } else { - // FormBanCountry fbc=new FormBanCountry(day); - // fbc.ShowDialog(); - // return fbc.RunGame; - // } - // } else if (Rabcr.IsLimitedCountry=IfLimitedCountry()) { - // string day=SomeImportantDay(); - // if (day!=null) { - // if ((Rabcr.random=new FastRandom()).Int(3)==1) { - // FormBanCountry fbc=new FormBanCountry(day); - // fbc.ShowDialog(); - // return fbc.RunGame; - // }else return true; - // } else return true; - // } else return true; - - // bool IfBanedCountry() { - // foreach (string c in Release.BannedStates) { - // if (c==cc)return true; - // } - // return false; - // } - - // bool IfLimitedCountry() { - // foreach (string c in Release.LimitedStates) { - // if (c==cc) return true; - // } - // return false; - // } - - // string SomeImportantDay(){ - // DateTime now=DateTime.Now; - // int day=now.Day, - // month=now.Month; - - // foreach (Release.GDay c in Release.Sometime) { - // if (c.Day==day) { - // if (c.Month==month) return c.Name; - // } - // } - // return null; - // } - //} - static void ShowError(string error) { Console.WriteLine("ERROR - Hra by se měla spouštět: rabcr.exe /Game "); MessageBox.Show("Hra by se měla spouštět: rabcr.exe /Game \r\n\r\nPodrobnosti:\r\n"+error,"Chyba - špatné argumenty", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -150,141 +87,6 @@ public static class Program { } catch (Exception ex) { FormError fe=new(ex, DateTime.Now); fe.ShowDialog(); - - // CultureInfo ci = CultureInfo.InstalledUICulture; - // string cap, text, details; - - // switch (ci.TwoLetterISOLanguageName) { - // case "cs": - // cap="Chyba hry"; - // text="Nastala chyba hry, chcete poslat vývojářům anonymní informace o chybě?"; - // details="Detail chyby"; - // break; - - // case "pl": - // cap="Błąd gry"; - // text="Wystąpił błąd w grze, czy chcesz wysłać anonimowe informacje o błędzie do programistów?"; - // details="Szczegóły błędu"; - // break; - - // case "sk": - // cap="Chyba hry"; - // text="Nastala chyba hry, chcete poslať vývojárom anonymné informácie o chybe?"; - // details="Detail chyby"; - // break; - - // case "de": - // cap="Spielfehler"; - // text="Es ist ein Spielfehler aufgetreten. Möchten Sie anonyme Fehlerinformationen an Entwickler senden?"; - // details="Fehlerdetail"; - // break; - - // case "jp": - // cap="ゲームエラー"; - // text="ゲームエラーが発生しました。匿名のエラー情報を開発者に送信しますか?"; - // details="エラーの詳細"; - // break; - - // default: - // cap="Game error"; - // text="A game error has occurred, do you want to send anonymous error information to developers?"; - // details="Error detail"; - // break; - // } - - // //try { - // DialogResult dr=MessageBox.Show(text+Environment.NewLine+Environment.NewLine+details+Environment.NewLine+ex.Message, cap, MessageBoxButtons.YesNo, MessageBoxIcon.Error); - // if (dr==DialogResult.Yes) { - // ManagementObjectSearcher searcher = new("SELECT * FROM Win32_DisplayConfiguration"); - - // // graphics - // string graphicsCard = string.Empty; - // foreach (ManagementObject mo in searcher.Get()) { - // foreach (PropertyData property in mo.Properties) { - // if (property.Name == "Description") { - // graphicsCard = property.Value.ToString(); - // } - // } - // } - - // // Ram - // ManagementObjectSearcher search = new ManagementObjectSearcher("Select * From Win32_PhysicalMemory"); - // ulong total = 0; - // foreach (ManagementObject ram in search.Get()) { - // total += (ulong)ram.GetPropertyValue("Capacity"); - // } - - // string send= - // "?a="+Release.VersionString + - // "&b="+Release.Date.Replace(" ", "%20") + - // "&c="+GetOsVersionText()+ "%20"+RuntimeInformation.OSArchitecture + - // "&d="+ Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")+ - // "&e="+Environment.ProcessorCount.ToString() + - // "&f="+graphicsCard.Replace(" ", "%20") + - // "&g="+ex.Message.Replace(" ", "%20") + - // "&p="+CultureInfo.InstalledUICulture.Name; - - // // StackTrace - // System.Diagnostics.StackTrace st=new System.Diagnostics.StackTrace(ex, true); - // int count = st.FrameCount; - - - // if (count>1) { - // StackFrame sf2=st.GetFrame(1); - // FileInfo fi2 =new FileInfo(sf2.GetFileName()); - // string trace="&r="+fi2.Name+"-method: "+sf2.GetMethod().Name.ToString()+ ", line: "+sf2.GetFileLineNumber() +Environment.NewLine; - // trace=trace.Replace(" ","%20"); - // send+=trace; - // } else send+="&r="; - - // // trace inner - // if (count>0) { - // System.Diagnostics.StackFrame sf = st.GetFrame(0); - // FileInfo fi = new(sf.GetFileName()); - // string trace = "&h="+fi.Name+"-method: "+sf.GetMethod().Name.ToString()+", line: "+sf.GetFileLineNumber()+Environment.NewLine; - // trace=trace.Replace(" ", "%20"); - // send+=trace; - // } else send+="&h="; - - - //Clipboard.SetText(Release.stringRRE+send); - // // Antispawn - // System.Threading.Thread.Sleep(200); - - // // Run - // WebClient wc=new(); - // string result=wc.DownloadString(Release.stringRRE+send); - // //System.Diagnostics.Process.Start(); - // if (result.StartsWith("O|")){ - // Console.WriteLine("send"); - // }else Console.WriteLine("not send"); - - - // // Antispawn - // System.Threading.Thread.Sleep(200); - // Environment.Exit(-1); - - // static string GetOsVersionText(){ - // return Environment.OSVersion.Version.Major switch { - // 10 => "win10", - // 6 => Environment.OSVersion.Version.Minor switch { - // 1 => "win 7 (or 2008 R2)", - // 2 => "win 8", - // 3 => "win 8.1", - // 0 => "win Vista (or 2008)", - // _ => "win", - // }, - // 5 => Environment.OSVersion.Version.Minor switch { - // 0 => "win 2000", - // 1 => "win XP", - // 2 => "win 2003", - // _ => "win", - // }, - // _ => "win", - // }; - // } - // } - } #endif } diff --git a/rabcrClient/rabcrClient.csproj b/rabcrClient/rabcrClient.csproj index 9d7b27d..ed95b4a 100644 --- a/rabcrClient/rabcrClient.csproj +++ b/rabcrClient/rabcrClient.csproj @@ -45,7 +45,7 @@ 4 true Off - true + false MinimumRecommendedRules.ruleset false From be729bccec7321362c8c297a55ee723b0bda24c1 Mon Sep 17 00:00:00 2001 From: GeftGames <69598668+GeftGames@users.noreply.github.com> Date: Sat, 22 Jan 2022 19:49:29 +0100 Subject: [PATCH 55/55] updated --- .../InterLogic/Game/BlockType/Chicken.cs | 5 +- .../InterLogic/Game/BlockType/MFish.cs | 26 +-- rabcrClient/InterLogic/Game/BlockType/Mob.cs | 2 + .../InterLogic/Game/BlockType/Parrot.cs | 3 +- .../InterLogic/Game/BlockType/Rabbit.cs | 5 +- .../InterLogic/Game/Terrain/MTerrain.cs | 7 +- .../Game/Terrain/MultiplayerMethods.cs | 99 +++++----- rabcrClient/InterLogic/Global/Global.cs | 6 +- .../InterLogic/Graphics/Screen/Rabcr.cs | 41 ++-- rabcrClient/InterLogic/TextDrawer.cs | 125 ++++++------- rabcrClient/LiveObject.cs | 12 +- .../GameStates/Game/Multiplayer.cs | 2 + .../GameStates/Game/Singleplayer.cs | 177 +++++++++--------- .../GameStates/Menu/MainMenu.cs | 3 +- .../GameStates/Menu/MenuCharacter.cs | 24 +-- .../GameStates/Menu/MenuMultiplayer.cs | 2 + .../Splash/FormLogin.Designer.cs | 2 + .../WindowsAndStates/Splash/FormLogin.cs | 2 + rabcrClient/rabcrClient.csproj | 45 ++++- 19 files changed, 321 insertions(+), 267 deletions(-) diff --git a/rabcrClient/InterLogic/Game/BlockType/Chicken.cs b/rabcrClient/InterLogic/Game/BlockType/Chicken.cs index c6a962e..c0ed5a5 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Chicken.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Chicken.cs @@ -122,7 +122,7 @@ class Chicken :Mob{ } } } - + #if MULTIPLAYER class MChicken :MMob{ public byte Frame; @@ -132,7 +132,7 @@ class MChicken :MMob{ public bool move; public byte moveCount; - public short lastChunkID; + // public short lastChunkID; public bool needToChangeChunk; public MoveType moveType; @@ -243,4 +243,5 @@ class MChicken :MMob{ } } } + #endif } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/BlockType/MFish.cs b/rabcrClient/InterLogic/Game/BlockType/MFish.cs index 88ffee1..ee6801f 100644 --- a/rabcrClient/InterLogic/Game/BlockType/MFish.cs +++ b/rabcrClient/InterLogic/Game/BlockType/MFish.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework.Graphics; namespace rabcrClient { + #if MULTIPLAYER class MFish :MMob{ // public bool IsLeft; public float speed; @@ -72,26 +73,5 @@ class MFish :MMob{ } } -} -/* -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -namespace rabcrClient { - public class Mob { - //public bool Dir; - public byte Height; - public byte Id; - public Vector2 position; - - public Mob() { } - - public Mob(byte id, byte height, Vector2 pos) { - Id=id; - Height=height; - position=pos; - } - - public void Draw(SpriteBatch s){ } - } -}*/ \ No newline at end of file + #endif +} \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/BlockType/Mob.cs b/rabcrClient/InterLogic/Game/BlockType/Mob.cs index ef6fc6a..fb400de 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Mob.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Mob.cs @@ -23,6 +23,7 @@ public abstract class Mob { public virtual void Draw() { } } + #if MULTIPLAYER public abstract class MMob { public byte Height { get { return (byte)(Position.Y/16); } @@ -42,4 +43,5 @@ public abstract class MMob { public virtual void Draw() { } } + #endif } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/BlockType/Parrot.cs b/rabcrClient/InterLogic/Game/BlockType/Parrot.cs index 6893504..c708ccc 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Parrot.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Parrot.cs @@ -122,7 +122,7 @@ class Parrot:Mob { } else Rabcr.spriteBatch.Draw(TextureStill, new Vector2(Position.X+5,Position.Y-10), Color.White); } } - + #if MULTIPLAYER class MParrot:MMob { #region Varibles @@ -242,4 +242,5 @@ class MParrot:MMob { } else Rabcr.spriteBatch.Draw(TextureStill, new Vector2(Position.X+5,Position.Y-10), Color.White); } } + #endif } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs b/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs index 5d1b102..1a30bad 100644 --- a/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs +++ b/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs @@ -135,12 +135,12 @@ class Rabbit:Mob { else Rabcr.spriteBatch.Draw(thisTexture, Position, rec/*new Rectangle((int)(Frame/16f)*16,0,16,16)*/, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); } } - + #if MULTIPLAYER class MRabbit:MMob { public byte Frame; public bool needToChangeChunk; public bool move; - public short lastChunkID; + // public short lastChunkID; public byte moveCount; public bool switchtoWalk; public MoveType moveType; @@ -265,4 +265,5 @@ class MRabbit:MMob { else Rabcr.spriteBatch.Draw(thisTexture, Position, new Rectangle((int)(Frame/16f)*16,0,16,16), Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); } } + #endif } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs b/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs index 5853aa7..fb9cdf9 100644 --- a/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs +++ b/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; namespace rabcrClient { + #if MULTIPLAYER public enum MChunkState:byte{ NotDownloaded, SendRequest, @@ -37,8 +38,8 @@ public int // public bool TopBlocksExists(int h) => IsTopBlocks[h]==MBlockState.Exist;//((int)IsTopBlocks[h] & 1)==1; - public List Mobs=new List(); - public List Plants=new List(); + public List Mobs=new(); + public List Plants=new(); public Vector2 LightVec; @@ -223,6 +224,6 @@ class SendedBlockToAdd:ChangeTerrain { public int SelectedInv; } - + #endif } \ No newline at end of file diff --git a/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs b/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs index 186ecac..ac1ed15 100644 --- a/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs +++ b/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs @@ -9,11 +9,12 @@ using System.Net.Sockets; namespace rabcrClient { + #if MULTIPLAYER partial class Multiplayer { int playerId=-1; #region varibles - List terrainChanges = new List(); - List Queue = new List(); + List terrainChanges = new(); + List Queue = new(); const string toServer = "{Server}"; const string toEveryone = "{Everyone}"; string SomeoneWantTeleportToYouName; @@ -49,7 +50,7 @@ enum LoginType { DateTime tpPlayerTime; string tpPlayerMsgWaiting; int safeSpawn = 0; - List players = new List(); + List players = new(); // bool UseBackColor; // Color BackColor; // bool UseGedo; @@ -237,9 +238,9 @@ enum LoginType { if (ipAddress.ToString()==IPAddress.Any.ToString()) { ipAddress=IPAddress.Loopback; ip=IPAddress.Loopback; } - IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port); + IPEndPoint ipEndPoint = new(ipAddress, port); - Console.WriteLine("Připojování: "+ipAddress.ToString()+":"+port); + Debug.WriteLine("Připojování: "+ipAddress.ToString()+":"+port); clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null); } @@ -252,9 +253,9 @@ enum LoginType { if (ipAddress.ToString()==IPAddress.Any.ToString()) ipAddress=IPAddress.Loopback; - IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port); + IPEndPoint ipEndPoint = new(ipAddress, port); - Console.WriteLine("Znovupřipojování: "+ipAddress.ToString()+":"+port); + Debug.WriteLine("Znovupřipojování: "+ipAddress.ToString()+":"+port); clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null); } @@ -271,8 +272,9 @@ enum LoginType { // Message = "" //}; - List bytesToSend=new List(); - bytesToSend.Add((byte)Command.Check); + List bytesToSend = new() { + (byte)Command.Check + }; AddStringToByteList(bytesToSend, Setting.Name); byteData = bytesToSend.ToArray(); @@ -1010,13 +1012,13 @@ enum LoginType { if (success) { playerId = byteData[3] | (byteData[4]>>8) | (byteData[5]>>16) | (byteData[6]>>24); - //PlayerX = (byteData[7] | (byteData[8]>>8)); - //PlayerY = byteData[9]; + //PlayerX = (byteData[7] | (byteData[8]>>8)); + //PlayerY = byteData[9]; - List bytesToSend = new List(); - bytesToSend.Add((byte)Command.PlayerPosition); - // bytesToSend.Add((byte)LoginType.BasicLogin); - AddStringToByteList(bytesToSend, Setting.Name); + List bytesToSend = new() { (byte)Command.PlayerPosition + }; + // bytesToSend.Add((byte)LoginType.BasicLogin); + AddStringToByteList(bytesToSend, Setting.Name); Queue.Add(new DataToSend { Bytes = bytesToSend.ToArray(), @@ -1148,26 +1150,26 @@ enum LoginType { case LoginType.FirstConnectPassword: { - using (Password p = new Password()) { - p.ShowDialog(); - if (p.Output!=null) { - //Data msg = new Data { - // Cmd=Command.SetPassword, - // // From=Setting.Name, - // To=toServer, - // Message=p.Output - //}; - - //Queue.Add(new DataToSend { - // Bytes=msg.ToByte(), - // Importance=Importance.VeryImportant - //}); - //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); - } else { - clientSocket.Disconnect(false); - } - } - } + using Password p = new(); + p.ShowDialog(); + if (p.Output != null) { + //Data msg = new Data { + // Cmd=Command.SetPassword, + // // From=Setting.Name, + // To=toServer, + // Message=p.Output + //}; + + //Queue.Add(new DataToSend { + // Bytes=msg.ToByte(), + // Importance=Importance.VeryImportant + //}); + //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null); + } + else { + clientSocket.Disconnect(false); + } + } break; case LoginType.LoginWithPassword: @@ -1203,10 +1205,10 @@ enum LoginType { // To=toServer, // Message="" //}; - List bytesToSend = new List(); - bytesToSend.Add((byte)Command.Login); - bytesToSend.Add((byte)LoginType.BasicLogin); - AddStringToByteList(bytesToSend, Setting.Name); + List bytesToSend = new() { (byte)Command.Login, + (byte)LoginType.BasicLogin + }; + AddStringToByteList(bytesToSend, Setting.Name); Queue.Add(new DataToSend { Bytes = bytesToSend.ToArray(), @@ -1226,7 +1228,7 @@ enum LoginType { // To = toServer, // Message = "" //}; - List bytesToSend = new List(); + List bytesToSend = new(); bytesToSend.Add((byte)Command.Login); bytesToSend.Add((byte)LoginType.FirstConnect); AddStringToByteList(bytesToSend, Setting.Name); @@ -1453,7 +1455,7 @@ enum LoginType { Debug.WriteLine("G|"+version+'|'+serverMessage+'|'+joinedPlayers+'|'+maxplayers); // Ask server what I need to join server - List bytesToSend=new List(); + List bytesToSend=new(); bytesToSend.Add((byte)Command.GetStatus); Queue.Add(new DataToSend { @@ -1567,15 +1569,16 @@ enum LoginType { if (Queue.Count == 0) { // if (cmd==Command.Blank) - // System.Threading.Thread.Sleep(10); - // else System.Threading.Thread.Sleep(5); + // System.Threading.Thread.Sleep(10); + // else System.Threading.Thread.Sleep(5); //Data data = new Data { // // From=Setting.Name, // To = toServer, // Cmd = Command.Blank //}; - ListbytesToSend=new List(); - bytesToSend.Add((byte)Command.Blank); + List bytesToSend = new() { + (byte)Command.Blank + }; try { byte[] bytes = bytesToSend.ToArray(); clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null); @@ -1797,8 +1800,9 @@ enum LoginType { // To=toServer, // Message="" //}; - List bytesToSend=new List(); - bytesToSend.Add((byte)Command.ConnectDuringGame); + List bytesToSend = new() { + (byte)Command.ConnectDuringGame + }; AddStringToByteList(bytesToSend,Setting.Name); byteData=bytesToSend.ToArray(); @@ -1930,4 +1934,5 @@ enum LoginType { } } + #endif } diff --git a/rabcrClient/InterLogic/Global/Global.cs b/rabcrClient/InterLogic/Global/Global.cs index 66526ac..0e8beea 100644 --- a/rabcrClient/InterLogic/Global/Global.cs +++ b/rabcrClient/InterLogic/Global/Global.cs @@ -15,9 +15,9 @@ static class Global { public static bool ChangedSettings; public static bool YoungPlayer=true; - public static bool OnlineAccount; - public static bool Logged; - public static string Pass; + // public static bool OnlineAccount; + // public static bool Logged; + // public static string Pass; public const float ScaleBigToMedium=0.4523809523809524f; public const float ScaleMediumToSmall=0.8421052631578947f; diff --git a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs index 311b37a..0d8fc1e 100644 --- a/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs +++ b/rabcrClient/InterLogic/Graphics/Screen/Rabcr.cs @@ -100,13 +100,28 @@ public class Rabcr : Game { //if (File.Exists(Path.GetTempPath()+"\\rabcrLastPassword.txt")) File.Delete(Path.GetTempPath()+"\\rabcrLastPassword.txt"); } - if (!Directory.Exists(Setting.Path))Directory.CreateDirectory(Setting.Path); - // if (!Directory.Exists(Setting.Path+"\\Logs"))Directory.CreateDirectory(Setting.Path+"\\Logs"); - if (!Directory.Exists(Setting.Path+"\\Worlds"))Directory.CreateDirectory(Setting.Path+"\\Worlds"); - + if (!Directory.Exists(Setting.Path)) { + try { + Directory.CreateDirectory(Setting.Path); + } catch (UnauthorizedAccessException) { + MessageBox.Show("Settings cannot be saved. This application does not have permissions to manipulate folders/files. Try run as administrator."); + } catch (Exception ex) { + throw ex; + } + } + + if (!Directory.Exists(Setting.Path+"\\Worlds")){ + try { + Directory.CreateDirectory(Setting.Path+"\\Worlds"); + } catch (UnauthorizedAccessException) { + MessageBox.Show("Folder for worlds cannot be created. This application does not have permissions to manipulate folders/files. Try run as administrator."); + } catch (Exception ex) { + throw ex; + } + } if (!Directory.Exists(new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName+"\\RabcrData")) { - switch (System.Globalization.CultureInfo.CurrentCulture.EnglishName){ + switch (System.Globalization.CultureInfo.CurrentCulture.EnglishName) { default: MessageBox.Show("Game data not found, game was probably runned from archive" #if DEBUG @@ -143,8 +158,8 @@ public class Rabcr : Game { GraphicsManager = new GraphicsDeviceManager(this); Graphics=GraphicsManager.GraphicsDevice; - GraphicsManager.PreferredBackBufferHeight =(int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height*0.6667f); - GraphicsManager.PreferredBackBufferWidth = (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width*0.6667f); + GraphicsManager.PreferredBackBufferHeight = (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height*0.6667f); + GraphicsManager.PreferredBackBufferWidth = (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width *0.6667f); // Graphics.RasterizerState.MultiSampleAntiAlias=true; GraphicsManager.PreparingDeviceSettings += new EventHandler(graphics_PreparingDeviceSettings); @@ -174,13 +189,13 @@ public class Rabcr : Game { Content = new ContentManager(Services, "RabcrData"); content=Content; - (Pixel = new Texture2D(GraphicsDevice, 1, 1)).SetData(new[] { Color.White }); + (Pixel = new Texture2D(GraphicsDevice, 1, 1)).SetData(new[] { Color.White }); (Pixel2 = new Texture2D(GraphicsDevice, 2, 2)).SetData(new[] { Color.White, Color.White, Color.White, Color.White }); Window.Position=new Microsoft.Xna.Framework.Point( - (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width/6f), - (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/7f) - ); + (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width/6f), + (int)(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/7f) + ); { Form MyGameForm = (Form)Control.FromHandle(Window.Handle); MyGameForm.LocationChanged+=Window_ClientSizeChanged; @@ -274,7 +289,9 @@ public class Rabcr : Game { } void MyGameForm_FormClosing(object sender, FormClosingEventArgs e) { + #if DEBUG Debug.WriteLine("Closing screen"); + #endif exiting=true; screen.Shutdown(); @@ -313,7 +330,7 @@ public class Rabcr : Game { if (resize) { GraphicsManager.ApplyChanges(); - if (screen!=null) screen.Resize(); + screen?.Resize(); } } diff --git a/rabcrClient/InterLogic/TextDrawer.cs b/rabcrClient/InterLogic/TextDrawer.cs index 9420374..c2dd25b 100644 --- a/rabcrClient/InterLogic/TextDrawer.cs +++ b/rabcrClient/InterLogic/TextDrawer.cs @@ -156,61 +156,61 @@ public class Text { } static bool IsArabicChar(char ch){ - switch (ch){ - case 'ا': return true; - case 'ب': return true; - case 'ت': return true; - case 'ث': return true; - case 'ج': return true; - case 'ح': return true; - case 'خ': return true; - case 'د': return true; - case 'ذ': return true; - case 'ر': return true; - case 'ز': return true; - case 'س': return true; - case 'ش': return true; - case 'ص': return true; - case 'ض': return true; - case 'ط': return true; - case 'ظ': return true; - case 'ع': return true; - case 'غ': return true; - case 'ف': return true; - case 'ق': return true; - case 'ك': return true; - case 'ل': return true; - case 'م': return true; - case 'ه': return true; - case 'ي': return true; - case 'و': return true; - case 'أ': return true; - case 'إ': return true; - case 'ؤ': return true; - case 'ئ': return true; - case 'آ': return true; - case 'ى': return true; - case 'ة': return true; - case 'ﻻ': return true; - case 'ن': return true; - case 'ﻹ': return true; - case 'ڭ': return true; - case 'ە': return true; - case 'ۇ': return true; - case 'چ': return true; - case 'ۈ': return true; - case 'ھ': return true; - case 'ک': return true; - case 'ی': return true; - case 'ہ': return true; - case 'ڑ': return true; - case 'ے': return true; - case 'ې': return true; - case 'ۆ': return true; - case 'ں': return true; - case 'گ': return true; - } - return false; + return ch switch { + 'ا' => true, + 'ب' => true, + 'ت' => true, + 'ث' => true, + 'ج' => true, + 'ح' => true, + 'خ' => true, + 'د' => true, + 'ذ' => true, + 'ر' => true, + 'ز' => true, + 'س' => true, + 'ش' => true, + 'ص' => true, + 'ض' => true, + 'ط' => true, + 'ظ' => true, + 'ع' => true, + 'غ' => true, + 'ف' => true, + 'ق' => true, + 'ك' => true, + 'ل' => true, + 'م' => true, + 'ه' => true, + 'ي' => true, + 'و' => true, + 'أ' => true, + 'إ' => true, + 'ؤ' => true, + 'ئ' => true, + 'آ' => true, + 'ى' => true, + 'ة' => true, + 'ﻻ' => true, + 'ن' => true, + 'ﻹ' => true, + 'ڭ' => true, + 'ە' => true, + 'ۇ' => true, + 'چ' => true, + 'ۈ' => true, + 'ھ' => true, + 'ک' => true, + 'ی' => true, + 'ہ' => true, + 'ڑ' => true, + 'ے' => true, + 'ې' => true, + 'ۆ' => true, + 'ں' => true, + 'گ' => true, + _ => false, + }; } void BuildTextArabic(string txt){ @@ -456,13 +456,10 @@ public class Text { 'ے' => false, #if DEBUG _ => throw new Exception("Missing arabic letter " + ch), + #else + _=> true #endif }; - -#if DEBUG -#else - return true; -#endif } static bool HaveFinalForm(char ch){ @@ -521,12 +518,10 @@ public class Text { 'ە' => true, #if DEBUG _ => throw new Exception("Missing arabic letter " + ch), + #else + _ => true #endif }; - -#if !DEBUG - return true; -#endif } public static char[] BuildArabicText(string txt) { @@ -1493,4 +1488,4 @@ class RenderEnngineDevanagari { } } } - } \ No newline at end of file +} \ No newline at end of file diff --git a/rabcrClient/LiveObject.cs b/rabcrClient/LiveObject.cs index 0f2d32a..81a354a 100644 --- a/rabcrClient/LiveObject.cs +++ b/rabcrClient/LiveObject.cs @@ -8,7 +8,7 @@ public abstract class LiveObject { public float angle; } - public class Cactus : LiveObject{ + public class Cactus : LiveObject { public List Titles; public Cactus(int x, int y) { @@ -28,8 +28,14 @@ public class Tree : LiveObject { TitlesWood=new List(); } - public void AddLeave(int x, int y) => TitlesLeaves.Add(new UShortAndByte((ushort)x, (byte)y)); + public Tree(ushort x, byte y) { + Root=new UShortAndByte(x, y); + TitlesLeaves=new List(); + TitlesWood=new List(); + } + + // public void AddLeave(int x, int y) => TitlesLeaves.Add(new UShortAndByte((ushort)x, (byte)y)); - public void AddWood(int x, int y) => TitlesLeaves.Add(new UShortAndByte((ushort)x, (byte)y)); + // public void AddWood(int x, int y) => TitlesLeaves.Add(new UShortAndByte((ushort)x, (byte)y)); } } \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs index 18d67cb..0e7b8be 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/Multiplayer.cs @@ -10,6 +10,7 @@ using Microsoft.Xna.Framework.Media; namespace rabcrClient { + #if MULTIPLAYER partial class Multiplayer : Screen { int animationInvBack=0; #region Multiplayer @@ -27078,4 +27079,5 @@ readonly Color } } } + #endif } \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs index 38f0331..ee8cf91 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Game/Singleplayer.cs @@ -5783,7 +5783,10 @@ readonly Color if (timer5==2) { UpdateLiquid((ushort)BlockId.WaterBlock); - if (wind){if (Global.WindowWidth>1000) WaveGrassDuringWind(); } + //UpdateLiquid((ushort)BlockId.Oil); + if (wind){ + if (Global.WindowWidth>1000) WaveGrassDuringWind(); + } } //// if (timer5==4) { @@ -15709,7 +15712,7 @@ readonly Color Tree tree=new( // Root - *current++ | (*current++<<8), + (ushort)(*current++ | (*current++<<8)), *current++ ); LiveObjects[i]=tree; @@ -15827,17 +15830,17 @@ readonly Color } - void CheckTerrain(string method) { - for (int x=0; xy-6) chunkM2.StartSomething=y-6; - if (chunkM1.StartSomething>y-9) chunkM1.StartSomething=y-9; + if (chunkM2.StartSomething>y-6) chunkM2.StartSomething=y-6; + if (chunkM1.StartSomething>y-9) chunkM1.StartSomething=y-9; if (chunk0. StartSomething>y-10) chunk0. StartSomething=y-10; - if (chunkP1.StartSomething>y-9) chunkP1.StartSomething=y-9; - if (chunkP2.StartSomething>y-6) chunkP2.StartSomething=y-6; + if (chunkP1.StartSomething>y-9) chunkP1.StartSomething=y-9; + if (chunkP2.StartSomething>y-6) chunkP2.StartSomething=y-6; } void TreeAcacia(int x, int y) { @@ -23734,13 +23738,13 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x, y-6, (ushort)BlockId.AcaciaLeaves, TextureAcaciaLeaves); Terrain - chunk0= terrain[x ], - chunkM1=terrain[x- 1], - chunkM2=terrain[x- 2], - chunkM3=terrain[x- 3], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2], - chunkP3=terrain[x+ 3]; + chunk0= terrain[x ], + chunkM1=terrain[x-1], + chunkM2=terrain[x-2], + chunkM3=terrain[x-3], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2], + chunkP3=terrain[x+3]; if (chunkM3.StartSomething>y-5) chunkM3.StartSomething=y-5; if (chunkM2.StartSomething>y-5) chunkM2.StartSomething=y-5; @@ -23769,9 +23773,9 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x, y-5, (ushort)BlockId.MangroveLeaves, TextureMangroveLeaves); Terrain - chunkM1=terrain[x- 1], - chunk0= terrain[x ], - chunkP1=terrain[x+ 1]; + chunkM1=terrain[x-1], + chunk0= terrain[x ], + chunkP1=terrain[x+1]; if (chunkM1.StartSomething>y-4) chunkM1.StartSomething=y-4; if (chunk0. StartSomething>y-5) chunk0. StartSomething=y-5; @@ -23823,11 +23827,11 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x+1, y-5, (ushort)BlockId.WillowLeaves, TextureWillowLeaves); Terrain - chunkM2=terrain[x- 2], - chunkM1=terrain[x- 1], - chunk0 =terrain[x ], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2]; + chunkM2=terrain[x-2], + chunkM1=terrain[x-1], + chunk0 =terrain[x ], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2]; if (chunkM2.StartSomething>y-4) chunkM2.StartSomething=y-4; if (chunkM1.StartSomething>y-5) chunkM1.StartSomething=y-5; @@ -23884,11 +23888,11 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x+1, y-7, (ushort)BlockId.EucalyptusLeaves, TextureEucalyptusLeaves); Terrain - chunkM2=terrain[x- 2], - chunkM1=terrain[x- 1], - chunk0= terrain[x ], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2]; + chunkM2=terrain[x-2], + chunkM1=terrain[x-1], + chunk0= terrain[x ], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2]; if (chunkM2.StartSomething>y-6) chunkM2.StartSomething=y-6; if (chunkM1.StartSomething>y-7) chunkM1.StartSomething=y-7; @@ -23931,11 +23935,11 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x+1, y-6, (ushort)BlockId.OliveLeaves, TextureOliveLeaves); Terrain - chunkM2=terrain[x- 2], - chunkM1=terrain[x- 1], - chunk0 =terrain[x ], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2]; + chunkM2=terrain[x-2], + chunkM1=terrain[x-1], + chunk0 =terrain[x ], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2]; if (chunkM2.StartSomething>y-8) chunkM2.StartSomething=y-5; if (chunkM1.StartSomething>y-6) chunkM1.StartSomething=y-6; @@ -23946,13 +23950,13 @@ string ConvertNormalToAtls(string key) void TreeKapok(int x, int y) { - TerrainSetBackground(x, y-1, (ushort)BlockId.KapokWood, TextureKapokWood); - TerrainSetBackground(x+1, y-1,(ushort)BlockId.KapokWood, TextureKapokWood); - TerrainSetBackground(x-1, y-1,(ushort)BlockId.KapokWood, TextureKapokWood); + TerrainSetBackground(x, y-1, (ushort)BlockId.KapokWood, TextureKapokWood); + TerrainSetBackground(x+1, y-1, (ushort)BlockId.KapokWood, TextureKapokWood); + TerrainSetBackground(x-1, y-1, (ushort)BlockId.KapokWood, TextureKapokWood); if (FastRandom.Bool()) { - TerrainSetBackground(x+1, y-2,(ushort)BlockId.KapokWood, TextureKapokWood); - TerrainSetBackground(x-1, y-2,(ushort)BlockId.KapokWood, TextureKapokWood); + TerrainSetBackground(x+1, y-2, (ushort)BlockId.KapokWood, TextureKapokWood); + TerrainSetBackground(x-1, y-2, (ushort)BlockId.KapokWood, TextureKapokWood); } TerrainSetBackground(x, y-2, (ushort)BlockId.KapokWood, TextureKapokWood); @@ -24047,11 +24051,11 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x, y-6,(ushort)BlockId.AppleLeaves, TextureAppleLeaves); Terrain - chunk0 =terrain[x ], - chunkM1=terrain[x- 1], - chunkM2=terrain[x- 2], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2]; + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkM2=terrain[x-2], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2]; if (chunkM2.StartSomething>y-4) chunkM2.StartSomething=y-4; if (chunkM1.StartSomething>y-6) chunkM1.StartSomething=y-6; @@ -24146,11 +24150,11 @@ string ConvertNormalToAtls(string key) Terrain - chunkM2=terrain[x- 2], - chunkM1=terrain[x- 1], - chunk0 =terrain[x ], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2]; + chunkM2=terrain[x-2], + chunkM1=terrain[x-1], + chunk0 =terrain[x ], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2]; if (chunkM2.StartSomething>y-5) chunkM2.StartSomething=y-5; if (chunkM1.StartSomething>y-6) chunkM1.StartSomething=y-6; @@ -24323,11 +24327,12 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x-1, y-10, (ushort)BlockId.PineLeaves, pineLeavesTexture); TerrainSetTopBlockNormal(x+1, y-10, (ushort)BlockId.PineLeaves, pineLeavesTexture); - Terrain chunk0=terrain[x ], - chunkM1=terrain[x- 1], - chunkM2=terrain[x- 2], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2]; + Terrain + chunk0 =terrain[x ], + chunkM1=terrain[x-1], + chunkM2=terrain[x-2], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2]; if (chunkM2.StartSomething>y-8 ) chunkM2.StartSomething=y-8; if (chunkM1.StartSomething>y-10) chunkM1.StartSomething=y-10; @@ -24434,11 +24439,11 @@ string ConvertNormalToAtls(string key) TerrainSetTopBlockNormal(x, y-10,(ushort)BlockId.LindenLeaves, TextureLindenLeaves); Terrain - chunkM2=terrain[x- 2], - chunkM1=terrain[x- 1], - chunk0 =terrain[x ], - chunkP1=terrain[x+ 1], - chunkP2=terrain[x+ 2]; + chunkM2=terrain[x-2], + chunkM1=terrain[x-1], + chunk0 =terrain[x ], + chunkP1=terrain[x+1], + chunkP2=terrain[x+2]; if (chunkM2.StartSomething>y-7 ) chunkM2.StartSomething=y-7; if (chunkM1.StartSomething>y-9 ) chunkM1.StartSomething=y-9; @@ -24507,13 +24512,12 @@ string ConvertNormalToAtls(string key) 1 => new DInt { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, 2 => new DInt { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 * 2 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, 3 => new DInt { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 40 + 8 + 4 }, + #if DEBUG _ => throw new Exception("Unknown pos id of stone frurnace inv"), + #else + _ => new DInt(0,0) + #endif }; - -#if DEBUG -#else - return null; -#endif } static Vector2 InventoryGetPosFurnaceStoneVector2(int ix) { @@ -24522,13 +24526,12 @@ string ConvertNormalToAtls(string key) 1 => new Vector2 { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, 2 => new Vector2 { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 * 2 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 4 }, 3 => new Vector2 { X = Global.WindowWidthHalf - 300 + 4 + 1 + 40 + 40 + 4, Y = Global.WindowHeightHalf - 200 + 2 + 4 + 60 + 40 + 8 + 4 }, + #if DEBUG _ => throw new Exception("Unknown pos id of stone frurnace inv"), + #else + _=> Vector2.Zero + #endif }; - -#if DEBUG -#else - return Vector2.Zero; -#endif } static Vector2 InventoryGetPosClothesVector2(int ix) { @@ -24542,8 +24545,7 @@ string ConvertNormalToAtls(string key) for (int i=(inventoryScrollbarValue/9)*9+5; i<(inventoryScrollbarValue/9)*9+45+5; i++) { if (i>maxInvCount) break; - if (ix==i) - return new DInt{X= Global.WindowWidthHalf-300+4+200+4+4+xx+4,Y=Global.WindowHeightHalf-200+2+4+yh+4 }; + if (ix==i) return new DInt{ X= Global.WindowWidthHalf-300+4+200+4+4+xx+4, Y=Global.WindowHeightHalf-200+2+4+yh+4 }; xx+=40; @@ -26354,13 +26356,12 @@ string ConvertNormalToAtls(string key) Biome.Jungle => TemperatureFromTo(32, 24, 29, 23), Biome.TropicalRainforest => TemperatureFromTo(32, 24, 29, 23), Biome.None => 0, + #if DEBUG _ => throw new Exception("Missing biome color"), + #else + _ => 0 + #endif }; - -#if DEBUG -#else - return 0; -#endif } /// From 0 to 1, 0=fastly after sun rise, 1 late in time when sun fall diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs index dbb9b1d..2ba9b60 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MainMenu.cs @@ -224,8 +224,9 @@ class MainMenu :MenuScreen { void GoToInformations(object sender, EventArgs e) => ((Menu)Rabcr.screen).GoToMenu(new Informations()); void GoToSingleplayer(object sender, EventArgs e) => ((Menu)Rabcr.screen).GoToMenu(new MenuSingleplayer()); + #if MULTIPLAYER void GoToMultiplayer(object sender, EventArgs e) => ((Menu)Rabcr.screen).GoToMenu(new MenuMultiplayer()); - + #endif public override void Update(GameTime gameTime) { //mouseState=Mouse.GetState(); diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs index 3ddf338..c71d039 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuCharacter.cs @@ -237,7 +237,7 @@ class MenuCharacter: MenuScreen { }; // Sex { - SettingSwitcher button=new SettingSwitcher(tex,Lang.Texts[83], new string[]{ Lang.Texts[85], Lang.Texts[88] }, (int)Setting.sex); + SettingSwitcher button=new(tex,Lang.Texts[83], new string[]{ Lang.Texts[85], Lang.Texts[88] }, (int)Setting.sex); button.Click+=ClickChangeSex; settings.Add(button); @@ -249,7 +249,7 @@ class MenuCharacter: MenuScreen { } // Mature { - SettingSwitcher button=new SettingSwitcher(tex,Lang.Texts[89], new string[]{Lang.Texts[336],Lang.Texts[337],Lang.Texts[338] },Setting.MaturePlayer); + SettingSwitcher button=new(tex,Lang.Texts[89], new string[]{Lang.Texts[336],Lang.Texts[337],Lang.Texts[338] },Setting.MaturePlayer); button.Click+=ClickMaturePlayer; settings.Add(button); @@ -261,7 +261,7 @@ class MenuCharacter: MenuScreen { } //SkinColor { - SettingColor button=new SettingColor(tex,Lang.Texts[325], + SettingColor button=new(tex,Lang.Texts[325], new Color[] { // yellow new Color(248, 235, 184), @@ -302,7 +302,7 @@ class MenuCharacter: MenuScreen { //type { - SettingSwitcherTexture button=new SettingSwitcherTexture(tex, Lang.Texts[327], + SettingSwitcherTexture button=new(tex, Lang.Texts[327], new Texture2D[]{ GetDataTexture(@"ClothesAnimations\InMenu\Hair\0"), GetDataTexture(@"ClothesAnimations\InMenu\Hair\1"), @@ -324,7 +324,7 @@ class MenuCharacter: MenuScreen { } //Color { - SettingColor button=new SettingColor(tex, Lang.Texts[328], + SettingColor button=new(tex, Lang.Texts[328], new Color[]{ // Brown new Color(15,3,1), @@ -386,7 +386,7 @@ class MenuCharacter: MenuScreen { settings.Add(new SettingHeader(Lang.Texts[329])); // type { - SettingSwitcherTexture button=new SettingSwitcherTexture(tex, Lang.Texts[330], new Texture2D[]{ + SettingSwitcherTexture button=new(tex, Lang.Texts[330], new Texture2D[]{ GetDataTexture(@"ClothesAnimations\InMenu\Eyes\0"), GetDataTexture(@"ClothesAnimations\InMenu\Eyes\1"), GetDataTexture(@"ClothesAnimations\InMenu\Eyes\2"), @@ -403,7 +403,7 @@ class MenuCharacter: MenuScreen { } //color { - SettingColor button=new SettingColor(tex, Lang.Texts[331], + SettingColor button=new(tex, Lang.Texts[331], new Color[]{ // blue new Color(140,182,211), @@ -452,7 +452,7 @@ class MenuCharacter: MenuScreen { settings.Add(new SettingHeader(Lang.Texts[332])); //type { - SettingSwitcherTexture button=new SettingSwitcherTexture(tex, Lang.Texts[333], + SettingSwitcherTexture button=new(tex, Lang.Texts[333], new Texture2D[]{ GetDataTexture(@"ClothesAnimations\InMenu\Moustage\0"), GetDataTexture(@"ClothesAnimations\InMenu\Moustage\1"), @@ -476,7 +476,7 @@ class MenuCharacter: MenuScreen { } //color { - SettingColor button=new SettingColor(tex, Lang.Texts[334], new Color[]{ + SettingColor button=new(tex, Lang.Texts[334], new Color[]{ // Brown new Color(15,3,1), new Color(65,17,5), @@ -818,7 +818,7 @@ public Texture2D { float scaleDown=1f, scaleUp=1f; // Pozice bodu ramena - Vector2 rameno=new Vector2(x-11+2+1,y-39/2+12-1); + Vector2 rameno=new(x-11+2+1,y-39/2+12-1); // velikost ruky int maxdistance=6*2; @@ -851,7 +851,7 @@ public Texture2D } else { Vector2 z=center-rameno; // Vektor na kterém leží loket - Vector2 loket=new Vector2(-z.Y,z.X); + Vector2 loket=new(-z.Y,z.X); // Vzdálenost loket a bod střed float toloket=(float)Math.Sqrt(6*6-dis*dis/4); @@ -926,7 +926,7 @@ public Texture2D int add=16; float scaleDown=1f, scaleUp=1f; // Pozice bodu ramena - Vector2 rameno=new Vector2(x-11+2+1+add,y-39/2+12-1); + Vector2 rameno=new(x-11+2+1+add,y-39/2+12-1); // velikost ruky int maxdistance=6*2; diff --git a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs index 1fa5ae7..41f0709 100644 --- a/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs +++ b/rabcrClient/WindowsAndStates/GameStates/Menu/MenuMultiplayer.cs @@ -9,6 +9,7 @@ using System.Threading; namespace rabcrClient { + #if MULTIPLAYER class MenuMultiplayer : MenuScreen { #region Varibles @@ -747,4 +748,5 @@ public enum Connection { } public Connection currentConnection = Connection.NotStarted; } + #endif } diff --git a/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs b/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs index f1549db..b56266d 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormLogin.Designer.cs @@ -1,4 +1,5 @@ namespace rabcrClient { + #if MULTIPLAYER partial class FormLogin { /// /// Required designer variable. @@ -215,4 +216,5 @@ partial class FormLogin { private GTextPanel textPanel4; public GeDoPanel geDoPanel1; } + #endif } \ No newline at end of file diff --git a/rabcrClient/WindowsAndStates/Splash/FormLogin.cs b/rabcrClient/WindowsAndStates/Splash/FormLogin.cs index f885e36..d4bcd16 100644 --- a/rabcrClient/WindowsAndStates/Splash/FormLogin.cs +++ b/rabcrClient/WindowsAndStates/Splash/FormLogin.cs @@ -6,6 +6,7 @@ using System.Windows.Forms; namespace rabcrClient { + #if MULTIPLAYER public partial class FormLogin : Form { // bool offline=false; @@ -210,4 +211,5 @@ public partial class FormLogin : Form { // return w; // } //} + #endif } diff --git a/rabcrClient/rabcrClient.csproj b/rabcrClient/rabcrClient.csproj index ed95b4a..82a996f 100644 --- a/rabcrClient/rabcrClient.csproj +++ b/rabcrClient/rabcrClient.csproj @@ -30,12 +30,12 @@ false true 0 - 1.0.0.0 + 0.1.26.0 false true - AnyCPU + x64 true full false @@ -324,9 +324,7 @@ FormBadTranslation.cs - - Form - + FormLogin.cs @@ -499,6 +497,11 @@ + + False + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 + true + False .NET Framework 3.5 SP1 @@ -508,6 +511,38 @@ + + + False + + + + + Exclude + True + File + + + False + + + + + Exclude + True + File + + + False + + + + + Exclude + True + File + +