Skip to content

Commit

Permalink
Added basic support for b and c side postcard
Browse files Browse the repository at this point in the history
  • Loading branch information
nhruo123 committed Jun 12, 2023
1 parent fdc6ddb commit dbc5e22
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Celeste.Mod.mm/Patches/LevelEnter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static bool PlayCustomVignette(Session session, bool fromSaveData) {
Engine.Scene = new CustomScreenVignette(session, meta: screen);
return true;
} else if (playVignette && (text = area.GetMeta()?.LoadingVignetteText) != null && text.Dialog != null) {
if (Engine.Scene is not Overworld {Snow: HiresSnow snow}) {
if (Engine.Scene is not Overworld { Snow: HiresSnow snow }) {
snow = null;
}

Expand Down Expand Up @@ -92,12 +92,21 @@ private IEnumerator Routine() {

AreaData areaData = AreaData.Get(session);
MapMeta areaMeta = areaData.GetMeta();

string postCardDialogInfix = "";
if (session.Area.Mode == AreaMode.BSide) {
postCardDialogInfix = "_b";
} else if (session.Area.Mode == AreaMode.CSide) {
postCardDialogInfix = "_c";
}

string postCardDialog = $"{areaData.Name}{postCardDialogInfix}_postcard";

if (areaMeta != null && areaData.GetLevelSet() != "Celeste" &&
Dialog.Has(areaData.Name + "_postcard") &&
Dialog.Has(postCardDialog) &&
session.StartedFromBeginning && !fromSaveData &&
session.Area.Mode == AreaMode.Normal &&
(!SaveData.Instance.Areas[session.Area.ID].Modes[0].Completed || SaveData.Instance.DebugMode)) {
return EnterWithPostcardRoutine(Dialog.Get(areaData.Name + "_postcard"), areaMeta.PostcardSoundID);
return EnterWithPostcardRoutine(Dialog.Get(postCardDialog), areaMeta.PostcardSoundID);
}

return orig_Routine();
Expand Down

0 comments on commit dbc5e22

Please sign in to comment.