Skip to content

Commit

Permalink
Patch out hardcoded music in fall routine
Browse files Browse the repository at this point in the history
Patch out the reflection music that's hardcoded in vanilla to start playing after the fall cutscene
  • Loading branch information
XMinty77 committed Sep 23, 2023
1 parent 5fdadfb commit 16833a9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Celeste.Mod.mm/Patches/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Monocle;
using MonoMod;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Mono.Cecil;
Expand Down Expand Up @@ -146,6 +147,33 @@ private void BoostBegin() {
}
}

private extern IEnumerator orig_ReflectionFallCoroutine();

private IEnumerator ReflectionFallCoroutine() {
if (SceneAs<Level>().Session.Area.GetLevelSet() == "Celeste") {
IEnumerator enumerator = orig_ReflectionFallCoroutine();
while (enumerator.MoveNext()) {
yield return enumerator.Current;
}
} else {
Sprite.Play("bigFall");
for (float t = 0f; t < 2f; t += Engine.DeltaTime) {
Speed.Y = 0f;
yield return null;
}
FallEffects.Show(visible: true);
Speed.Y = 320f;
while (!CollideCheck<Water>()) {
yield return null;
}
Input.Rumble(RumbleStrength.Strong, RumbleLength.Medium);
FallEffects.Show(visible: false);
Sprite.Play("bigFallRecover");
yield return 1.2f;
StateMachine.State = 0;
}
}

private extern void orig_WindMove(Vector2 move);
private void WindMove(Vector2 move) {
// Don't apply wind on player in the Attract state: this would constantly push the player away from its target.
Expand Down

0 comments on commit 16833a9

Please sign in to comment.