Esempio n. 1
1
 public override bool Update(Dust dust)
 {
     dust.scale *= 0.98F;
     if (dust.scale <= 0.25F)
         dust.active = false;
     return false;
 }
Esempio n. 2
0
 public override void OnSpawn(Dust dust)
 {
     dust.frame.X = Main.rand.Next(2) * 8;
     dust.frame.Y = Main.rand.Next(2) * 8;
     dust.noLight = true;
     dust.scale = Main.rand.Next(1, 4);
 }
Esempio n. 3
0
        public override bool Update(Dust dust)
        {
            Garnorepassivedustdata data = (Garnorepassivedustdata)dust.customData;

            switch (data.counter)
            {
                case 10:
                    Lighting.AddLight(dust.position, 0.4F, 0.0F, 0.0F);
                    break;
                case 15:
                    Lighting.AddLight(dust.position, 0.4F, 0.0F, 0.0F);
                    break;
                case 20:
                    Lighting.AddLight(dust.position, 0.3F, 0.0F, 0.0F);
                    break;
                case 25:
                    Lighting.AddLight(dust.position, 0.3F, 0.0F, 0.0F);
                    break;
                case 30:
                    Lighting.AddLight(dust.position, 0.2F, 0.0F, 0.0F);
                    break;
            }

            if (data.counter < 30)
            {
                data.counter++;
            }
            else
            {
                dust.active = false;
            }

            return false;
        }
Esempio n. 4
0
 public override void OnSpawn(Dust dust)
 {
     dust.velocity *= 0.4f;
     dust.noGravity = true;
     dust.noLight = true;
     dust.scale *= 1.5f;
 }
Esempio n. 5
0
 public override void OnSpawn(Dust dust)
 {
     dust.noGravity = true;
     dust.noLight = true;
     dust.velocity.X = 0;
     dust.velocity.Y = -0.5F;
     rotateDir = Main.rand.Next(-1, 2);
 }
Esempio n. 6
0
		public override void OnSpawn(Dust dust)
		{
			dust.color = new Color(120, 255, 90);
			dust.alpha = 1;
			dust.scale = 1.1f;
			dust.velocity *= 0.2f;
			dust.noGravity = true;
			dust.noLight = true;
		}
Esempio n. 7
0
		//in Terraria.Dust.UpdateDust after incrementing Dust.dCount call this
		internal static void SetupUpdateType(Dust dust)
		{
			ModDust modDust = GetDust(dust.type);
			if (modDust != null && modDust.updateType >= 0)
			{
				dust.realType = dust.type;
				dust.type = modDust.updateType;
			}
		}
Esempio n. 8
0
		public override void OnSpawn(Dust dust)
		{
			dust.noLight = true;
			dust.color = new Color(200, 220, 230);
			dust.scale = 1.2f;
			dust.noGravity = true;
			dust.velocity /= 2f;
			dust.alpha = 100;
		}
Esempio n. 9
0
		//in Terraria.Dust.NewDust after initializing dust properties call ModDust.SetupDust(dust);
		internal static void SetupDust(Dust dust)
		{
			ModDust modDust = GetDust(dust.type);
			if (modDust != null)
			{
				dust.frame.X = 0;
				dust.frame.Y %= 30;
				modDust.OnSpawn(dust);
			}
		}
Esempio n. 10
0
		public override bool Update(Dust dust)
		{
			dust.position += dust.velocity;
			dust.scale -= 0.01f;
			if (dust.scale < 0.75f)
			{
				dust.active = false;
			}
			return false;
		}
Esempio n. 11
0
 public override bool Update(Dust dust)
 {
     dust.position += dust.velocity;
     dust.velocity *= 0.97f;
     if(dust.velocity.Length() < 0.01)
     {
     dust.active = false;
     }
     return false;
 }
 public static void DustLighting(int type, Dust dust)
 {
     if (type == 268)
     {
         Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), 0.0125f, 0.4575f, 0.4625f);
     }
     else if (type == 271)
     {
         Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), 0.49f, 0f, 0.42f);
     }
 }
Esempio n. 13
0
 public override bool Update(Dust dust)
 {
     dust.rotation += 0.03F * rotateDir;
     dust.velocity.Y -= 0.03F; 
     dust.position += dust.velocity;
     dust.scale -= 0.01f;
     if (dust.scale <= 0.5f)
     {
         dust.active = false;
     }
     return false;
 }
Esempio n. 14
0
 //in Terraria.Main.DrawDust before universal dust drawing call
 //  if(dust.modDust != null) { dust.modDust.Draw(dust, color5, scale); continue; }
 internal void Draw(Dust dust, Color alpha, float scale)
 {
     Main.spriteBatch.Draw(Texture, dust.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, new Vector2(4f, 4f), scale, SpriteEffects.None, 0f);
     if (dust.color != default(Microsoft.Xna.Framework.Color))
     {
     Main.spriteBatch.Draw(Texture, dust.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), dust.GetColor(alpha), dust.rotation, new Vector2(4f, 4f), scale, SpriteEffects.None, 0f);
     }
     if (alpha == Microsoft.Xna.Framework.Color.Black)
     {
     dust.active = false;
     }
 }
Esempio n. 15
0
		public override bool Update(Dust dust)
		{
			dust.position += dust.velocity;
			dust.rotation += dust.velocity.X;
			Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), 0.05f, 0.15f, 0.2f);
			dust.scale -= 0.03f;
			if (dust.scale < 0.5f)
			{
				dust.active = false;
			}
			return false;
		}
Esempio n. 16
0
 public override bool Update(Dust dust)
 {
     dust.position += dust.velocity;
     dust.rotation += dust.velocity.X * 0.15f;
     dust.scale *= 0.99f;
     float light = 0.35f * dust.scale;
     Lighting.AddLight(dust.position, light, light, light);
     if(dust.scale < 0.5f)
     {
     dust.active = false;
     }
     return false;
 }
Esempio n. 17
0
 public override bool Update(Dust dust)
 {
     dust.position += dust.velocity;
     dust.scale -= 0.01f;
     if(dust.scale < 0.75f)
     {
     dust.active = false;
     }
     else
     {
     Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), dust.color.R / 255f * 0.5f, dust.color.G / 255f * 0.5f, dust.color.B / 255f * 0.5f);
     }
     return false;
 }
Esempio n. 18
0
        public override bool Update(Terraria.Dust dust)
        {
            dust.position += dust.velocity;
            dust.rotation += dust.velocity.X * 015f;
            dust.scale    *= 0.99f;
            float light = 0.35f * dust.scale;

            Lighting.AddLight(dust.position, light, light, light);
            if (dust.scale < 0.5f)
            {
                dust.active = false;
            }
            return(false);
        }
Esempio n. 19
0
 public override bool Update(Dust dust)
 {
     dust.position += dust.velocity;
     dust.rotation += dust.velocity.X;
     dust.scale -= 0.1f;
     if (dust.scale < 0.5f)
     {
     dust.active = false;
     }
     else
     {
     float strength = dust.scale / 2f;
     Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), dust.color.R / 255f * 0.5f * strength, dust.color.G / 255f * 0.5f * strength, dust.color.B / 255f * 0.5f * strength);
     }
     return false;
 }
Esempio n. 20
0
		public override bool MidUpdate(Dust dust)
		{
			if (!dust.noGravity)
			{
				dust.velocity.Y += 0.05f;
			}
			if (!dust.noLight)
			{
				float strength = dust.scale * 1.4f;
				if (strength > 1f)
				{
					strength = 1f;
				}
				Lighting.AddLight(dust.position, 0.1f * strength, 0.2f * strength, 0.7f * strength);
			}
			return true;
		}
Esempio n. 21
0
		public override bool Update(Dust dust)
		{
			dust.rotation += dust.velocity.X / 3f;
			dust.position += dust.velocity;
			int oldAlpha = dust.alpha;
			dust.alpha = (int)(dust.alpha * 1.2);
			if (dust.alpha == oldAlpha)
			{
				dust.alpha++;
			}
			if (dust.alpha >= 255)
			{
				dust.alpha = 255;
				dust.active = false;
			}
			return false;
		}
Esempio n. 22
0
 public static Dust CloneDust(Dust rf)
 {
     Dust dust = Main.dust[Dust.NewDust(rf.position, 0, 0, rf.type, 0f, 0f, 0, default(Color), 1f)];
     dust.position = rf.position;
     dust.velocity = rf.velocity;
     dust.fadeIn = rf.fadeIn;
     dust.noGravity = rf.noGravity;
     dust.scale = rf.scale;
     dust.rotation = rf.rotation;
     dust.noLight = rf.noLight;
     dust.active = rf.active;
     dust.type = rf.type;
     dust.color = rf.color;
     dust.alpha = rf.alpha;
     dust.frame = rf.frame;
     dust.shader = rf.shader;
     dust.customData = rf.customData;
     return dust;
 }
Esempio n. 23
0
 //in Terraria.Dust.UpdateDust after setting up update type add
 //  ModDust modDust = ModDust.GetDust(dust.type);
 //  if(modDust != null && !modDust.Update(dust)) { ModDust.TakeDownUpdateType(dust); continue; }
 public virtual bool Update(Dust dust)
 {
     return true;
 }
Esempio n. 24
0
 public virtual void OnSpawn(Dust dust)
 {
 }
Esempio n. 25
0
 //in beginning of Terraria.Dust.GetAlpha add
 //  ModDust modDust = ModDust.GetDust(this.type);
 //  if(modDust != null)
 //  {
 //      Color? modColor = modDust.GetAlpha(this, newColor);
 //      if(modColor.HasValue)
 //      {
 //          return modColor.Value;
 //      }
 //  }
 public virtual Color? GetAlpha(Dust dust, Color lightColor)
 {
     return null;
 }
Esempio n. 26
0
 //in Terraria.Dust.UdpateDust at end of dust update code call this
 internal static void TakeDownUpdateType(Dust dust)
 {
     if (dust.realType >= 0)
     {
         dust.type = dust.realType;
         dust.realType = -1;
     }
 }
