Ejemplo n.º 1
0
 public override void Unload()
 {
     CloneSpawner.Unload();
     WaterDrowningController.Unload();
     TimeField.Unload();
     MarioClearPipe.Unload();
     DreamDashController.Unload();
 }
Ejemplo n.º 2
0
        private static int Player_DreamDashUpdate(On.Celeste.Player.orig_DreamDashUpdate orig, Player self)
        {
            DreamDashController controller = self.Scene.Tracker.GetEntity <DreamDashController>();

            controller?.AttemptBounce(self);

            return(orig(self));
        }
Ejemplo n.º 3
0
        private static void Player_DreamDashBegin(On.Celeste.Player.orig_DreamDashBegin orig, Player self)
        {
            DreamDashController controller    = self.Scene.Tracker.GetEntity <DreamDashController>();
            Vector2             preEnterSpeed = self.Speed;

            orig(self);

            controller?.DreamDashStart(self, preEnterSpeed);
        }
Ejemplo n.º 4
0
        private static void DreamBlock_Setup(On.Celeste.DreamBlock.orig_Setup orig, DreamBlock self)
        {
            DreamDashController controller = self.Scene.Tracker.GetEntity <DreamDashController>();
            bool playerHasDreamdash        = (bool)dreamBlockPlayerHasDreamDash.GetValue(self);

            orig(self);

            if (playerHasDreamdash)
            {
                controller?.changeDreamBlockParticleColors(self);
            }
        }
Ejemplo n.º 5
0
        private static void Player_Update(On.Celeste.Player.orig_Update orig, Player self)
        {
            DreamDashController controller = self.Scene.Tracker.GetEntity <DreamDashController>();

            if (controller != null)
            {
                if (Input.Dash.Pressed && Input.Aim.Value != Vector2.Zero)
                {
                    controller.dreamDashRedirect(self);
                }
            }

            orig(self);
        }
Ejemplo n.º 6
0
        private static int Player_DreamDashUpdate(On.Celeste.Player.orig_DreamDashUpdate orig, Player self)
        {
            DreamDashController controller = self.Scene.Tracker.GetEntity <DreamDashController>();

            bool bounced = controller?.AttemptBounce(self) ?? false;

            if (bounced)
            {
                return(self.StateMachine.State);
            }
            else
            {
                return(orig(self));
            }
        }
Ejemplo n.º 7
0
        private static void Player_Update(On.Celeste.Player.orig_Update orig, Player self)
        {
            DreamDashController controller = self.Scene.Tracker.GetEntity <DreamDashController>();

            if (controller != null)
            {
                if (Input.Dash.Pressed && Input.Aim.Value != Vector2.Zero)
                {
                    controller.dreamDashRedirect(self);
                }
            }

            Facings preOrigFacing = self.Facing;
            Vector2 preOrigScale  = self.Sprite.Scale;

            orig(self);

            if (wallPlayerRotations.TryGetValue(self, out var rotationHolder))
            {
                self.Facing       = preOrigFacing;
                self.Sprite.Scale = preOrigScale;

                Vector2 inputAim = Input.Aim.Value;

                if (inputAim != Vector2.Zero)
                {
                    float   inputAngleOffset = (inputAim.Angle() - rotationHolder.value + MathHelper.TwoPi) % MathHelper.TwoPi;
                    Facings newFacing        = self.Facing;

                    if (inputAngleOffset >= Math.PI * 0.75 && inputAngleOffset <= Math.PI * 1.25)
                    {
                        newFacing = Facings.Left;
                    }
                    else if (inputAngleOffset >= Math.PI * -0.25 && inputAngleOffset <= Math.PI * 0.25 || inputAngleOffset - MathHelper.TwoPi >= Math.PI * -0.25 && inputAngleOffset - MathHelper.TwoPi <= Math.PI * 0.25)
                    {
                        newFacing = Facings.Right;
                    }

                    if (self.Facing != newFacing)
                    {
                        self.Facing = newFacing;
                    }
                }
            }
        }