|
19 | 19 | using MiraAPI.Utilities; |
20 | 20 | using NewMod.Options.Roles.EnergyThiefOptions; |
21 | 21 | using NewMod.Options.Roles.WraithCallerOptions; |
| 22 | +using NewMod.Options.Roles.ShadeOptions; |
22 | 23 |
|
23 | 24 | namespace NewMod.Patches |
24 | 25 | { |
@@ -131,6 +132,11 @@ public static void OnGameEnd(GameEndEvent evt) |
131 | 132 | customWinColor = GetRoleColor(GetRoleType<WraithCaller>()); |
132 | 133 | endGameManager.BackgroundBar.material.SetColor("_Color", customWinColor); |
133 | 134 | break; |
| 135 | + case (GameOverReason)NewModEndReasons.ShadeWin: |
| 136 | + customWinText = "Darkness Consumes All"; |
| 137 | + customWinColor = GetRoleColor(GetRoleType<Shade>()); |
| 138 | + endGameManager.BackgroundBar.material.SetColor("_Color", customWinColor); |
| 139 | + break; |
134 | 140 | default: |
135 | 141 | customWinText = string.Empty; |
136 | 142 | customWinColor = Color.white; |
@@ -218,6 +224,7 @@ public static bool Prefix(ShipStatus __instance) |
218 | 224 | if (DestroyableSingleton<TutorialManager>.InstanceExists) return true; |
219 | 225 | if (Time.timeSinceLevelLoad < 2f) return true; |
220 | 226 | if (CheckForEndGameFaction<WraithCaller>(__instance, (GameOverReason)NewModEndReasons.WraithCallerWin)) return false; |
| 227 | + if (CheckForEndGameFaction<Shade>(__instance, (GameOverReason)NewModEndReasons.ShadeWin)) return false; |
221 | 228 | if (CheckForEndGameFaction<PulseBlade>(__instance, (GameOverReason)NewModEndReasons.PulseBladeWin)) return false; |
222 | 229 | if (CheckForEndGameFaction<Tyrant>(__instance, (GameOverReason)NewModEndReasons.TyrantWin)) return false; |
223 | 230 | if (CheckEndGameForRole<DoubleAgent>(__instance, (GameOverReason)NewModEndReasons.DoubleAgentWin)) return false; |
@@ -277,6 +284,12 @@ public static bool CheckForEndGameFaction<TFaction>(ShipStatus __instance, GameO |
277 | 284 | int current = WraithCallerUtilities.GetKillsNPC(player.PlayerId); |
278 | 285 | shouldEndGame = current >= required; |
279 | 286 | } |
| 287 | + if (typeof(TFaction) == typeof(Shade)) |
| 288 | + { |
| 289 | + Shade.ShadeKills.TryGetValue(player.PlayerId, out var count); |
| 290 | + int required = (int)OptionGroupSingleton<ShadeOptions>.Instance.RequiredKills; |
| 291 | + shouldEndGame = count >= required; |
| 292 | + } |
280 | 293 | if (shouldEndGame) |
281 | 294 | { |
282 | 295 | GameManager.Instance.RpcEndGame(winReason, false); |
|
0 commit comments