public static void Update() { for (int index = 0; index < _pieces.Count; ++index) { MoonlordPiece moonlordPiece = _pieces[index]; moonlordPiece.Update(); if (moonlordPiece.Dead) { _pieces.Remove(moonlordPiece); --index; } } for (int index = 0; index < _explosions.Count; ++index) { MoonlordExplosion moonlordExplosion = _explosions[index]; moonlordExplosion.Update(); if (moonlordExplosion.Dead) { _explosions.Remove(moonlordExplosion); --index; } } bool flag = false; for (int index = 0; index < _lightSources.Count; ++index) { if (Main.player[Main.myPlayer].Distance(_lightSources[index]) < 2000.0) { flag = true; break; } } _lightSources.Clear(); if (!flag) { requestedLight = 0.0f; } if (requestedLight != whitening) { if (Math.Abs(requestedLight - whitening) < 0.0199999995529652) { whitening = requestedLight; } else { whitening += (float)Math.Sign(requestedLight - whitening) * 0.02f; } } requestedLight = 0.0f; }
public static void Update() { for (int i = 0; i < _pieces.Count; i++) { MoonlordPiece moonlordPiece = _pieces[i]; moonlordPiece.Update(); if (moonlordPiece.Dead) { _pieces.Remove(moonlordPiece); i--; } } for (int j = 0; j < _explosions.Count; j++) { MoonlordExplosion moonlordExplosion = _explosions[j]; moonlordExplosion.Update(); if (moonlordExplosion.Dead) { _explosions.Remove(moonlordExplosion); j--; } } bool flag = false; for (int k = 0; k < _lightSources.Count; k++) { if (Main.player[Main.myPlayer].Distance(_lightSources[k]) < 2000f) { flag = true; break; } } _lightSources.Clear(); if (!flag) { requestedLight = 0f; } if (requestedLight != whitening) { if (Math.Abs(requestedLight - whitening) < 0.02f) { whitening = requestedLight; } else { whitening += (float)Math.Sign(requestedLight - whitening) * 0.02f; } } requestedLight = 0f; }