public CustomSpinner(EntityData data, Vector2 position, bool attachToSolid, string directory, string destroyColor, bool isCore, string tint) : base(data.Position + position)
        {
            ID             = data.ID;
            DashThrough    = data.Bool("dashThrough", false);
            this.tint      = tint;
            Tint           = ColorHelper.GetColor(tint);
            this.directory = directory;

            // for VivHelper compatibility
            SpritePathSuffix = data.Attr("spritePathSuffix", "");

            UpdateDirectoryFields(false);
            moveWithWind = data.Bool("moveWithWind", false);

            // funny story time: this used to exist in older versions of Frost Helper as a leftover.
            // I tried removing it in 1.20.3, but this broke some TASes due to spinner cycles.
            // So now this needs to stay here forever D:
            // List<MTexture> atlasSubtextures = GFX.Game.GetAtlasSubtextures(this.bgDirectory);
            // MTexture mtexture = Calc.Random.Choose(atlasSubtextures);
            // Actually, just calling Random.Next() is enough, so that's nice
            Calc.Random.Next();

            coldDirectory     = directory;
            this.destroyColor = destroyColor;
            this.isCore       = isCore;
            offset            = Calc.Random.NextFloat();
            Tag      = Tags.TransitionUpdate;
            Collider = new ColliderList(new Collider[]
            {
                new Circle(6f, 0f, 0f),
                new Hitbox(16f, 4f, -8f, -3f)
            });
            Visible = false;
            Add(new PlayerCollider(new Action <Player>(OnPlayer), null, null));
            Add(new HoldableCollider(new Action <Holdable>(OnHoldable), null));
            Add(new LedgeBlocker(null));
            Depth = -8500;

            AttachToSolid = attachToSolid;
            if (AttachToSolid)
            {
                Add(new StaticMover
                {
                    OnShake      = new Action <Vector2>(OnShake),
                    SolidChecker = new Func <Solid, bool>(IsRiding),
                    OnDestroy    = new Action(RemoveSelf)
                });
            }

            randomSeed = Calc.Random.Next();
            if (isCore)
            {
                Add(new CoreModeListener(new Action <Session.CoreModes>(OnChangeMode)));
            }
            float bloomAlpha = data.Float("bloomAlpha", 0.0f);

            if (bloomAlpha != 0.0f)
            {
                Add(new BloomPoint(Collider.Center, bloomAlpha, data.Float("bloomRadius", 0f)));
            }
        }
Ejemplo n.º 2
0
        //public static FieldInfo FlutterBird_colors

        public CustomFlutterBird(EntityData data, Vector2 offset) : base(data, offset)
        {
            Get <Sprite>().Color = Calc.Random.Choose(ColorHelper.GetColors(data.Attr("colors", "89fbff,f0fc6c,f493ff,93baff")));
        }
Ejemplo n.º 3
0
 public PlusOneRefill(EntityData data, Vector2 offset) : this(data.Position + offset, data.Bool("oneUse", false), data.Attr("directory", "objects/FrostHelper/plusOneRefill"), data.Int("dashCount", 1), data.Float("respawnTime", 2.5f), ColorHelper.GetColor(data.Attr("particleColor", "ffffff")), data.Bool("recoverStamina", false))
 {
 }