public override void PreUpdate() { float distance = Vector2.Distance(Main.LocalPlayer.Center, LegendWorld.RiftLocation); if (distance <= 1500) { float val = (1500 / distance - 1) * 2; if (val <= 1) { val = 1; } if (val >= 2.5f) { val = 2.5f; } Lighting.brightness = 1 / val; } if (ZoneVoidPre) { Overlay.state = 1; if (player.GetModPlayer <AbilityHandler>().pure.Locked) { player.AddBuff(mod.BuffType("DarkSlow"), 5); } } else if (ZoneJungleCorrupt) { Overlay.state = 2; } else if (ZoneJungleBloody) { Overlay.state = 3; } else if (ZoneJungleHoly) { Overlay.state = (int)OverlayState.HolyJungle; } if (ZoneOvergrow && Main.rand.Next(5) == 0) { Dust.NewDustPerfect(Main.screenPosition - Vector2.One * 100 + new Vector2(Main.rand.Next(Main.screenWidth + 200), Main.rand.Next(Main.screenHeight + 200)), ModContent.DustType <Dusts.OvergrowDust>(), Vector2.Zero, 0, new Color(255, 255, 205) * 0.05f, 2); } //Codex Unlocks if (ZoneGlass && player.GetModPlayer <CodexHandler>().Entries.Any(entry => entry is VitricEntry && entry.Locked)) { Helper.UnlockEntry <VitricEntry>(player); } }
public override void PreUpdate() { float distance = Vector2.Distance(Main.LocalPlayer.Center, StarlightWorld.RiftLocation); if (distance <= 1500) { float val = (1500 / distance - 1) * 2; if (val <= 1) { val = 1; } if (val >= 2.5f) { val = 2.5f; } //Lighting.brightness = 1 / val; } if (ZoneVoidPre) { ParticleOverlay.state = 1; } else if (ZoneJungleCorrupt) { ParticleOverlay.state = 2; if (player.wet) { player.maxFallSpeed = 999f; if (player.breath != player.breathMax) { player.breath--; } } } else if (ZoneJungleBloody) { ParticleOverlay.state = 3; if (player.wet) { player.AddBuff(Terraria.ID.BuffID.Ichor, 600); } } else if (ZoneJungleHoly) { ParticleOverlay.state = (int)OverlayState.HolyJungle; } if (ZoneOvergrow && Main.rand.Next(10) == 0) { Dust.NewDustPerfect(Main.screenPosition - Vector2.One * 100 + new Vector2(Main.rand.Next(Main.screenWidth + 200), Main.rand.Next(Main.screenHeight + 200)), DustType <Dusts.OvergrowDust>(), Vector2.Zero, 0, new Color(255, 255, 205) * 0.05f, 2); } //Codex Unlocks if (ZoneGlass && player.GetModPlayer <CodexHandler>().Entries.Any(entry => entry is VitricEntry && entry.Locked)) { Helper.UnlockEntry <VitricEntry>(player); } if (ZoneOvergrow && player.GetModPlayer <CodexHandler>().Entries.Any(entry => entry is OvergrowEntry && entry.Locked)) { Helper.UnlockEntry <OvergrowEntry>(player); } if (zonePermafrost && player.GetModPlayer <CodexHandler>().Entries.Any(entry => entry is PermafrostEntry && entry.Locked)) { Helper.UnlockEntry <PermafrostEntry>(player); } }