Esempio n. 27
0
 protected override void Update(GameTime gameTime)
 {
     if (Main.netMode != 2)
     {
         snowing();
     }
     Stopwatch stopwatch = new Stopwatch();
     stopwatch.Start();
     WorldGen.destroyObject = false;
     if (!dedServ)
     {
         if (fixedTiming)
         {
             if (base.IsActive)
             {
                 base.IsFixedTimeStep = false;
             }
             else
             {
                 base.IsFixedTimeStep = true;
             }
         }
         else
         {
             base.IsFixedTimeStep = true;
         }
         this.graphics.SynchronizeWithVerticalRetrace = true;
         this.UpdateMusic();
         if (showSplash)
         {
             return;
         }
         if (!gameMenu && (Main.netMode == 1))
         {
             if (!saveTime.IsRunning)
             {
                 saveTime.Start();
             }
             if (saveTime.ElapsedMilliseconds > 0x493e0)
             {
                 saveTime.Reset();
                 WorldGen.saveToonWhilePlaying();
             }
         }
         else if (!gameMenu && autoSave)
         {
             if (!saveTime.IsRunning)
             {
                 saveTime.Start();
             }
             if (saveTime.ElapsedMilliseconds > 0x927c0)
             {
                 saveTime.Reset();
                 WorldGen.saveToonWhilePlaying();
                 WorldGen.saveAndPlay();
             }
         }
         else if (saveTime.IsRunning)
         {
             saveTime.Stop();
         }
         if (teamCooldown > 0)
         {
             teamCooldown--;
         }
         updateTime++;
         if (fpsTimer.ElapsedMilliseconds >= 0x3e8)
         {
             if (fpsCount >= (30f + (30f * gfxQuality)))
             {
                 gfxQuality += gfxRate;
                 gfxRate += 0.005f;
             }
             else if (fpsCount < (29f + (30f * gfxQuality)))
             {
                 gfxRate = 0.01f;
                 gfxQuality -= 0.1f;
             }
             if (gfxQuality < 0f)
             {
                 gfxQuality = 0f;
             }
             if (gfxQuality > 1f)
             {
                 gfxQuality = 1f;
             }
             if (maxQ && base.IsActive)
             {
                 gfxQuality = 1f;
                 maxQ = false;
             }
             updateRate = uCount;
             frameRate = fpsCount;
             fpsCount = 0;
             fpsTimer.Restart();
             updateTime = 0;
             drawTime = 0;
             uCount = 0;
             if (Main.netMode == 2)
             {
                 cloudLimit = 0;
             }
         }
         if (fixedTiming)
         {
             float num = 16f;
             float elapsedMilliseconds = updateTimer.ElapsedMilliseconds;
             if ((elapsedMilliseconds + uCarry) < num)
             {
                 drawSkip = true;
                 return;
             }
             uCarry += elapsedMilliseconds - num;
             if (uCarry > 1000f)
             {
                 uCarry = 1000f;
             }
             updateTimer.Restart();
         }
         uCount++;
         drawSkip = false;
         if (qaStyle == 1)
         {
             gfxQuality = 1f;
         }
         else if (qaStyle == 2)
         {
             gfxQuality = 0.5f;
         }
         else if (qaStyle == 3)
         {
             gfxQuality = 0f;
         }
         numDust = (int)(2000f * ((gfxQuality * 0.75f) + 0.25f));
         Gore.goreTime = (int)(600f * gfxQuality);
         cloudLimit = (int)(100f * gfxQuality);
         Liquid.maxLiquid = (int)(2500f + (2500f * gfxQuality));
         Liquid.cycles = (int)(17f - (10f * gfxQuality));
         if (gfxQuality < 0.5)
         {
             this.graphics.SynchronizeWithVerticalRetrace = false;
         }
         else
         {
             this.graphics.SynchronizeWithVerticalRetrace = true;
         }
         if (gfxQuality < 0.2)
         {
             Lighting.maxRenderCount = 8;
         }
         else if (gfxQuality < 0.4)
         {
             Lighting.maxRenderCount = 7;
         }
         else if (gfxQuality < 0.6)
         {
             Lighting.maxRenderCount = 6;
         }
         else if (gfxQuality < 0.8)
         {
             Lighting.maxRenderCount = 5;
         }
         else
         {
             Lighting.maxRenderCount = 4;
         }
         if (Liquid.quickSettle)
         {
             Liquid.maxLiquid = Liquid.resLiquid;
             Liquid.cycles = 1;
         }
         if (!base.IsActive)
         {
             hasFocus = false;
         }
         else
         {
             hasFocus = true;
         }
         if (!base.IsActive && (Main.netMode == 0))
         {
             base.IsMouseVisible = true;
             if ((Main.netMode != 2) && (myPlayer >= 0))
             {
                 player[myPlayer].delayUseItem = true;
             }
             mouseLeftRelease = false;
             mouseRightRelease = false;
             if (gameMenu)
             {
                 UpdateMenu();
             }
             gamePaused = true;
             return;
         }
         base.IsMouseVisible = false;
         demonTorch += demonTorchDir * 0.01f;
         if (demonTorch > 1f)
         {
             demonTorch = 1f;
             demonTorchDir = -1;
         }
         if (demonTorch < 0f)
         {
             demonTorch = 0f;
             demonTorchDir = 1;
         }
         int num3 = 7;
         if (this.DiscoStyle == 0)
         {
             DiscoG += num3;
             if (DiscoG >= 0xff)
             {
                 DiscoG = 0xff;
                 this.DiscoStyle++;
             }
             DiscoR -= num3;
             if (DiscoR <= 0)
             {
                 DiscoR = 0;
             }
         }
         else if (this.DiscoStyle == 1)
         {
             DiscoB += num3;
             if (DiscoB >= 0xff)
             {
                 DiscoB = 0xff;
                 this.DiscoStyle++;
             }
             DiscoG -= num3;
             if (DiscoG <= 0)
             {
                 DiscoG = 0;
             }
         }
         else
         {
             DiscoR += num3;
             if (DiscoR >= 0xff)
             {
                 DiscoR = 0xff;
                 this.DiscoStyle = 0;
             }
             DiscoB -= num3;
             if (DiscoB <= 0)
             {
                 DiscoB = 0;
             }
         }
         if ((keyState.IsKeyDown(Keys.F10) && !chatMode) && !editSign)
         {
             if (frameRelease)
             {
                 PlaySound(12, -1, -1, 1);
                 if (showFrameRate)
                 {
                     showFrameRate = false;
                 }
                 else
                 {
                     showFrameRate = true;
                 }
             }
             frameRelease = false;
         }
         else
         {
             frameRelease = true;
         }
         if ((keyState.IsKeyDown(Keys.F9) && !chatMode) && !editSign)
         {
             if (RGBRelease)
             {
                 Lighting.lightCounter += 100;
                 PlaySound(12, -1, -1, 1);
                 Lighting.lightMode++;
                 if (Lighting.lightMode >= 4)
                 {
                     Lighting.lightMode = 0;
                 }
                 if ((Lighting.lightMode == 2) || (Lighting.lightMode == 0))
                 {
                     renderCount = 0;
                     renderNow = true;
                     int num4 = (screenWidth / 0x10) + (Lighting.offScreenTiles * 2);
                     int num5 = (screenHeight / 0x10) + (Lighting.offScreenTiles * 2);
                     for (int i = 0; i < num4; i++)
                     {
                         for (int j = 0; j < num5; j++)
                         {
                             Lighting.color[i, j] = 0f;
                             Lighting.colorG[i, j] = 0f;
                             Lighting.colorB[i, j] = 0f;
                         }
                     }
                 }
             }
             RGBRelease = false;
         }
         else
         {
             RGBRelease = true;
         }
         if ((keyState.IsKeyDown(Keys.F8) && !chatMode) && !editSign)
         {
             if (netRelease)
             {
                 PlaySound(12, -1, -1, 1);
                 if (netDiag)
                 {
                     netDiag = false;
                 }
                 else
                 {
                     netDiag = true;
                 }
             }
             netRelease = false;
         }
         else
         {
             netRelease = true;
         }
         if ((keyState.IsKeyDown(Keys.F7) && !chatMode) && !editSign)
         {
             if (drawRelease)
             {
                 PlaySound(12, -1, -1, 1);
                 if (drawDiag)
                 {
                     drawDiag = false;
                 }
                 else
                 {
                     drawDiag = true;
                 }
             }
             drawRelease = false;
         }
         else
         {
             drawRelease = true;
         }
         if (keyState.IsKeyDown(Keys.F11))
         {
             if (releaseUI)
             {
                 if (hideUI)
                 {
                     hideUI = false;
                 }
                 else
                 {
                     hideUI = true;
                 }
             }
             releaseUI = false;
         }
         else
         {
             releaseUI = true;
         }
         if ((keyState.IsKeyDown(Keys.LeftAlt) || keyState.IsKeyDown(Keys.RightAlt)) && keyState.IsKeyDown(Keys.Enter))
         {
             if (this.toggleFullscreen)
             {
                 this.graphics.ToggleFullScreen();
                 chatRelease = false;
             }
             this.toggleFullscreen = false;
         }
         else
         {
             this.toggleFullscreen = true;
         }
         if (!gamePad || gameMenu)
         {
             oldMouseState = mouseState;
             mouseState = Mouse.GetState();
             mouseX = mouseState.X;
             mouseY = mouseState.Y;
             mouseLeft = false;
             mouseRight = false;
             if (mouseState.LeftButton == ButtonState.Pressed)
             {
                 mouseLeft = true;
             }
             if (mouseState.RightButton == ButtonState.Pressed)
             {
                 mouseRight = true;
             }
         }
         keyState = Keyboard.GetState();
         if (editSign)
         {
             chatMode = false;
         }
         if (chatMode)
         {
             if (keyState.IsKeyDown(Keys.Escape))
             {
                 chatMode = false;
             }
             string chatText = Main.chatText;
             Main.chatText = GetInputText(Main.chatText);
             while (fontMouseText.MeasureString(Main.chatText).X > 470f)
             {
                 Main.chatText = Main.chatText.Substring(0, Main.chatText.Length - 1);
             }
             if (chatText != Main.chatText)
             {
                 PlaySound(12, -1, -1, 1);
             }
             if (inputTextEnter && chatRelease)
             {
                 //if (Main.chatText != "")
                 if (Main.chatText != "" && Mods.ModHooks.onChat(Main.chatText))
                 {
                     NetMessage.SendData(0x19, -1, -1, Main.chatText, myPlayer, 0f, 0f, 0f, 0);
                 }
                 Main.chatText = "";
                 chatMode = false;
                 chatRelease = false;
                 player[myPlayer].releaseHook = false;
                 player[myPlayer].releaseThrow = false;
                 PlaySound(11, -1, -1, 1);
             }
         }
         //
         // original code:
         //if ((keyState.IsKeyDown(Keys.Enter) && (Main.netMode == 1)) && (!keyState.IsKeyDown(Keys.LeftAlt) && !keyState.IsKeyDown(Keys.RightAlt)))
         //
         // ALLOW CHAT IN SINGLEPLAYER
         //
         if ((keyState.IsKeyDown(Keys.Enter)) && (!keyState.IsKeyDown(Keys.LeftAlt) && !keyState.IsKeyDown(Keys.RightAlt)))
         {
             if ((chatRelease && !chatMode) && (!editSign && !keyState.IsKeyDown(Keys.Escape)))
             {
                 PlaySound(10, -1, -1, 1);
                 chatMode = true;
                 Main.chatText = "";
             }
             chatRelease = false;
         }
         else
         {
             chatRelease = true;
         }
         if (gameMenu)
         {
             UpdateMenu();
             if (Main.netMode != 2)
             {
                 return;
             }
             gamePaused = false;
         }
     }
     if (Main.netMode == 1)
     {
         for (int k = 0; k < 0x31; k++)
         {
             if (player[myPlayer].inventory[k].IsNotTheSameAs(clientPlayer.inventory[k]))
             {
                 NetMessage.SendData(5, -1, -1, player[myPlayer].inventory[k].name, myPlayer, (float)k, (float)player[myPlayer].inventory[k].prefix, 0f, 0);
             }
         }
         if (player[myPlayer].armor[0].IsNotTheSameAs(clientPlayer.armor[0]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[0].name, myPlayer, 49f, (float)player[myPlayer].armor[0].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[1].IsNotTheSameAs(clientPlayer.armor[1]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[1].name, myPlayer, 50f, (float)player[myPlayer].armor[1].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[2].IsNotTheSameAs(clientPlayer.armor[2]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[2].name, myPlayer, 51f, (float)player[myPlayer].armor[2].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[3].IsNotTheSameAs(clientPlayer.armor[3]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[3].name, myPlayer, 52f, (float)player[myPlayer].armor[3].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[4].IsNotTheSameAs(clientPlayer.armor[4]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[4].name, myPlayer, 53f, (float)player[myPlayer].armor[4].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[5].IsNotTheSameAs(clientPlayer.armor[5]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[5].name, myPlayer, 54f, (float)player[myPlayer].armor[5].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[6].IsNotTheSameAs(clientPlayer.armor[6]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[6].name, myPlayer, 55f, (float)player[myPlayer].armor[6].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[7].IsNotTheSameAs(clientPlayer.armor[7]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[7].name, myPlayer, 56f, (float)player[myPlayer].armor[7].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[8].IsNotTheSameAs(clientPlayer.armor[8]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[8].name, myPlayer, 57f, (float)player[myPlayer].armor[8].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[9].IsNotTheSameAs(clientPlayer.armor[9]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[9].name, myPlayer, 58f, (float)player[myPlayer].armor[9].prefix, 0f, 0);
         }
         if (player[myPlayer].armor[10].IsNotTheSameAs(clientPlayer.armor[10]))
         {
             NetMessage.SendData(5, -1, -1, player[myPlayer].armor[10].name, myPlayer, 59f, (float)player[myPlayer].armor[10].prefix, 0f, 0);
         }
         if (player[myPlayer].chest != clientPlayer.chest)
         {
             NetMessage.SendData(0x21, -1, -1, "", player[myPlayer].chest, 0f, 0f, 0f, 0);
         }
         if (player[myPlayer].talkNPC != clientPlayer.talkNPC)
         {
             NetMessage.SendData(40, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
         }
         if (player[myPlayer].zoneEvil != clientPlayer.zoneEvil)
         {
             NetMessage.SendData(0x24, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
         }
         if (player[myPlayer].zoneMeteor != clientPlayer.zoneMeteor)
         {
             NetMessage.SendData(0x24, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
         }
         if (player[myPlayer].zoneDungeon != clientPlayer.zoneDungeon)
         {
             NetMessage.SendData(0x24, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
         }
         if (player[myPlayer].zoneJungle != clientPlayer.zoneJungle)
         {
             NetMessage.SendData(0x24, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
         }
         if (player[myPlayer].zoneHoly != clientPlayer.zoneHoly)
         {
             NetMessage.SendData(0x24, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
         }
         bool flag = false;
         for (int m = 0; m < 10; m++)
         {
             if (player[myPlayer].buffType[m] != clientPlayer.buffType[m])
             {
                 flag = true;
             }
         }
         if (flag)
         {
             NetMessage.SendData(50, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
             NetMessage.SendData(13, -1, -1, "", myPlayer, 0f, 0f, 0f, 0);
         }
     }
     if (Main.netMode == 1)
     {
         clientPlayer = (Player)player[myPlayer].clientClone();
     }
     if (((Main.netMode == 0) && ((playerInventory || (npcChatText != "")) || (player[myPlayer].sign >= 0))) && autoPause)
     {
         Keys[] pressedKeys = keyState.GetPressedKeys();
         player[myPlayer].controlInv = false;
         for (int n = 0; n < pressedKeys.Length; n++)
         {
             if ((pressedKeys[n]).ToString() == cInv)
             {
                 player[myPlayer].controlInv = true;
             }
         }
         if (player[myPlayer].controlInv)
         {
             if (player[myPlayer].releaseInventory)
             {
                 player[myPlayer].toggleInv();
             }
             player[myPlayer].releaseInventory = false;
         }
         else
         {
             player[myPlayer].releaseInventory = true;
         }
         if (playerInventory)
         {
             int num11 = (mouseState.ScrollWheelValue - oldMouseState.ScrollWheelValue) / 120;
             focusRecipe += num11;
             if (focusRecipe > (numAvailableRecipes - 1))
             {
                 focusRecipe = numAvailableRecipes - 1;
             }
             if (focusRecipe < 0)
             {
                 focusRecipe = 0;
             }
             player[myPlayer].dropItemCheck();
         }
         player[myPlayer].head = player[myPlayer].armor[0].headSlot;
         player[myPlayer].body = player[myPlayer].armor[1].bodySlot;
         player[myPlayer].legs = player[myPlayer].armor[2].legSlot;
         if (!player[myPlayer].hostile)
         {
             if (player[myPlayer].armor[8].headSlot >= 0)
             {
                 player[myPlayer].head = player[myPlayer].armor[8].headSlot;
             }
             if (player[myPlayer].armor[9].bodySlot >= 0)
             {
                 player[myPlayer].body = player[myPlayer].armor[9].bodySlot;
             }
             if (player[myPlayer].armor[10].legSlot >= 0)
             {
                 player[myPlayer].legs = player[myPlayer].armor[10].legSlot;
             }
         }
         if (editSign)
         {
             if (player[myPlayer].sign == -1)
             {
                 editSign = false;
             }
             else
             {
                 npcChatText = GetInputText(npcChatText);
                 if (inputTextEnter)
                 {
                     byte[] bytes = new byte[] { 10 };
                     npcChatText = npcChatText + Encoding.ASCII.GetString(bytes);
                 }
             }
         }
         gamePaused = true;
     }
     else
     {
         gamePaused = false;
         if ((!dedServ && (screenPosition.Y < ((worldSurface * 16.0) + 16.0))) && (Main.netMode != 2))
         {
             Star.UpdateStars();
             Cloud.UpdateClouds();
         }
         for (int num12 = 0; num12 < 0xff; num12++)
         {
             if (ignoreErrors)
             {
                 try
                 {
                     player[num12].UpdatePlayer(num12);
                 }
                 catch
                 {
                 }
             }
             else
             {
                 player[num12].UpdatePlayer(num12);
             }
         }
         if (Main.netMode != 1)
         {
             NPC.SpawnNPC();
         }
         for (int num13 = 0; num13 < 0xff; num13++)
         {
             player[num13].activeNPCs = 0f;
             player[num13].townNPCs = 0f;
         }
         if ((wof >= 0) && !npc[wof].active)
         {
             wof = -1;
         }
         for (int num14 = 0; num14 < 200; num14++)
         {
             if (ignoreErrors)
             {
                 try
                 {
                     npc[num14].UpdateNPC(num14);
                 }
                 catch (Exception)
                 {
                     npc[num14] = new NPC();
                 }
             }
             else
             {
                 npc[num14].UpdateNPC(num14);
             }
         }
         for (int num15 = 0; num15 < 200; num15++)
         {
             if (ignoreErrors)
             {
                 try
                 {
                     gore[num15].Update();
                 }
                 catch
                 {
                     gore[num15] = new Gore();
                 }
             }
             else
             {
                 gore[num15].Update();
             }
         }
         for (int num16 = 0; num16 < 0x3e8; num16++)
         {
             if (ignoreErrors)
             {
                 try
                 {
                     projectile[num16].Update(num16);
                 }
                 catch
                 {
                     projectile[num16] = new Projectile();
                 }
             }
             else
             {
                 projectile[num16].Update(num16);
             }
         }
         for (int num17 = 0; num17 < 200; num17++)
         {
             if (ignoreErrors)
             {
                 try
                 {
                     item[num17].UpdateItem(num17);
                 }
                 catch
                 {
                     item[num17] = new Item();
                 }
             }
             else
             {
                 item[num17].UpdateItem(num17);
             }
         }
         if (ignoreErrors)
         {
             try
             {
                 Dust.UpdateDust();
             }
             catch
             {
                 for (int num18 = 0; num18 < 0x7d0; num18++)
                 {
                     dust[num18] = new Dust();
                 }
             }
         }
         else
         {
             Dust.UpdateDust();
         }
         if (Main.netMode != 2)
         {
             CombatText.UpdateCombatText();
             ItemText.UpdateItemText();
         }
         if (ignoreErrors)
         {
             try
             {
                 UpdateTime();
             }
             catch
             {
                 checkForSpawns = 0;
             }
         }
         else
         {
             UpdateTime();
         }
         if (Main.netMode != 1)
         {
             if (ignoreErrors)
             {
                 try
                 {
                     WorldGen.UpdateWorld();
                     UpdateInvasion();
                 }
                 catch
                 {
                 }
             }
             else
             {
                 WorldGen.UpdateWorld();
                 UpdateInvasion();
             }
         }
         if (ignoreErrors)
         {
             try
             {
                 if (Main.netMode == 2)
                 {
                     UpdateServer();
                 }
                 if (Main.netMode == 1)
                 {
                     UpdateClient();
                 }
             }
             catch
             {
                 int netMode = Main.netMode;
             }
         }
         else
         {
             if (Main.netMode == 2)
             {
                 UpdateServer();
             }
             if (Main.netMode == 1)
             {
                 UpdateClient();
             }
         }
         if (ignoreErrors)
         {
             try
             {
                 for (int num19 = 0; num19 < numChatLines; num19++)
                 {
                     if (chatLine[num19].showTime > 0)
                     {
                         ChatLine line1 = chatLine[num19];
                         line1.showTime--;
                     }
                 }
             }
             catch
             {
                 for (int num20 = 0; num20 < numChatLines; num20++)
                 {
                     chatLine[num20] = new ChatLine();
                 }
             }
         }
         else
         {
             for (int num21 = 0; num21 < numChatLines; num21++)
             {
                 if (chatLine[num21].showTime > 0)
                 {
                     ChatLine line2 = chatLine[num21];
                     line2.showTime--;
                 }
             }
         }
         upTimer = stopwatch.ElapsedMilliseconds;
         if (upTimerMaxDelay > 0f)
         {
             upTimerMaxDelay--;
         }
         else
         {
             upTimerMax = 0f;
         }
         if (upTimer > upTimerMax)
         {
             upTimerMax = upTimer;
             upTimerMaxDelay = 400f;
         }
         base.Update(gameTime);
     }
 }
Esempio n. 28
0
        public static int NewDust(Vector2 Position, int Width, int Height, int Type, float SpeedX = 0f, float SpeedY = 0f, int Alpha = 0, Color newColor = new Color(), float Scale = 1f)
        {
            if (Main.gameMenu)
            {
                return(0);
            }
            if (Main.rand == null)
            {
                Main.rand = new Random((int)DateTime.Now.Ticks);
            }
            if (Main.gamePaused)
            {
                return(0);
            }
            if (WorldGen.gen)
            {
                return(0);
            }
            if (Main.netMode == 2)
            {
                return(0);
            }
            Rectangle rectangle  = new Rectangle((int)((Main.player[Main.myPlayer].position.X - (Main.screenWidth / 2)) - 100f), (int)((Main.player[Main.myPlayer].position.Y - (Main.screenHeight / 2)) - 100f), Main.screenWidth + 200, Main.screenHeight + 200);
            Rectangle rectangle2 = new Rectangle((int)Position.X, (int)Position.Y, 10, 10);

            if (!rectangle.Intersects(rectangle2))
            {
                return(0x7d0);
            }
            int num = 0x7d0;

            for (int i = 0; i < 0x7d0; i++)
            {
                if (!Main.dust[i].active)
                {
                    int num3 = Width;
                    int num4 = Height;
                    if (num3 < 5)
                    {
                        num3 = 5;
                    }
                    if (num4 < 5)
                    {
                        num4 = 5;
                    }
                    num = i;
                    Main.dust[i].fadeIn       = 0f;
                    Main.dust[i].active       = true;
                    Main.dust[i].type         = Type;
                    Main.dust[i].noGravity    = false;
                    Main.dust[i].color        = newColor;
                    Main.dust[i].alpha        = Alpha;
                    Main.dust[i].position.X   = (Position.X + Main.rand.Next(num3 - 4)) + 4f;
                    Main.dust[i].position.Y   = (Position.Y + Main.rand.Next(num4 - 4)) + 4f;
                    Main.dust[i].velocity.X   = (Main.rand.Next(-20, 0x15) * 0.1f) + SpeedX;
                    Main.dust[i].velocity.Y   = (Main.rand.Next(-20, 0x15) * 0.1f) + SpeedY;
                    Main.dust[i].frame.X      = 10 * Type;
                    Main.dust[i].frame.Y      = 10 * Main.rand.Next(3);
                    Main.dust[i].frame.Width  = 8;
                    Main.dust[i].frame.Height = 8;
                    Main.dust[i].rotation     = 0f;
                    Main.dust[i].scale        = 1f + (Main.rand.Next(-20, 0x15) * 0.01f);
                    Dust dust1 = Main.dust[i];
                    dust1.scale         *= Scale;
                    Main.dust[i].noLight = false;
                    if (((Main.dust[i].type == 6) || (Main.dust[i].type == 0x4b)) || ((Main.dust[i].type == 0x1d) || ((Main.dust[i].type >= 0x3b) && (Main.dust[i].type <= 0x41))))
                    {
                        Main.dust[i].velocity.Y  = Main.rand.Next(-10, 6) * 0.1f;
                        Main.dust[i].velocity.X *= 0.3f;
                        Dust dust2 = Main.dust[i];
                        dust2.scale *= 0.7f;
                    }
                    if ((Main.dust[i].type == 0x21) || (Main.dust[i].type == 0x34))
                    {
                        Main.dust[i].alpha = 170;
                        Dust dust3 = Main.dust[i];
                        dust3.velocity = (Vector2)(dust3.velocity * 0.5f);
                        Main.dust[i].velocity.Y++;
                    }
                    if (Main.dust[i].type == 0x29)
                    {
                        Dust dust4 = Main.dust[i];
                        dust4.velocity = (Vector2)(dust4.velocity * 0f);
                    }
                    if ((Main.dust[i].type == 0x22) || (Main.dust[i].type == 0x23))
                    {
                        Dust dust5 = Main.dust[i];
                        dust5.velocity          = (Vector2)(dust5.velocity * 0.1f);
                        Main.dust[i].velocity.Y = -0.5f;
                        if ((Main.dust[i].type == 0x22) && !Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y - 8f), 4, 4))
                        {
                            Main.dust[i].active = false;
                        }
                    }
                    return(num);
                }
            }
            return(num);
        }
Esempio n. 29
0
 public override void OnSpawn(Dust dust)
 {
     dust.noGravity = true;
     dust.noLight = false;
     dust.customData = new Garnorepassivedustdata();
 }
Esempio n. 30
0
        public static void UpdateDust()
        {
            lavaBubbles = 0;
            for (int i = 0; i < 0x7d0; i++)
            {
                if (i < Main.numDust)
                {
                    if (!Main.dust[i].active)
                    {
                        continue;
                    }
                    if (Main.dust[i].type == 0x23)
                    {
                        lavaBubbles++;
                    }
                    Dust dust1 = Main.dust[i];
                    dust1.position += Main.dust[i].velocity;
                    if (((Main.dust[i].type == 6) || (Main.dust[i].type == 0x4b)) || ((Main.dust[i].type == 0x1d) || ((Main.dust[i].type >= 0x3b) && (Main.dust[i].type <= 0x41))))
                    {
                        if (!Main.dust[i].noGravity)
                        {
                            Main.dust[i].velocity.Y += 0.05f;
                        }
                        if (!Main.dust[i].noLight)
                        {
                            float b = Main.dust[i].scale * 1.4f;
                            if (Main.dust[i].type == 0x1d)
                            {
                                if (b > 1f)
                                {
                                    b = 1f;
                                }
                                Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), b * 0.1f, b * 0.4f, b);
                            }
                            if (Main.dust[i].type == 0x4b)
                            {
                                if (b > 1f)
                                {
                                    b = 1f;
                                }
                                Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), b * 0.7f, b, b * 0.2f);
                            }
                            else if ((Main.dust[i].type >= 0x3b) && (Main.dust[i].type <= 0x41))
                            {
                                if (b > 0.8f)
                                {
                                    b = 0.8f;
                                }
                                int   num3 = Main.dust[i].type - 0x3a;
                                float num4 = 1f;
                                float num5 = 1f;
                                float num6 = 1f;
                                switch (num3)
                                {
                                case 1:
                                    num4 = 0f;
                                    num5 = 0.1f;
                                    num6 = 1.3f;
                                    break;

                                case 2:
                                    num4 = 1f;
                                    num5 = 0.1f;
                                    num6 = 0.1f;
                                    break;

                                case 3:
                                    num4 = 0f;
                                    num5 = 1f;
                                    num6 = 0.1f;
                                    break;

                                case 4:
                                    num4 = 0.9f;
                                    num5 = 0f;
                                    num6 = 0.9f;
                                    break;

                                case 5:
                                    num4 = 1.3f;
                                    num5 = 1.3f;
                                    num6 = 1.3f;
                                    break;

                                case 6:
                                    num4 = 0.9f;
                                    num5 = 0.9f;
                                    num6 = 0f;
                                    break;

                                case 7:
                                    num4 = (0.5f * Main.demonTorch) + (1f * (1f - Main.demonTorch));
                                    num5 = 0.3f;
                                    num6 = (1f * Main.demonTorch) + (0.5f * (1f - Main.demonTorch));
                                    break;
                                }
                                Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), b * num4, b * num5, b * num6);
                            }
                            else
                            {
                                if (b > 0.6f)
                                {
                                    b = 0.6f;
                                }
                                Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), b, b * 0.65f, b * 0.4f);
                            }
                        }
                    }
                    else if (((Main.dust[i].type == 14) || (Main.dust[i].type == 0x10)) || ((Main.dust[i].type == 0x1f) || (Main.dust[i].type == 0x2e)))
                    {
                        Main.dust[i].velocity.Y *= 0.98f;
                        Main.dust[i].velocity.X *= 0.98f;
                        if ((Main.dust[i].type == 0x1f) && Main.dust[i].noGravity)
                        {
                            Dust dust2 = Main.dust[i];
                            dust2.velocity = (Vector2)(dust2.velocity * 1.02f);
                            Dust dust3 = Main.dust[i];
                            dust3.scale += 0.02f;
                            Dust dust4 = Main.dust[i];
                            dust4.alpha += 4;
                            if (Main.dust[i].alpha > 0xff)
                            {
                                Main.dust[i].scale = 0.0001f;
                                Main.dust[i].alpha = 0xff;
                            }
                        }
                    }
                    else if (Main.dust[i].type == 0x20)
                    {
                        Dust dust5 = Main.dust[i];
                        dust5.scale             -= 0.01f;
                        Main.dust[i].velocity.X *= 0.96f;
                        Main.dust[i].velocity.Y += 0.1f;
                    }
                    else if (Main.dust[i].type == 0x2b)
                    {
                        Dust dust6 = Main.dust[i];
                        dust6.rotation += 0.1f * Main.dust[i].scale;
                        Color color = Lighting.GetColor((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f));
                        float r     = ((float)color.R) / 270f;
                        float g     = ((float)color.G) / 270f;
                        float num9  = ((float)color.B) / 270f;
                        r    *= Main.dust[i].scale * 1.07f;
                        g    *= Main.dust[i].scale * 1.07f;
                        num9 *= Main.dust[i].scale * 1.07f;
                        if (Main.dust[i].alpha < 0xff)
                        {
                            Dust dust7 = Main.dust[i];
                            dust7.scale += 0.09f;
                            if (Main.dust[i].scale >= 1f)
                            {
                                Main.dust[i].scale = 1f;
                                Main.dust[i].alpha = 0xff;
                            }
                        }
                        else
                        {
                            if (Main.dust[i].scale < 0.8)
                            {
                                Dust dust8 = Main.dust[i];
                                dust8.scale -= 0.01f;
                            }
                            if (Main.dust[i].scale < 0.5)
                            {
                                Dust dust9 = Main.dust[i];
                                dust9.scale -= 0.01f;
                            }
                        }
                        if (((r < 0.05) && (g < 0.05)) && (num9 < 0.05))
                        {
                            Main.dust[i].active = false;
                        }
                        else
                        {
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), r, g, num9);
                        }
                    }
                    else if (((Main.dust[i].type == 15) || (Main.dust[i].type == 0x39)) || (Main.dust[i].type == 0x3a))
                    {
                        Main.dust[i].velocity.Y *= 0.98f;
                        Main.dust[i].velocity.X *= 0.98f;
                        float scale = Main.dust[i].scale;
                        if (Main.dust[i].type != 15)
                        {
                            scale = Main.dust[i].scale * 0.8f;
                        }
                        if (Main.dust[i].noLight)
                        {
                            Dust dust10 = Main.dust[i];
                            dust10.velocity = (Vector2)(dust10.velocity * 0.95f);
                        }
                        if (scale > 1f)
                        {
                            scale = 1f;
                        }
                        if (Main.dust[i].type == 15)
                        {
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), scale * 0.45f, scale * 0.55f, scale);
                        }
                        else if (Main.dust[i].type == 0x39)
                        {
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), scale * 0.95f, scale * 0.95f, scale * 0.45f);
                        }
                        else if (Main.dust[i].type == 0x3a)
                        {
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), scale, scale * 0.55f, scale * 0.75f);
                        }
                    }
                    else if (Main.dust[i].type == 0x42)
                    {
                        if (Main.dust[i].velocity.X < 0f)
                        {
                            Dust dust11 = Main.dust[i];
                            dust11.rotation--;
                        }
                        else
                        {
                            Dust dust12 = Main.dust[i];
                            dust12.rotation++;
                        }
                        Main.dust[i].velocity.Y *= 0.98f;
                        Main.dust[i].velocity.X *= 0.98f;
                        Dust dust13 = Main.dust[i];
                        dust13.scale += 0.02f;
                        float num11 = Main.dust[i].scale;
                        if (Main.dust[i].type != 15)
                        {
                            num11 = Main.dust[i].scale * 0.8f;
                        }
                        if (num11 > 1f)
                        {
                            num11 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num11 * (((float)Main.dust[i].color.R) / 255f), num11 * (((float)Main.dust[i].color.G) / 255f), num11 * (((float)Main.dust[i].color.B) / 255f));
                    }
                    else if ((Main.dust[i].type == 20) || (Main.dust[i].type == 0x15))
                    {
                        Dust dust14 = Main.dust[i];
                        dust14.scale            += 0.005f;
                        Main.dust[i].velocity.Y *= 0.94f;
                        Main.dust[i].velocity.X *= 0.94f;
                        float num12 = Main.dust[i].scale * 0.8f;
                        if (num12 > 1f)
                        {
                            num12 = 1f;
                        }
                        if (Main.dust[i].type == 0x15)
                        {
                            num12 = Main.dust[i].scale * 0.4f;
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num12 * 0.8f, num12 * 0.3f, num12);
                        }
                        else
                        {
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num12 * 0.3f, num12 * 0.6f, num12);
                        }
                    }
                    else if ((Main.dust[i].type == 0x1b) || (Main.dust[i].type == 0x2d))
                    {
                        Dust dust15 = Main.dust[i];
                        dust15.velocity = (Vector2)(dust15.velocity * 0.94f);
                        Dust dust16 = Main.dust[i];
                        dust16.scale += 0.002f;
                        float num13 = Main.dust[i].scale;
                        if (Main.dust[i].noLight)
                        {
                            num13 *= 0.1f;
                            Dust dust17 = Main.dust[i];
                            dust17.scale -= 0.06f;
                            if (Main.dust[i].scale < 1f)
                            {
                                Dust dust18 = Main.dust[i];
                                dust18.scale -= 0.06f;
                            }
                            if (Main.player[Main.myPlayer].wet)
                            {
                                Dust dust19 = Main.dust[i];
                                dust19.position += (Vector2)(Main.player[Main.myPlayer].velocity * 0.5f);
                            }
                            else
                            {
                                Dust dust20 = Main.dust[i];
                                dust20.position += Main.player[Main.myPlayer].velocity;
                            }
                        }
                        if (num13 > 1f)
                        {
                            num13 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13 * 0.6f, num13 * 0.2f, num13);
                    }
                    else if (((Main.dust[i].type == 0x37) || (Main.dust[i].type == 0x38)) || ((Main.dust[i].type == 0x49) || (Main.dust[i].type == 0x4a)))
                    {
                        Dust dust21 = Main.dust[i];
                        dust21.velocity = (Vector2)(dust21.velocity * 0.98f);
                        float num14 = Main.dust[i].scale * 0.8f;
                        if (Main.dust[i].type == 0x37)
                        {
                            if (num14 > 1f)
                            {
                                num14 = 1f;
                            }
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num14, num14, num14 * 0.6f);
                        }
                        else if (Main.dust[i].type == 0x49)
                        {
                            if (num14 > 1f)
                            {
                                num14 = 1f;
                            }
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num14, num14 * 0.35f, num14 * 0.5f);
                        }
                        else if (Main.dust[i].type == 0x4a)
                        {
                            if (num14 > 1f)
                            {
                                num14 = 1f;
                            }
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num14 * 0.35f, num14, num14 * 0.5f);
                        }
                        else
                        {
                            num14 = Main.dust[i].scale * 1.2f;
                            if (num14 > 1f)
                            {
                                num14 = 1f;
                            }
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num14 * 0.35f, num14 * 0.5f, num14);
                        }
                    }
                    else if ((Main.dust[i].type == 0x47) || (Main.dust[i].type == 0x48))
                    {
                        Dust dust22 = Main.dust[i];
                        dust22.velocity = (Vector2)(dust22.velocity * 0.98f);
                        float num15 = Main.dust[i].scale;
                        if (num15 > 1f)
                        {
                            num15 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num15 * 0.2f, 0f, num15 * 0.1f);
                    }
                    else if ((!Main.dust[i].noGravity && (Main.dust[i].type != 0x29)) && (Main.dust[i].type != 0x2c))
                    {
                        Main.dust[i].velocity.Y += 0.1f;
                    }
                    if ((Main.dust[i].type == 5) && Main.dust[i].noGravity)
                    {
                        Dust dust23 = Main.dust[i];
                        dust23.scale -= 0.04f;
                    }
                    if ((Main.dust[i].type == 0x21) || (Main.dust[i].type == 0x34))
                    {
                        if (Main.dust[i].velocity.X == 0f)
                        {
                            if (Collision.SolidCollision(Main.dust[i].position, 2, 2))
                            {
                                Main.dust[i].scale = 0f;
                            }
                            Dust dust24 = Main.dust[i];
                            dust24.rotation += 0.5f;
                            Dust dust25 = Main.dust[i];
                            dust25.scale -= 0.01f;
                        }
                        if (Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y), 4, 4))
                        {
                            Dust dust26 = Main.dust[i];
                            dust26.alpha += 20;
                            Dust dust27 = Main.dust[i];
                            dust27.scale -= 0.1f;
                        }
                        Dust dust28 = Main.dust[i];
                        dust28.alpha += 2;
                        Dust dust29 = Main.dust[i];
                        dust29.scale -= 0.005f;
                        if (Main.dust[i].alpha > 0xff)
                        {
                            Main.dust[i].scale = 0f;
                        }
                        Main.dust[i].velocity.X *= 0.93f;
                        if (Main.dust[i].velocity.Y > 4f)
                        {
                            Main.dust[i].velocity.Y = 4f;
                        }
                        if (Main.dust[i].noGravity)
                        {
                            if (Main.dust[i].velocity.X < 0f)
                            {
                                Dust dust30 = Main.dust[i];
                                dust30.rotation -= 0.2f;
                            }
                            else
                            {
                                Dust dust31 = Main.dust[i];
                                dust31.rotation += 0.2f;
                            }
                            Dust dust32 = Main.dust[i];
                            dust32.scale            += 0.03f;
                            Main.dust[i].velocity.X *= 1.05f;
                            Main.dust[i].velocity.Y += 0.15f;
                        }
                    }
                    if ((Main.dust[i].type == 0x23) && Main.dust[i].noGravity)
                    {
                        Dust dust33 = Main.dust[i];
                        dust33.scale += 0.03f;
                        if (Main.dust[i].scale < 1f)
                        {
                            Main.dust[i].velocity.Y += 0.075f;
                        }
                        Main.dust[i].velocity.X *= 1.08f;
                        if (Main.dust[i].velocity.X > 0f)
                        {
                            Dust dust34 = Main.dust[i];
                            dust34.rotation += 0.01f;
                        }
                        else
                        {
                            Dust dust35 = Main.dust[i];
                            dust35.rotation -= 0.01f;
                        }
                        float num16 = Main.dust[i].scale * 0.6f;
                        if (num16 > 1f)
                        {
                            num16 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)((Main.dust[i].position.Y / 16f) + 1f), num16, num16 * 0.3f, num16 * 0.1f);
                    }
                    else if (Main.dust[i].type == 0x43)
                    {
                        float num17 = Main.dust[i].scale;
                        if (num17 > 1f)
                        {
                            num17 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), 0f, num17 * 0.8f, num17);
                    }
                    else if ((Main.dust[i].type == 0x22) || (Main.dust[i].type == 0x23))
                    {
                        if (!Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y - 8f), 4, 4))
                        {
                            Main.dust[i].scale = 0f;
                        }
                        else
                        {
                            Dust dust36 = Main.dust[i];
                            dust36.alpha += Main.rand.Next(2);
                            if (Main.dust[i].alpha > 0xff)
                            {
                                Main.dust[i].scale = 0f;
                            }
                            Main.dust[i].velocity.Y = -0.5f;
                            if (Main.dust[i].type == 0x22)
                            {
                                Dust dust37 = Main.dust[i];
                                dust37.scale += 0.005f;
                            }
                            else
                            {
                                Dust dust38 = Main.dust[i];
                                dust38.alpha++;
                                Dust dust39 = Main.dust[i];
                                dust39.scale           -= 0.01f;
                                Main.dust[i].velocity.Y = -0.2f;
                            }
                            Main.dust[i].velocity.X += Main.rand.Next(-10, 10) * 0.002f;
                            if (Main.dust[i].velocity.X < -0.25)
                            {
                                Main.dust[i].velocity.X = -0.25f;
                            }
                            if (Main.dust[i].velocity.X > 0.25)
                            {
                                Main.dust[i].velocity.X = 0.25f;
                            }
                        }
                        if (Main.dust[i].type == 0x23)
                        {
                            float num18 = (Main.dust[i].scale * 0.3f) + 0.4f;
                            if (num18 > 1f)
                            {
                                num18 = 1f;
                            }
                            Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num18, num18 * 0.5f, num18 * 0.3f);
                        }
                    }
                    if (Main.dust[i].type == 0x44)
                    {
                        float num19 = Main.dust[i].scale * 0.3f;
                        if (num19 > 1f)
                        {
                            num19 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num19 * 0.1f, num19 * 0.2f, num19);
                    }
                    if (Main.dust[i].type == 70)
                    {
                        float num20 = Main.dust[i].scale * 0.3f;
                        if (num20 > 1f)
                        {
                            num20 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num20 * 0.5f, 0f, num20);
                    }
                    if (Main.dust[i].type == 0x29)
                    {
                        Main.dust[i].velocity.X += Main.rand.Next(-10, 11) * 0.01f;
                        Main.dust[i].velocity.Y += Main.rand.Next(-10, 11) * 0.01f;
                        if (Main.dust[i].velocity.X > 0.75)
                        {
                            Main.dust[i].velocity.X = 0.75f;
                        }
                        if (Main.dust[i].velocity.X < -0.75)
                        {
                            Main.dust[i].velocity.X = -0.75f;
                        }
                        if (Main.dust[i].velocity.Y > 0.75)
                        {
                            Main.dust[i].velocity.Y = 0.75f;
                        }
                        if (Main.dust[i].velocity.Y < -0.75)
                        {
                            Main.dust[i].velocity.Y = -0.75f;
                        }
                        Dust dust40 = Main.dust[i];
                        dust40.scale += 0.007f;
                        float num21 = Main.dust[i].scale * 0.7f;
                        if (num21 > 1f)
                        {
                            num21 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num21 * 0.4f, num21 * 0.9f, num21);
                    }
                    else if (Main.dust[i].type == 0x2c)
                    {
                        Main.dust[i].velocity.X += Main.rand.Next(-10, 11) * 0.003f;
                        Main.dust[i].velocity.Y += Main.rand.Next(-10, 11) * 0.003f;
                        if (Main.dust[i].velocity.X > 0.35)
                        {
                            Main.dust[i].velocity.X = 0.35f;
                        }
                        if (Main.dust[i].velocity.X < -0.35)
                        {
                            Main.dust[i].velocity.X = -0.35f;
                        }
                        if (Main.dust[i].velocity.Y > 0.35)
                        {
                            Main.dust[i].velocity.Y = 0.35f;
                        }
                        if (Main.dust[i].velocity.Y < -0.35)
                        {
                            Main.dust[i].velocity.Y = -0.35f;
                        }
                        Dust dust41 = Main.dust[i];
                        dust41.scale += 0.0085f;
                        float num22 = Main.dust[i].scale * 0.7f;
                        if (num22 > 1f)
                        {
                            num22 = 1f;
                        }
                        Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num22 * 0.7f, num22, num22 * 0.8f);
                    }
                    else
                    {
                        Main.dust[i].velocity.X *= 0.99f;
                    }
                    if (Main.dust[i].type != 0x4f)
                    {
                        Dust dust42 = Main.dust[i];
                        dust42.rotation += Main.dust[i].velocity.X * 0.5f;
                    }
                    if (Main.dust[i].fadeIn > 0f)
                    {
                        if (Main.dust[i].type == 0x2e)
                        {
                            Dust dust43 = Main.dust[i];
                            dust43.scale += 0.1f;
                        }
                        else
                        {
                            Dust dust44 = Main.dust[i];
                            dust44.scale += 0.03f;
                        }
                        if (Main.dust[i].scale > Main.dust[i].fadeIn)
                        {
                            Main.dust[i].fadeIn = 0f;
                        }
                    }
                    else
                    {
                        Dust dust45 = Main.dust[i];
                        dust45.scale -= 0.01f;
                    }
                    if (Main.dust[i].noGravity)
                    {
                        Dust dust46 = Main.dust[i];
                        dust46.velocity = (Vector2)(dust46.velocity * 0.92f);
                        if (Main.dust[i].fadeIn == 0f)
                        {
                            Dust dust47 = Main.dust[i];
                            dust47.scale -= 0.04f;
                        }
                    }
                    if (Main.dust[i].position.Y > (Main.screenPosition.Y + Main.screenHeight))
                    {
                        Main.dust[i].active = false;
                    }
                    if (Main.dust[i].scale < 0.1)
                    {
                        Main.dust[i].active = false;
                    }
                    continue;
                }
                Main.dust[i].active = false;
            }
        }
