Terraria.Player.UpdateBiomes C# (CSharp) Method

UpdateBiomes() public method

public UpdateBiomes ( ) : void
return void
        public void UpdateBiomes()
        {
            this.ZoneDungeon = false;
            if (Main.dungeonTiles >= 250 && (double)this.position.Y > Main.worldSurface * 16.0)
            {
                int index1 = (int)this.position.X / 16;
                int index2 = (int)this.position.Y / 16;
                if (Main.wallDungeon[(int)Main.tile[index1, index2].wall])
                    this.ZoneDungeon = true;
            }
            if (Main.sandTiles > 1000 && (double)this.position.Y > 3200.0)
            {
                Point point = Utils.ToTileCoordinates(this.Center);
                Tile tileSafely = Framing.GetTileSafely(point.X, point.Y);
                if (WallID.Sets.Conversion.Sandstone[(int)tileSafely.wall] || WallID.Sets.Conversion.HardenedSand[(int)tileSafely.wall])
                    this.ZoneUndergroundDesert = true;
            }
            else
                this.ZoneUndergroundDesert = false;
            this.ZoneCorrupt = Main.evilTiles >= 200;
            this.ZoneHoly = Main.holyTiles >= 100;
            this.ZoneMeteor = Main.meteorTiles >= 50;
            this.ZoneJungle = Main.jungleTiles >= 80;
            this.ZoneSnow = Main.snowTiles >= 300;
            this.ZoneCrimson = Main.bloodTiles >= 200;
            this.ZoneWaterCandle = Main.waterCandles > 0;
            this.ZonePeaceCandle = Main.peaceCandles > 0;
            this.ZoneDesert = Main.sandTiles > 1000;
            this.ZoneGlowshroom = Main.shroomTiles > 100;
            this.ZoneTowerSolar = this.ZoneTowerVortex = this.ZoneTowerNebula = this.ZoneTowerStardust = false;
            Vector2 vector2_1 = Vector2.Zero;
            Vector2 vector2_2 = Vector2.Zero;
            Vector2 vector2_3 = Vector2.Zero;
            Vector2 vector2_4 = Vector2.Zero;
            for (int index = 0; index < 200; ++index)
            {
                if (Main.npc[index].active)
                {
                    if (Main.npc[index].type == 493)
                    {
                        if ((double)this.Distance(Main.npc[index].Center) <= 4000.0)
                        {
                            this.ZoneTowerStardust = true;
                            vector2_4 = Main.npc[index].Center;
                        }
                    }
                    else if (Main.npc[index].type == 507)
                    {
                        if ((double)this.Distance(Main.npc[index].Center) <= 4000.0)
                        {
                            this.ZoneTowerNebula = true;
                            vector2_3 = Main.npc[index].Center;
                        }
                    }
                    else if (Main.npc[index].type == 422)
                    {
                        if ((double)this.Distance(Main.npc[index].Center) <= 4000.0)
                        {
                            this.ZoneTowerVortex = true;
                            vector2_2 = Main.npc[index].Center;
                        }
                    }
                    else if (Main.npc[index].type == 517 && (double)this.Distance(Main.npc[index].Center) <= 4000.0)
                    {
                        this.ZoneTowerSolar = true;
                        vector2_1 = Main.npc[index].Center;
                    }
                }
            }
            this.ManageSpecialBiomeVisuals("Stardust", this.ZoneTowerStardust, vector2_4 - new Vector2(0.0f, 10f));
            this.ManageSpecialBiomeVisuals("Nebula", this.ZoneTowerNebula, vector2_3 - new Vector2(0.0f, 10f));
            this.ManageSpecialBiomeVisuals("Vortex", this.ZoneTowerVortex, vector2_2 - new Vector2(0.0f, 10f));
            this.ManageSpecialBiomeVisuals("Solar", this.ZoneTowerSolar, vector2_1 - new Vector2(0.0f, 10f));
            this.ManageSpecialBiomeVisuals("MoonLord", NPC.AnyNPCs(398), new Vector2());
            this.ManageSpecialBiomeVisuals("BloodMoon", Main.bloodMoon, new Vector2());
            if (!this.dead)
            {
                Point point = Utils.ToTileCoordinates(this.Center);
                if (WorldGen.InWorld(point.X, point.Y, 1))
                {
                    int num = 0;
                    if (Main.tile[point.X, point.Y] != null)
                        num = (int)Main.tile[point.X, point.Y].wall;
                    switch (num)
                    {
                        case 62:
                            AchievementsHelper.HandleSpecialEvent(this, 13);
                            break;
                        case 86:
                            AchievementsHelper.HandleSpecialEvent(this, 12);
                            break;
                    }
                }
                if (this._funkytownCheckCD > 0)
                    --this._funkytownCheckCD;
                if ((double)this.position.Y / 16.0 > (double)(Main.maxTilesY - 200))
                {
                    AchievementsHelper.HandleSpecialEvent(this, 14);
                }
                else
                {
                    if (this._funkytownCheckCD != 0 || (double)this.position.Y / 16.0 >= Main.worldSurface || Main.shroomTiles < 200)
                        return;
                    AchievementsHelper.HandleSpecialEvent(this, 15);
                }
            }
            else
                this._funkytownCheckCD = 100;
        }
Player