示例#1
0
        public IEnumerator RefillRoutine(Player player)
        {
            Celeste.Freeze(0.025f);

            baseData.Get <Sprite>("sprite").Visible = baseData.Get <Sprite>("flash").Visible = false;
            bool oneUse = baseData.Get <bool>("oneUse");

            if (!oneUse)
            {
                baseData.Get <Image>("outline").Visible = true;
            }
            yield return(0.05);

            player.StateMachine.State = 0;
            float angle = player.Speed.Angle();
            Level level = baseData.Get <Level>("level");

            level.ParticlesFG.Emit(P_Shatter, 5, Position, Vector2.One * 4f, angle - (float)Math.PI / 2f);
            level.ParticlesFG.Emit(P_Shatter, 5, Position, Vector2.One * 4f, angle + (float)Math.PI / 2f);
            SlashFx.Burst(Position, angle);
            if (oneUse)
            {
                RemoveSelf();
            }
        }
示例#2
0
        private IEnumerator RefillRoutine(Player player)
        {
            Celeste.Freeze(0.05f);

            yield return(null);

            (Scene as Level).Shake();

            sprite.Visible = (flash.Visible = false);

            if (!oneUse)
            {
                outline.Visible = true;
            }
            Depth = 8999;

            yield return(0.05f);

            float angle = player.Speed.Angle();

            SlashFx.Burst(Position, angle);

            if (oneUse)
            {
                RemoveSelf();
            }
        }
示例#3
0
        private IEnumerator RefillRoutine(Player player)
        {
            Celeste.Celeste.Freeze(0.05f);
            yield return(null);

            level.Shake(0.3f);
            sprite.Visible = flash.Visible = false;
            if (!oneUse)
            {
                outline.Visible = true;
            }
            Depth = 8999;
            yield return(0.05f);

            float angle = player.Speed.Angle();

            level.ParticlesFG.Emit(Refill.P_Shatter, 5, Position, Vector2.One * 4f, particleColor, angle - 1.57079637f);
            level.ParticlesFG.Emit(Refill.P_Shatter, 5, Position, Vector2.One * 4f, particleColor, angle + 1.57079637f);
            SlashFx.Burst(Position, angle);
            if (oneUse)
            {
                RemoveSelf();
            }
            yield break;
        }
示例#4
0
        private IEnumerator RefillRoutine(Player player)
        {
            Celeste.Freeze(0.05f);
            Audio.Play(CustomSFX.game_shieldedRefill_diamondbubble_pop, Position);
            level.ParticlesFG.Emit(Player.P_CassetteFly, 6, Center, Vector2.One * 5f);
            yield return(null);

            level.Shake();
            sprite.Visible = (flash.Visible = false);
            if (!oneUse)
            {
                outline.Visible = true;
            }
            Depth = Depths.BGDecals * 1;
            yield return(0.05f);

            float num = player.Speed.Angle();

            level.ParticlesFG.Emit(p_shatter, 5, Position, Vector2.One * 4f, num - (float)Math.PI / 2f);
            level.ParticlesFG.Emit(p_shatter, 5, Position, Vector2.One * 4f, num + (float)Math.PI / 2f);
            SlashFx.Burst(Position, num);
            if (oneUse)
            {
                RemoveSelf();
            }
        }
示例#5
0
 public void ExplodeLaunch(Vector2 from)
 {
     if (!Hold.IsHeld)
     {
         Speed = (base.Center - from).SafeNormalize(120f);
         SlashFx.Burst(base.Center, Speed.Angle());
     }
 }
 public void Crack(Player player)
 {
     SlashFx.Burst(Center, 3f);
     health--;
     if (health < 1)
     {
         m_HeartGem_Collect.Invoke(this, new object[] { player });
     }
     // Add crack to heart
     // create light rays
 }
 private void makeDisappear(Player player, float angle)
 {
     if (Collidable)
     {
         Collidable   = (Visible = false);
         respawnTimer = 3f;
         Celeste.Freeze(0.05f);
         SceneAs <Level>().Shake();
         SlashFx.Burst(Position, angle);
         player?.RefillDash();
     }
 }
示例#8
0
        private IEnumerator RefillRoutine(Player player)
        {
            //Celeste.Celeste.Freeze(0.05f);
            yield return((object)null);

            level.Shake(0.3f);
            sprite.Visible  = (flash.Visible = false);
            outline.Visible = true;
            Depth           = 8999;
            yield return((object)0.05f);

            float num = player.Speed.Angle();

            //level.ParticlesFG.Emit(P_Shatter, 5, base.Position, Vector2.One * 4f, num - 1.57079637f);
            //level.ParticlesFG.Emit(P_Shatter, 5, base.Position, Vector2.One * 4f, num + 1.57079637f);
            SlashFx.Burst(base.Position, num);
        }