Esempio n. 31
0
 public override void OnSpawn(Terraria.Dust dust)
 {
     dust.noGravity  = true;
     dust.scale     *= 1f;
     dust.velocity.Y = Main.rand.Next(1, 2) * 0.1f;
 }
Esempio n. 32
0
 public static void SendWalker(Point startFloorPosition, int height, int direction, out int distanceCoveredInTiles, out Point lastIteratedFloorSpot, int maxDistance = 100, bool showDebug = false)
 {
   distanceCoveredInTiles = 0;
   // ISSUE: explicit reference operation
   // ISSUE: variable of a reference type
   Point& local1 = @startFloorPosition;
   // ISSUE: explicit reference operation
   int num1 = (^local1).Y - 1;
   // ISSUE: explicit reference operation
   (^local1).Y = (__Null) num1;
   lastIteratedFloorSpot = startFloorPosition;
   for (int index1 = 0; index1 < maxDistance; ++index1)
   {
     for (int index2 = 0; index2 < 3 && WorldGen.SolidTile3((int) startFloorPosition.X, (int) startFloorPosition.Y); ++index2)
     {
       // ISSUE: explicit reference operation
       // ISSUE: variable of a reference type
       Point& local2 = @startFloorPosition;
       // ISSUE: explicit reference operation
       int num2 = (^local2).Y - 1;
       // ISSUE: explicit reference operation
       (^local2).Y = (__Null) num2;
     }
     int topY1;
     int bottomY1;
     Collision.ExpandVertically((int) startFloorPosition.X, (int) startFloorPosition.Y, out topY1, out bottomY1, height, 2);
     ++topY1;
     --bottomY1;
     if (!WorldGen.SolidTile3((int) startFloorPosition.X, bottomY1 + 1))
     {
       int topY2;
       int bottomY2;
       Collision.ExpandVertically((int) startFloorPosition.X, bottomY1, out topY2, out bottomY2, 0, 6);
       if (showDebug)
         Dust.QuickBox(new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (topY2 * 16)), new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (bottomY2 * 16)), 1, Color.get_Blue(), (Action<Dust>) null);
       if (!WorldGen.SolidTile3((int) startFloorPosition.X, bottomY2))
         break;
     }
     if (bottomY1 - topY1 >= height - 1)
     {
       if (showDebug)
       {
         Dust.QuickDust(startFloorPosition, Color.get_Green()).scale = 1f;
         Dust.QuickBox(new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (topY1 * 16)), new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (bottomY1 * 16 + 16)), 1, Color.get_Red(), (Action<Dust>) null);
       }
       distanceCoveredInTiles += direction;
       // ISSUE: explicit reference operation
       // ISSUE: variable of a reference type
       Point& local2 = @startFloorPosition;
       // ISSUE: explicit reference operation
       int num2 = (^local2).X + direction;
       // ISSUE: explicit reference operation
       (^local2).X = (__Null) num2;
       startFloorPosition.Y = (__Null) bottomY1;
       lastIteratedFloorSpot = startFloorPosition;
       if (Math.Abs(distanceCoveredInTiles) >= maxDistance)
         break;
     }
     else
       break;
   }
   distanceCoveredInTiles = Math.Abs(distanceCoveredInTiles);
 }
