// Token: 0x0600008F RID: 143 RVA: 0x0000BB70 File Offset: 0x00009D70 public void DrawFreshAnimations(SpriteBatch spriteBatch) { for (int i = 0; i < this.data.Length; i++) { this.data[i].animationTimeElapsed++; } if (!Main.SettingsEnabled_MinersWobble) { return; } int num = 1; Vector2 zero = new Vector2((float)Main.offScreenRange); if (Main.drawToScreen) { zero = Vector2.Zero; } zero = Vector2.Zero; for (int j = 0; j < this.data.Length; j++) { if (this.data[j].type == num) { int damage = this.data[j].damage; if (damage >= 20) { int x = this.data[j].X; int y = this.data[j].Y; if (WorldGen.InWorld(x, y, 0)) { bool flag = Main.tile[x, y] != null; if (flag && num == 1) { flag = (flag && Main.tile[x, y].active() && Main.tileSolid[(int)Main.tile[x, y].type]); } if (flag && num == 2) { flag = (flag && Main.tile[x, y].wall > 0); } if (flag) { bool flag2 = false; bool flag3 = false; if (Main.tile[x, y].type == 10) { flag2 = false; } else if (Main.tileSolid[(int)Main.tile[x, y].type] && !Main.tileSolidTop[(int)Main.tile[x, y].type]) { flag2 = true; } else if (Main.tile[x, y].type == 5) { flag3 = true; int num2 = (int)(Main.tile[x, y].frameX / 22); int num3 = (int)(Main.tile[x, y].frameY / 22); if (num3 < 9) { flag2 = (((num2 != 1 && num2 != 2) || num3 < 6 || num3 > 8) && (num2 != 3 || num3 > 2) && (num2 != 4 || num3 < 3 || num3 > 5) && (num2 != 5 || num3 < 6 || num3 > 8)); } } else if (Main.tile[x, y].type == 72) { flag3 = true; if (Main.tile[x, y].frameX <= 34) { flag2 = true; } } if (flag2 && Main.tile[x, y].slope() == 0 && !Main.tile[x, y].halfBrick()) { int num4 = 0; if (damage >= 80) { num4 = 3; } else if (damage >= 60) { num4 = 2; } else if (damage >= 40) { num4 = 1; } else if (damage >= 20) { num4 = 0; } Rectangle value = new Rectangle(this.data[j].crackStyle * 18, num4 * 18, 16, 16); value.Inflate(-2, -2); if (flag3) { value.X = (4 + this.data[j].crackStyle / 2) * 18; } int animationTimeElapsed = this.data[j].animationTimeElapsed; if ((float)animationTimeElapsed < 10f) { float arg_365_0 = (float)animationTimeElapsed / 10f; Color color = Lighting.GetColor(x, y); float rotation = 0f; Vector2 zero2 = Vector2.Zero; float num5 = 0.5f; float num6 = arg_365_0 % num5; num6 *= 1f / num5; if ((int)(arg_365_0 / num5) % 2 == 1) { num6 = 1f - num6; } Tile tileSafely = Framing.GetTileSafely(x, y); Tile tile = tileSafely; Texture2D texture; if (Main.canDrawColorTile(tileSafely.type, (int)tileSafely.color())) { texture = Main.tileAltTexture[(int)tileSafely.type, (int)tileSafely.color()]; } else { texture = Main.tileTexture[(int)tileSafely.type]; } Vector2 vector = new Vector2(8f); Vector2 value2 = new Vector2(1f); float arg_427_0 = num6 * 0.2f + 1f; float num7 = 1f - num6; num7 = 1f; color *= num7 * num7 * 0.8f; Vector2 scale = arg_427_0 * value2; Vector2 position = (new Vector2((float)(x * 16 - (int)Main.screenPosition.X), (float)(y * 16 - (int)Main.screenPosition.Y)) + zero + vector + zero2).Floor(); spriteBatch.Draw(texture, position, new Rectangle?(new Rectangle((int)tile.frameX, (int)tile.frameY, 16, 16)), color, rotation, vector, scale, SpriteEffects.None, 0f); color.A = 180; spriteBatch.Draw(Main.tileCrackTexture, position, new Rectangle?(value), color, rotation, vector, scale, SpriteEffects.None, 0f); } } } } } } } }
public void DrawFreshAnimations(SpriteBatch spriteBatch) { for (int index = 0; index < this.data.Length; ++index) { ++this.data[index].animationTimeElapsed; } if (!Main.SettingsEnabled_MinersWobble) { return; } int num1 = 1; Vector2 vector2_1 = new Vector2((float)Main.offScreenRange); if (Main.drawToScreen) { vector2_1 = Vector2.Zero; } vector2_1 = Vector2.Zero; for (int index = 0; index < this.data.Length; ++index) { if (this.data[index].type == num1) { int damage = this.data[index].damage; if (damage >= 20) { int x = this.data[index].X; int y = this.data[index].Y; if (WorldGen.InWorld(x, y, 0)) { bool flag1 = Main.tile[x, y] != null; if (flag1 && num1 == 1) { flag1 = flag1 && Main.tile[x, y].active() && Main.tileSolid[(int)Main.tile[x, y].type]; } if (flag1 && num1 == 2) { flag1 = flag1 && Main.tile[x, y].wall > (ushort)0; } if (flag1) { bool flag2 = false; bool flag3 = false; if (Main.tile[x, y].type == (ushort)10) { flag2 = false; } else if (Main.tileSolid[(int)Main.tile[x, y].type] && !Main.tileSolidTop[(int)Main.tile[x, y].type]) { flag2 = true; } else if (WorldGen.IsTreeType((int)Main.tile[x, y].type)) { flag3 = true; int num2 = (int)Main.tile[x, y].frameX / 22; int num3 = (int)Main.tile[x, y].frameY / 22; if (num3 < 9) { flag2 = (num2 != 1 && num2 != 2 || (num3 < 6 || num3 > 8)) && ((num2 != 3 || num3 > 2) && ((num2 != 4 || num3 < 3 || num3 > 5) && (num2 != 5 || num3 < 6 || num3 > 8))); } } else if (Main.tile[x, y].type == (ushort)72) { flag3 = true; if (Main.tile[x, y].frameX <= (short)34) { flag2 = true; } } if (flag2 && Main.tile[x, y].slope() == (byte)0 && !Main.tile[x, y].halfBrick()) { int num2 = 0; if (damage >= 80) { num2 = 3; } else if (damage >= 60) { num2 = 2; } else if (damage >= 40) { num2 = 1; } else if (damage >= 20) { num2 = 0; } Rectangle rectangle = new Rectangle(this.data[index].crackStyle * 18, num2 * 18, 16, 16); rectangle.Inflate(-2, -2); if (flag3) { rectangle.X = (4 + this.data[index].crackStyle / 2) * 18; } int animationTimeElapsed = this.data[index].animationTimeElapsed; if ((double)animationTimeElapsed < 10.0) { double num3 = (double)animationTimeElapsed / 10.0; Color color1 = Lighting.GetColor(x, y); float rotation = 0.0f; Vector2 zero = Vector2.Zero; float num4 = 0.5f; float num5 = (float)num3 % num4 * (1f / num4); if ((int)(num3 / (double)num4) % 2 == 1) { num5 = 1f - num5; } Tile tileSafely = Framing.GetTileSafely(x, y); Tile tile = tileSafely; Texture2D requestIfNotReady = Main.instance.TilePaintSystem.TryGetTileAndRequestIfNotReady((int)tileSafely.type, 0, (int)tileSafely.color()); if (requestIfNotReady != null) { Vector2 origin = new Vector2(8f); Vector2 vector2_2 = new Vector2(1f); double num6 = (double)num5 * 0.200000002980232 + 1.0; float num7 = 1f - num5; float num8 = 1f; Color color2 = color1 * (float)((double)num8 * (double)num8 * 0.800000011920929); Vector2 vector2_3 = vector2_2; Vector2 scale = (float)num6 * vector2_3; Vector2 position = (new Vector2((float)(x * 16 - (int)Main.screenPosition.X), (float)(y * 16 - (int)Main.screenPosition.Y)) + vector2_1 + origin + zero).Floor(); spriteBatch.Draw(requestIfNotReady, position, new Rectangle?(new Rectangle((int)tile.frameX, (int)tile.frameY, 16, 16)), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); color2.A = (byte)180; spriteBatch.Draw(TextureAssets.TileCrack.Value, position, new Rectangle?(rectangle), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); } } } } } } } } }
public void DrawFreshAnimations(SpriteBatch spriteBatch) { for (int i = 0; i < data.Length; i++) { data[i].animationTimeElapsed++; } if (!Main.SettingsEnabled_MinersWobble) { return; } int num = 1; Vector2 vector = new Vector2(Main.offScreenRange); if (Main.drawToScreen) { vector = Vector2.Zero; } vector = Vector2.Zero; for (int j = 0; j < data.Length; j++) { if (data[j].type != num) { continue; } int damage = data[j].damage; if (damage < 20) { continue; } int x = data[j].X; int y = data[j].Y; if (!WorldGen.InWorld(x, y)) { continue; } bool flag = Main.tile[x, y] != null; if (flag && num == 1) { flag = (flag && Main.tile[x, y].active() && Main.tileSolid[Main.tile[x, y].type]); } if (flag && num == 2) { flag = (flag && Main.tile[x, y].wall != 0); } if (!flag) { continue; } bool flag2 = false; bool flag3 = false; if (Main.tile[x, y].type == 10) { flag2 = false; } else if (Main.tileSolid[Main.tile[x, y].type] && !Main.tileSolidTop[Main.tile[x, y].type]) { flag2 = true; } else if (WorldGen.IsTreeType(Main.tile[x, y].type)) { flag3 = true; int num2 = Main.tile[x, y].frameX / 22; int num3 = Main.tile[x, y].frameY / 22; if (num3 < 9) { flag2 = (((num2 != 1 && num2 != 2) || num3 < 6 || num3 > 8) && (num2 != 3 || num3 > 2) && (num2 != 4 || num3 < 3 || num3 > 5) && ((num2 != 5 || num3 < 6 || num3 > 8) ? true : false)); } } else if (Main.tile[x, y].type == 72) { flag3 = true; if (Main.tile[x, y].frameX <= 34) { flag2 = true; } } if (!flag2 || Main.tile[x, y].slope() != 0 || Main.tile[x, y].halfBrick()) { continue; } int num4 = 0; if (damage >= 80) { num4 = 3; } else if (damage >= 60) { num4 = 2; } else if (damage >= 40) { num4 = 1; } else if (damage >= 20) { num4 = 0; } Rectangle value = new Rectangle(data[j].crackStyle * 18, num4 * 18, 16, 16); value.Inflate(-2, -2); if (flag3) { value.X = (4 + data[j].crackStyle / 2) * 18; } int animationTimeElapsed = data[j].animationTimeElapsed; if (!((float)animationTimeElapsed >= 10f)) { float num5 = (float)animationTimeElapsed / 10f; Color color = Lighting.GetColor(x, y); float rotation = 0f; Vector2 zero = Vector2.Zero; float num6 = 0.5f; float num7 = num5 % num6; num7 *= 1f / num6; if ((int)(num5 / num6) % 2 == 1) { num7 = 1f - num7; } Tile tileSafely = Framing.GetTileSafely(x, y); Tile tile = tileSafely; Texture2D texture2D = Main.instance.TilePaintSystem.TryGetTileAndRequestIfNotReady(tileSafely.type, 0, tileSafely.color()); if (texture2D != null) { Vector2 vector2 = new Vector2(8f); Vector2 value2 = new Vector2(1f); float scaleFactor = num7 * 0.2f + 1f; float num8 = 1f - num7; num8 = 1f; color *= num8 * num8 * 0.8f; Vector2 scale = scaleFactor * value2; Vector2 position = (new Vector2(x * 16 - (int)Main.screenPosition.X, y * 16 - (int)Main.screenPosition.Y) + vector + vector2 + zero).Floor(); spriteBatch.Draw(texture2D, position, new Rectangle(tile.frameX, tile.frameY, 16, 16), color, rotation, vector2, scale, SpriteEffects.None, 0f); color.A = 180; spriteBatch.Draw(TextureAssets.TileCrack.get_Value(), position, value, color, rotation, vector2, scale, SpriteEffects.None, 0f); } } } }
private void DrawWaterfall(SpriteBatch spriteBatch, int Style = 0, float Alpha = 1f) { float num = 0f; float num2 = 99999f; float num3 = 99999f; int num4 = -1; int num5 = -1; float num6 = 0f; float num7 = 99999f; float num8 = 99999f; int num9 = -1; int num10 = -1; int i = 0; while (i < this.currentMax) { int num11 = 0; int num12 = this.waterfalls[i].type; int num13 = this.waterfalls[i].x; int num14 = this.waterfalls[i].y; int num15 = 0; int num16 = 0; int num17 = 0; int num18 = 0; int num19 = 0; int num20 = 0; int num22; if (num12 == 1 || num12 == 14) { if (!Main.drewLava && this.waterfalls[i].stopAtStep != 0) { int num21 = 32 * this.slowFrame; goto IL_3FA; } } else { if (num12 != 11) { if (num12 == 0) { num12 = Style; } else if (num12 == 2 && Main.drewLava) { goto IL_1879; } int num21 = 32 * this.regularFrame; goto IL_3FA; } if (!Main.drewLava) { num22 = this.waterfallDist / 4; if (this.waterfalls[i].stopAtStep > num22) { this.waterfalls[i].stopAtStep = num22; } if (this.waterfalls[i].stopAtStep != 0 && (float)(num14 + num22) >= Main.screenPosition.Y / 16f && (float)num13 >= Main.screenPosition.X / 16f - 1f && (float)num13 <= (Main.screenPosition.X + (float)Main.screenWidth) / 16f + 1f) { int num23; int num24; if (num13 % 2 == 0) { num23 = this.rainFrameForeground + 3; if (num23 > 7) { num23 -= 8; } num24 = this.rainFrameBackground + 2; if (num24 > 7) { num24 -= 8; } } else { num23 = this.rainFrameForeground; num24 = this.rainFrameBackground; } Rectangle value = new Rectangle(num24 * 18, 0, 16, 16); Rectangle value2 = new Rectangle(num23 * 18, 0, 16, 16); Vector2 origin = new Vector2(8f, 8f); Vector2 position; if (num14 % 2 == 0) { position = new Vector2((float)(num13 * 16 + 9), (float)(num14 * 16 + 8)) - Main.screenPosition; } else { position = new Vector2((float)(num13 * 16 + 8), (float)(num14 * 16 + 8)) - Main.screenPosition; } bool flag = false; for (int j = 0; j < num22; j++) { Color color = Lighting.GetColor(num13, num14); float num25 = 0.6f; float num26 = 0.3f; if (j > num22 - 8) { float num27 = (float)(num22 - j) / 8f; num25 *= num27; num26 *= num27; } Color color2 = color * num25; Color color3 = color * num26; spriteBatch.Draw(this.waterfallTexture[12], position, new Rectangle?(value), color3, 0f, origin, 1f, SpriteEffects.None, 0f); spriteBatch.Draw(this.waterfallTexture[11], position, new Rectangle?(value2), color2, 0f, origin, 1f, SpriteEffects.None, 0f); if (flag) { break; } num14++; Tile tile = Main.tile[num13, num14]; if (WorldGen.SolidTile(tile)) { flag = true; } if (tile.liquid > 0) { int num28 = (int)(16f * ((float)tile.liquid / 255f)) & 254; if (num28 >= 15) { break; } value2.Height -= num28; value.Height -= num28; } if (num14 % 2 == 0) { position.X += 1f; } else { position.X -= 1f; } position.Y += 16f; } this.waterfalls[i].stopAtStep = 0; } } } IL_1879: i++; continue; IL_3FA: int num29 = 0; num22 = this.waterfallDist; Color color4 = Color.White; for (int k = 0; k < num22; k++) { if (num29 < 2) { int num30 = num12; switch (num30) { case 1: { float num31 = 0.55f; num31 += (float)(270 - (int)Main.mouseTextColor) / 900f; num31 *= 0.4f; float num32 = num31; float num33 = num31 * 0.3f; float num34 = num31 * 0.1f; Lighting.addLight(num13, num14, num32, num33, num34); break; } case 2: { float num32 = (float)Main.DiscoR / 255f; float num33 = (float)Main.DiscoG / 255f; float num34 = (float)Main.DiscoB / 255f; num32 *= 0.2f; num33 *= 0.2f; num34 *= 0.2f; Lighting.addLight(num13, num14, num32, num33, num34); break; } default: switch (num30) { case 15: { float num32 = 0f; float num33 = 0f; float num34 = 0.2f; Lighting.addLight(num13, num14, num32, num33, num34); break; } case 16: { float num32 = 0f; float num33 = 0.2f; float num34 = 0f; Lighting.addLight(num13, num14, num32, num33, num34); break; } case 17: { float num32 = 0f; float num33 = 0f; float num34 = 0.2f; Lighting.addLight(num13, num14, num32, num33, num34); break; } case 18: { float num32 = 0f; float num33 = 0.2f; float num34 = 0f; Lighting.addLight(num13, num14, num32, num33, num34); break; } case 19: { float num32 = 0.2f; float num33 = 0f; float num34 = 0f; Lighting.addLight(num13, num14, num32, num33, num34); break; } case 20: Lighting.addLight(num13, num14, 0.2f, 0.2f, 0.2f); break; case 21: { float num32 = 0.2f; float num33 = 0f; float num34 = 0f; Lighting.addLight(num13, num14, num32, num33, num34); break; } } break; } Tile tile2 = Main.tile[num13, num14]; if (tile2 == null) { tile2 = new Tile(); Main.tile[num13, num14] = tile2; } Tile tile3 = Main.tile[num13 - 1, num14]; if (tile3 == null) { tile3 = new Tile(); Main.tile[num13 - 1, num14] = tile3; } Tile tile4 = Main.tile[num13, num14 + 1]; if (tile4 == null) { tile4 = new Tile(); Main.tile[num13, num14 + 1] = tile4; } Tile tile5 = Main.tile[num13 + 1, num14]; if (tile5 == null) { tile5 = new Tile(); Main.tile[num13 + 1, num14] = tile5; } int num35 = tile2.liquid / 16; int num36 = 0; int num37 = num18; int num38; int num39; if (tile4.topSlope()) { if (tile4.slope() == 1) { num36 = 1; num38 = 1; num17 = 1; num18 = num17; } else { num36 = -1; num38 = -1; num17 = -1; num18 = num17; } num39 = 1; } else if ((((!WorldGen.SolidTile(tile4) && !tile4.bottomSlope()) || tile4.type == 162) && !tile2.halfBrick()) || (!tile4.active() && !tile2.halfBrick())) { num29 = 0; num39 = 1; num38 = 0; } else if ((WorldGen.SolidTile(tile3) || tile3.topSlope() || tile3.liquid > 0) && !WorldGen.SolidTile(tile5) && tile5.liquid == 0) { if (num17 == -1) { num29++; } num38 = 1; num39 = 0; num17 = 1; } else if ((WorldGen.SolidTile(tile5) || tile5.topSlope() || tile5.liquid > 0) && !WorldGen.SolidTile(tile3) && tile3.liquid == 0) { if (num17 == 1) { num29++; } num38 = -1; num39 = 0; num17 = -1; } else if (((!WorldGen.SolidTile(tile5) && !tile2.topSlope()) || tile5.liquid == 0) && !WorldGen.SolidTile(tile3) && !tile2.topSlope() && tile3.liquid == 0) { num39 = 0; num38 = num17; } else { num29++; num39 = 0; num38 = 0; } if (num29 >= 2) { num17 *= -1; num38 *= -1; } int num40 = -1; if (num12 != 1 && num12 != 14) { if (tile4.active()) { num40 = (int)tile4.type; } if (tile2.active()) { num40 = (int)tile2.type; } } if (num40 != -1) { if (num40 == 160) { num12 = 2; } else if (num40 >= 262 && num40 <= 268) { num12 = 15 + num40 - 262; } } if (WorldGen.SolidTile(tile4) && !tile2.halfBrick()) { num11 = 8; } else if (num16 != 0) { num11 = 0; } Color color5 = Lighting.GetColor(num13, num14); Color color6 = color5; float num41; if (num12 == 1) { num41 = 1f; } else if (num12 == 14) { num41 = 0.8f; } else if (tile2.wall == 0 && (double)num14 < Main.worldSurface) { num41 = Alpha; } else { num41 = 0.6f * Alpha; } if (k > num22 - 10) { num41 *= (float)(num22 - k) / 10f; } float num42 = (float)color5.R * num41; float num43 = (float)color5.G * num41; float num44 = (float)color5.B * num41; float num45 = (float)color5.A * num41; if (num12 == 1) { if (num42 < 190f * num41) { num42 = 190f * num41; } if (num43 < 190f * num41) { num43 = 190f * num41; } if (num44 < 190f * num41) { num44 = 190f * num41; } } else if (num12 == 2) { num42 = (float)Main.DiscoR * num41; num43 = (float)Main.DiscoG * num41; num44 = (float)Main.DiscoB * num41; } else if (num12 >= 15 && num12 <= 21) { num42 = 255f * num41; num43 = 255f * num41; num44 = 255f * num41; } color5 = new Color((int)num42, (int)num43, (int)num44, (int)num45); if (num12 == 1) { float num46 = Math.Abs((float)(num13 * 16 + 8) - (Main.screenPosition.X + (float)(Main.screenWidth / 2))); float num47 = Math.Abs((float)(num14 * 16 + 8) - (Main.screenPosition.Y + (float)(Main.screenHeight / 2))); if (num46 < (float)(Main.screenWidth * 2) && num47 < (float)(Main.screenHeight * 2)) { float num48 = (float)Math.Sqrt((double)(num46 * num46 + num47 * num47)); float num49 = 1f - num48 / ((float)Main.screenWidth * 0.75f); if (num49 > 0f) { num6 += num49; } } if (num46 < num7) { num7 = num46; num9 = num13 * 16 + 8; } if (num47 < num8) { num8 = num46; num10 = num14 * 16 + 8; } } else if (num12 != 1 && num12 != 14 && num12 != 11 && num12 != 12) { float num50 = Math.Abs((float)(num13 * 16 + 8) - (Main.screenPosition.X + (float)(Main.screenWidth / 2))); float num51 = Math.Abs((float)(num14 * 16 + 8) - (Main.screenPosition.Y + (float)(Main.screenHeight / 2))); if (num50 < (float)(Main.screenWidth * 2) && num51 < (float)(Main.screenHeight * 2)) { float num52 = (float)Math.Sqrt((double)(num50 * num50 + num51 * num51)); float num53 = 1f - num52 / ((float)Main.screenWidth * 0.75f); if (num53 > 0f) { num += num53; } } if (num50 < num2) { num2 = num50; num4 = num13 * 16 + 8; } if (num51 < num3) { num3 = num50; num5 = num14 * 16 + 8; } } if (k > 50 && (color6.R > 20 || color6.B > 20 || color6.G > 20)) { float num54 = (float)color6.R; if ((float)color6.G > num54) { num54 = (float)color6.G; } if ((float)color6.B > num54) { num54 = (float)color6.B; } if ((float)Main.rand.Next(20000) < num54 / 30f) { int num55 = Dust.NewDust(new Vector2((float)(num13 * 16 - num17 * 7), (float)(num14 * 16 + 6)), 10, 8, 43, 0f, 0f, 254, Color.White, 0.5f); Main.dust[num55].velocity *= 0f; } } int num21 = 0; if (num15 == 0 && num36 != 0 && num16 == 1 && num17 != num18) { num36 = 0; num17 = num18; color5 = Color.White; if (num17 == 1) { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color5, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 8)), color5, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } } if (num19 != 0 && num38 == 0 && num39 == 1) { if (num17 == 1) { if (num20 != num12) { spriteBatch.Draw(this.waterfallTexture[num20], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 0, 16, 16 - num35 - 8)), color4, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 0, 16, 16 - num35 - 8)), color5, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 0, 16, 16 - num35 - 8)), color5, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } } if (num11 == 8 && num16 == 1 && num19 == 0) { if (num18 == -1) { if (num20 != num12) { spriteBatch.Draw(this.waterfallTexture[num20], new Vector2((float)(num13 * 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 8)), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 8)), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } else if (num20 != num12) { spriteBatch.Draw(this.waterfallTexture[num20], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 8)), color4, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 8)), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } if (num36 != 0 && num15 == 0) { if (num37 == 1) { if (num20 != num12) { spriteBatch.Draw(this.waterfallTexture[num20], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color4, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else if (num20 != num12) { spriteBatch.Draw(this.waterfallTexture[num20], new Vector2((float)(num13 * 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } if (num39 == 1 && num36 == 0 && num19 == 0) { if (num17 == -1) { if (num16 == 0) { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 0, 16, 16 - num35)), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else if (num20 != num12) { spriteBatch.Draw(this.waterfallTexture[num20], new Vector2((float)(num13 * 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } else if (num16 == 0) { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 0, 16, 16 - num35)), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else if (num20 != num12) { spriteBatch.Draw(this.waterfallTexture[num20], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color4, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16 - 16), (float)(num14 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num21, 24, 32, 16 - num35)), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else if (num38 == 1) { if (Main.tile[num13, num14].liquid <= 0 || Main.tile[num13, num14].halfBrick()) { if (num36 == 1) { for (int l = 0; l < 8; l++) { int num56 = l * 2; int num57 = 14 - l * 2; int num58 = num56; num11 = 8; if (num15 == 0 && l < 2) { num58 = 4; } spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16 + num56), (float)(num14 * 16 + num11 + num58)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num21 + num57, 0, 2, 16 - num11)), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num21, 0, 16, 16)), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } } else if (num38 == -1) { if (Main.tile[num13, num14].liquid <= 0 || Main.tile[num13, num14].halfBrick()) { if (num36 == -1) { for (int m = 0; m < 8; m++) { int num59 = m * 2; int num60 = m * 2; int num61 = 14 - m * 2; num11 = 8; if (num15 == 0 && m > 5) { num61 = 4; } spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16 + num59), (float)(num14 * 16 + num11 + num61)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num21 + num60, 0, 2, 16 - num11)), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num21, 0, 16, 16)), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } } else if (num38 == 0 && num39 == 0) { if (Main.tile[num13, num14].liquid <= 0 || Main.tile[num13, num14].halfBrick()) { spriteBatch.Draw(this.waterfallTexture[num12], new Vector2((float)(num13 * 16), (float)(num14 * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num21, 0, 16, 16)), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } k = 1000; } if (tile2.liquid > 0 && !tile2.halfBrick()) { k = 1000; } num16 = num39; num18 = num17; num15 = num38; num13 += num38; num14 += num39; num19 = num36; color4 = color5; if (num20 != num12) { num20 = num12; } if ((tile3.active() && (tile3.type == 189 || tile3.type == 196)) || (tile5.active() && (tile5.type == 189 || tile5.type == 196)) || (tile4.active() && (tile4.type == 189 || tile4.type == 196))) { num22 = (int)((float)(40 * (Main.maxTilesX / 4200)) * Main.gfxQuality); } } } goto IL_1879; } Main.ambientWaterfallX = (float)num4; Main.ambientWaterfallY = (float)num5; Main.ambientWaterfallStrength = num; Main.ambientLavafallX = (float)num9; Main.ambientLavafallY = (float)num10; Main.ambientLavafallStrength = num6; }
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; } }
private void DrawWaterfall(SpriteBatch spriteBatch, int Style = 0, float Alpha = 1f) { Main.tileSolid[546] = false; float num = 0f; float num2 = 99999f; float num3 = 99999f; int num4 = -1; int num5 = -1; float num6 = 0f; float num7 = 99999f; float num8 = 99999f; int num9 = -1; int num10 = -1; for (int i = 0; i < currentMax; i++) { int num11 = 0; int num12 = waterfalls[i].type; int num13 = waterfalls[i].x; int num14 = waterfalls[i].y; int num15 = 0; int num16 = 0; int num17 = 0; int num18 = 0; int num19 = 0; int num20 = 0; int num21; int num22; if (num12 == 1 || num12 == 14) { if (Main.drewLava || waterfalls[i].stopAtStep == 0) { continue; } num21 = 32 * slowFrame; } else { switch (num12) { case 11: case 22: { if (Main.drewLava) { continue; } num22 = waterfallDist / 4; if (num12 == 22) { num22 = waterfallDist / 2; } if (waterfalls[i].stopAtStep > num22) { waterfalls[i].stopAtStep = num22; } if (waterfalls[i].stopAtStep == 0 || (float)(num14 + num22) < Main.screenPosition.Y / 16f || (float)num13 <Main.screenPosition.X / 16f - 20f || (float)num13> (Main.screenPosition.X + (float)Main.screenWidth) / 16f + 20f) { continue; } int num23; int num24; if (num13 % 2 == 0) { num23 = rainFrameForeground + 3; if (num23 > 7) { num23 -= 8; } num24 = rainFrameBackground + 2; if (num24 > 7) { num24 -= 8; } if (num12 == 22) { num23 = snowFrameForeground + 3; if (num23 > 7) { num23 -= 8; } } } else { num23 = rainFrameForeground; num24 = rainFrameBackground; if (num12 == 22) { num23 = snowFrameForeground; } } Rectangle value = new Rectangle(num24 * 18, 0, 16, 16); Rectangle value2 = new Rectangle(num23 * 18, 0, 16, 16); Vector2 origin = new Vector2(8f, 8f); Vector2 position = ((num14 % 2 != 0) ? (new Vector2(num13 * 16 + 8, num14 * 16 + 8) - Main.screenPosition) : (new Vector2(num13 * 16 + 9, num14 * 16 + 8) - Main.screenPosition)); Tile tile = Main.tile[num13, num14 - 1]; if (tile.active() && tile.bottomSlope()) { position.Y -= 16f; } bool flag = false; float rotation = 0f; for (int j = 0; j < num22; j++) { Color color = Lighting.GetColor(num13, num14); float num25 = 0.6f; float num26 = 0.3f; if (j > num22 - 8) { float num27 = (float)(num22 - j) / 8f; num25 *= num27; num26 *= num27; } Color color2 = color * num25; Color color3 = color * num26; if (num12 == 22) { spriteBatch.Draw(waterfallTexture[22].Value, position, value2, color2, 0f, origin, 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(waterfallTexture[12].Value, position, value, color3, rotation, origin, 1f, SpriteEffects.None, 0f); spriteBatch.Draw(waterfallTexture[11].Value, position, value2, color2, rotation, origin, 1f, SpriteEffects.None, 0f); } if (flag) { break; } num14++; Tile tile2 = Main.tile[num13, num14]; if (WorldGen.SolidTile(tile2)) { flag = true; } if (tile2.liquid > 0) { int num28 = (int)(16f * ((float)(int)tile2.liquid / 255f)) & 0xFE; if (num28 >= 15) { break; } value2.Height -= num28; value.Height -= num28; } if (num14 % 2 == 0) { position.X += 1f; } else { position.X -= 1f; } position.Y += 16f; } waterfalls[i].stopAtStep = 0; continue; } case 0: num12 = Style; break; case 2: if (Main.drewLava) { continue; } break; } num21 = 32 * regularFrame; } int num29 = 0; num22 = waterfallDist; Color color4 = Color.White; for (int k = 0; k < num22; k++) { if (num29 >= 2) { continue; } switch (num12) { case 1: { float r; float num30 = (r = (0.55f + (float)(270 - Main.mouseTextColor) / 900f) * 0.4f); float g = num30 * 0.3f; float b = num30 * 0.1f; Lighting.AddLight(num13, num14, r, g, b); break; } case 2: { float r = (float)Main.DiscoR / 255f; float g = (float)Main.DiscoG / 255f; float b = (float)Main.DiscoB / 255f; r *= 0.2f; g *= 0.2f; b *= 0.2f; Lighting.AddLight(num13, num14, r, g, b); break; } case 15: { float r = 0f; float g = 0f; float b = 0.2f; Lighting.AddLight(num13, num14, r, g, b); break; } case 16: { float r = 0f; float g = 0.2f; float b = 0f; Lighting.AddLight(num13, num14, r, g, b); break; } case 17: { float r = 0f; float g = 0f; float b = 0.2f; Lighting.AddLight(num13, num14, r, g, b); break; } case 18: { float r = 0f; float g = 0.2f; float b = 0f; Lighting.AddLight(num13, num14, r, g, b); break; } case 19: { float r = 0.2f; float g = 0f; float b = 0f; Lighting.AddLight(num13, num14, r, g, b); break; } case 20: Lighting.AddLight(num13, num14, 0.2f, 0.2f, 0.2f); break; case 21: { float r = 0.2f; float g = 0f; float b = 0f; Lighting.AddLight(num13, num14, r, g, b); break; } } int num31 = 0; int num32 = 0; int num33 = 0; Tile tile3 = Main.tile[num13, num14]; if (tile3 == null) { tile3 = new Tile(); Main.tile[num13, num14] = tile3; } if (tile3.nactive() && Main.tileSolid[tile3.type] && !Main.tileSolidTop[tile3.type] && !TileID.Sets.Platforms[tile3.type] && tile3.blockType() == 0) { break; } Tile tile4 = Main.tile[num13 - 1, num14]; if (tile4 == null) { tile4 = new Tile(); Main.tile[num13 - 1, num14] = tile4; } Tile tile5 = Main.tile[num13, num14 + 1]; if (tile5 == null) { tile5 = new Tile(); Main.tile[num13, num14 + 1] = tile5; } Tile tile6 = Main.tile[num13 + 1, num14]; if (tile6 == null) { tile6 = new Tile(); Main.tile[num13 + 1, num14] = tile6; } num33 = (int)tile3.liquid / 16; int num34 = 0; int num35 = num18; if (tile5.topSlope() && !tile3.halfBrick() && tile5.type != 19) { if (tile5.slope() == 1) { num34 = 1; num31 = 1; num17 = 1; num18 = num17; } else { num34 = -1; num31 = -1; num17 = -1; num18 = num17; } num32 = 1; } else if ((!WorldGen.SolidTile(tile5) && !tile5.bottomSlope() && !tile3.halfBrick()) || (!tile5.active() && !tile3.halfBrick())) { num29 = 0; num32 = 1; num31 = 0; } else if ((WorldGen.SolidTile(tile4) || tile4.topSlope() || tile4.liquid > 0) && !WorldGen.SolidTile(tile6) && tile6.liquid == 0) { if (num17 == -1) { num29++; } num31 = 1; num32 = 0; num17 = 1; } else if ((WorldGen.SolidTile(tile6) || tile6.topSlope() || tile6.liquid > 0) && !WorldGen.SolidTile(tile4) && tile4.liquid == 0) { if (num17 == 1) { num29++; } num31 = -1; num32 = 0; num17 = -1; } else if (((!WorldGen.SolidTile(tile6) && !tile3.topSlope()) || tile6.liquid == 0) && !WorldGen.SolidTile(tile4) && !tile3.topSlope() && tile4.liquid == 0) { num32 = 0; num31 = num17; } else { num29++; num32 = 0; num31 = 0; } if (num29 >= 2) { num17 *= -1; num31 *= -1; } int num36 = -1; if (num12 != 1 && num12 != 14) { if (tile5.active()) { num36 = tile5.type; } if (tile3.active()) { num36 = tile3.type; } } switch (num36) { case 160: num12 = 2; break; case 262: case 263: case 264: case 265: case 266: case 267: case 268: num12 = 15 + num36 - 262; break; } if (WorldGen.SolidTile(tile5) && !tile3.halfBrick()) { num11 = 8; } else if (num16 != 0) { num11 = 0; } Color color5 = Lighting.GetColor(num13, num14); Color color6 = color5; float num37 = num12 switch { 1 => 1f, 14 => 0.8f, _ => (tile3.wall != 0 || !((double)num14 < Main.worldSurface)) ? (0.6f * Alpha) : Alpha, }; if (k > num22 - 10) { num37 *= (float)(num22 - k) / 10f; } float num38 = (float)(int)color5.R * num37; float num39 = (float)(int)color5.G * num37; float num40 = (float)(int)color5.B * num37; float num41 = (float)(int)color5.A * num37; switch (num12) { case 1: if (num38 < 190f * num37) { num38 = 190f * num37; } if (num39 < 190f * num37) { num39 = 190f * num37; } if (num40 < 190f * num37) { num40 = 190f * num37; } break; case 2: num38 = (float)Main.DiscoR * num37; num39 = (float)Main.DiscoG * num37; num40 = (float)Main.DiscoB * num37; break; case 15: case 16: case 17: case 18: case 19: case 20: case 21: num38 = 255f * num37; num39 = 255f * num37; num40 = 255f * num37; break; } color5 = new Color((int)num38, (int)num39, (int)num40, (int)num41); if (num12 == 1) { float num42 = Math.Abs((float)(num13 * 16 + 8) - (Main.screenPosition.X + (float)(Main.screenWidth / 2))); float num43 = Math.Abs((float)(num14 * 16 + 8) - (Main.screenPosition.Y + (float)(Main.screenHeight / 2))); if (num42 < (float)(Main.screenWidth * 2) && num43 < (float)(Main.screenHeight * 2)) { float num44 = (float)Math.Sqrt(num42 * num42 + num43 * num43); float num45 = 1f - num44 / ((float)Main.screenWidth * 0.75f); if (num45 > 0f) { num6 += num45; } } if (num42 < num7) { num7 = num42; num9 = num13 * 16 + 8; } if (num43 < num8) { num8 = num42; num10 = num14 * 16 + 8; } } else if (num12 != 1 && num12 != 14 && num12 != 11 && num12 != 12 && num12 != 22) { float num46 = Math.Abs((float)(num13 * 16 + 8) - (Main.screenPosition.X + (float)(Main.screenWidth / 2))); float num47 = Math.Abs((float)(num14 * 16 + 8) - (Main.screenPosition.Y + (float)(Main.screenHeight / 2))); if (num46 < (float)(Main.screenWidth * 2) && num47 < (float)(Main.screenHeight * 2)) { float num48 = (float)Math.Sqrt(num46 * num46 + num47 * num47); float num49 = 1f - num48 / ((float)Main.screenWidth * 0.75f); if (num49 > 0f) { num += num49; } } if (num46 < num2) { num2 = num46; num4 = num13 * 16 + 8; } if (num47 < num3) { num3 = num46; num5 = num14 * 16 + 8; } } if (k > 50 && (color6.R > 20 || color6.B > 20 || color6.G > 20)) { float num50 = (int)color6.R; if ((float)(int)color6.G > num50) { num50 = (int)color6.G; } if ((float)(int)color6.B > num50) { num50 = (int)color6.B; } if ((float)Main.rand.Next(20000) < num50 / 30f) { int num51 = Dust.NewDust(new Vector2(num13 * 16 - num17 * 7, num14 * 16 + 6), 10, 8, 43, 0f, 0f, 254, Color.White, 0.5f); Main.dust[num51].velocity *= 0f; } } if (num15 == 0 && num34 != 0 && num16 == 1 && num17 != num18) { num34 = 0; num17 = num18; color5 = Color.White; if (num17 == 1) { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16 - 16, num14 * 16 + 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color5, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16 - 16, num14 * 16 + 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 8), color5, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } } if (num19 != 0 && num31 == 0 && num32 == 1) { if (num17 == 1) { if (num20 != num12) { spriteBatch.Draw(waterfallTexture[num20].Value, new Vector2(num13 * 16, num14 * 16 + num11 + 8) - Main.screenPosition, new Rectangle(num21, 0, 16, 16 - num33 - 8), color4, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16 + num11 + 8) - Main.screenPosition, new Rectangle(num21, 0, 16, 16 - num33 - 8), color5, 0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0f); } } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16 + num11 + 8) - Main.screenPosition, new Rectangle(num21, 0, 16, 16 - num33 - 8), color5, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } } if (num11 == 8 && num16 == 1 && num19 == 0) { if (num18 == -1) { if (num20 != num12) { spriteBatch.Draw(waterfallTexture[num20].Value, new Vector2(num13 * 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 8), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 8), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } else if (num20 != num12) { spriteBatch.Draw(waterfallTexture[num20].Value, new Vector2(num13 * 16 - 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 8), color4, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16 - 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 8), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } if (num34 != 0 && num15 == 0) { if (num35 == 1) { if (num20 != num12) { spriteBatch.Draw(waterfallTexture[num20].Value, new Vector2(num13 * 16 - 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color4, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16 - 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else if (num20 != num12) { spriteBatch.Draw(waterfallTexture[num20].Value, new Vector2(num13 * 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } if (num32 == 1 && num34 == 0 && num19 == 0) { if (num17 == -1) { if (num16 == 0) { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16 + num11) - Main.screenPosition, new Rectangle(num21, 0, 16, 16 - num33), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else if (num20 != num12) { spriteBatch.Draw(waterfallTexture[num20].Value, new Vector2(num13 * 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } else if (num16 == 0) { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16 + num11) - Main.screenPosition, new Rectangle(num21, 0, 16, 16 - num33), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else if (num20 != num12) { spriteBatch.Draw(waterfallTexture[num20].Value, new Vector2(num13 * 16 - 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color4, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16 - 16, num14 * 16) - Main.screenPosition, new Rectangle(num21, 24, 32, 16 - num33), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else { switch (num31) { case 1: if (Main.tile[num13, num14].liquid > 0 && !Main.tile[num13, num14].halfBrick()) { break; } if (num34 == 1) { for (int m = 0; m < 8; m++) { int num55 = m * 2; int num56 = 14 - m * 2; int num57 = num55; num11 = 8; if (num15 == 0 && m < 2) { num57 = 4; } spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16 + num55, num14 * 16 + num11 + num57) - Main.screenPosition, new Rectangle(16 + num21 + num56, 0, 2, 16 - num11), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else { int height2 = 16; if (TileID.Sets.BlocksWaterDrawingBehindSelf[Main.tile[num13, num14].type]) { height2 = 8; } else if (TileID.Sets.BlocksWaterDrawingBehindSelf[Main.tile[num13, num14 + 1].type]) { height2 = 8; } spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16 + num11) - Main.screenPosition, new Rectangle(16 + num21, 0, 16, height2), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } break; case -1: if (Main.tile[num13, num14].liquid > 0 && !Main.tile[num13, num14].halfBrick()) { break; } if (num34 == -1) { for (int l = 0; l < 8; l++) { int num52 = l * 2; int num53 = l * 2; int num54 = 14 - l * 2; num11 = 8; if (num15 == 0 && l > 5) { num54 = 4; } spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16 + num52, num14 * 16 + num11 + num54) - Main.screenPosition, new Rectangle(16 + num21 + num53, 0, 2, 16 - num11), color5, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); } } else { int height = 16; if (TileID.Sets.BlocksWaterDrawingBehindSelf[Main.tile[num13, num14].type]) { height = 8; } else if (TileID.Sets.BlocksWaterDrawingBehindSelf[Main.tile[num13, num14 + 1].type]) { height = 8; } spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16 + num11) - Main.screenPosition, new Rectangle(16 + num21, 0, 16, height), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } break; case 0: if (num32 == 0) { if (Main.tile[num13, num14].liquid <= 0 || Main.tile[num13, num14].halfBrick()) { spriteBatch.Draw(waterfallTexture[num12].Value, new Vector2(num13 * 16, num14 * 16 + num11) - Main.screenPosition, new Rectangle(16 + num21, 0, 16, 16), color5, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } k = 1000; } break; } } if (tile3.liquid > 0 && !tile3.halfBrick()) { k = 1000; } num16 = num32; num18 = num17; num15 = num31; num13 += num31; num14 += num32; num19 = num34; color4 = color5; if (num20 != num12) { num20 = num12; } if ((tile4.active() && (tile4.type == 189 || tile4.type == 196)) || (tile6.active() && (tile6.type == 189 || tile6.type == 196)) || (tile5.active() && (tile5.type == 189 || tile5.type == 196))) { num22 = (int)((float)(40 * (Main.maxTilesX / 4200)) * Main.gfxQuality); } } } Main.ambientWaterfallX = num4; Main.ambientWaterfallY = num5; Main.ambientWaterfallStrength = num; Main.ambientLavafallX = num9; Main.ambientLavafallY = num10; Main.ambientLavafallStrength = num6; Main.tileSolid[546] = true; }
public void DrawFreshAnimations(SpriteBatch spriteBatch) { for (int index = 0; index < this.data.Length; ++index) { ++this.data[index].animationTimeElapsed; } if (!Main.SettingsEnabled_MinersWobble) { return; } int num1 = 1; Vector2 zero1; // ISSUE: explicit reference operation ((Vector2)@zero1).\u002Ector((float)Main.offScreenRange); if (Main.drawToScreen) { zero1 = Vector2.get_Zero(); } zero1 = Vector2.get_Zero(); for (int index = 0; index < this.data.Length; ++index) { if (this.data[index].type == num1) { int damage = this.data[index].damage; if (damage >= 20) { int x = this.data[index].X; int y = this.data[index].Y; if (WorldGen.InWorld(x, y, 0)) { bool flag1 = Main.tile[x, y] != null; if (flag1 && num1 == 1) { flag1 = flag1 && Main.tile[x, y].active() && Main.tileSolid[(int)Main.tile[x, y].type]; } if (flag1 && num1 == 2) { flag1 = flag1 && (uint)Main.tile[x, y].wall > 0U; } if (flag1) { bool flag2 = false; bool flag3 = false; if ((int)Main.tile[x, y].type == 10) { flag2 = false; } else if (Main.tileSolid[(int)Main.tile[x, y].type] && !Main.tileSolidTop[(int)Main.tile[x, y].type]) { flag2 = true; } else if ((int)Main.tile[x, y].type == 5) { flag3 = true; int num2 = (int)Main.tile[x, y].frameX / 22; int num3 = (int)Main.tile[x, y].frameY / 22; if (num3 < 9) { flag2 = (num2 != 1 && num2 != 2 || (num3 < 6 || num3 > 8)) && ((num2 != 3 || num3 > 2) && ((num2 != 4 || num3 < 3 || num3 > 5) && (num2 != 5 || num3 < 6 || num3 > 8))); } } else if ((int)Main.tile[x, y].type == 72) { flag3 = true; if ((int)Main.tile[x, y].frameX <= 34) { flag2 = true; } } if (flag2 && (int)Main.tile[x, y].slope() == 0 && !Main.tile[x, y].halfBrick()) { int num2 = 0; if (damage >= 80) { num2 = 3; } else if (damage >= 60) { num2 = 2; } else if (damage >= 40) { num2 = 1; } else if (damage >= 20) { num2 = 0; } Rectangle rectangle; // ISSUE: explicit reference operation ((Rectangle)@rectangle).\u002Ector(this.data[index].crackStyle * 18, num2 * 18, 16, 16); // ISSUE: explicit reference operation ((Rectangle)@rectangle).Inflate(-2, -2); if (flag3) { rectangle.X = (__Null)((4 + this.data[index].crackStyle / 2) * 18); } int animationTimeElapsed = this.data[index].animationTimeElapsed; if ((double)animationTimeElapsed < 10.0) { double num3 = (double)animationTimeElapsed / 10.0; Color color1 = Lighting.GetColor(x, y); float num4 = 0.0f; Vector2 zero2 = Vector2.get_Zero(); float num5 = 0.5f; double num6 = (double)num5; float num7 = (float)(num3 % num6) * (1f / num5); double num8 = (double)num5; if ((int)(num3 / num8) % 2 == 1) { num7 = 1f - num7; } Tile tileSafely = Framing.GetTileSafely(x, y); Tile tile = tileSafely; Texture2D texture2D = !Main.canDrawColorTile(tileSafely.type, (int)tileSafely.color()) ? Main.tileTexture[(int)tileSafely.type] : (Texture2D)Main.tileAltTexture[(int)tileSafely.type, (int)tileSafely.color()]; Vector2 vector2_1; // ISSUE: explicit reference operation ((Vector2)@vector2_1).\u002Ector(8f); Vector2 vector2_2; // ISSUE: explicit reference operation ((Vector2)@vector2_2).\u002Ector(1f); double num9 = (double)num7 * 0.200000002980232 + 1.0; float num10 = 1f - num7; float num11 = 1f; Color color2 = Color.op_Multiply(color1, (float)((double)num11 * (double)num11 * 0.800000011920929)); Vector2 vector2_3 = vector2_2; Vector2 vector2_4 = Vector2.op_Multiply((float)num9, vector2_3); Vector2 vector2_5 = Vector2.op_Addition(Vector2.op_Addition(Vector2.op_Addition(new Vector2((float)(x * 16 - (int)Main.screenPosition.X), (float)(y * 16 - (int)Main.screenPosition.Y)), zero1), vector2_1), zero2).Floor(); spriteBatch.Draw(texture2D, vector2_5, new Rectangle?(new Rectangle((int)tile.frameX, (int)tile.frameY, 16, 16)), color2, num4, vector2_1, vector2_4, (SpriteEffects)0, 0.0f); // ISSUE: explicit reference operation ((Color)@color2).set_A((byte)180); spriteBatch.Draw(Main.tileCrackTexture, vector2_5, new Rectangle?(rectangle), color2, num4, vector2_1, vector2_4, (SpriteEffects)0, 0.0f); } } } } } } } }
public static void UpdateDust() { Dust.lavaBubbles = 0; Main.snowDust = 0; for (int i = 0; i < 2000; i++) { if (i < Main.numDust) { if (Main.dust[i].active) { if (Main.dust[i].type == 35) { Dust.lavaBubbles++; } Dust dust = Main.dust[i]; dust.position += Main.dust[i].velocity; if (Main.dust[i].type == 6 || Main.dust[i].type == 75 || Main.dust[i].type == 29 || (Main.dust[i].type >= 59 && Main.dust[i].type <= 65)) { if (!Main.dust[i].noGravity) { Dust dust2 = Main.dust[i]; dust2.velocity.Y = dust2.velocity.Y + 0.05f; } if (!Main.dust[i].noLight) { float num = Main.dust[i].scale * 1.4f; if (Main.dust[i].type == 29) { if (num > 1f) { num = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num * 0.1f, num * 0.4f, num); } if (Main.dust[i].type == 75) { if (num > 1f) { num = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num * 0.7f, num, num * 0.2f); } else if (Main.dust[i].type >= 59 && Main.dust[i].type <= 65) { if (num > 0.8f) { num = 0.8f; } int num2 = Main.dust[i].type - 58; float num3 = 1f; float num4 = 1f; float num5 = 1f; if (num2 == 1) { num3 = 0f; num4 = 0.1f; num5 = 1.3f; } else if (num2 == 2) { num3 = 1f; num4 = 0.1f; num5 = 0.1f; } else if (num2 == 3) { num3 = 0f; num4 = 1f; num5 = 0.1f; } else if (num2 == 4) { num3 = 0.9f; num4 = 0f; num5 = 0.9f; } else if (num2 == 5) { num3 = 1.3f; num4 = 1.3f; num5 = 1.3f; } else if (num2 == 6) { num3 = 0.9f; num4 = 0.9f; num5 = 0f; } else if (num2 == 7) { num3 = 0.5f * Main.demonTorch + 1f * (1f - Main.demonTorch); num4 = 0.3f; num5 = 1f * Main.demonTorch + 0.5f * (1f - Main.demonTorch); } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num * num3, num * num4, num * num5); } else { if (num > 0.6f) { num = 0.6f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num, num * 0.65f, num * 0.4f); } } } else if (Main.dust[i].type == 14 || Main.dust[i].type == 16 || Main.dust[i].type == 31 || Main.dust[i].type == 46) { Dust dust3 = Main.dust[i]; dust3.velocity.Y = dust3.velocity.Y * 0.98f; Dust dust4 = Main.dust[i]; dust4.velocity.X = dust4.velocity.X * 0.98f; if (Main.dust[i].type == 31 && Main.dust[i].noGravity) { Dust dust5 = Main.dust[i]; dust5.velocity *= 1.02f; Main.dust[i].scale += 0.02f; Main.dust[i].alpha += 4; if (Main.dust[i].alpha > 255) { Main.dust[i].scale = 0.0001f; Main.dust[i].alpha = 255; } } } else if (Main.dust[i].type == 32) { Main.dust[i].scale -= 0.01f; Dust dust6 = Main.dust[i]; dust6.velocity.X = dust6.velocity.X * 0.96f; Dust dust7 = Main.dust[i]; dust7.velocity.Y = dust7.velocity.Y + 0.1f; } else if (Main.dust[i].type == 43) { Main.dust[i].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 num6 = (float)color.R / 270f; float num7 = (float)color.G / 270f; float num8 = (float)color.B / 270f; num6 *= Main.dust[i].scale * 1.07f; num7 *= Main.dust[i].scale * 1.07f; num8 *= Main.dust[i].scale * 1.07f; if (Main.dust[i].alpha < 255) { Main.dust[i].scale += 0.09f; if (Main.dust[i].scale >= 1f) { Main.dust[i].scale = 1f; Main.dust[i].alpha = 255; } } else { if ((double)Main.dust[i].scale < 0.8) { Main.dust[i].scale -= 0.01f; } if ((double)Main.dust[i].scale < 0.5) { Main.dust[i].scale -= 0.01f; } } if ((double)num6 < 0.05 && (double)num7 < 0.05 && (double)num8 < 0.05) { Main.dust[i].active = false; } else { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num6, num7, num8); } } else if (Main.dust[i].type == 15 || Main.dust[i].type == 57 || Main.dust[i].type == 58) { Dust dust8 = Main.dust[i]; dust8.velocity.Y = dust8.velocity.Y * 0.98f; Dust dust9 = Main.dust[i]; dust9.velocity.X = dust9.velocity.X * 0.98f; float num9 = Main.dust[i].scale; if (Main.dust[i].type != 15) { num9 = Main.dust[i].scale * 0.8f; } if (Main.dust[i].noLight) { Dust dust10 = Main.dust[i]; dust10.velocity *= 0.95f; } if (num9 > 1f) { num9 = 1f; } if (Main.dust[i].type == 15) { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num9 * 0.45f, num9 * 0.55f, num9); } else if (Main.dust[i].type == 57) { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num9 * 0.95f, num9 * 0.95f, num9 * 0.45f); } else if (Main.dust[i].type == 58) { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num9, num9 * 0.55f, num9 * 0.75f); } } else if (Main.dust[i].type == 66) { if (Main.dust[i].velocity.X < 0f) { Main.dust[i].rotation -= 1f; } else { Main.dust[i].rotation += 1f; } Dust dust11 = Main.dust[i]; dust11.velocity.Y = dust11.velocity.Y * 0.98f; Dust dust12 = Main.dust[i]; dust12.velocity.X = dust12.velocity.X * 0.98f; Main.dust[i].scale += 0.02f; float num10 = Main.dust[i].scale; if (Main.dust[i].type != 15) { num10 = Main.dust[i].scale * 0.8f; } if (num10 > 1f) { num10 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num10 * ((float)Main.dust[i].color.R / 255f), num10 * ((float)Main.dust[i].color.G / 255f), num10 * ((float)Main.dust[i].color.B / 255f)); } else if (Main.dust[i].type == 20 || Main.dust[i].type == 21) { Main.dust[i].scale += 0.005f; Dust dust13 = Main.dust[i]; dust13.velocity.Y = dust13.velocity.Y * 0.94f; Dust dust14 = Main.dust[i]; dust14.velocity.X = dust14.velocity.X * 0.94f; float num11 = Main.dust[i].scale * 0.8f; if (num11 > 1f) { num11 = 1f; } if (Main.dust[i].type == 21) { num11 = Main.dust[i].scale * 0.4f; Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num11 * 0.8f, num11 * 0.3f, num11); } else { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num11 * 0.3f, num11 * 0.6f, num11); } } else if (Main.dust[i].type == 27 || Main.dust[i].type == 45) { Dust dust15 = Main.dust[i]; dust15.velocity *= 0.94f; Main.dust[i].scale += 0.002f; float num12 = Main.dust[i].scale; if (Main.dust[i].noLight) { num12 *= 0.1f; Main.dust[i].scale -= 0.06f; if (Main.dust[i].scale < 1f) { Main.dust[i].scale -= 0.06f; } if (Main.player[Main.myPlayer].wet) { Dust dust16 = Main.dust[i]; dust16.position += Main.player[Main.myPlayer].velocity * 0.5f; } else { Dust dust17 = Main.dust[i]; dust17.position += Main.player[Main.myPlayer].velocity; } } if (num12 > 1f) { num12 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num12 * 0.6f, num12 * 0.2f, num12); } else if (Main.dust[i].type == 55 || Main.dust[i].type == 56 || Main.dust[i].type == 73 || Main.dust[i].type == 74) { Dust dust18 = Main.dust[i]; dust18.velocity *= 0.98f; float num13 = Main.dust[i].scale * 0.8f; if (Main.dust[i].type == 55) { if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13, num13, num13 * 0.6f); } else if (Main.dust[i].type == 73) { if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13, num13 * 0.35f, num13 * 0.5f); } else if (Main.dust[i].type == 74) { if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13 * 0.35f, num13, num13 * 0.5f); } else { num13 = Main.dust[i].scale * 1.2f; if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13 * 0.35f, num13 * 0.5f, num13); } } else if (Main.dust[i].type == 71 || Main.dust[i].type == 72) { Dust dust19 = Main.dust[i]; dust19.velocity *= 0.98f; float num14 = Main.dust[i].scale; if (num14 > 1f) { num14 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num14 * 0.2f, 0f, num14 * 0.1f); } else if (Main.dust[i].type == 76) { Main.snowDust++; Main.dust[i].scale += 0.009f; Dust dust20 = Main.dust[i]; dust20.position += Main.player[Main.myPlayer].velocity * 0.2f; } else if (!Main.dust[i].noGravity && Main.dust[i].type != 41 && Main.dust[i].type != 44) { Dust dust21 = Main.dust[i]; dust21.velocity.Y = dust21.velocity.Y + 0.1f; } if (Main.dust[i].type == 5 && Main.dust[i].noGravity) { Main.dust[i].scale -= 0.04f; } if (Main.dust[i].type == 33 || Main.dust[i].type == 52) { if (Main.dust[i].velocity.X == 0f) { if (Collision.SolidCollision(Main.dust[i].position, 2, 2)) { Main.dust[i].scale = 0f; } Main.dust[i].rotation += 0.5f; Main.dust[i].scale -= 0.01f; } bool flag = Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y), 4, 4); if (flag) { Main.dust[i].alpha += 20; Main.dust[i].scale -= 0.1f; } Main.dust[i].alpha += 2; Main.dust[i].scale -= 0.005f; if (Main.dust[i].alpha > 255) { Main.dust[i].scale = 0f; } Dust dust22 = Main.dust[i]; dust22.velocity.X = dust22.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) { Main.dust[i].rotation -= 0.2f; } else { Main.dust[i].rotation += 0.2f; } Main.dust[i].scale += 0.03f; Dust dust23 = Main.dust[i]; dust23.velocity.X = dust23.velocity.X * 1.05f; Dust dust24 = Main.dust[i]; dust24.velocity.Y = dust24.velocity.Y + 0.15f; } } if (Main.dust[i].type == 35 && Main.dust[i].noGravity) { Main.dust[i].scale += 0.03f; if (Main.dust[i].scale < 1f) { Dust dust25 = Main.dust[i]; dust25.velocity.Y = dust25.velocity.Y + 0.075f; } Dust dust26 = Main.dust[i]; dust26.velocity.X = dust26.velocity.X * 1.08f; if (Main.dust[i].velocity.X > 0f) { Main.dust[i].rotation += 0.01f; } else { Main.dust[i].rotation -= 0.01f; } float num15 = Main.dust[i].scale * 0.6f; if (num15 > 1f) { num15 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f + 1f), num15, num15 * 0.3f, num15 * 0.1f); } else if (Main.dust[i].type == 67) { float num16 = Main.dust[i].scale; if (num16 > 1f) { num16 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), 0f, num16 * 0.8f, num16); } else if (Main.dust[i].type == 34 || Main.dust[i].type == 35) { if (!Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y - 8f), 4, 4)) { Main.dust[i].scale = 0f; } else { Main.dust[i].alpha += Main.rand.Next(2); if (Main.dust[i].alpha > 255) { Main.dust[i].scale = 0f; } Main.dust[i].velocity.Y = -0.5f; if (Main.dust[i].type == 34) { Main.dust[i].scale += 0.005f; } else { Main.dust[i].alpha++; Main.dust[i].scale -= 0.01f; Main.dust[i].velocity.Y = -0.2f; } Dust dust27 = Main.dust[i]; dust27.velocity.X = dust27.velocity.X + (float)Main.rand.Next(-10, 10) * 0.002f; if ((double)Main.dust[i].velocity.X < -0.25) { Main.dust[i].velocity.X = -0.25f; } if ((double)Main.dust[i].velocity.X > 0.25) { Main.dust[i].velocity.X = 0.25f; } } if (Main.dust[i].type == 35) { float num17 = Main.dust[i].scale * 0.3f + 0.4f; if (num17 > 1f) { num17 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num17, num17 * 0.5f, num17 * 0.3f); } } if (Main.dust[i].type == 68) { float num18 = Main.dust[i].scale * 0.3f; if (num18 > 1f) { num18 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num18 * 0.1f, num18 * 0.2f, num18); } if (Main.dust[i].type == 70) { 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.5f, 0f, num19); } if (Main.dust[i].type == 41) { Dust dust28 = Main.dust[i]; dust28.velocity.X = dust28.velocity.X + (float)Main.rand.Next(-10, 11) * 0.01f; Dust dust29 = Main.dust[i]; dust29.velocity.Y = dust29.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.01f; if ((double)Main.dust[i].velocity.X > 0.75) { Main.dust[i].velocity.X = 0.75f; } if ((double)Main.dust[i].velocity.X < -0.75) { Main.dust[i].velocity.X = -0.75f; } if ((double)Main.dust[i].velocity.Y > 0.75) { Main.dust[i].velocity.Y = 0.75f; } if ((double)Main.dust[i].velocity.Y < -0.75) { Main.dust[i].velocity.Y = -0.75f; } Main.dust[i].scale += 0.007f; float num20 = Main.dust[i].scale * 0.7f; if (num20 > 1f) { num20 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num20 * 0.4f, num20 * 0.9f, num20); } else if (Main.dust[i].type == 44) { Dust dust30 = Main.dust[i]; dust30.velocity.X = dust30.velocity.X + (float)Main.rand.Next(-10, 11) * 0.003f; Dust dust31 = Main.dust[i]; dust31.velocity.Y = dust31.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.003f; if ((double)Main.dust[i].velocity.X > 0.35) { Main.dust[i].velocity.X = 0.35f; } if ((double)Main.dust[i].velocity.X < -0.35) { Main.dust[i].velocity.X = -0.35f; } if ((double)Main.dust[i].velocity.Y > 0.35) { Main.dust[i].velocity.Y = 0.35f; } if ((double)Main.dust[i].velocity.Y < -0.35) { Main.dust[i].velocity.Y = -0.35f; } Main.dust[i].scale += 0.0085f; 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.7f, num21, num21 * 0.8f); } else { Dust dust32 = Main.dust[i]; dust32.velocity.X = dust32.velocity.X * 0.99f; } if (Main.dust[i].type != 79) { Main.dust[i].rotation += Main.dust[i].velocity.X * 0.5f; } if (Main.dust[i].fadeIn > 0f) { if (Main.dust[i].type == 46) { Main.dust[i].scale += 0.1f; } else { Main.dust[i].scale += 0.03f; } if (Main.dust[i].scale > Main.dust[i].fadeIn) { Main.dust[i].fadeIn = 0f; } } else { Main.dust[i].scale -= 0.01f; } if (Main.dust[i].noGravity) { Dust dust33 = Main.dust[i]; dust33.velocity *= 0.92f; if (Main.dust[i].fadeIn == 0f) { Main.dust[i].scale -= 0.04f; } } if (Main.dust[i].position.Y > Main.screenPosition.Y + (float)Main.screenHeight) { Main.dust[i].active = false; } if ((double)Main.dust[i].scale < 0.1) { Main.dust[i].active = false; } } } else { Main.dust[i].active = false; } } }
public void DrawFreshAnimations(SpriteBatch spriteBatch) { for (int index = 0; index < this.data.Length; ++index) { ++this.data[index].animationTimeElapsed; } if (!Main.SettingsEnabled_MinersWobble) { return; } int num1 = 1; Vector2 vector2_1 = new Vector2((float)Main.offScreenRange); if (Main.drawToScreen) { vector2_1 = Vector2.Zero; } vector2_1 = Vector2.Zero; for (int index = 0; index < this.data.Length; ++index) { if (this.data[index].type == num1) { int damage = this.data[index].damage; if (damage >= 20) { int x = this.data[index].X; int y = this.data[index].Y; if (WorldGen.InWorld(x, y, 0)) { bool flag1; if ((flag1 = Main.tile[x, y] != null) && num1 == 1) { flag1 = flag1 && Main.tile[x, y].active() && Main.tileSolid[(int)Main.tile[x, y].type]; } if (flag1 && num1 == 2) { flag1 = flag1 && (int)Main.tile[x, y].wall != 0; } if (flag1) { bool flag2 = false; bool flag3 = false; if ((int)Main.tile[x, y].type == 10) { flag2 = false; } else if (Main.tileSolid[(int)Main.tile[x, y].type] && !Main.tileSolidTop[(int)Main.tile[x, y].type]) { flag2 = true; } else if ((int)Main.tile[x, y].type == 5) { flag3 = true; int num2 = (int)Main.tile[x, y].frameX / 22; int num3 = (int)Main.tile[x, y].frameY / 22; if (num3 < 9) { flag2 = (num2 != 1 && num2 != 2 || (num3 < 6 || num3 > 8)) && ((num2 != 3 || num3 > 2) && ((num2 != 4 || num3 < 3 || num3 > 5) && (num2 != 5 || num3 < 6 || num3 > 8))); } } else if ((int)Main.tile[x, y].type == 72) { flag3 = true; if ((int)Main.tile[x, y].frameX <= 34) { flag2 = true; } } if (flag2 && (int)Main.tile[x, y].slope() == 0 && !Main.tile[x, y].halfBrick()) { int num2 = 0; if (damage >= 80) { num2 = 3; } else if (damage >= 60) { num2 = 2; } else if (damage >= 40) { num2 = 1; } else if (damage >= 20) { num2 = 0; } Rectangle rectangle = new Rectangle(this.data[index].crackStyle * 18, num2 * 18, 16, 16); rectangle.Inflate(-2, -2); if (flag3) { rectangle.X = (4 + this.data[index].crackStyle / 2) * 18; } int animationTimeElapsed = this.data[index].animationTimeElapsed; if ((double)animationTimeElapsed < 10.0) { float num3 = (float)animationTimeElapsed / 10f; float num4 = 1f; Color color1 = Lighting.GetColor(x, y); float rotation = 0.0f; Vector2 zero = Vector2.Zero; float num5 = num3; float num6 = 0.5f; float num7 = num5 % num6 * 2f; if ((int)((double)num5 / (double)num6) % 2 == 1) { num7 = 1f - num7; } num4 = (float)((double)num7 * 0.449999988079071 + 1.0); Tile tileSafely = Framing.GetTileSafely(x, y); Tile tile = tileSafely; Texture2D texture = !Main.canDrawColorTile(tileSafely.type, (int)tileSafely.color()) ? Main.tileTexture[(int)tileSafely.type] : (Texture2D)Main.tileAltTexture[(int)tileSafely.type, (int)tileSafely.color()]; Vector2 origin = new Vector2(8f); Vector2 vector2_2 = new Vector2(1f); float num8 = (float)((double)num7 * 0.200000002980232 + 1.0); Color color2 = color1 * 0.8f; Vector2 scale = num8 * vector2_2; Vector2 position = (new Vector2((float)(x * 16 - (int)Main.screenPosition.X), (float)(y * 16 - (int)Main.screenPosition.Y)) + vector2_1 + origin + zero).Floor(); spriteBatch.Draw(texture, position, new Rectangle?(new Rectangle((int)tile.frameX, (int)tile.frameY, 16, 16)), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); color2.A = (byte)180; spriteBatch.Draw(Main.tileCrackTexture, position, new Rectangle?(rectangle), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); } } } } } } } }
public static void UpdateDust() { Dust.lavaBubbles = 0; for (int i = 0; i < 2000; i++) { if (i < Main.numDust) { if (Main.dust[i].active) { if (Main.dust[i].type == 35) { Dust.lavaBubbles++; } Dust expr_4C = Main.dust[i]; expr_4C.position += Main.dust[i].velocity; if (Main.dust[i].type == 6 || Main.dust[i].type == 75 || Main.dust[i].type == 29 || (Main.dust[i].type >= 59 && Main.dust[i].type <= 65)) { if (!Main.dust[i].noGravity) { Dust expr_D7_cp_0 = Main.dust[i]; expr_D7_cp_0.velocity.Y = expr_D7_cp_0.velocity.Y + 0.05f; } if (!Main.dust[i].noLight) { float num = Main.dust[i].scale * 1.4f; if (Main.dust[i].type == 29) { if (num > 1f) { num = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num * 0.1f, num * 0.4f, num); } if (Main.dust[i].type == 75) { if (num > 1f) { num = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num * 0.7f, num, num * 0.2f); } else { if (Main.dust[i].type >= 59 && Main.dust[i].type <= 65) { if (num > 0.8f) { num = 0.8f; } int num2 = Main.dust[i].type - 58; float num3 = 1f; float num4 = 1f; float num5 = 1f; if (num2 == 1) { num3 = 0f; num4 = 0.1f; num5 = 1.3f; } else { if (num2 == 2) { num3 = 1f; num4 = 0.1f; num5 = 0.1f; } else { if (num2 == 3) { num3 = 0f; num4 = 1f; num5 = 0.1f; } else { if (num2 == 4) { num3 = 0.9f; num4 = 0f; num5 = 0.9f; } else { if (num2 == 5) { num3 = 1.3f; num4 = 1.3f; num5 = 1.3f; } else { if (num2 == 6) { num3 = 0.9f; num4 = 0.9f; num5 = 0f; } else { if (num2 == 7) { num3 = 0.5f * Main.demonTorch + 1f * (1f - Main.demonTorch); num4 = 0.3f; num5 = 1f * Main.demonTorch + 0.5f * (1f - Main.demonTorch); } } } } } } } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num * num3, num * num4, num * num5); } else { if (num > 0.6f) { num = 0.6f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num, num * 0.65f, num * 0.4f); } } } } else { if (Main.dust[i].type == 14 || Main.dust[i].type == 16 || Main.dust[i].type == 31 || Main.dust[i].type == 46) { Dust expr_405_cp_0 = Main.dust[i]; expr_405_cp_0.velocity.Y = expr_405_cp_0.velocity.Y * 0.98f; Dust expr_422_cp_0 = Main.dust[i]; expr_422_cp_0.velocity.X = expr_422_cp_0.velocity.X * 0.98f; if (Main.dust[i].type == 31 && Main.dust[i].noGravity) { Dust expr_45E = Main.dust[i]; expr_45E.velocity *= 1.02f; Main.dust[i].scale += 0.02f; Main.dust[i].alpha += 4; if (Main.dust[i].alpha > 255) { Main.dust[i].scale = 0.0001f; Main.dust[i].alpha = 255; } } } else { if (Main.dust[i].type == 32) { Main.dust[i].scale -= 0.01f; Dust expr_510_cp_0 = Main.dust[i]; expr_510_cp_0.velocity.X = expr_510_cp_0.velocity.X * 0.96f; Dust expr_52D_cp_0 = Main.dust[i]; expr_52D_cp_0.velocity.Y = expr_52D_cp_0.velocity.Y + 0.1f; } else { if (Main.dust[i].type == 43) { Main.dust[i].rotation += 0.1f * Main.dust[i].scale; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f)); float num6 = (float)color.R / 270f; float num7 = (float)color.G / 270f; float num8 = (float)color.B / 270f; num6 *= Main.dust[i].scale * 1.07f; num7 *= Main.dust[i].scale * 1.07f; num8 *= Main.dust[i].scale * 1.07f; if (Main.dust[i].alpha < 255) { Main.dust[i].scale += 0.09f; if (Main.dust[i].scale >= 1f) { Main.dust[i].scale = 1f; Main.dust[i].alpha = 255; } } else { if ((double)Main.dust[i].scale < 0.8) { Main.dust[i].scale -= 0.01f; } if ((double)Main.dust[i].scale < 0.5) { Main.dust[i].scale -= 0.01f; } } if ((double)num6 < 0.05 && (double)num7 < 0.05 && (double)num8 < 0.05) { Main.dust[i].active = false; } else { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num6, num7, num8); } } else { if (Main.dust[i].type == 15 || Main.dust[i].type == 57 || Main.dust[i].type == 58) { Dust expr_7A7_cp_0 = Main.dust[i]; expr_7A7_cp_0.velocity.Y = expr_7A7_cp_0.velocity.Y * 0.98f; Dust expr_7C4_cp_0 = Main.dust[i]; expr_7C4_cp_0.velocity.X = expr_7C4_cp_0.velocity.X * 0.98f; float num9 = Main.dust[i].scale; if (Main.dust[i].type != 15) { num9 = Main.dust[i].scale * 0.8f; } if (Main.dust[i].noLight) { Dust expr_81C = Main.dust[i]; expr_81C.velocity *= 0.95f; } if (num9 > 1f) { num9 = 1f; } if (Main.dust[i].type == 15) { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num9 * 0.45f, num9 * 0.55f, num9); } else { if (Main.dust[i].type == 57) { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num9 * 0.95f, num9 * 0.95f, num9 * 0.45f); } else { if (Main.dust[i].type == 58) { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num9, num9 * 0.55f, num9 * 0.75f); } } } } else { if (Main.dust[i].type == 66) { if (Main.dust[i].velocity.X < 0f) { Main.dust[i].rotation -= 1f; } else { Main.dust[i].rotation += 1f; } Dust expr_9C7_cp_0 = Main.dust[i]; expr_9C7_cp_0.velocity.Y = expr_9C7_cp_0.velocity.Y * 0.98f; Dust expr_9E4_cp_0 = Main.dust[i]; expr_9E4_cp_0.velocity.X = expr_9E4_cp_0.velocity.X * 0.98f; Main.dust[i].scale += 0.02f; float num10 = Main.dust[i].scale; if (Main.dust[i].type != 15) { num10 = Main.dust[i].scale * 0.8f; } if (num10 > 1f) { num10 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num10 * ((float)Main.dust[i].color.R / 255f), num10 * ((float)Main.dust[i].color.G / 255f), num10 * ((float)Main.dust[i].color.B / 255f)); } else { if (Main.dust[i].type == 20 || Main.dust[i].type == 21) { Main.dust[i].scale += 0.005f; Dust expr_B21_cp_0 = Main.dust[i]; expr_B21_cp_0.velocity.Y = expr_B21_cp_0.velocity.Y * 0.94f; Dust expr_B3E_cp_0 = Main.dust[i]; expr_B3E_cp_0.velocity.X = expr_B3E_cp_0.velocity.X * 0.94f; float num11 = Main.dust[i].scale * 0.8f; if (num11 > 1f) { num11 = 1f; } if (Main.dust[i].type == 21) { num11 = Main.dust[i].scale * 0.4f; Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num11 * 0.8f, num11 * 0.3f, num11); } else { Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num11 * 0.3f, num11 * 0.6f, num11); } } else { if (Main.dust[i].type == 27 || Main.dust[i].type == 45) { Dust expr_C59 = Main.dust[i]; expr_C59.velocity *= 0.94f; Main.dust[i].scale += 0.002f; float num12 = Main.dust[i].scale; if (Main.dust[i].noLight) { num12 *= 0.1f; Main.dust[i].scale -= 0.06f; if (Main.dust[i].scale < 1f) { Main.dust[i].scale -= 0.06f; } if (Main.player[Main.myPlayer].wet) { Dust expr_D0B = Main.dust[i]; expr_D0B.position += Main.player[Main.myPlayer].velocity * 0.5f; } else { Dust expr_D3E = Main.dust[i]; expr_D3E.position += Main.player[Main.myPlayer].velocity; } } if (num12 > 1f) { num12 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num12 * 0.6f, num12 * 0.2f, num12); } else { if (Main.dust[i].type == 55 || Main.dust[i].type == 56 || Main.dust[i].type == 73 || Main.dust[i].type == 74) { Dust expr_E04 = Main.dust[i]; expr_E04.velocity *= 0.98f; float num13 = Main.dust[i].scale * 0.8f; if (Main.dust[i].type == 55) { if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13, num13, num13 * 0.6f); } else { if (Main.dust[i].type == 73) { if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13, num13 * 0.35f, num13 * 0.5f); } else { if (Main.dust[i].type == 74) { if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13 * 0.35f, num13, num13 * 0.5f); } else { num13 = Main.dust[i].scale * 1.2f; if (num13 > 1f) { num13 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num13 * 0.35f, num13 * 0.5f, num13); } } } } else { if (Main.dust[i].type == 71 || Main.dust[i].type == 72) { Dust expr_1005 = Main.dust[i]; expr_1005.velocity *= 0.98f; float num14 = Main.dust[i].scale; if (num14 > 1f) { num14 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num14 * 0.2f, 0f, num14 * 0.1f); } else { if (!Main.dust[i].noGravity && Main.dust[i].type != 41 && Main.dust[i].type != 44) { Dust expr_10BE_cp_0 = Main.dust[i]; expr_10BE_cp_0.velocity.Y = expr_10BE_cp_0.velocity.Y + 0.1f; } } } } } } } } } } } if (Main.dust[i].type == 5 && Main.dust[i].noGravity) { Main.dust[i].scale -= 0.04f; } if (Main.dust[i].type == 33 || Main.dust[i].type == 52) { if (Main.dust[i].velocity.X == 0f) { if (Collision.SolidCollision(Main.dust[i].position, 2, 2)) { Main.dust[i].scale = 0f; } Main.dust[i].rotation += 0.5f; Main.dust[i].scale -= 0.01f; } bool flag = Collision.WetCollision(new Microsoft.Xna.Framework.Vector2(Main.dust[i].position.X, Main.dust[i].position.Y), 4, 4); if (flag) { Main.dust[i].alpha += 20; Main.dust[i].scale -= 0.1f; } Main.dust[i].alpha += 2; Main.dust[i].scale -= 0.005f; if (Main.dust[i].alpha > 255) { Main.dust[i].scale = 0f; } Dust expr_1252_cp_0 = Main.dust[i]; expr_1252_cp_0.velocity.X = expr_1252_cp_0.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) { Main.dust[i].rotation -= 0.2f; } else { Main.dust[i].rotation += 0.2f; } Main.dust[i].scale += 0.03f; Dust expr_1310_cp_0 = Main.dust[i]; expr_1310_cp_0.velocity.X = expr_1310_cp_0.velocity.X * 1.05f; Dust expr_132D_cp_0 = Main.dust[i]; expr_132D_cp_0.velocity.Y = expr_132D_cp_0.velocity.Y + 0.15f; } } if (Main.dust[i].type == 35 && Main.dust[i].noGravity) { Main.dust[i].scale += 0.03f; if (Main.dust[i].scale < 1f) { Dust expr_1399_cp_0 = Main.dust[i]; expr_1399_cp_0.velocity.Y = expr_1399_cp_0.velocity.Y + 0.075f; } Dust expr_13B6_cp_0 = Main.dust[i]; expr_13B6_cp_0.velocity.X = expr_13B6_cp_0.velocity.X * 1.08f; if (Main.dust[i].velocity.X > 0f) { Main.dust[i].rotation += 0.01f; } else { Main.dust[i].rotation -= 0.01f; } float num15 = Main.dust[i].scale * 0.6f; if (num15 > 1f) { num15 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f + 1f), num15, num15 * 0.3f, num15 * 0.1f); } else { if (Main.dust[i].type == 67) { float num16 = Main.dust[i].scale; if (num16 > 1f) { num16 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), 0f, num16 * 0.8f, num16); } else { if (Main.dust[i].type == 34 || Main.dust[i].type == 35) { if (!Collision.WetCollision(new Microsoft.Xna.Framework.Vector2(Main.dust[i].position.X, Main.dust[i].position.Y - 8f), 4, 4)) { Main.dust[i].scale = 0f; } else { Main.dust[i].alpha += Main.rand.Next(2); if (Main.dust[i].alpha > 255) { Main.dust[i].scale = 0f; } Main.dust[i].velocity.Y = -0.5f; if (Main.dust[i].type == 34) { Main.dust[i].scale += 0.005f; } else { Main.dust[i].alpha++; Main.dust[i].scale -= 0.01f; Main.dust[i].velocity.Y = -0.2f; } Dust expr_1641_cp_0 = Main.dust[i]; expr_1641_cp_0.velocity.X = expr_1641_cp_0.velocity.X + (float)Main.rand.Next(-10, 10) * 0.002f; if ((double)Main.dust[i].velocity.X < -0.25) { Main.dust[i].velocity.X = -0.25f; } if ((double)Main.dust[i].velocity.X > 0.25) { Main.dust[i].velocity.X = 0.25f; } } if (Main.dust[i].type == 35) { float num17 = Main.dust[i].scale * 0.3f + 0.4f; if (num17 > 1f) { num17 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num17, num17 * 0.5f, num17 * 0.3f); } } } } if (Main.dust[i].type == 68) { float num18 = Main.dust[i].scale * 0.3f; if (num18 > 1f) { num18 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num18 * 0.1f, num18 * 0.2f, num18); } if (Main.dust[i].type == 70) { 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.5f, 0f, num19); } if (Main.dust[i].type == 41) { Dust expr_185B_cp_0 = Main.dust[i]; expr_185B_cp_0.velocity.X = expr_185B_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.01f; Dust expr_1888_cp_0 = Main.dust[i]; expr_1888_cp_0.velocity.Y = expr_1888_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.01f; if ((double)Main.dust[i].velocity.X > 0.75) { Main.dust[i].velocity.X = 0.75f; } if ((double)Main.dust[i].velocity.X < -0.75) { Main.dust[i].velocity.X = -0.75f; } if ((double)Main.dust[i].velocity.Y > 0.75) { Main.dust[i].velocity.Y = 0.75f; } if ((double)Main.dust[i].velocity.Y < -0.75) { Main.dust[i].velocity.Y = -0.75f; } Main.dust[i].scale += 0.007f; float num20 = Main.dust[i].scale * 0.7f; if (num20 > 1f) { num20 = 1f; } Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num20 * 0.4f, num20 * 0.9f, num20); } else { if (Main.dust[i].type == 44) { Dust expr_1A1C_cp_0 = Main.dust[i]; expr_1A1C_cp_0.velocity.X = expr_1A1C_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.003f; Dust expr_1A49_cp_0 = Main.dust[i]; expr_1A49_cp_0.velocity.Y = expr_1A49_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.003f; if ((double)Main.dust[i].velocity.X > 0.35) { Main.dust[i].velocity.X = 0.35f; } if ((double)Main.dust[i].velocity.X < -0.35) { Main.dust[i].velocity.X = -0.35f; } if ((double)Main.dust[i].velocity.Y > 0.35) { Main.dust[i].velocity.Y = 0.35f; } if ((double)Main.dust[i].velocity.Y < -0.35) { Main.dust[i].velocity.Y = -0.35f; } Main.dust[i].scale += 0.0085f; 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.7f, num21, num21 * 0.8f); } else { Dust expr_1BC7_cp_0 = Main.dust[i]; expr_1BC7_cp_0.velocity.X = expr_1BC7_cp_0.velocity.X * 0.99f; } } if (Main.dust[i].type != 79) { Main.dust[i].rotation += Main.dust[i].velocity.X * 0.5f; } if (Main.dust[i].fadeIn > 0f) { if (Main.dust[i].type == 46) { Main.dust[i].scale += 0.1f; } else { Main.dust[i].scale += 0.03f; } if (Main.dust[i].scale > Main.dust[i].fadeIn) { Main.dust[i].fadeIn = 0f; } } else { Main.dust[i].scale -= 0.01f; } if (Main.dust[i].noGravity) { Dust expr_1CC1 = Main.dust[i]; expr_1CC1.velocity *= 0.92f; if (Main.dust[i].fadeIn == 0f) { Main.dust[i].scale -= 0.04f; } } if (Main.dust[i].position.Y > Main.screenPosition.Y + (float)Main.screenHeight) { Main.dust[i].active = false; } if ((double)Main.dust[i].scale < 0.1) { Main.dust[i].active = false; } } } else { Main.dust[i].active = false; } } }