summary refs log tree commit diff stats
path: root/GameplayPatches.cs
diff options
context:
space:
mode:
Diffstat (limited to 'GameplayPatches.cs')
-rw-r--r--GameplayPatches.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/GameplayPatches.cs b/GameplayPatches.cs index bdcbcae..37a671d 100644 --- a/GameplayPatches.cs +++ b/GameplayPatches.cs
@@ -389,4 +389,52 @@ namespace ManifoldGardenArchipelago
389 return false; 389 return false;
390 } 390 }
391 } 391 }
392
393 [HarmonyPatch(typeof(DarkModeCageController), "StartFilling")]
394 static class DarkModeCageControllerStartFillingPatch
395 {
396 static bool Prefix(DarkModeCageController __instance)
397 {
398 SceneItemReference sir = GameState.GetGameplayComponentSceneReference(__instance);
399
400 if (GameData.scenes.TryGetValue(sir.scene, out var sceneDescription))
401 {
402 if (sceneDescription.lasers.TryGetValue(sir.index, out var requirement))
403 {
404 Requirement.Decision decision = requirement.Check();
405
406 if (decision == Requirement.Decision.No)
407 {
408 return false;
409 }
410 }
411 }
412
413 return true;
414 }
415 }
416
417 [HarmonyPatch(typeof(DarkModeCageController), "StartUnfilling")]
418 static class DarkModeCageControllerStartUnfillingPatch
419 {
420 static bool Prefix(DarkModeCageController __instance)
421 {
422 SceneItemReference sir = GameState.GetGameplayComponentSceneReference(__instance);
423
424 if (GameData.scenes.TryGetValue(sir.scene, out var sceneDescription))
425 {
426 if (sceneDescription.lasers.TryGetValue(sir.index, out var requirement))
427 {
428 Requirement.Decision decision = requirement.Check();
429
430 if (decision == Requirement.Decision.Yes)
431 {
432 return false;
433 }
434 }
435 }
436
437 return true;
438 }
439 }
392} 440}