Skip to content

Commit a860288

Browse files
Fix not sending finish
1 parent 6833e5d commit a860288

File tree

3 files changed

+46
-16
lines changed

3 files changed

+46
-16
lines changed

ProdigalArchipelago/Archipelago.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public class Archipelago : MonoBehaviour
4040
private static readonly int[] LOCS_ENLIGHTENMENT = [64, 74, 75, 77, 78, 79, 80, 90];
4141
public static readonly int[] LOCS_SECRET_SHOP = [245, 246, 247];
4242

43-
public static bool Enabled;
43+
public static bool Enabled = false;
44+
public static bool Debug = false;
4445
public static Archipelago AP;
4546
private static GameObject Obj;
4647

@@ -717,6 +718,17 @@ private IEnumerator Warp()
717718
GameMaster.GM.PC.CUTSCENE(false);
718719
}
719720

721+
public IEnumerator EndGame()
722+
{
723+
yield return new WaitForSeconds(1);
724+
while (GameMaster.GM.GS != GameMaster.GameState.IN_GAME)
725+
{
726+
yield return null;
727+
}
728+
Archipelago.AP.Finish();
729+
GameMaster.GM.StartCoroutine((IEnumerator)AccessTools.Method(typeof(GameMaster), "ClosingSplashes").Invoke(GameMaster.GM, [true]));
730+
}
731+
720732
private void Randomize()
721733
{
722734
Random = new(Data.Seed);

ProdigalArchipelago/Plugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public enum Button
1616
Trigger,
1717
}
1818

19-
[BepInPlugin("com.randomsalience.prodigal.archipelago", "Archipelago", "0.1.5")]
19+
[BepInPlugin("com.randomsalience.prodigal.archipelago", "Archipelago", "0.1.5.1")]
2020
[BepInProcess("Prodigal.exe")]
2121
public class Plugin : BaseUnityPlugin
2222
{

ProdigalArchipelago/WorldPatcher.cs

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,7 @@ static IEnumerator Postfix(IEnumerator __result, ShadowOranHM.BOSS_TYPE ___BOSS_
138138

139139
if (Archipelago.Enabled && ___BOSS_LOC == ShadowOranHM.BOSS_TYPE.BASE && Archipelago.AP.Settings.GoalShadow())
140140
{
141-
yield return new WaitForSeconds(1);
142-
while (GameMaster.GM.GS != GameMaster.GameState.IN_GAME)
143-
{
144-
yield return null;
145-
}
146-
Archipelago.AP.Finish();
147-
GameMaster.GM.StartCoroutine((IEnumerator)AccessTools.Method(typeof(GameMaster), "ClosingSplashes").Invoke(GameMaster.GM, [true]));
141+
Archipelago.AP.StartCoroutine(Archipelago.AP.EndGame());
148142
}
149143
}
150144
}
@@ -163,13 +157,7 @@ static IEnumerator Postfix(IEnumerator __result)
163157

164158
if (Archipelago.Enabled && Archipelago.AP.Settings.GoalTorran())
165159
{
166-
yield return new WaitForSeconds(1);
167-
while (GameMaster.GM.GS != GameMaster.GameState.IN_GAME)
168-
{
169-
yield return null;
170-
}
171-
Archipelago.AP.Finish();
172-
GameMaster.GM.StartCoroutine((IEnumerator)AccessTools.Method(typeof(GameMaster), "ClosingSplashes").Invoke(GameMaster.GM, [true]));
160+
Archipelago.AP.StartCoroutine(Archipelago.AP.EndGame());
173161
}
174162
}
175163
}
@@ -788,4 +776,34 @@ static void Prefix()
788776
Archipelago.AP.IsBjergCastle = false;
789777
}
790778
}
779+
}
780+
781+
// Debug code to activate all warps
782+
[HarmonyPatch(typeof(LevelStatue))]
783+
[HarmonyPatch("StatueDisable")]
784+
class LevelStatue_StatueDisable_Patch
785+
{
786+
static void Prefix(LevelStatue __instance)
787+
{
788+
if (Archipelago.Debug)
789+
{
790+
AccessTools.Method(typeof(LevelStatue), "StatueEnable").Invoke(__instance, []);
791+
}
792+
}
793+
}
794+
795+
// Debug code to remove all light pillars
796+
[HarmonyPatch(typeof(LIGHT_PILLAR))]
797+
[HarmonyPatch("OnEnable")]
798+
class LIGHT_PILLAR_OnEnable_Patch
799+
{
800+
static void Postfix(LIGHT_PILLAR __instance)
801+
{
802+
if (Archipelago.Debug)
803+
{
804+
__instance.STATUS = LIGHT_PILLAR.STATE.SHROUDED;
805+
__instance.GetComponent<Animator>().SetTrigger("DEAD");
806+
__instance.GetComponent<Collider2D>().enabled = false;
807+
}
808+
}
791809
}

0 commit comments

Comments
 (0)