Esempio n. 1
0
        private PlayerDeadBody Player_Die(On.Celeste.Player.orig_Die orig, Player self, Vector2 direction, bool evenIfInvincible, bool registerDeathInStats)
        {
            if (self.Dashes == 2)
            {
                twoDashesOnSpawn = true;
            }
            else
            {
                twoDashesOnSpawn = false;
            }

            foreach (Seeker seeker in spawnHelper.spawnedSeekers)
            {
                SeekerName nameObj = seeker.Get <SeekerName>();
                nameObj.Name = null;
            }

            foreach (Snowball seeker in spawnHelper.spawnedSnowballs)
            {
                SnowballName nameObj = seeker.Get <SnowballName>();
                nameObj.Name = null;
            }

            return(orig(self, direction, evenIfInvincible, registerDeathInStats));
        }
Esempio n. 2
0
        private void HudRenderer_RenderContent(On.Celeste.HudRenderer.orig_RenderContent orig, HudRenderer self, Monocle.Scene scene)
        {
            if (!Settings.Enabled)
            {
                orig(self, scene);
                return;
            }

            if (effectTime != Settings.EffectTime)
            {
                timerHelper.ChangeTimerIntervals();
                effectTime = Settings.EffectTime;
            }

            Monocle.Draw.SpriteBatch.Begin();
            if (Settings.EnableInfoPanel)
            {
                infoPanel.Update();
                infoPanel.SetFont(Monocle.Draw.DefaultFont, Monocle.Draw.SpriteBatch.GraphicsDevice);
                infoPanel.Draw(Monocle.Draw.SpriteBatch);
            }

            if (Settings.ShowSeekerNames)
            {
                foreach (Seeker seeker in spawnHelper.spawnedSeekers)
                {
                    SeekerName nameObj = seeker.Get <SeekerName>();
                    if (nameObj.Name != null)
                    {
                        string name = nameObj.Name;

                        DrawTextOverObject(name, seeker.Position);
                    }
                }
            }

            if (Settings.ShowSnowballNames)
            {
                foreach (Snowball snowball in spawnHelper.spawnedSnowballs)
                {
                    SnowballName nameObj = snowball.Get <SnowballName>();
                    if (nameObj.Name != null)
                    {
                        string name = nameObj.Name;

                        DrawTextOverObject(name, snowball.Position);
                    }
                }
            }

            Monocle.Draw.SpriteBatch.End();

            orig(self, scene);
        }
        public void SpawnSnowball(bool addToList, string name)
        {
            if (currentLevel == null)
            {
                return;
            }

            Snowball     snowball     = new Snowball();
            SnowballName snowballName = new SnowballName(true, true, name);

            snowball.Add(snowballName);
            if (addToList)
            {
                spawnedSnowballs.Add(snowball);
            }
            currentLevel.Add(snowball);

            snowball.X = currentLevel.Camera.Left - 60f;
        }