public void Load()
        {
            DimDungeonsProxy.madness      = new List <HellionInsanity>();
            DimDungeonsProxy.Instance     = this;
            DimDungeonsProxy.counter      = 0;
            DimDungeonsProxy.DungeonSeeds = (int)(System.DateTime.Now.Millisecond * 1370.3943162338);

            Filters.Scene["SGAmod:LimboSky"]       = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0.6f, 0.6f, 0.6f).UseOpacity(0.25f), EffectPriority.High);
            SkyManager.Instance["SGAmod:LimboSky"] = new LimboSky();
            LimboDim.CreateTextures();
            Filters.Scene["SGAmod:SpaceSky"]       = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(1f, 1f, 1f).UseOpacity(0.0f), EffectPriority.High);
            SkyManager.Instance["SGAmod:SpaceSky"] = new SpaceSky();

            //On.Terraria.Player.Update += Player_Update;
            DrawOverride.InitTestThings();
        }
        public override void ResetEffects()
        {
            int count = 0;

            if (SGAPocketDim.WhereAmI == typeof(LimboDim))
            {
                count = (int)(player.CountItem(ModContent.ItemType <Entrophite>(), 1000) / 15f);
            }
            heartBeat += count;

            if (heartBeat > 10000 && !player.dead)
            {
                if (SGAPocketDim.WhereAmI == typeof(LimboDim))
                {
                    LimboDim.PlayWarning();
                }

                SoundEffectInstance sound = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Heartbeat").WithVolume(Math.Min(0.25f + (count / 250f), 1f)).WithPitchVariance(.05f), player.Center);
                if (sound != null)
                {
                    sound.Pitch = -0.75f + (float)Math.Min(Math.Atan(count / 25f), 1.7f);
                }

                NullWatcher.DoAwarenessChecks(600 + count * 5, false, true, player.Center);
                heartBeat       = 0;
                staticHeartBeat = 30;
                staticHeartRate = Math.Min(count / 500f, 0.04f);
            }
            if (!Main.dedServ && Main.LocalPlayer == player)
            {
                staticHeartBeat -= 1;
            }

            noLight     = false;
            noLightGrow = Math.Max(noLightGrow - 1, 0);
            if (!(player.HasBuff(BuffID.Darkness) || player.HasBuff(BuffID.Blackout)))
            {
                lightSize = Math.Min(lightSize + (noLightGrow > 0 ? 0 : lightGrowRate), 3000);// 2000+(int)(Math.Sin(Main.GlobalTime/2f)*1000);
            }
            lightGrowRate = 5;
        }
 public void Unload()
 {
     DimDungeonsProxy.Instance = null;
     LimboDim.DestroyTextures();
 }