////////////////

        private void UpdateHideState(Projectile projectile)
        {
            if (this.HidingState == 0)
            {
                bool isNearMe   = UPMod.IsNearMeForProjectileDimming(projectile.position);
                bool isNearBoss = UPNpc.IsNearBossForProjectileDimming(projectile.position);

                if (isNearMe || isNearBoss)
                {
                    if (this.HidePercent < 1f)
                    {
                        if (UPMod.Instance.Config.DebugModeInfo)
                        {
                            Main.NewText("-hide " + projectile.Name + " " + projectile.whoAmI);
                        }

                        this.HidingState = 1;
                    }
                }
                else
                {
                    if (this.HidePercent > 0f)
                    {
                        if (UPMod.Instance.Config.DebugModeInfo)
                        {
                            Main.NewText("+show " + projectile.Name + " " + projectile.whoAmI);
                        }

                        this.HidingState = -1;
                    }
                }
            }

            if (this.HidePercent >= 1f)
            {
                UPProjectile.HiddenProjectiles.Add(projectile.whoAmI);
            }
            else
            {
                UPProjectile.HiddenProjectiles.Remove(projectile.whoAmI);
            }
        }
Exemple #2
0
        ////////////////

        public static bool AreSpamProjectileLikelyToExist()
        {
            var  config       = UPMod.Instance.Config;
            bool unclutBoss   = config.UnclutterDuringBosses;
            bool unclutEclip  = config.UnclutterDuringEclipses;
            bool unclutInvas  = config.UnclutterDuringInvasions;
            bool unclutLunar  = config.UnclutterDuringLunarApocalypse;
            bool isBossActive = UPNpc.IsAnyBossActive();

            if (unclutBoss && !isBossActive)                                      // No boss active?
            {
                if (!WorldHelpers.IsAboveWorldSurface(Main.LocalPlayer.position)) // Not above world surface?
                {
                    return(false);
                }
            }

            return((unclutBoss && isBossActive) ||
                   (unclutEclip && Main.eclipse) ||
                   (unclutInvas && Main.invasionType != 0) ||
                   (unclutInvas && Main.pumpkinMoon) ||
                   (unclutInvas && Main.snowMoon) ||
                   (unclutLunar && NPC.LunarApocalypseIsUp));
        }