Exemplo n.º 1
0
        public override void OnEnterWorld(Player player)
        {
            ZoomHandler.SetZoomAnimation(Main.GameZoomTarget, 1);

            Shake   = 0;
            panDown = 0;

            ScreenMoveTime   = 0;
            ScreenMoveTarget = Vector2.Zero;
            ScreenMovePan    = Vector2.Zero;

            rotation = 0;

            BootlegHealthbar.tracked = null;
            Collection.ShouldReset   = true;
            inTutorial = false;

            DummyTile.dummies.Clear();
        }
Exemplo n.º 2
0
        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 (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 <Content.Dusts.OvergrowDust>(), Vector2.Zero, 0, new Color(255, 255, 205) * 0.05f, 2);
            }

            if (!Main.dedServ && player == Main.LocalPlayer)
            {
                if (ZoneGlass && Main.Configuration.Get <bool>("UseHeatDistortion", false))
                {
                    if (!Filters.Scene["GradientDistortion"].IsActive())
                    {
                        Filters.Scene["GradientDistortion"].GetShader().Shader.Parameters["uZoom"].SetValue(Main.GameViewMatrix.Zoom);
                        Filters.Scene.Activate("GradientDistortion").GetShader()
                        .UseOpacity(2.5f)
                        .UseIntensity(7f)
                        .UseProgress(6)
                        .UseImage(StarlightRiver.LightingBufferInstance.ScreenLightingTexture, 0);
                    }
                }
                else
                {
                    if (Filters.Scene["GradientDistortion"].IsActive())
                    {
                        Filters.Scene.Deactivate("GradientDistortion");
                    }
                }
            }

            if (ZoneGlassTemple)
            {
                ZoomHandler.AddFlatZoom(0.2f);
            }

            //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);
            }
        }