Exemplo n.º 1
0
        private void PlayerDeadBody_Render(On.Celeste.PlayerDeadBody.orig_Render orig, PlayerDeadBody self)
        {
            if (Settings.DisplayDeaths)
            {
                Level level = self.Scene as Level;
                int   i     = 0;

                deaths.ForEach((location) =>
                {
                    if (level.IsInBounds(location) && deathTimer >= deathspopupdelays[i])
                    {
                        float alpha = deathTimer - deathspopupdelays[i];

                        if (i == deaths.Count - 1)
                        {
                            alpha *= 2;
                        }
                        if (alpha > 1f)
                        {
                            alpha = 1f;
                        }

                        deathsprite.DrawCentered(location, Color.White, alpha);
                    }

                    i++;
                });
            }

            orig(self);
        }
        private void PlayerDeadBodyRenderHook(On.Celeste.PlayerDeadBody.orig_Render orig, PlayerDeadBody self)
        {
            DynData <PlayerDeadBody> deadBody = new DynData <PlayerDeadBody>(self);
            int dashCount = deadBody.Get <Player>("player").Dashes;

            if (UniqueSkinSelected())
            {
                string colorGradePath = skinConfigs[Settings.SelectedSkinMod].GetUniquePath() + "dash";

                while (dashCount > 2 && !GFX.ColorGrades.Has(colorGradePath + dashCount))
                {
                    dashCount--;
                }
                if (GFX.ColorGrades.Has(colorGradePath + dashCount))
                {
                    Effect fxColorGrading = GFX.FxColorGrading;
                    fxColorGrading.CurrentTechnique            = fxColorGrading.Techniques["ColorGradeSingle"];
                    Engine.Graphics.GraphicsDevice.Textures[1] = GFX.ColorGrades[colorGradePath + dashCount].Texture.Texture_Safe;
                    Draw.SpriteBatch.End();
                    Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, RasterizerState.CullNone, fxColorGrading, (self.Scene as Level).GameplayRenderer.Camera.Matrix);
                    orig(self);
                    Draw.SpriteBatch.End();
                    Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, RasterizerState.CullNone, null, (self.Scene as Level).GameplayRenderer.Camera.Matrix);
                    return;
                }
            }
            orig(self);
        }