示例#9
0
        private IEnumerator CollectRoutine(Player player, Vector2 playerSpeed)
        {
            level.Shake(0.3f);
            sprite.Visible = false;
            yield return(0.05f);

            float angle;

            if (playerSpeed != Vector2.Zero)
            {
                angle = playerSpeed.Angle();
            }
            else
            {
                angle = (Position - player.Center).Angle();
            }
            level.ParticlesFG.Emit(P_Collect, 10, Position, Vector2.One * 6f, FlyColor);
            SlashFx.Burst(Position, angle);
            yield break;
        }
        private IEnumerator RefillRoutine(Player player)
        {
            Celeste.Celeste.Freeze(0.05f);
            yield return(null);

            _level.Shake();
            _dangerSprite.Visible = _gemSprite.Visible = _shineSprite.Visible = false;
            Depth = 8999;
            if (_static)
            {
                _outline.Visible = true;
            }
            _broken = true;
            yield return(0.05f);

            float angle = player.Speed.Angle();

            _level.ParticlesFG.Emit(P_Shatter, 5, Position, Vector2.One * 8f, angle - (float)Math.PI / 2f);
            _level.ParticlesFG.Emit(P_Shatter, 5, Position, Vector2.One * 8f, angle + (float)Math.PI / 2f);
            SlashFx.Burst(Position, angle);
        }
示例#11
0
        private IEnumerator SmashRoutine(Player player, Level level)
        {
            Visible        = false;
            Collidable     = false;
            player.Stamina = 110f;
            SoundEmitter.Play(SFX.game_07_gem_get, this, null);

            Session session = (Scene as Level).Session;

            session.DoNotLoad.Add(GID);
            CommunalHelperModule.Session.SummitGems.Add(CustomGemSID);
            CommunalHelperModule.SaveData.RegisterSummitGem(CustomGemSID);

            level.Shake(0.3f);
            Celeste.Freeze(0.1f);
            P_Shatter.Color = particleColor ?? GemColors[Calc.Clamp(GemID, 0, 7)];
            float angle = player.Speed.Angle();

            level.ParticlesFG.Emit(P_Shatter, 5, Position, Vector2.One * 4f, angle - Calc.QuarterCircle);
            level.ParticlesFG.Emit(P_Shatter, 5, Position, Vector2.One * 4f, angle + Calc.QuarterCircle);
            SlashFx.Burst(Position, angle);

            for (int i = 0; i < 10; i++)
            {
                Scene.Add(new AbsorbOrb(Position, player, null));
            }
            level.Flash(Color.White, true);
            Scene.Add((Entity)Activator.CreateInstance(t_BgFlash));

            Engine.TimeRate = 0.5f;
            while (Engine.TimeRate < 1f)
            {
                Engine.TimeRate += Engine.RawDeltaTime * 0.5f;
                yield return(null);
            }

            RemoveSelf();
            yield break;
        }
示例#12
0
        private IEnumerator RefillRoutine(Battery battery)
        {
            Celeste.Freeze(0.05f);
            yield return(null);

            level.Shake();
            sprite.Visible = (flash.Visible = false);
            if (!oneUse)
            {
                outline.Visible = true;
            }
            Depth = 8999;
            yield return(0.05f);

            float angle = battery.Speed.Angle();

            level.ParticlesFG.Emit(p_shatter, 5, Position, Vector2.One * 4f, angle - (float)Math.PI / 2f);
            level.ParticlesFG.Emit(p_shatter, 5, Position, Vector2.One * 4f, angle + (float)Math.PI / 2f);
            SlashFx.Burst(Position, angle);
            if (oneUse)
            {
                RemoveSelf();
            }
        }
示例#13
0
        public void Update()
        {
            Playback.Update();
            Playback.Hair.AfterUpdate();
            if (Playback.Sprite.CurrentAnimationID == "dash" && Playback.Sprite.CurrentAnimationFrame == 0)
            {
                if (!dashing)
                {
                    dashing = true;
                    Celeste.Celeste.Freeze(0.05f);
                    SlashFx.Burst(Playback.Center, (-Vector2.UnitY).Angle()).Tag = tag;
                    dashTrailTimer   = 0.1f;
                    dashTrailCounter = 2;
                    CreateTrail();

                    launchedDelay = 0.15f;
                }
            }
            else
            {
                dashing = false;
            }
            if (dashTrailTimer > 0f)
            {
                dashTrailTimer -= Engine.DeltaTime;
                if (dashTrailTimer <= 0f)
                {
                    CreateTrail();
                    dashTrailCounter--;
                    if (dashTrailCounter > 0)
                    {
                        dashTrailTimer = 0.1f;
                    }
                }
            }
            if (launchedDelay > 0f)
            {
                launchedDelay -= Engine.DeltaTime;
                if (launchedDelay <= 0f)
                {
                    launched      = true;
                    launchedTimer = 0f;
                }
            }
            if (launched)
            {
                float prevVal = launchedTimer;
                launchedTimer += Engine.DeltaTime;
                if (launchedTimer >= 0.5f)
                {
                    launched      = false;
                    launchedTimer = 0f;
                }
                else if (Calc.OnInterval(launchedTimer, prevVal, 0.15f))
                {
                    SpeedRing speedRing = Engine.Pooler.Create <SpeedRing>().Init(Playback.Center, (Playback.Position - Playback.LastPosition).Angle(), Color.White);
                    speedRing.Tag = tag;
                    Engine.Scene.Add(speedRing);
                }
            }
        }
 public static SlashFx Clone(this SlashFx slashFx)
 {
     return(SlashFx.Burst(slashFx.GetStartPosition(), slashFx.GetDirection()));
 }