Advertisement
Guest User

Untitled

a guest
Jul 8th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 38.14 KB | None | 0 0
  1. using Microsoft.Win32;
  2. using Microsoft.Xna.Framework;
  3. using Microsoft.Xna.Framework.Audio;
  4. using Microsoft.Xna.Framework.Graphics;
  5. using Microsoft.Xna.Framework.Input;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Diagnostics;
  9. using System.Drawing;
  10. using System.IO;
  11. using System.Runtime.InteropServices;
  12. using System.Text;
  13. using System.Text.RegularExpressions;
  14. using System.Threading;
  15. using System.Windows.Forms;
  16. using Terraria.Achievements;
  17. using Terraria.DataStructures;
  18. using Terraria.GameContent;
  19. using Terraria.GameContent.Achievements;
  20. using Terraria.GameContent.Events;
  21. using Terraria.GameContent.Liquid;
  22. using Terraria.GameContent.Tile_Entities;
  23. using Terraria.GameContent.UI;
  24. using Terraria.GameContent.UI.Chat;
  25. using Terraria.GameContent.UI.States;
  26. using Terraria.Graphics;
  27. using Terraria.Graphics.Capture;
  28. using Terraria.Graphics.Effects;
  29. using Terraria.Graphics.Shaders;
  30. using Terraria.ID;
  31. using Terraria.Initializers;
  32. using Terraria.IO;
  33. using Terraria.Map;
  34. using Terraria.Net;
  35. using Terraria.ObjectData;
  36. using Terraria.Social;
  37. using Terraria.UI;
  38. using Terraria.UI.Chat;
  39. using Terraria.Utilities;
  40. using Terraria.World.Generation;
  41. namespace Terraria
  42. {
  43.     public class Main : Game
  44.     {
  45.         public delegate void OnPlayerSelected(PlayerFileData player);
  46.         public const int offLimitBorderTiles = 40;
  47.         public const int maxItemTypes = 3601;
  48.         public const int maxProjectileTypes = 651;
  49.         public const int maxNPCTypes = 540;
  50.         public const int maxTileSets = 419;
  51.         public const int maxWallTypes = 225;
  52.         public const int maxBuffTypes = 191;
  53.         public const int maxGlowMasks = 214;
  54.         public const int maxExtras = 69;
  55.         public const int maxGoreTypes = 907;
  56.         public const int numBannerTypes = 251;
  57.         public const int numArmorHead = 194;
  58.         public const int numArmorBody = 195;
  59.         public const int numArmorLegs = 135;
  60.         public const int numAccHandsOn = 19;
  61.         public const int numAccHandsOff = 12;
  62.         public const int numAccNeck = 9;
  63.         public const int numAccBack = 10;
  64.         public const int numAccFront = 5;
  65.         public const int numAccShoes = 18;
  66.         public const int numAccWaist = 12;
  67.         public const int numAccShield = 6;
  68.         public const int numAccFace = 9;
  69.         public const int numAccBalloon = 16;
  70.         public const int maxWings = 37;
  71.         public const int maxBackgrounds = 207;
  72.         public const int numInfoIcons = 13;
  73.         private const int MF_BYPOSITION = 1024;
  74.         public const int sectionWidth = 200;
  75.         public const int sectionHeight = 150;
  76.         public const int maxDust = 6000;
  77.         public const int maxCombatText = 100;
  78.         public const int maxItemText = 20;
  79.         public const int maxPlayers = 255;
  80.         public const int maxChests = 1000;
  81.         public const int maxItems = 400;
  82.         public const int maxProjectiles = 1000;
  83.         public const int maxNPCs = 200;
  84.         private const double slimeRainMaxTime = 54000.0;
  85.         private const double slimeRainMinTime = 32400.0;
  86.         private const double slimeRainMaxDelay = 604800.0;
  87.         private const double slimeRainMinDelay = 302400.0;
  88.         private const double slimeRainChance = 1728000.0;
  89.         public const int maxGore = 500;
  90.         public const int realInventory = 50;
  91.         public const int maxInventory = 58;
  92.         public const int maxItemSounds = 125;
  93.         public const int maxNPCHitSounds = 57;
  94.         public const int maxNPCKilledSounds = 62;
  95.         public const int maxLiquidTypes = 12;
  96.         public const int maxMusic = 40;
  97.         public const double dayLength = 54000.0;
  98.         public const double nightLength = 32400.0;
  99.         public const int maxStars = 130;
  100.         public const int maxStarTypes = 5;
  101.         public const int maxClouds = 200;
  102.         public const int maxCloudTypes = 22;
  103.         public const int maxHair = 134;
  104.         public const int maxCharSelectHair = 51;
  105.         public const int MaxTimeout = 120;
  106.         public static bool HidePassword = false;
  107.         public static bool ThickMouse = false;
  108.         public static uint ThickMousePackedColor = Microsoft.Xna.Framework.Color.White.PackedValue;
  109.         public static bool CaptureModeDisabled = false;
  110.         public bool unityMouseOver;
  111.         public static Main instance;
  112.         public static int curRelease = 149;
  113.         public static string versionNumber = "v1.3.0.3";
  114.         public static string versionNumber2 = "v1.3.0.3";
  115.         public static Vector2 destroyerHB = new Vector2(0f, 0f);
  116.         public static FavoritesFile LocalFavoriteData = new FavoritesFile(string.Concat(new object[]
  117.         {
  118.             Environment.GetFolderPath(Environment.SpecialFolder.Personal),
  119.             Path.DirectorySeparatorChar,
  120.             "My Games",
  121.             Path.DirectorySeparatorChar,
  122.             "Terraria",
  123.             Path.DirectorySeparatorChar,
  124.             "favorites.json"
  125.         }), false);
  126.         public static FavoritesFile CloudFavoritesData = new FavoritesFile("/favorites.json", true);
  127.         public static FileMetadata WorldFileMetadata;
  128.         public static FileMetadata MapFileMetadata;
  129.         private AchievementManager _achievements;
  130.         public static UserInterface MenuUI = new UserInterface();
  131.         public static UserInterface InGameUI = new UserInterface();
  132.         private static Main.OnPlayerSelected _pendingCharacterSelect;
  133.         public static bool drawBackGore = false;
  134.         public static ulong LobbyId = 0uL;
  135.         public static float expertLife = 2f;
  136.         public static float expertDamage = 2f;
  137.         public static float expertDebuffTime = 2f;
  138.         public static float expertKnockBack = 0.9f;
  139.         public static float expertNPCDamage = 1.5f;
  140.         public static float knockBackMultiplier = 1f;
  141.         public static float damageMultiplier = 1f;
  142.         public WaterfallManager waterfallManager;
  143.         public static WorldSections sectionManager;
  144.         public static bool ServerSideCharacter = false;
  145.         public static string clientUUID;
  146.         public static bool ContentLoaded = false;
  147.         public static int maxMsg = 106;
  148.         private static int toolTipDistance = 6;
  149.         public static float GlobalTime = 0f;
  150.         public static bool GlobalTimerPaused = false;
  151.         private static ulong _tileFrameSeed = (ulong)((long)Guid.NewGuid().GetHashCode());
  152.         private static ulong _drawCycleCounter = 0uL;
  153.         public static Effect screenShader;
  154.         public static Effect pixelShader;
  155.         public static Effect tileShader;
  156.         public static int npcStreamSpeed = 60;
  157.         public static int musicError = 0;
  158.         public static bool dedServFPS = false;
  159.         public static int dedServCount1 = 0;
  160.         public static int dedServCount2 = 0;
  161.         public static bool superFast = false;
  162.         public static bool[] hairLoaded = new bool[134];
  163.         public static bool[] wingsLoaded = new bool[37];
  164.         public static bool[] goreLoaded = new bool[907];
  165.         public static bool[] projectileLoaded = new bool[651];
  166.         public static bool[] itemFlameLoaded = new bool[3601];
  167.         public static bool[] backgroundLoaded = new bool[207];
  168.         public static bool[] tileSetsLoaded = new bool[419];
  169.         public static bool[] wallLoaded = new bool[225];
  170.         public static bool[] NPCLoaded = new bool[540];
  171.         public static bool[] armorHeadLoaded = new bool[194];
  172.         public static bool[] armorBodyLoaded = new bool[195];
  173.         public static bool[] armorLegsLoaded = new bool[135];
  174.         public static bool[] accHandsOnLoaded = new bool[19];
  175.         public static bool[] accHandsOffLoaded = new bool[12];
  176.         public static bool[] accBackLoaded = new bool[10];
  177.         public static bool[] accFrontLoaded = new bool[5];
  178.         public static bool[] accShoesLoaded = new bool[18];
  179.         public static bool[] accWaistLoaded = new bool[12];
  180.         public static bool[] accShieldLoaded = new bool[6];
  181.         public static bool[] accNeckLoaded = new bool[9];
  182.         public static bool[] accFaceLoaded = new bool[9];
  183.         public static bool[] accballoonLoaded = new bool[16];
  184.         public static Vector2[] OffsetsNPCOffhand = new Vector2[]
  185.         {
  186.             new Vector2(14f, 34f),
  187.             new Vector2(14f, 32f),
  188.             new Vector2(14f, 26f),
  189.             new Vector2(14f, 22f),
  190.             new Vector2(14f, 18f)
  191.         };
  192.         public static Vector2[] OffsetsPlayerOffhand = new Vector2[]
  193.         {
  194.             new Vector2(14f, 20f),
  195.             new Vector2(14f, 20f),
  196.             new Vector2(14f, 20f),
  197.             new Vector2(14f, 18f),
  198.             new Vector2(14f, 20f),
  199.             new Vector2(16f, 4f),
  200.             new Vector2(16f, 16f),
  201.             new Vector2(18f, 14f),
  202.             new Vector2(18f, 14f),
  203.             new Vector2(18f, 14f),
  204.             new Vector2(16f, 16f),
  205.             new Vector2(16f, 16f),
  206.             new Vector2(16f, 16f),
  207.             new Vector2(16f, 16f),
  208.             new Vector2(14f, 14f),
  209.             new Vector2(14f, 14f),
  210.             new Vector2(12f, 14f),
  211.             new Vector2(14f, 16f),
  212.             new Vector2(16f, 16f),
  213.             new Vector2(16f, 16f)
  214.         };
  215.         public static Vector2[] OffsetsPlayerOnhand = new Vector2[]
  216.         {
  217.             new Vector2(6f, 19f),
  218.             new Vector2(5f, 10f),
  219.             new Vector2(12f, 10f),
  220.             new Vector2(13f, 17f),
  221.             new Vector2(12f, 19f),
  222.             new Vector2(5f, 10f),
  223.             new Vector2(7f, 17f),
  224.             new Vector2(6f, 16f),
  225.             new Vector2(6f, 16f),
  226.             new Vector2(6f, 16f),
  227.             new Vector2(6f, 17f),
  228.             new Vector2(7f, 17f),
  229.             new Vector2(7f, 17f),
  230.             new Vector2(7f, 17f),
  231.             new Vector2(8f, 17f),
  232.             new Vector2(9f, 16f),
  233.             new Vector2(9f, 12f),
  234.             new Vector2(8f, 17f),
  235.             new Vector2(7f, 17f),
  236.             new Vector2(7f, 17f)
  237.         };
  238.         public static Vector2[] OffsetsPlayerHeadgear = new Vector2[]
  239.         {
  240.             new Vector2(0f, 2f),
  241.             new Vector2(0f, 2f),
  242.             new Vector2(0f, 2f),
  243.             new Vector2(0f, 2f),
  244.             new Vector2(0f, 2f),
  245.             new Vector2(0f, 2f),
  246.             new Vector2(0f, 2f),
  247.             new Vector2(0f, 0f),
  248.             new Vector2(0f, 0f),
  249.             new Vector2(0f, 0f),
  250.             new Vector2(0f, 2f),
  251.             new Vector2(0f, 2f),
  252.             new Vector2(0f, 2f),
  253.             new Vector2(0f, 2f),
  254.             new Vector2(0f, 0f),
  255.             new Vector2(0f, 0f),
  256.             new Vector2(0f, 0f),
  257.             new Vector2(0f, 2f),
  258.             new Vector2(0f, 2f),
  259.             new Vector2(0f, 2f)
  260.         };
  261.         public static float zoomX;
  262.         public static float zoomY;
  263.         public static float sunCircle;
  264.         public static int BlackFadeIn = 0;
  265.         public static bool noWindowBorder = false;
  266.         private Matrix Transform = Matrix.CreateScale(1f, 1f, 1f) * Matrix.CreateRotationZ(0f) * Matrix.CreateTranslation(new Vector3(0f, 0f, 0f));
  267.         private RasterizerState Rasterizer = RasterizerState.CullCounterClockwise;
  268.         public static int ugBack = 0;
  269.         public static int oldUgBack = 0;
  270.         public static int[] bgFrame = new int[1];
  271.         public static int[] bgFrameCounter = new int[1];
  272.         public static bool skipMenu = false;
  273.         public static bool verboseNetplay = false;
  274.         public static bool stopTimeOuts = false;
  275.         public static bool showSpam = false;
  276.         public static bool showItemOwner = false;
  277.         public static bool[] nextNPC = new bool[540];
  278.         public static int musicBox = -1;
  279.         public static int musicBox2 = -1;
  280.         public static byte hbPosition = 1;
  281.         public static bool cEd = false;
  282.         public static float wFrCounter = 0f;
  283.         public static float wFrame = 0f;
  284.         public static float upTimer;
  285.         public static float upTimerMax;
  286.         public static float upTimerMaxDelay;
  287.         public static bool drawDiag = false;
  288.         public static bool drawRelease = false;
  289.         public static bool drawBetterDebug = false;
  290.         public static bool betterDebugRelease = false;
  291.         public static bool renderNow = false;
  292.         public static bool drawToScreen = false;
  293.         public static bool targetSet = false;
  294.         public static int mouseX;
  295.         public static int mouseY;
  296.         public static int lastMouseX;
  297.         public static int lastMouseY;
  298.         public static bool mouseLeft;
  299.         public static bool mouseRight;
  300.         private static bool _isMouseLeftConsumedByUI = false;
  301.         public static float essScale = 1f;
  302.         public static int essDir = -1;
  303.         public static float[] cloudBGX = new float[2];
  304.         public static float cloudBGAlpha;
  305.         public static float cloudBGActive;
  306.         public static int[] cloudBG = new int[]
  307.         {
  308.             112,
  309.             113
  310.         };
  311.         public static int[] treeMntBG = new int[2];
  312.         public static int[] treeBG = new int[3];
  313.         public static int[] corruptBG = new int[3];
  314.         public static int[] jungleBG = new int[3];
  315.         public static int[] snowMntBG = new int[2];
  316.         public static int[] snowBG = new int[3];
  317.         public static int[] hallowBG = new int[3];
  318.         public static int[] crimsonBG = new int[3];
  319.         public static int[] desertBG = new int[2];
  320.         public static int oceanBG;
  321.         public static int[] treeX = new int[4];
  322.         public static int[] treeStyle = new int[4];
  323.         public static int[] caveBackX = new int[4];
  324.         public static int[] caveBackStyle = new int[4];
  325.         public static int iceBackStyle;
  326.         public static int hellBackStyle;
  327.         public static int jungleBackStyle;
  328.         public static string debugWords = "";
  329.         public static bool gamePad = false;
  330.         public static bool xMas = false;
  331.         public static bool halloween = false;
  332.         public static int snowDust = 0;
  333.         public static bool chTitle = false;
  334.         public static bool hairWindow = false;
  335.         public static bool clothesWindow = false;
  336.         public static bool ingameOptionsWindow = false;
  337.         public static bool achievementsWindow = false;
  338.         public static int keyCount = 0;
  339.         public static string[] keyString = new string[10];
  340.         public static int[] keyInt = new int[10];
  341.         public static byte gFade = 0;
  342.         public static float gFader = 0f;
  343.         public static byte gFadeDir = 1;
  344.         public static bool netDiag = false;
  345.         public static int txData = 0;
  346.         public static int rxData = 0;
  347.         public static int txMsg = 0;
  348.         public static int rxMsg = 0;
  349.         public static int[] rxMsgType = new int[Main.maxMsg];
  350.         public static int[] rxDataType = new int[Main.maxMsg];
  351.         public static int[] txMsgType = new int[Main.maxMsg];
  352.         public static int[] txDataType = new int[Main.maxMsg];
  353.         public static float uCarry = 0f;
  354.         public static bool drawSkip = false;
  355.         public static int fpsCount = 0;
  356.         public static Stopwatch fpsTimer = new Stopwatch();
  357.         public static Stopwatch updateTimer = new Stopwatch();
  358.         public bool gammaTest;
  359.         public static int fountainColor = -1;
  360.         public static int monolithType = -1;
  361.         public static bool showSplash = true;
  362.         public static bool ignoreErrors = true;
  363.         public static string defaultIP = "";
  364.         public static int dayRate = 1;
  365.         public static int maxScreenW = 1920;
  366.         public static int minScreenW = 800;
  367.         public static int maxScreenH = 1200;
  368.         public static int minScreenH = 600;
  369.         public static float iS = 1f;
  370.         public static bool render = false;
  371.         public static int qaStyle = 0;
  372.         public static int zoneX = 99;
  373.         public static int zoneY = 87;
  374.         public static float harpNote = 0f;
  375.         public static bool[] projHostile = new bool[651];
  376.         public static bool[] projHook = new bool[651];
  377.         public static bool[] pvpBuff = new bool[191];
  378.         public static bool[] persistentBuff = new bool[191];
  379.         public static bool[] vanityPet = new bool[191];
  380.         public static bool[] lightPet = new bool[191];
  381.         public static bool[] meleeBuff = new bool[191];
  382.         public static bool[] debuff = new bool[191];
  383.         public static string[] buffName = new string[191];
  384.         public static string[] buffTip = new string[191];
  385.         public static bool[] buffNoSave = new bool[191];
  386.         public static bool[] buffNoTimeDisplay = new bool[191];
  387.         public static bool[] buffDoubleApply = new bool[191];
  388.         public static int maxMP = 10;
  389.         public static string[] recentWorld = new string[Main.maxMP];
  390.         public static string[] recentIP = new string[Main.maxMP];
  391.         public static int[] recentPort = new int[Main.maxMP];
  392.         public static bool shortRender = true;
  393.         public static bool owBack = true;
  394.         public static int quickBG = 2;
  395.         public static int bgDelay = 0;
  396.         public static int bgStyle = 0;
  397.         public static float[] bgAlpha = new float[10];
  398.         public static float[] bgAlpha2 = new float[10];
  399.         public static int EquipPage = 0;
  400.         public static int EquipPageSelected = 0;
  401.         public int mouseNPC = -1;
  402.         public static int wof = -1;
  403.         public static int wofT;
  404.         public static int wofB;
  405.         public static int wofF = 0;
  406.         public static int offScreenRange = 200;
  407.         private RenderTarget2D backWaterTarget;
  408.         private RenderTarget2D waterTarget;
  409.         private RenderTarget2D tileTarget;
  410.         private RenderTarget2D blackTarget;
  411.         private RenderTarget2D tile2Target;
  412.         private RenderTarget2D wallTarget;
  413.         private RenderTarget2D backgroundTarget;
  414.         private RenderTarget2D screenTarget;
  415.         public static int maxMapUpdates = 250000;
  416.         public static bool refreshMap = false;
  417.         public static int loadMapLastX = 0;
  418.         public static bool loadMapLock = false;
  419.         public static bool loadMap = false;
  420.         public static bool mapReady = false;
  421.         public static int textureMaxWidth = 2000;
  422.         public static int textureMaxHeight = 1800;
  423.         public static bool updateMap = false;
  424.         public static int mapMinX = 0;
  425.         public static int mapMaxX = 0;
  426.         public static int mapMinY = 0;
  427.         public static int mapMaxY = 0;
  428.         public static int mapTimeMax = 30;
  429.         public static int mapTime = Main.mapTimeMax;
  430.         public static bool clearMap;
  431.         public static int mapTargetX = 5;
  432.         public static int mapTargetY = 2;
  433.         private static bool flameRingLoaded;
  434.         private Texture2D flameRingTexture;
  435.         private Texture2D mapDeathTexture;
  436.         private RenderTarget2D[,] mapTarget = new RenderTarget2D[Main.mapTargetX, Main.mapTargetY];
  437.         private RenderTarget2D mapSectionTexture;
  438.         public static bool[,] initMap = new bool[Main.mapTargetX, Main.mapTargetY];
  439.         public static bool[,] mapWasContentLost = new bool[Main.mapTargetX, Main.mapTargetY];
  440.         private Texture2D[] infoIconTexture = new Texture2D[13];
  441.         public static Texture2D[] clothesTexture = new Texture2D[4];
  442.         public static Texture2D[] mapIconTexture = new Texture2D[9];
  443.         private static Texture2D[] underworldTexture = new Texture2D[5];
  444.         public static Texture2D mapTexture;
  445.         private Texture2D mapBG1Texture;
  446.         private Texture2D mapBG2Texture;
  447.         private Texture2D mapBG3Texture;
  448.         private Texture2D mapBG4Texture;
  449.         private Texture2D mapBG5Texture;
  450.         private Texture2D mapBG6Texture;
  451.         private Texture2D mapBG7Texture;
  452.         private Texture2D mapBG8Texture;
  453.         private Texture2D mapBG9Texture;
  454.         private Texture2D mapBG10Texture;
  455.         private Texture2D mapBG11Texture;
  456.         private Texture2D mapBG12Texture;
  457.         private Texture2D mapBG13Texture;
  458.         private Texture2D mapBG14Texture;
  459.         private Texture2D mapBG15Texture;
  460.         private Texture2D hueTexture;
  461.         public static Texture2D colorSliderTexture;
  462.         public static Texture2D colorBarTexture;
  463.         public static Texture2D colorBlipTexture;
  464.         public static Texture2D smartDigTexture;
  465.         public static Microsoft.Xna.Framework.Color OurFavoriteColor = new Microsoft.Xna.Framework.Color(255, 231, 69);
  466.         public static Texture2D tileCrackTexture;
  467.         private Texture2D iceBarrierTexture;
  468.         public static bool mapInit = false;
  469.         public static bool mapEnabled = true;
  470.         public static int mapStyle = 1;
  471.         public static float grabMapX = 0f;
  472.         public static float grabMapY = 0f;
  473.         public static int miniMapX = 0;
  474.         public static int miniMapY = 0;
  475.         public static int miniMapWidth = 0;
  476.         public static int miniMapHeight = 0;
  477.         public static float mapMinimapScale = 1.25f;
  478.         public static float mapMinimapAlpha = 1f;
  479.         public static float mapOverlayScale = 2.5f;
  480.         public static float mapOverlayAlpha = 0.35f;
  481.         public static bool mapFullscreen = false;
  482.         public static bool resetMapFull = false;
  483.         public static float mapFullscreenScale = 4f;
  484.         public static Vector2 mapFullscreenPos = new Vector2(-1f, -1f);
  485.         private static bool IsEngineLoaded = false;
  486.         private int firstTileX;
  487.         private int lastTileX;
  488.         private int firstTileY;
  489.         private int lastTileY;
  490.         private double bgParallax;
  491.         private int bgStart;
  492.         private int bgLoops;
  493.         private int bgStartY;
  494.         private int bgLoopsY;
  495.         private int bgTop;
  496.         public static int renderCount = 99;
  497.         public static GraphicsDeviceManager graphics;
  498.         public static SpriteBatch spriteBatch;
  499.         public static TileBatch tileBatch;
  500.         public static GenerationProgress AutogenProgress = new GenerationProgress();
  501.         private Process tServer = new Process();
  502.         private static Stopwatch saveTime = new Stopwatch();
  503.         public static MouseState mouseState;
  504.         public static MouseState oldMouseState;
  505.         public static int oldMouseWheel;
  506.         public static KeyboardState keyState;
  507.         public static Microsoft.Xna.Framework.Color mcColor = new Microsoft.Xna.Framework.Color(125, 125, 255);
  508.         public static Microsoft.Xna.Framework.Color hcColor = new Microsoft.Xna.Framework.Color(200, 125, 255);
  509.         public static Microsoft.Xna.Framework.Color highVersionColor = new Microsoft.Xna.Framework.Color(255, 255, 0);
  510.         public static Microsoft.Xna.Framework.Color errorColor = new Microsoft.Xna.Framework.Color(255, 0, 0);
  511.         public static Microsoft.Xna.Framework.Color bgColor;
  512.         public static bool mouseHC = false;
  513.         public static bool craftingHide = false;
  514.         public static bool armorHide = false;
  515.         public static float craftingAlpha = 1f;
  516.         public static float armorAlpha = 1f;
  517.         public static float[] buffAlpha = new float[191];
  518.         public static bool hardMode = false;
  519.         public float chestLootScale = 1f;
  520.         public bool chestLootHover;
  521.         public float chestStackScale = 1f;
  522.         public bool chestStackHover;
  523.         public float chestDepositScale = 1f;
  524.         public bool chestDepositHover;
  525.         public float chestRenameScale = 1f;
  526.         public bool chestRenameHover;
  527.         public float chestCancelScale = 1f;
  528.         public bool chestCancelHover;
  529.         public static Vector2 sceneWaterPos = Vector2.Zero;
  530.         public static Vector2 sceneTilePos = Vector2.Zero;
  531.         public static Vector2 sceneTile2Pos = Vector2.Zero;
  532.         public static Vector2 sceneWallPos = Vector2.Zero;
  533.         public static Vector2 sceneBackgroundPos = Vector2.Zero;
  534.         public static bool maxQ = true;
  535.         public static float gfxQuality = 1f;
  536.         public static float gfxRate = 0.01f;
  537.         public int DiscoStyle;
  538.         public static int DiscoR = 255;
  539.         public static int DiscoB = 0;
  540.         public static int DiscoG = 0;
  541.         public static int teamCooldown = 0;
  542.         public static int teamCooldownLen = 300;
  543.         public static bool gamePaused = false;
  544.         public static bool gameInactive = false;
  545.         public static int updateTime = 0;
  546.         public static int drawTime = 0;
  547.         public static int uCount = 0;
  548.         public static int updateRate = 0;
  549.         public static int frameRate = 0;
  550.         public static bool RGBRelease = false;
  551.         public static bool qRelease = false;
  552.         public static bool netRelease = false;
  553.         public static bool frameRelease = false;
  554.         public static bool showFrameRate = false;
  555.         public static int magmaBGFrame = 0;
  556.         public static int magmaBGFrameCounter = 0;
  557.         public static int saveTimer = 0;
  558.         public static bool autoJoin = false;
  559.         public static bool serverStarting = false;
  560.         public static float leftWorld = 0f;
  561.         public static float rightWorld = 134400f;
  562.         public static float topWorld = 0f;
  563.         public static float bottomWorld = 38400f;
  564.         public static int maxTilesX = (int)Main.rightWorld / 16 + 1;
  565.         public static int maxTilesY = (int)Main.bottomWorld / 16 + 1;
  566.         public static int maxSectionsX = Main.maxTilesX / 200;
  567.         public static int maxSectionsY = Main.maxTilesY / 150;
  568.         public static int numDust = 6000;
  569.         public static int numPlayers = 0;
  570.         public static int maxNetPlayers = 255;
  571.         private static UICharacterSelect _characterSelectMenu = new UICharacterSelect();
  572.         private static UIWorldSelect _worldSelectMenu = new UIWorldSelect();
  573.         public static UIAchievementsMenu AchievementsMenu = new UIAchievementsMenu();
  574.         public static int maxRain = 750;
  575.         public static int slimeWarningTime = 0;
  576.         public static int slimeWarningDelay = 420;
  577.         public static float slimeRainNPCSlots = 0.65f;
  578.         public static bool[] slimeRainNPC = new bool[540];
  579.         public static double slimeRainTime = 0.0;
  580.         public static bool slimeRain = false;
  581.         public static int slimeRainKillCount = 0;
  582.         public int invBottom = 210;
  583.         public static float cameraX = 0f;
  584.         public static bool drewLava = false;
  585.         public static float[] liquidAlpha = new float[12];
  586.         public static int waterStyle = 0;
  587.         public static int worldRate = 1;
  588.         public static float caveParallax = 0.88f;
  589.         public static int dungeonX;
  590.         public static int dungeonY;
  591.         public static Liquid[] liquid = new Liquid[Liquid.resLiquid];
  592.         public static LiquidBuffer[] liquidBuffer = new LiquidBuffer[10000];
  593.         public static bool dedServ = false;
  594.         public static int spamCount = 0;
  595.         public static int curMusic = 0;
  596.         public static int dayMusic = 0;
  597.         public static int ugMusic = 0;
  598.         public int newMusic;
  599.         public static bool showItemText = true;
  600.         public static bool autoSave = true;
  601.         public static bool validateSaves = true;
  602.         public static bool bannerMouseOver = false;
  603.         public static string buffString = "";
  604.         public static string libPath = "";
  605.         public static int lo = 0;
  606.         public static int LogoA = 255;
  607.         public static int LogoB = 0;
  608.         public static bool LogoT = false;
  609.         public static string statusText = "";
  610.         public static string worldName = "";
  611.         public static int worldID;
  612.         public static int background = 0;
  613.         public static int caveBackground = 0;
  614.         public static float ugBackTransition = 0f;
  615.         public static Microsoft.Xna.Framework.Color tileColor;
  616.         public static double worldSurface;
  617.         public static double rockLayer;
  618.         public static Microsoft.Xna.Framework.Color[] teamColor = new Microsoft.Xna.Framework.Color[6];
  619.         public static bool dayTime = true;
  620.         public static double time = 13500.0;
  621.         public static int moonPhase = 0;
  622.         public static short sunModY = 0;
  623.         public static short moonModY = 0;
  624.         public static bool grabSky = false;
  625.         public static bool bloodMoon = false;
  626.         public static bool pumpkinMoon = false;
  627.         public static bool snowMoon = false;
  628.         public static float cloudAlpha = 0f;
  629.         public static float maxRaining = 0f;
  630.         public static float oldMaxRaining = 0f;
  631.         public static int rainTime = 0;
  632.         public static bool raining = false;
  633.         public static bool eclipse = false;
  634.         public static float eclipseLight = 0f;
  635.         public static int checkForSpawns = 0;
  636.         public static int helpText = 0;
  637.         public static bool autoGen = false;
  638.         public static bool autoPause = false;
  639.         public static int[] projFrames = new int[651];
  640.         public static bool[] projPet = new bool[651];
  641.         public static float demonTorch = 1f;
  642.         public static int demonTorchDir = 1;
  643.         public static float martianLight = 1f;
  644.         public static int martianLightDir = 1;
  645.         public static bool placementPreview = true;
  646.         public static int numStars;
  647.         public static int weatherCounter = 0;
  648.         public static int cloudLimit = 200;
  649.         public static int numClouds = Main.cloudLimit;
  650.         public static int numCloudsTemp = Main.numClouds;
  651.         public static float windSpeedTemp = 0f;
  652.         public static float windSpeed = 0f;
  653.         public static float windSpeedSet = 0f;
  654.         public static float windSpeedSpeed = 0f;
  655.         public static Cloud[] cloud = new Cloud[200];
  656.         public static bool resetClouds = true;
  657.         public static int sandTiles;
  658.         public static int evilTiles;
  659.         public static int shroomTiles;
  660.         public static float shroomLight;
  661.         public static int snowTiles;
  662.         public static int holyTiles;
  663.         public static int waterCandles;
  664.         public static int peaceCandles;
  665.         public static int meteorTiles;
  666.         public static int bloodTiles;
  667.         public static int jungleTiles;
  668.         public static int dungeonTiles;
  669.         public static bool sunflower;
  670.         public static bool clock;
  671.         public static bool campfire;
  672.         public static bool starInBottle;
  673.         public static bool heartLantern;
  674.         public static int fadeCounter = 0;
  675.         public static float invAlpha = 1f;
  676.         public static float invDir = 1f;
  677.         [ThreadStatic]
  678.         public static Random rand;
  679.         public static Texture2D[] chestStackTexture = new Texture2D[2];
  680.         private static bool allChestStackHover = false;
  681.         public static Texture2D[] bannerTexture = new Texture2D[3];
  682.         public static Texture2D[] npcHeadTexture = new Texture2D[24];
  683.         public static Texture2D[] npcHeadBossTexture = new Texture2D[31];
  684.         public static Texture2D[] craftToggleTexture = new Texture2D[4];
  685.         public static Texture2D craftUpButtonTexture;
  686.         public static Texture2D craftDownButtonTexture;
  687.         public static Texture2D scrollLeftButtonTexture;
  688.         public static Texture2D scrollRightButtonTexture;
  689.         public static Texture2D frozenTexture;
  690.         public static Texture2D magicPixel;
  691.         public static Texture2D miniMapFrameTexture;
  692.         public static Texture2D miniMapFrame2Texture;
  693.         public static Texture2D[] miniMapButtonTexture = new Texture2D[3];
  694.         public static Texture2D[] destTexture = new Texture2D[3];
  695.         public static Texture2D[] gemTexture = new Texture2D[6];
  696.         public static Texture2D[] rudolphMountTexture = new Texture2D[3];
  697.         public static Texture2D bunnyMountTexture;
  698.         public static Texture2D pigronMountTexture;
  699.         public static Texture2D slimeMountTexture;
  700.         public static Texture2D minecartMountTexture;
  701.         public static Texture2D turtleMountTexture;
  702.         public static Texture2D[] beeMountTexture = new Texture2D[2];
  703.         public static Texture2D[] UFOMountTexture = new Texture2D[2];
  704.         public static Texture2D[] drillMountTexture = new Texture2D[6];
  705.         public static Texture2D[] scutlixMountTexture = new Texture2D[3];
  706.         public static Texture2D unicornMountTexture;
  707.         public static Texture2D[] minecartMechMountTexture = new Texture2D[2];
  708.         public static Texture2D[] cuteFishronMountTexture = new Texture2D[2];
  709.         public static Texture2D minecartWoodMountTexture;
  710.         public static Texture2D[] wingsTexture = new Texture2D[37];
  711.         public static Texture2D[] armorHeadTexture = new Texture2D[194];
  712.         public static Texture2D[] armorBodyTexture = new Texture2D[195];
  713.         public static Texture2D[] femaleBodyTexture = new Texture2D[195];
  714.         public static Texture2D[] armorArmTexture = new Texture2D[195];
  715.         public static Texture2D[] armorLegTexture = new Texture2D[135];
  716.         public static Texture2D[] accHandsOnTexture = new Texture2D[19];
  717.         public static Texture2D[] accHandsOffTexture = new Texture2D[12];
  718.         public static Texture2D[] accBackTexture = new Texture2D[10];
  719.         public static Texture2D[] accFrontTexture = new Texture2D[5];
  720.         public static Texture2D[] accShoesTexture = new Texture2D[18];
  721.         public static Texture2D[] accWaistTexture = new Texture2D[12];
  722.         public static Texture2D[] accShieldTexture = new Texture2D[6];
  723.         public static Texture2D[] accNeckTexture = new Texture2D[9];
  724.         public static Texture2D[] accFaceTexture = new Texture2D[9];
  725.         public static Texture2D[] accBalloonTexture = new Texture2D[16];
  726.         public static Texture2D pulleyTexture;
  727.         public static Texture2D[] xmasTree = new Texture2D[5];
  728.         public static Texture2D[] FlameTexture = new Texture2D[17];
  729.         public static Texture2D timerTexture;
  730.         public static Texture2D[] reforgeTexture = new Texture2D[2];
  731.         public static Texture2D wallOutlineTexture;
  732.         public static Texture2D actuatorTexture;
  733.         public static Texture2D wireTexture;
  734.         public static Texture2D wire2Texture;
  735.         public static Texture2D wire3Texture;
  736.         public static Texture2D[] cameraTexture = new Texture2D[8];
  737.         public static Texture2D flyingCarpetTexture;
  738.         public static Texture2D gridTexture;
  739.         public static Texture2D lightDiscTexture;
  740.         public static Texture2D EyeLaserTexture;
  741.         public static Texture2D BoneEyesTexture;
  742.         public static Texture2D BoneLaserTexture;
  743.         public static Texture2D trashTexture;
  744.         public static Texture2D fishingLineTexture;
  745.         public static Texture2D beetleTexture;
  746.         public static Texture2D probeTexture;
  747.         public static Texture2D eyeLaserSmallTexture;
  748.         public static Texture2D xmasLightTexture;
  749.         public static Texture2D[] golemTexture = new Texture2D[4];
  750.         public static Texture2D confuseTexture;
  751.         public static Texture2D sunOrbTexture;
  752.         public static Texture2D sunAltarTexture;
  753.         public static Texture2D[] chainsTexture = new Texture2D[16];
  754.         public static Texture2D chainTexture;
  755.         public static Texture2D[] gemChainTexture = new Texture2D[7];
  756.         public static Texture2D chain2Texture;
  757.         public static Texture2D chain3Texture;
  758.         public static Texture2D chain4Texture;
  759.         public static Texture2D chain5Texture;
  760.         public static Texture2D chain6Texture;
  761.         public static Texture2D chain7Texture;
  762.         public static Texture2D chain8Texture;
  763.         public static Texture2D chain9Texture;
  764.         public static Texture2D chain10Texture;
  765.         public static Texture2D chain11Texture;
  766.         public static Texture2D chain12Texture;
  767.         public static Texture2D chain13Texture;
  768.         public static Texture2D chain14Texture;
  769.         public static Texture2D chain15Texture;
  770.         public static Texture2D chain16Texture;
  771.         public static Texture2D chain17Texture;
  772.         public static Texture2D chain18Texture;
  773.         public static Texture2D chain19Texture;
  774.         public static Texture2D chain20Texture;
  775.         public static Texture2D chain21Texture;
  776.         public static Texture2D chain22Texture;
  777.         public static Texture2D chain23Texture;
  778.         public static Texture2D chain24Texture;
  779.         public static Texture2D chain25Texture;
  780.         public static Texture2D chain26Texture;
  781.         public static Texture2D chain27Texture;
  782.         public static Texture2D chain28Texture;
  783.         public static Texture2D chain29Texture;
  784.         public static Texture2D chain30Texture;
  785.         public static Texture2D chain31Texture;
  786.         public static Texture2D chain32Texture;
  787.         public static Texture2D chain33Texture;
  788.         public static Texture2D chain34Texture;
  789.         public static Texture2D chain35Texture;
  790.         public static Texture2D chain36Texture;
  791.         public static Texture2D chain37Texture;
  792.         public static Texture2D chain38Texture;
  793.         public static Texture2D chain39Texture;
  794.         public static Texture2D chain40Texture;
  795.         public static Texture2D hbTexture1;
  796.         public static Texture2D hbTexture2;
  797.         public static Texture2D chaosTexture;
  798.         public static Texture2D cdTexture;
  799.         public static Texture2D wofTexture;
  800.         public static Texture2D boneArmTexture;
  801.         public static Texture2D boneArm2Texture;
  802.         public static Texture2D pumpkingArmTexture;
  803.         public static Texture2D pumpkingCloakTexture;
  804.         public static Texture2D[] EquipPageTexture = new Texture2D[11];
  805.         public static Texture2D[] PVPTexture = new Texture2D[3];
  806.         public static Texture2D[] npcToggleTexture = new Texture2D[2];
  807.         public static Texture2D[] HBLockTexture = new Texture2D[2];
  808.         public static Texture2D[] buffTexture = new Texture2D[191];
  809.         public static Texture2D[] itemTexture = new Texture2D[3601];
  810.         public static Texture2D[] itemFlameTexture = new Texture2D[3601];
  811.         public static Texture2D[] npcTexture = new Texture2D[540];
  812.         public static Texture2D[] projectileTexture = new Texture2D[651];
  813.         public static Texture2D[] goreTexture = new Texture2D[907];
  814.         public static Texture2D[] BackPackTexture = new Texture2D[8];
  815.         public static Texture2D rainTexture;
  816.         public static Texture2D[] glowMaskTexture = new Texture2D[214];
  817.         public static Texture2D[] extraTexture = new Texture2D[69];
  818.         public static Texture2D[] coinTexture = new Texture2D[4];
  819.         public static Texture2D[] cursorTextures = new Texture2D[13];
  820.         public static Texture2D dustTexture;
  821.         public static Texture2D sunTexture;
  822.         public static Texture2D sun2Texture;
  823.         public static Texture2D sun3Texture;
  824.         public static int maxMoons = 3;
  825.         public static int moonType = 0;
  826.         public static Texture2D[] moonTexture = new Texture2D[Main.maxMoons];
  827.         public static Texture2D pumpkinMoonTexture;
  828.         public static Texture2D snowMoonTexture;
  829.         public static Texture2D oneDropLogo;
  830.         public static int numTileColors = 31;
  831.         public static RenderTarget2D[,] tileAltTexture = new RenderTarget2D[419, Main.numTileColors];
  832.         public static bool[,] tileAltTextureInit = new bool[419, Main.numTileColors];
  833.         public static bool[,] tileAltTextureDrawn = new bool[419, Main.numTileColors];
  834.         public static int numTreeStyles = 19;
  835.         public static RenderTarget2D[,] treeTopAltTexture = new RenderTarget2D[Main.numTreeStyles, Main.numTileColors];
  836.         public static RenderTarget2D[,] treeBranchAltTexture = new RenderTarget2D[Main.numTreeStyles, Main.numTileColors];
  837.         public static bool[,] treeAltTextureInit = new bool[Main.numTreeStyles, Main.numTileColors];
  838.         public static bool[,] treeAltTextureDrawn = new bool[Main.numTreeStyles, Main.numTileColors];
  839.         public static bool[,] checkTreeAlt = new bool[Main.numTreeStyles, Main.numTileColors];
  840.         public static RenderTarget2D[,] wallAltTexture = new RenderTarget2D[225, Main.numTileColors];
  841.         public static bool[,] wallAltTextureInit = new bool[225, Main.numTileColors];
  842.         public static bool[,] wallAltTextureDrawn = new bool[225, Main.numTileColors];
  843.         public static Texture2D[] tileTexture = new Texture2D[419];
  844.         public static Texture2D blackTileTexture;
  845.         public static Texture2D[] wallTexture = new Texture2D[225];
  846.         public static Texture2D[] backgroundTexture = new Texture2D[207];
  847.         public static Texture2D[] cloudTexture = new Texture2D[22];
  848.         public static Texture2D[] starTexture = new Texture2D[5];
  849.         public static Texture2D[] liquidTexture = new Texture2D[12];
  850.         public static Texture2D heartTexture;
  851.         public static Texture2D heart2Texture;
  852.         public static Texture2D manaTexture;
  853.         public static Texture2D bubbleTexture;
  854.         public static Texture2D flameTexture;
  855.         public static Texture2D[] treeTopTexture = new Texture2D[Main.numTreeStyles];
  856.         public static Texture2D[] treeBranchTexture = new Texture2D[Main.numTreeStyles];
  857.         public static Texture2D[] woodTexture = new Texture2D[7];
  858.         public static RenderTarget2D[,] woodAltTexture = new RenderTarget2D[Main.woodTexture.Length, Main.numTileColors];
  859.         public static Texture2D shroomCapTexture;
  860.         public static Texture2D inventoryBackTexture;
  861.         public static Texture2D inventoryBack2Texture;
  862.         public static Texture2D inventoryBack3Texture;
  863.         public static Texture2D inventoryBack4Texture;
  864.         public static Texture2D inventoryBack5Texture;
  865.         public static Texture2D inventoryBack6Texture;
  866.         public static Texture2D inventoryBack7Texture;
  867.         public static Texture2D inventoryBack8Texture;
  868.         public static Texture2D inventoryBack9Texture;
  869.         public static Texture2D inventoryBack10Texture;
  870.         public static Texture2D inventoryBack11Texture;
  871.         public static Texture2D inventoryBack12Texture;
  872.         public static Texture2D inventoryBack13Texture;
  873.         public static Texture2D inventoryBack14Texture;
  874.         public static Texture2D inventoryBack15Texture;
  875.         public static Texture2D hairStyleBackTexture;
  876.         public static Texture2D clothesStyleBackTexture;
  877.         public static Texture2D inventoryTickOnTexture;
  878.         public static Texture2D inventoryTickOffTexture;
  879.         public static Texture2D loTexture;
  880.         public static Texture2D logoTexture;
  881.         public static Texture2D logo2Texture;
  882.         public static Texture2D textBackTexture;
  883.         public static Texture2D chatTexture;
  884.         public static Texture2D chat2Texture;
  885.         public static Texture2D chatBackTexture;
  886.         public static Texture2D teamTexture;
  887.         public static Texture2D reTexture;
  888.         public static Texture2D raTexture;
  889.         public static Texture2D splashTexture;
  890.         public static Texture2D fadeTexture;
  891.         public static Texture2D ninjaTexture;
  892.         public static Texture2D antLionTexture;
  893.         public static Texture2D spikeBaseTexture;
  894.         public static Texture2D ghostTexture;
  895.         public static Texture2D evilCactusTexture;
  896.         public static Texture2D goodCactusTexture;
  897.         public static Texture2D crimsonCactusTexture;
  898.         public static Texture2D wraithEyeTexture;
  899.         public static Texture2D fireflyTexture;
  900.         public static Texture2D fireflyJarTexture;
  901.         public static Texture2D lightningbugTexture;
  902.  
  903. ETC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement