コード例 #1
0
        public void Tick(SceneGame scene)
        {
            var tile = Curio.GetMainTile();

            if (tile != null)
            {
                var pos = tile.GetVisualTarget();
                if (pos != ShadowPosition.End)
                {
                    ShadowPosition.Set(pos, LerpHelper.Quadratic, 10);
                }
            }
            ShadowPosition.Update();
        }
コード例 #2
0
        public override void DrawArcObject(SceneGame scene, DrawPass pass)
        {
            var spriteWraith      = SpriteLoader.Instance.AddSprite("content/wraith");
            var spriteWraithTrail = SpriteLoader.Instance.AddSprite("content/wraith_trail");
            var tile     = Curio.GetMainTile();
            var startPos = Source;
            var endPos   = tile.VisualTarget;

            Vector2 curve(float slide)
            {
                var a = Vector2.Lerp(startPos, startPos + VelocityStart, (float)LerpHelper.Quadratic(0, 1, slide));
                var b = Vector2.Lerp(endPos + VelocityEnd, endPos, (float)LerpHelper.Quadratic(0, 1, slide));

                return(Vector2.Lerp(a, b, (float)LerpHelper.Quadratic(0, 1, slide)));
            }

            Color colorStart = new Color(215, 63, 36);
            Color colorEnd   = new Color(118, 39, 102);

            if (pass == DrawPass.Effect)
            {
                int segments = 5;
                for (int i = 0; i < segments; i++)
                {
                    float   trailSlide = (float)i / (segments - 1);
                    float   trailPos   = (float)LerpHelper.QuadraticOut(Frame.Slide - 0.05f, Frame.Slide, trailSlide);
                    Vector2 pos        = curve(trailPos);
                    scene.DrawSpriteExt(spriteWraithTrail, 0, pos - spriteWraithTrail.Middle, spriteWraithTrail.Middle, 0, Vector2.One, SpriteEffects.None, Color.Lerp(colorStart.WithAlpha(0), colorEnd, trailSlide), 0);
                }
            }
            if (pass == DrawPass.EffectAdditive)
            {
                scene.DrawSpriteExt(spriteWraith, 0, curve(Frame.Slide) - spriteWraith.Middle, spriteWraith.Middle, 0, Vector2.One, SpriteEffects.None, colorStart, 0);
            }
        }
コード例 #3
0
        public override bool CanUse()
        {
            var world = Curio.GetWorld();
            var tile  = Curio.GetMainTile();
            var map   = tile.Map;
            var mace  = Curio.GetBehavior <BehaviorMace>();

            return(mace != null && mace.IsInArea(world.PlayerCurio) && map.CanSee(Curio.GetVisualTarget(), world.PlayerCurio.GetVisualTarget()));
        }
コード例 #4
0
        public override IEnumerable <MapTile> GetImpactArea()
        {
            var tile = Curio.GetMainTile();

            return(tile.GetNearby(1));
        }