Esempio n. 33
0
        protected override void Initialize()
        {
            NPC.clrNames();
            NPC.setNames();
            bgAlpha[0] = 1f;
            bgAlpha2[0] = 1f;
            for (int i = 0; i < 0x6f; i++)
            {
                projFrames[i] = 1;
            }
            projFrames[0x48] = 4;
            projFrames[0x56] = 4;
            projFrames[0x57] = 4;
            projFrames[0x66] = 2;
            debuff[20] = true;
            debuff[0x15] = true;
            debuff[0x16] = true;
            debuff[0x17] = true;
            debuff[0x18] = true;
            debuff[0x19] = true;
            debuff[0x1c] = true;
            debuff[30] = true;
            debuff[0x1f] = true;
            debuff[0x20] = true;
            debuff[0x21] = true;
            debuff[0x22] = true;
            debuff[0x23] = true;
            debuff[0x24] = true;
            debuff[0x25] = true;
            debuff[0x26] = true;
            debuff[0x27] = true;
            buffName[1] = "Obsidian Skin";
            buffTip[1] = "Immune to lava";
            buffName[2] = "Regeneration";
            buffTip[2] = "Provides life regeneration";
            buffName[3] = "Swiftness";
            buffTip[3] = "25% increased movement speed";
            buffName[4] = "Gills";
            buffTip[4] = "Breathe water instead of air";
            buffName[5] = "Ironskin";
            buffTip[5] = "Increase defense by 8";
            buffName[6] = "Mana Regeneration";
            buffTip[6] = "Increased mana regeneration";
            buffName[7] = "Magic Power";
            buffTip[7] = "20% increased magic damage";
            buffName[8] = "Featherfall";
            buffTip[8] = "Press UP or DOWN to control speed of descent";
            buffName[9] = "Spelunker";
            buffTip[9] = "Shows the location of treasure and ore";
            buffName[10] = "Invisibility";
            buffTip[10] = "Grants invisibility";
            buffName[11] = "Shine";
            buffTip[11] = "Emitting light";
            buffName[12] = "Night Owl";
            buffTip[12] = "Increased night vision";
            buffName[13] = "Battle";
            buffTip[13] = "Increased enemy spawn rate";
            buffName[14] = "Thorns";
            buffTip[14] = "Attackers also take damage";
            buffName[15] = "Water Walking";
            buffTip[15] = "Press DOWN to enter water";
            buffName[0x10] = "Archery";
            buffTip[0x10] = "20% increased arrow damage and speed";
            buffName[0x11] = "Hunter";
            buffTip[0x11] = "Shows the location of enemies";
            buffName[0x12] = "Gravitation";
            buffTip[0x12] = "Press UP or DOWN to reverse gravity";
            buffName[0x13] = "Orb of Light";
            buffTip[0x13] = "A magical orb that provides light";
            buffName[20] = "Poisoned";
            buffTip[20] = "Slowly losing life";
            buffName[0x15] = "Potion Sickness";
            buffTip[0x15] = "Cannot consume anymore healing items";
            buffName[0x16] = "Darkness";
            buffTip[0x16] = "Decreased light vision";
            buffName[0x17] = "Cursed";
            buffTip[0x17] = "Cannot use any items";
            buffName[0x18] = "On Fire!";
            buffTip[0x18] = "Slowly losing life";
            buffName[0x19] = "Tipsy";
            buffTip[0x19] = "Increased melee abilities, lowered defense";
            buffName[0x1a] = "Well Fed";
            buffTip[0x1a] = "Minor improvements to all stats";
            buffName[0x1b] = "Fairy";
            buffTip[0x1b] = "A fairy is following you";
            buffName[0x1c] = "Werewolf";
            buffTip[0x1c] = "Physical abilities are increased";
            buffName[0x1d] = "Clairvoyance";
            buffTip[0x1d] = "Magic powers are increased";
            buffName[30] = "Bleeding";
            buffTip[30] = "Cannot regenerate life";
            buffName[0x1f] = "Confused";
            buffTip[0x1f] = "Movement is reversed";
            buffName[0x20] = "Slow";
            buffTip[0x20] = "Movement speed is reduced";
            buffName[0x21] = "Weak";
            buffTip[0x21] = "Physical abilities are decreased";
            buffName[0x22] = "Merfolk";
            buffTip[0x22] = "Can breathe and move easily underwater";
            buffName[0x23] = "Silenced";
            buffTip[0x23] = "Cannot use items that require mana";
            buffName[0x24] = "Broken Armor";
            buffTip[0x24] = "Defense is cut in half";
            buffName[0x25] = "Horrified";
            buffTip[0x25] = "You have seen something nasty, there is no escape.";
            buffName[0x26] = "The Tongue";
            buffTip[0x26] = "You are being sucked into the mouth";
            buffName[0x27] = "Cursed Inferno";
            buffTip[0x27] = "Losing life";
            for (int j = 0; j < 10; j++)
            {
                recentWorld[j] = "";
                recentIP[j] = "";
                recentPort[j] = 0;
            }
            if (rand == null)
            {
                rand = new Random((int)DateTime.Now.Ticks);
            }
            if (WorldGen.genRand == null)
            {
                WorldGen.genRand = new Random((int)DateTime.Now.Ticks);
            }
            switch (rand.Next(15))
            {
                case 0:
                    base.Window.Title = "Terraria: Dig Peon, Dig!";
                    break;

                case 1:
                    base.Window.Title = "Terraria: Epic Dirt";
                    break;

                case 2:
                    base.Window.Title = "Terraria: Hey Guys!";
                    break;

                case 3:
                    base.Window.Title = "Terraria: Sand is Overpowered";
                    break;

                case 4:
                    base.Window.Title = "Terraria Part 3: The Return of the Guide";
                    break;

                case 5:
                    base.Window.Title = "Terraria: A Bunnies Tale";
                    break;

                case 6:
                    base.Window.Title = "Terraria: Dr. Bones and The Temple of Blood Moon";
                    break;

                case 7:
                    base.Window.Title = "Terraria: Slimeassic Park";
                    break;

                case 8:
                    base.Window.Title = "Terraria: The Grass is Greener on This Side";
                    break;

                case 9:
                    base.Window.Title = "Terraria: Small Blocks, Not for Children Under the Age of 5";
                    break;

                case 10:
                    base.Window.Title = "Terraria: Digger T' Blocks";
                    break;

                case 11:
                    base.Window.Title = "Terraria: There is No Cow Layer";
                    break;

                case 12:
                    base.Window.Title = "Terraria: Suspicous Looking Eyeballs";
                    break;

                case 13:
                    base.Window.Title = "Terraria: Purple Grass!";
                    break;

                case 14:
                    base.Window.Title = "Terraria: Noone Dug Behind!";
                    break;

                default:
                    base.Window.Title = "Terraria: Shut Up and Dig Gaiden!";
                    break;
            }
            lo = rand.Next(6);
            //ADDED TILEOPTIONS for flags:  (tiki = 0x56)
            tileHammer[150] = true;
            tileLighted[150] = true;
            tileLavaDeath[150] = true;
            tileFrameImportant[150] = true;
            tileNoAttach[150] = true;
            tileName[150] = "Red Flag";     //CHANGED: ADDED

            tileHammer[151] = true;
            //tileLighted[151] = true;
            tileLavaDeath[151] = true;
            //tileFrameImportant[151] = true;
            tileNoAttach[151] = true;
            tileName[151] = "Blue Flag";     //CHANGED: ADDED

            //ORIG
            tileShine2[6] = true;
            tileShine2[7] = true;
            tileShine2[8] = true;
            tileShine2[9] = true;
            tileShine2[12] = true;
            tileShine2[0x15] = true;
            tileShine2[0x16] = true;
            tileShine2[0x19] = true;
            tileShine2[0x2d] = true;
            tileShine2[0x2e] = true;
            tileShine2[0x2f] = true;
            tileShine2[0x3f] = true;
            tileShine2[0x40] = true;
            tileShine2[0x41] = true;
            tileShine2[0x42] = true;
            tileShine2[0x43] = true;
            tileShine2[0x44] = true;
            tileShine2[0x6b] = true;
            tileShine2[0x6c] = true;
            tileShine2[0x6f] = true;
            tileShine2[0x79] = true;
            tileShine2[0x7a] = true;
            tileShine2[0x75] = true;
            tileShine[0x81] = 300;
            tileHammer[0x8d] = true;
            tileHammer[4] = true;
            tileHammer[10] = true;
            tileHammer[11] = true;
            tileHammer[12] = true;
            tileHammer[13] = true;
            tileHammer[14] = true;
            tileHammer[15] = true;
            tileHammer[0x10] = true;
            tileHammer[0x11] = true;
            tileHammer[0x12] = true;
            tileHammer[0x13] = true;
            tileHammer[0x15] = true;
            tileHammer[0x1a] = true;
            tileHammer[0x1c] = true;
            tileHammer[0x1d] = true;
            tileHammer[0x1f] = true;
            tileHammer[0x21] = true;
            tileHammer[0x22] = true;
            tileHammer[0x23] = true;
            tileHammer[0x24] = true;
            tileHammer[0x2a] = true;
            tileHammer[0x30] = true;
            tileHammer[0x31] = true;
            tileHammer[50] = true;
            tileHammer[0x36] = true;
            tileHammer[0x37] = true;
            tileHammer[0x4d] = true;
            tileHammer[0x4e] = true;
            tileHammer[0x4f] = true;
            tileHammer[0x51] = true;
            tileHammer[0x55] = true;
            tileHammer[0x56] = true;
            tileHammer[0x57] = true;
            tileHammer[0x58] = true;
            tileHammer[0x59] = true;
            tileHammer[90] = true;
            tileHammer[0x5b] = true;
            tileHammer[0x5c] = true;
            tileHammer[0x5d] = true;
            tileHammer[0x5e] = true;
            tileHammer[0x5f] = true;
            tileHammer[0x60] = true;
            tileHammer[0x61] = true;
            tileHammer[0x62] = true;
            tileHammer[0x63] = true;
            tileHammer[100] = true;
            tileHammer[0x65] = true;
            tileHammer[0x66] = true;
            tileHammer[0x67] = true;
            tileHammer[0x68] = true;
            tileHammer[0x69] = true;
            tileHammer[0x6a] = true;
            tileHammer[0x72] = true;
            tileHammer[0x7d] = true;
            tileHammer[0x7e] = true;
            tileHammer[0x80] = true;
            tileHammer[0x81] = true;
            tileHammer[0x84] = true;
            tileHammer[0x85] = true;
            tileHammer[0x86] = true;
            tileHammer[0x87] = true;
            tileHammer[0x88] = true;
            tileFrameImportant[0x8b] = true;
            tileHammer[0x8b] = true;
            tileLighted[0x95] = true;
            tileFrameImportant[0x95] = true;
            tileHammer[0x95] = true;
            tileFrameImportant[0x8e] = true;
            tileHammer[0x8e] = true;
            tileFrameImportant[0x8f] = true;
            tileHammer[0x8f] = true;
            tileFrameImportant[0x90] = true;
            tileHammer[0x90] = true;
            tileStone[0x83] = true;
            tileFrameImportant[0x88] = true;
            tileFrameImportant[0x89] = true;
            tileFrameImportant[0x8a] = true;
            tileBlockLight[0x89] = true;
            tileSolid[0x89] = true;
            tileBlockLight[0x91] = true;
            tileSolid[0x91] = true;
            tileMergeDirt[0x91] = true;
            tileBlockLight[0x92] = true;
            tileSolid[0x92] = true;
            tileMergeDirt[0x92] = true;
            tileBlockLight[0x93] = true;
            tileSolid[0x93] = true;
            tileMergeDirt[0x93] = true;
            tileBlockLight[0x94] = true;
            tileSolid[0x94] = true;
            tileMergeDirt[0x94] = true;
            tileBlockLight[0x8a] = true;
            tileSolid[0x8a] = true;
            tileBlockLight[140] = true;
            tileSolid[140] = true;
            tileAxe[5] = true;
            tileAxe[30] = true;
            tileAxe[0x48] = true;
            tileAxe[80] = true;
            tileAxe[0x7c] = true;
            tileShine[0x16] = 0x47e;
            tileShine[6] = 0x47e;
            tileShine[7] = 0x44c;
            tileShine[8] = 0x3e8;
            tileShine[9] = 0x41a;
            tileShine[12] = 0x3e8;
            tileShine[0x15] = 0x4b0;
            tileShine[0x3f] = 900;
            tileShine[0x40] = 900;
            tileShine[0x41] = 900;
            tileShine[0x42] = 900;
            tileShine[0x43] = 900;
            tileShine[0x44] = 900;
            tileShine[0x2d] = 0x76c;
            tileShine[0x2e] = 0x7d0;
            tileShine[0x2f] = 0x834;
            tileShine[0x7a] = 0x708;
            tileShine[0x79] = 0x73a;
            tileShine[0x7d] = 600;
            tileShine[0x6d] = 0x2328;
            tileShine[110] = 0x2328;
            tileShine[0x74] = 0x2328;
            tileShine[0x75] = 0x2328;
            tileShine[0x76] = 0x1f40;
            tileShine[0x6b] = 950;
            tileShine[0x6c] = 900;
            tileShine[0x6f] = 850;
            tileLighted[4] = true;
            tileLighted[0x11] = true;
            tileLighted[0x85] = true;
            tileLighted[0x1f] = true;
            tileLighted[0x21] = true;
            tileLighted[0x22] = true;
            tileLighted[0x23] = true;
            tileLighted[0x24] = true;
            tileLighted[0x25] = true;
            tileLighted[0x2a] = true;
            tileLighted[0x31] = true;
            tileLighted[0x3a] = true;
            tileLighted[0x3d] = true;
            tileLighted[70] = true;
            tileLighted[0x47] = true;
            tileLighted[0x48] = true;
            tileLighted[0x4c] = true;
            tileLighted[0x4d] = true;
            tileLighted[0x13] = true;
            tileLighted[0x16] = true;
            tileLighted[0x1a] = true;
            tileLighted[0x53] = true;
            tileLighted[0x54] = true;
            tileLighted[0x5c] = true;
            tileLighted[0x5d] = true;
            tileLighted[0x5f] = true;
            tileLighted[0x62] = true;
            tileLighted[100] = true;
            tileLighted[0x6d] = true;
            tileLighted[0x7d] = true;
            tileLighted[0x7e] = true;
            tileLighted[0x81] = true;
            tileLighted[140] = true;
            tileMergeDirt[1] = true;
            tileMergeDirt[6] = true;
            tileMergeDirt[7] = true;
            tileMergeDirt[8] = true;
            tileMergeDirt[9] = true;
            tileMergeDirt[0x16] = true;
            tileMergeDirt[0x19] = true;
            tileMergeDirt[30] = true;
            tileMergeDirt[0x25] = true;
            tileMergeDirt[0x26] = true;
            tileMergeDirt[40] = true;
            tileMergeDirt[0x35] = true;
            tileMergeDirt[0x38] = true;
            tileMergeDirt[0x6b] = true;
            tileMergeDirt[0x6c] = true;
            tileMergeDirt[0x6f] = true;
            tileMergeDirt[0x70] = true;
            tileMergeDirt[0x74] = true;
            tileMergeDirt[0x75] = true;
            tileMergeDirt[0x7b] = true;
            tileMergeDirt[140] = true;
            tileMergeDirt[0x27] = true;
            tileMergeDirt[0x7a] = true;
            tileMergeDirt[0x79] = true;
            tileMergeDirt[120] = true;
            tileMergeDirt[0x77] = true;
            tileMergeDirt[0x76] = true;
            tileMergeDirt[0x2f] = true;
            tileMergeDirt[0x2e] = true;
            tileMergeDirt[0x2d] = true;
            tileMergeDirt[0x2c] = true;
            tileMergeDirt[0x2b] = true;
            tileMergeDirt[0x29] = true;
            tileFrameImportant[3] = true;
            tileFrameImportant[4] = true;
            tileFrameImportant[5] = true;
            tileFrameImportant[10] = true;
            tileFrameImportant[11] = true;
            tileFrameImportant[12] = true;
            tileFrameImportant[13] = true;
            tileFrameImportant[14] = true;
            tileFrameImportant[15] = true;
            tileFrameImportant[0x10] = true;
            tileFrameImportant[0x11] = true;
            tileFrameImportant[0x12] = true;
            tileFrameImportant[20] = true;
            tileFrameImportant[0x15] = true;
            tileFrameImportant[0x18] = true;
            tileFrameImportant[0x1a] = true;
            tileFrameImportant[0x1b] = true;
            tileFrameImportant[0x1c] = true;
            tileFrameImportant[0x1d] = true;
            tileFrameImportant[0x1f] = true;
            tileFrameImportant[0x21] = true;
            tileFrameImportant[0x22] = true;
            tileFrameImportant[0x23] = true;
            tileFrameImportant[0x24] = true;
            tileFrameImportant[0x2a] = true;
            tileFrameImportant[50] = true;
            tileFrameImportant[0x37] = true;
            tileFrameImportant[0x3d] = true;
            tileFrameImportant[0x47] = true;
            tileFrameImportant[0x48] = true;
            tileFrameImportant[0x49] = true;
            tileFrameImportant[0x4a] = true;
            tileFrameImportant[0x4d] = true;
            tileFrameImportant[0x4e] = true;
            tileFrameImportant[0x4f] = true;
            tileFrameImportant[0x51] = true;
            tileFrameImportant[0x52] = true;
            tileFrameImportant[0x53] = true;
            tileFrameImportant[0x54] = true;
            tileFrameImportant[0x55] = true;
            tileFrameImportant[0x56] = true;
            tileFrameImportant[0x57] = true;
            tileFrameImportant[0x58] = true;
            tileFrameImportant[0x59] = true;
            tileFrameImportant[90] = true;
            tileFrameImportant[0x5b] = true;
            tileFrameImportant[0x5c] = true;
            tileFrameImportant[0x5d] = true;
            tileFrameImportant[0x5e] = true;
            tileFrameImportant[0x5f] = true;
            tileFrameImportant[0x60] = true;
            tileFrameImportant[0x61] = true;
            tileFrameImportant[0x62] = true;
            tileFrameImportant[0x63] = true;
            tileFrameImportant[0x65] = true;
            tileFrameImportant[0x66] = true;
            tileFrameImportant[0x67] = true;
            tileFrameImportant[0x68] = true;
            tileFrameImportant[0x69] = true;
            tileFrameImportant[100] = true;
            tileFrameImportant[0x6a] = true;
            tileFrameImportant[110] = true;
            tileFrameImportant[0x71] = true;
            tileFrameImportant[0x72] = true;
            tileFrameImportant[0x7d] = true;
            tileFrameImportant[0x7e] = true;
            tileFrameImportant[0x80] = true;
            tileFrameImportant[0x81] = true;
            tileFrameImportant[0x84] = true;
            tileFrameImportant[0x85] = true;
            tileFrameImportant[0x86] = true;
            tileFrameImportant[0x87] = true;
            tileFrameImportant[0x8d] = true;
            tileCut[3] = true;
            tileCut[0x18] = true;
            tileCut[0x1c] = true;
            tileCut[0x20] = true;
            tileCut[0x33] = true;
            tileCut[0x34] = true;
            tileCut[0x3d] = true;
            tileCut[0x3e] = true;
            tileCut[0x45] = true;
            tileCut[0x47] = true;
            tileCut[0x49] = true;
            tileCut[0x4a] = true;
            tileCut[0x52] = true;
            tileCut[0x53] = true;
            tileCut[0x54] = true;
            tileCut[110] = true;
            tileCut[0x71] = true;
            tileCut[0x73] = true;
            tileAlch[0x52] = true;
            tileAlch[0x53] = true;
            tileAlch[0x54] = true;
            tileLavaDeath[0x68] = true;
            tileLavaDeath[110] = true;
            tileLavaDeath[0x71] = true;
            tileLavaDeath[0x73] = true;
            tileSolid[0x7f] = true;
            tileSolid[130] = true;
            tileBlockLight[130] = true;
            tileBlockLight[0x83] = true;
            tileSolid[0x6b] = true;
            tileBlockLight[0x6b] = true;
            tileSolid[0x6c] = true;
            tileBlockLight[0x6c] = true;
            tileSolid[0x6f] = true;
            tileBlockLight[0x6f] = true;
            tileSolid[0x6d] = true;
            tileBlockLight[0x6d] = true;
            tileSolid[110] = false;
            tileNoAttach[110] = true;
            tileNoFail[110] = true;
            tileSolid[0x70] = true;
            tileBlockLight[0x70] = true;
            tileSolid[0x74] = true;
            tileBlockLight[0x74] = true;
            tileSolid[0x75] = true;
            tileBlockLight[0x75] = true;
            tileSolid[0x7b] = true;
            tileBlockLight[0x7b] = true;
            tileSolid[0x76] = true;
            tileBlockLight[0x76] = true;
            tileSolid[0x77] = true;
            tileBlockLight[0x77] = true;
            tileSolid[120] = true;
            tileBlockLight[120] = true;
            tileSolid[0x79] = true;
            tileBlockLight[0x79] = true;
            tileSolid[0x7a] = true;
            tileBlockLight[0x7a] = true;
            tileBlockLight[0x73] = true;
            tileSolid[0] = true;
            tileBlockLight[0] = true;
            tileSolid[1] = true;
            tileBlockLight[1] = true;
            tileSolid[2] = true;
            tileBlockLight[2] = true;
            tileSolid[3] = false;
            tileNoAttach[3] = true;
            tileNoFail[3] = true;
            tileSolid[4] = false;
            tileNoAttach[4] = true;
            tileNoFail[4] = true;
            tileNoFail[0x18] = true;
            tileSolid[5] = false;
            tileSolid[6] = true;
            tileBlockLight[6] = true;
            tileSolid[7] = true;
            tileBlockLight[7] = true;
            tileSolid[8] = true;
            tileBlockLight[8] = true;
            tileSolid[9] = true;
            tileBlockLight[9] = true;
            tileBlockLight[10] = true;
            tileSolid[10] = true;
            tileNoAttach[10] = true;
            tileBlockLight[10] = true;
            tileSolid[11] = false;
            tileSolidTop[0x13] = true;
            tileSolid[0x13] = true;
            tileSolid[0x16] = true;
            tileSolid[0x17] = true;
            tileSolid[0x19] = true;
            tileSolid[30] = true;
            tileNoFail[0x20] = true;
            tileBlockLight[0x20] = true;
            tileSolid[0x25] = true;
            tileBlockLight[0x25] = true;
            tileSolid[0x26] = true;
            tileBlockLight[0x26] = true;
            tileSolid[0x27] = true;
            tileBlockLight[0x27] = true;
            tileSolid[40] = true;
            tileBlockLight[40] = true;
            tileSolid[0x29] = true;
            tileBlockLight[0x29] = true;
            tileSolid[0x2b] = true;
            tileBlockLight[0x2b] = true;
            tileSolid[0x2c] = true;
            tileBlockLight[0x2c] = true;
            tileSolid[0x2d] = true;
            tileBlockLight[0x2d] = true;
            tileSolid[0x2e] = true;
            tileBlockLight[0x2e] = true;
            tileSolid[0x2f] = true;
            tileBlockLight[0x2f] = true;
            tileSolid[0x30] = true;
            tileBlockLight[0x30] = true;
            tileSolid[0x35] = true;
            tileBlockLight[0x35] = true;
            tileSolid[0x36] = true;
            tileBlockLight[0x34] = true;
            tileSolid[0x38] = true;
            tileBlockLight[0x38] = true;
            tileSolid[0x39] = true;
            tileBlockLight[0x39] = true;
            tileSolid[0x3a] = true;
            tileBlockLight[0x3a] = true;
            tileSolid[0x3b] = true;
            tileBlockLight[0x3b] = true;
            tileSolid[60] = true;
            tileBlockLight[60] = true;
            tileSolid[0x3f] = true;
            tileBlockLight[0x3f] = true;
            tileStone[0x3f] = true;
            tileStone[130] = true;
            tileSolid[0x40] = true;
            tileBlockLight[0x40] = true;
            tileStone[0x40] = true;
            tileSolid[0x41] = true;
            tileBlockLight[0x41] = true;
            tileStone[0x41] = true;
            tileSolid[0x42] = true;
            tileBlockLight[0x42] = true;
            tileStone[0x42] = true;
            tileSolid[0x43] = true;
            tileBlockLight[0x43] = true;
            tileStone[0x43] = true;
            tileSolid[0x44] = true;
            tileBlockLight[0x44] = true;
            tileStone[0x44] = true;
            tileSolid[0x4b] = true;
            tileBlockLight[0x4b] = true;
            tileSolid[0x4c] = true;
            tileBlockLight[0x4c] = true;
            tileSolid[70] = true;
            tileBlockLight[70] = true;
            tileNoFail[50] = true;
            tileNoAttach[50] = true;
            tileDungeon[0x29] = true;
            tileDungeon[0x2b] = true;
            tileDungeon[0x2c] = true;
            tileBlockLight[30] = true;
            tileBlockLight[0x19] = true;
            tileBlockLight[0x17] = true;
            tileBlockLight[0x16] = true;
            tileBlockLight[0x3e] = true;
            tileSolidTop[0x12] = true;
            tileSolidTop[14] = true;
            tileSolidTop[0x10] = true;
            tileSolidTop[0x72] = true;
            tileNoAttach[20] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[13] = true;
            tileNoAttach[14] = true;
            tileNoAttach[15] = true;
            tileNoAttach[0x10] = true;
            tileNoAttach[0x11] = true;
            tileNoAttach[0x12] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[0x15] = true;
            tileNoAttach[0x1b] = true;
            tileNoAttach[0x72] = true;
            tileTable[14] = true;
            tileTable[0x12] = true;
            tileTable[0x13] = true;
            tileTable[0x72] = true;
            tileNoAttach[0x56] = true;
            tileNoAttach[0x57] = true;
            tileNoAttach[0x58] = true;
            tileNoAttach[0x59] = true;
            tileNoAttach[90] = true;
            tileLavaDeath[0x56] = true;
            tileLavaDeath[0x57] = true;
            tileLavaDeath[0x58] = true;
            tileLavaDeath[0x59] = true;
            tileLavaDeath[0x7d] = true;
            tileLavaDeath[0x7e] = true;
            tileLavaDeath[0x65] = true;
            tileTable[0x65] = true;
            tileNoAttach[0x65] = true;
            tileLavaDeath[0x66] = true;
            tileNoAttach[0x66] = true;
            tileNoAttach[0x5e] = true;
            tileNoAttach[0x5f] = true;
            tileNoAttach[0x60] = true;
            tileNoAttach[0x61] = true;
            tileNoAttach[0x62] = true;
            tileNoAttach[0x63] = true;
            tileLavaDeath[0x5e] = true;
            tileLavaDeath[0x5f] = true;
            tileLavaDeath[0x60] = true;
            tileLavaDeath[0x61] = true;
            tileLavaDeath[0x62] = true;
            tileLavaDeath[0x63] = true;
            tileLavaDeath[100] = true;
            tileLavaDeath[0x67] = true;
            tileTable[0x57] = true;
            tileTable[0x58] = true;
            tileSolidTop[0x57] = true;
            tileSolidTop[0x58] = true;
            tileSolidTop[0x65] = true;
            tileNoAttach[0x5b] = true;
            tileLavaDeath[0x5b] = true;
            tileNoAttach[0x5c] = true;
            tileLavaDeath[0x5c] = true;
            tileNoAttach[0x5d] = true;
            tileLavaDeath[0x5d] = true;
            tileWaterDeath[4] = true;
            tileWaterDeath[0x33] = true;
            tileWaterDeath[0x5d] = true;
            tileWaterDeath[0x62] = true;
            tileLavaDeath[3] = true;
            tileLavaDeath[5] = true;
            tileLavaDeath[10] = true;
            tileLavaDeath[11] = true;
            tileLavaDeath[12] = true;
            tileLavaDeath[13] = true;
            tileLavaDeath[14] = true;
            tileLavaDeath[15] = true;
            tileLavaDeath[0x10] = true;
            tileLavaDeath[0x11] = true;
            tileLavaDeath[0x12] = true;
            tileLavaDeath[0x13] = true;
            tileLavaDeath[20] = true;
            tileLavaDeath[0x1b] = true;
            tileLavaDeath[0x1c] = true;
            tileLavaDeath[0x1d] = true;
            tileLavaDeath[0x20] = true;
            tileLavaDeath[0x21] = true;
            tileLavaDeath[0x22] = true;
            tileLavaDeath[0x23] = true;
            tileLavaDeath[0x24] = true;
            tileLavaDeath[0x2a] = true;
            tileLavaDeath[0x31] = true;
            tileLavaDeath[50] = true;
            tileLavaDeath[0x34] = true;
            tileLavaDeath[0x37] = true;
            tileLavaDeath[0x3d] = true;
            tileLavaDeath[0x3e] = true;
            tileLavaDeath[0x45] = true;
            tileLavaDeath[0x47] = true;
            tileLavaDeath[0x48] = true;
            tileLavaDeath[0x49] = true;
            tileLavaDeath[0x4a] = true;
            tileLavaDeath[0x4f] = true;
            tileLavaDeath[80] = true;
            tileLavaDeath[0x51] = true;
            tileLavaDeath[0x6a] = true;
            wallHouse[1] = true;
            wallHouse[4] = true;
            wallHouse[5] = true;
            wallHouse[6] = true;
            wallHouse[10] = true;
            wallHouse[11] = true;
            wallHouse[12] = true;
            wallHouse[0x10] = true;
            wallHouse[0x11] = true;
            wallHouse[0x12] = true;
            wallHouse[0x13] = true;
            wallHouse[20] = true;
            wallHouse[0x15] = true;
            wallHouse[0x16] = true;
            wallHouse[0x17] = true;
            wallHouse[0x18] = true;
            wallHouse[0x19] = true;
            wallHouse[0x1a] = true;
            wallHouse[0x1b] = true;
            wallHouse[0x1d] = true;
            wallHouse[30] = true;
            wallHouse[0x1f] = true;
            for (int k = 0; k < 0x20; k++)
            {
                switch (k)
                {
                    case 20:
                        wallBlend[k] = 14;
                        break;

                    case 0x13:
                        wallBlend[k] = 9;
                        break;

                    case 0x12:
                        wallBlend[k] = 8;
                        break;

                    case 0x11:
                        wallBlend[k] = 7;
                        break;

                    case 0x10:
                        wallBlend[k] = 2;
                        break;

                    default:
                        wallBlend[k] = k;
                        break;
                }
            }
            tileNoFail[0x20] = true;
            tileNoFail[0x3d] = true;
            tileNoFail[0x45] = true;
            tileNoFail[0x49] = true;
            tileNoFail[0x4a] = true;
            tileNoFail[0x52] = true;
            tileNoFail[0x53] = true;
            tileNoFail[0x54] = true;
            tileNoFail[110] = true;
            tileNoFail[0x71] = true;
            for (int m = 0; m < maxTileSets; m++)    //CHANGED: orig 150
            {
                tileName[m] = "";
                if (tileSolid[m])
                {
                    tileNoSunLight[m] = true;
                }
            }
            tileNoSunLight[0x13] = false;
            tileNoSunLight[11] = true;
            tileName[13] = "Bottle";
            tileName[14] = "Table";
            tileName[15] = "Chair";
            tileName[0x10] = "Anvil";
            tileName[0x11] = "Furnace";
            tileName[0x12] = "Workbench";
            tileName[0x1a] = "Demon Altar";
            tileName[0x4d] = "Hellforge";
            tileName[0x56] = "Loom";
            tileName[0x5e] = "Keg";
            tileName[0x60] = "Cooking Pot";
            tileName[0x65] = "Bookcase";
            tileName[0x6a] = "Sawmill";
            tileName[0x72] = "Tinkerer's Workshop";
            tileName[0x85] = "Adamantite Forge";
            tileName[0x86] = "Mythril Anvil";

            for (int n = 0; n < maxMenuItems; n++)
            {
                this.menuItemScale[n] = 0.8f;
            }
            for (int num7 = 0; num7 < 0x7d1; num7++)
            {
                dust[num7] = new Dust();
            }
            for (int num8 = 0; num8 < 0xc9; num8++)
            {
                Main.item[num8] = new Item();
            }
            for (int num9 = 0; num9 < 0xc9; num9++)
            {
                npc[num9] = new NPC();
                npc[num9].whoAmI = num9;
            }
            for (int num10 = 0; num10 < 0x100; num10++)
            {
                player[num10] = new Player();
            }
            for (int num11 = 0; num11 < 0x3e9; num11++)
            {
                projectile[num11] = new Projectile();
            }
            for (int num12 = 0; num12 < 0xc9; num12++)
            {
                gore[num12] = new Gore();
            }
            for (int num13 = 0; num13 < 100; num13++)
            {
                cloud[num13] = new Cloud();
            }
            for (int num14 = 0; num14 < 100; num14++)
            {
                combatText[num14] = new CombatText();
            }
            for (int num15 = 0; num15 < 20; num15++)
            {
                itemText[num15] = new ItemText();
            }
            for (int num16 = 0; num16 < maxItemTypes; num16++) //CHANGED, orig 0x25b
            {
                Item item = new Item();
                item.SetDefaults(num16, false);
                itemName[num16] = item.name;
                if (item.headSlot > 0)
                {
                    Item.headType[item.headSlot] = item.type;
                }
                if (item.bodySlot > 0)
                {
                    Item.bodyType[item.bodySlot] = item.type;
                }
                if (item.legSlot > 0)
                {
                    Item.legType[item.legSlot] = item.type;
                }
            }
            for (int num17 = 0; num17 < Recipe.maxRecipes; num17++)
            {
                recipe[num17] = new Recipe();
                availableRecipeY[num17] = 0x41 * num17;
            }
            Recipe.SetupRecipes();
            for (int num18 = 0; num18 < numChatLines; num18++)
            {
                chatLine[num18] = new ChatLine();
            }
            for (int num19 = 0; num19 < Liquid.resLiquid; num19++)
            {
                liquid[num19] = new Liquid();
            }
            for (int num20 = 0; num20 < 0x2710; num20++)
            {
                liquidBuffer[num20] = new LiquidBuffer();
            }
            this.shop[0] = new Chest();
            this.shop[1] = new Chest();
            this.shop[1].SetupShop(1);
            this.shop[2] = new Chest();
            this.shop[2].SetupShop(2);
            this.shop[3] = new Chest();
            this.shop[3].SetupShop(3);
            this.shop[4] = new Chest();
            this.shop[4].SetupShop(4);
            this.shop[5] = new Chest();
            this.shop[5].SetupShop(5);
            this.shop[6] = new Chest();
            this.shop[6].SetupShop(6);
            this.shop[7] = new Chest();
            this.shop[7].SetupShop(7);
            this.shop[8] = new Chest();
            this.shop[8].SetupShop(8);
            this.shop[9] = new Chest();
            this.shop[9].SetupShop(9);
            teamColor[0] = Color.White;
            teamColor[1] = new Color(230, 40, 20);
            teamColor[2] = new Color(20, 200, 30);
            teamColor[3] = new Color(0x4b, 90, 0xff);
            teamColor[4] = new Color(200, 180, 0);
            if (menuMode == 1)
            {
                LoadPlayers();
            }
            Netplay.Init();
            /*if (skipMenu) // CHANGED: wasnt working so made new skipmenu (line 17280)
            {
                WorldGen.clearWorld();
                gameMenu = false;
                LoadPlayers();
                player[myPlayer] = (Player)loadPlayer[0].Clone();
                PlayerPath = loadPlayerPath[0];
                LoadWorlds();
                WorldGen.generateWorld(-1);
                WorldGen.EveryTileFrame();
                player[myPlayer].Spawn();
            }
            else
            {*/
                IntPtr systemMenu = GetSystemMenu(base.Window.Handle, false);
                int menuItemCount = GetMenuItemCount(systemMenu);
                RemoveMenu(systemMenu, menuItemCount - 1, 0x400);
            //}
            if (!dedServ)
            {
                this.graphics.PreferredBackBufferWidth = screenWidth;
                this.graphics.PreferredBackBufferHeight = screenHeight;
                this.graphics.ApplyChanges();
                base.Initialize();
                base.Window.AllowUserResizing = true;
                this.OpenSettings();
                this.OpenRecent();
                Star.SpawnStars();
                foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
                {
                    if (((mode.Width < minScreenW) || (mode.Height < minScreenH)) || ((mode.Width > maxScreenW) || (mode.Height > maxScreenH)))
                    {
                        continue;
                    }
                    bool flag = true;
                    for (int num22 = 0; num22 < this.numDisplayModes; num22++)
                    {
                        if ((mode.Width == this.displayWidth[num22]) && (mode.Height == this.displayHeight[num22]))
                        {
                            flag = false;
                            break;
                        }
                    }
                    if (flag)
                    {
                        this.displayHeight[this.numDisplayModes] = mode.Height;
                        this.displayWidth[this.numDisplayModes] = mode.Width;
                        this.numDisplayModes++;
                    }
                }
                if (autoJoin)
                {
                    LoadPlayers();
                    menuMode = 1;
                    menuMultiplayer = true;
                }
                fpsTimer.Start();
                updateTimer.Start();
            }
            if(Mods.ModMain.skipMenu)
            {
                Mods.ModMain.skipMenus();   //CHANGED: Try to skip menus
            }
        }
Esempio n. 34
0
		public override void OnSpawn(Dust dust)
		{
			dust.noGravity = true;
		}
Esempio n. 35
0
 public override void OnSpawn(Dust dust)
 {
     dust.noGravity = true;
     dust.velocity *= 0.5f;
     dust.velocity.Y -= 0.5f;
 }