Beispiel #1
0
        public EntityMover(EntityData data, Vector2 offset) : base(data.Position + offset)
        {
            Collider = new Hitbox(data.Width, data.Height);

            Types       = FrostModule.GetTypes(data.Attr("types", "")).ToList();
            isBlacklist = data.Bool("blacklist");

            pauseTime    = data.Float("pauseTimeLength", 0f);
            pauseTimer   = data.Float("startPauseTimeLength", 0f);
            relativeMode = data.Bool("relativeMovementMode", false);
            onEndSFX     = data.Attr("onEndSFX", "");
            if (isBlacklist)
            {
                // Some basic types we don't want to move D:
                foreach (Type type in new List <Type>()
                {
                    typeof(Player), typeof(SolidTiles), typeof(BackgroundTiles), typeof(SpeedrunTimerDisplay), typeof(StrawberriesCounter)
                })
                {
                    Types.Add(type);
                }
            }

            endNode     = data.FirstNodeNullable(offset).GetValueOrDefault();
            easer       = EaseHelper.GetEase(data.Attr("easing", "CubeInOut"));
            duration    = data.Float("moveDuration", 1f);
            mustCollide = data.Bool("mustCollide", true);
            distance    = new Vector2(endNode.X - Position.X, endNode.Y - Position.Y);
        }
Beispiel #2
0
 public CustomDreamBlockV2(EntityData data, Vector2 offset) : base(data, offset)
 {
     ActiveBackColor              = ColorHelper.GetColor(data.Attr("activeBackColor", "Black"));
     DisabledBackColor            = ColorHelper.GetColor(data.Attr("disabledBackColor", "1f2e2d"));
     ActiveLineColor              = ColorHelper.GetColor(data.Attr("activeLineColor", "White"));
     DisabledLineColor            = ColorHelper.GetColor(data.Attr("disabledLineColor", "6a8480"));
     DashSpeed                    = data.Float("speed", 240f);
     AllowRedirects               = data.Bool("allowRedirects");
     AllowRedirectsInSameDir      = data.Bool("allowSameDirectionDash");
     SameDirectionSpeedMultiplier = data.Float("sameDirectionSpeedMultiplier", 1f);
     node          = data.FirstNodeNullable(new Vector2?(offset));
     moveSpeedMult = data.Float("moveSpeedMult", 1f);
     easer         = EaseHelper.GetEase(data.Attr("moveEase", "SineInOut"));
     ConserveSpeed = data.Bool("conserveSpeed", false);
     // legacy
     fastMoving = data.Bool("fastMoving", false);
 }