summary refs log tree commit diff stats
path: root/GameState.cs
diff options
context:
space:
mode:
Diffstat (limited to 'GameState.cs')
-rw-r--r--GameState.cs37
1 files changed, 33 insertions, 4 deletions
diff --git a/GameState.cs b/GameState.cs index d3bea06..bdf5760 100644 --- a/GameState.cs +++ b/GameState.cs
@@ -112,7 +112,7 @@ namespace ManifoldGardenArchipelago
112 { 112 {
113 foreach (var location in listeners.locations) 113 foreach (var location in listeners.locations)
114 { 114 {
115 if (location.Value.Check()) 115 if (location.Value.Check() == Requirement.Decision.Yes)
116 { 116 {
117 Plugin.archipelagoManager.CheckLocation(location.Key); 117 Plugin.archipelagoManager.CheckLocation(location.Key);
118 } 118 }
@@ -120,8 +120,14 @@ namespace ManifoldGardenArchipelago
120 120
121 foreach (var door in listeners.doors) 121 foreach (var door in listeners.doors)
122 { 122 {
123 bool shouldOpen = door.Value.Check(); 123 Requirement.Decision decision = door.Value.Check();
124 Plugin.Logger.LogInfo($"{door.Key}: {door.Value} -> {shouldOpen}"); 124 if (decision == Requirement.Decision.Maybe)
125 {
126 continue;
127 }
128
129 bool shouldOpen = (decision == Requirement.Decision.Yes);
130 //Plugin.Logger.LogInfo($"{door.Key}: {door.Value} -> {shouldOpen}");
125 131
126 if (SceneManager.GetSceneByName(door.Key.scene) is Scene doorScene && doorScene.isLoaded) 132 if (SceneManager.GetSceneByName(door.Key.scene) is Scene doorScene && doorScene.isLoaded)
127 { 133 {
@@ -142,11 +148,34 @@ namespace ManifoldGardenArchipelago
142 } 148 }
143 } 149 }
144 150
151 foreach (var smokeWall in listeners.smokeWalls)
152 {
153 Requirement.Decision decision = smokeWall.Value.Check();
154 if (decision == Requirement.Decision.Maybe)
155 {
156 continue;
157 }
158
159 bool shouldOpen = (decision == Requirement.Decision.Yes);
160 //Plugin.Logger.LogInfo($"{smokeWall.Key}: {smokeWall.Value} -> {shouldOpen}");
145 161
162 if (SceneManager.GetSceneByName(smokeWall.Key.scene) is Scene smokeScene && smokeScene.isLoaded)
163 {
164 LevelSystems levelSystems = GetLevelSystems(smokeScene);
165 if (levelSystems.isActiveAndEnabled)
166 {
167 SolidStateController ldc = levelSystems.chainListeners[smokeWall.Key.index].GetComponent<SolidStateController>();
168 ldc.chains.Clear();
169
170 FieldInfo fieldInfo = typeof(SolidStateController).GetField("m_isSolid", BindingFlags.Instance | BindingFlags.NonPublic);
171 fieldInfo.SetValue(ldc, !shouldOpen);
172 }
173 }
174 }
146 175
147 foreach (var worldGrow in listeners.worldGrows) 176 foreach (var worldGrow in listeners.worldGrows)
148 { 177 {
149 if (worldGrow.Value.Check()) 178 if (worldGrow.Value.Check() == Requirement.Decision.Yes)
150 { 179 {
151 if (SceneManager.GetSceneByName(worldGrow.Key.scene) is Scene gardenScene && gardenScene.isLoaded) 180 if (SceneManager.GetSceneByName(worldGrow.Key.scene) is Scene gardenScene && gardenScene.isLoaded)
152 { 181 {