Ejemplo n.º 1
0
        public override void ModifyScreenPosition()
        {
            if (ScreenModifiers.Count > 0)
            {
                if (ScreenModifiers[0].Active)
                {
                    ScreenModifiers[0].UpdateScreenPosition(ref Main.screenPosition);
                }

                ScreenModifiers[0].UpdateModifier(player);

                if (ScreenModifiers[0].LifeTimeEnded)
                {
                    ScreenModifiers.RemoveAt(0);
                }
            }
        }
Ejemplo n.º 2
0
        public void UpdateArrowUseProgress()
        {
            foreach (BeamVisual beam in BeamVisuals)
            {
                beam.Update();
            }

            BeamVisuals.RemoveAll(x => x.TimeLeft <= 0);

            if (ArrowProgress > 0)
            {
                ArrowProgress--;
            }

            if (ArrowProgress == 0 && IsUsingArrow)
            {
                if (!BeganPiercing)
                {
                    ArrowXOffset -= 0.6f;

                    if (ArrowXOffset <= -6f)
                    {
                        BeganPiercing = true;
                    }
                }
                else
                {
                    if (BeamVisuals.Count <= 0)
                    {
                        ScreenModifiers.Clear();
                        ScreenModifiers.Add(new ShakeScreenModifier(player.Center - new Vector2(0, 64), 120, 3, 0.25f));
                        ScreenModifiers.Add(new SmoothStepScreenModifier(player.Center - new Vector2(0, 64), player.Center, 0.025f));
                        BeamVisual.AddBeamVisual(player, 30, 1200, player.itemAnimation, 60, Color.Goldenrod);
                    }

                    Lighting.AddLight(player.Center, Color.PaleGoldenrod.ToVector3() * 2f);
                    for (int i = 0; i < 3; i++)
                    {
                        var dust = Dust.NewDust(UsePosition + new Vector2(-player.width, 0), 40, 0, DustID.AmberBolt, 0, -Main.rand.Next(10, 100), 0, default, 1.1f);