Skip to content

Commit

Permalink
v0.5.0 Source
Browse files Browse the repository at this point in the history
  • Loading branch information
AlchlcDvl committed Aug 29, 2023
1 parent 85b7b54 commit 9b721de
Show file tree
Hide file tree
Showing 193 changed files with 6,804 additions and 6,267 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ dotnet_diagnostic.CS0649.severity = none
dotnet_diagnostic.RS2008.severity = none
dotnet_diagnostic.IDE0005.severity = warning
dotnet_diagnostic.IDE0007.severity = warning
dotnet_diagnostic.IDE0035.severity = warning
dotnet_diagnostic.IDE0036.severity = none
dotnet_diagnostic.IDE0043.severity = warning
dotnet_diagnostic.IDE0044.severity = warning
dotnet_diagnostic.IDE0055.severity = none
dotnet_diagnostic.IDE0270.severity = none
dotnet_diagnostic.IDE0300.severity = none
dotnet_diagnostic.IDE1006.severity = none
dotnet_diagnostic.CA1000.severity = none
dotnet_diagnostic.CA1016.severity = none
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
315 changes: 232 additions & 83 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ReworkedAssets
22 changes: 16 additions & 6 deletions TownOfUsReworked/BetterMaps/BetterAirship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public static class SpawnInMinigamePatch

public static bool Prefix(SpawnInMinigame __instance)
{
if ((CustomPlayer.Local.IsPostmortal() && !CustomPlayer.Local.Caught()) || (CustomPlayer.Local.Is(LayerEnum.Astral) &&
Modifier.GetModifier<Astral>(CustomPlayer.Local).LastPosition != Vector3.zero))
if ((CustomPlayer.Local.IsPostmortal() && !CustomPlayer.Local.Caught()) || (CustomPlayer.Local.Is(LayerEnum.Astral) && Modifier.GetModifier<Astral>(CustomPlayer.Local).LastPosition
!= Vector3.zero))
{
__instance.Close();
return false;
Expand Down Expand Up @@ -141,15 +141,25 @@ public static Vector3 GetMeetingPosition(byte playerId)
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.Start))]
static class GameEndedPatch
{
public static void Postfix() => SpawnInMinigamePatch.GameStarted = false;
public static void Prefix() => SpawnInMinigamePatch.GameStarted = false;
}

[HarmonyPatch(typeof(HeliSabotageSystem), nameof(HeliSabotageSystem.UpdateHeliSize))]
[HarmonyPatch(typeof(HeliSabotageSystem), nameof(HeliSabotageSystem.RepairDamage))]
public static class HeliCountdownPatch
{
public static void Prefix(HeliSabotageSystem __instance)
public static bool Prefix(HeliSabotageSystem __instance, ref byte amount)
{
if (__instance.Countdown != CustomGameOptions.CrashTimer)
if ((HeliSabotageSystem.Tags)(amount & 240) == HeliSabotageSystem.Tags.DamageBit)
{
__instance.Countdown = CustomGameOptions.CrashTimer;
HeliSabotageSystem.CharlesDuration = CustomGameOptions.CrashTimer;
__instance.CompletedConsoles.Clear();
__instance.ActiveConsoles.Clear();
__instance.codeResetTimer = -1f;
__instance.IsDirty = true;
return false;
}

return true;
}
}
36 changes: 36 additions & 0 deletions TownOfUsReworked/BetterMaps/BetterMiraHQ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,40 @@ private static void MoveCommsVent()
if (CommsVent.transform.position != CommsPos)
CommsVent.transform.position = CommsPos;
}
}

[HarmonyPatch(typeof(ReactorSystemType), nameof(ReactorSystemType.RepairDamage))]
public static class ReactorMira
{
public static bool Prefix(ReactorSystemType __instance, ref byte opCode)
{
if (ShipStatus.Instance.Type == ShipStatus.MapType.Hq && opCode == 128 && !__instance.IsActive)
{
__instance.Countdown = CustomGameOptions.MiraReactorTimer;
__instance.ReactorDuration = CustomGameOptions.MiraReactorTimer;
__instance.UserConsolePairs.Clear();
__instance.IsDirty = true;
return false;
}

return true;
}
}

[HarmonyPatch(typeof(LifeSuppSystemType), nameof(LifeSuppSystemType.RepairDamage))]
public static class O2Mira
{
public static bool Prefix(LifeSuppSystemType __instance, ref byte opCode)
{
if (ShipStatus.Instance.Type == ShipStatus.MapType.Hq && opCode == 128 && !__instance.IsActive)
{
__instance.Countdown = CustomGameOptions.MiraO2Timer;
__instance.LifeSuppDuration = CustomGameOptions.MiraO2Timer;
__instance.CompletedConsoles.Clear();
__instance.IsDirty = true;
return false;
}

return true;
}
}
1 change: 1 addition & 0 deletions TownOfUsReworked/BetterMaps/BetterPolus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ public static bool Prefix(ReactorSystemType __instance, ref byte opCode)
if (ShipStatus.Instance.Type == ShipStatus.MapType.Pb && opCode == 128 && !__instance.IsActive)
{
__instance.Countdown = CustomGameOptions.SeismicTimer;
__instance.ReactorDuration = CustomGameOptions.SeismicTimer;
__instance.UserConsolePairs.Clear();
__instance.IsDirty = true;
return false;
Expand Down
36 changes: 36 additions & 0 deletions TownOfUsReworked/BetterMaps/BetterSkeld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,40 @@ private static void MoveCafeVent()
if (CafeVent.transform.position != CafeVentNewPos)
CafeVent.transform.position = CafeVentNewPos;
}
}

[HarmonyPatch(typeof(ReactorSystemType), nameof(ReactorSystemType.RepairDamage))]
public static class ReactorSkeld
{
public static bool Prefix(ReactorSystemType __instance, ref byte opCode)
{
if (ShipStatus.Instance.Type == ShipStatus.MapType.Ship && opCode == 128 && !__instance.IsActive)
{
__instance.Countdown = CustomGameOptions.SkeldReactorTimer;
__instance.ReactorDuration = CustomGameOptions.SkeldReactorTimer;
__instance.UserConsolePairs.Clear();
__instance.IsDirty = true;
return false;
}

return true;
}
}

[HarmonyPatch(typeof(LifeSuppSystemType), nameof(LifeSuppSystemType.RepairDamage))]
public static class O2Skeld
{
public static bool Prefix(LifeSuppSystemType __instance, ref byte opCode)
{
if (ShipStatus.Instance.Type == ShipStatus.MapType.Ship && opCode == 128 && !__instance.IsActive)
{
__instance.Countdown = CustomGameOptions.SkeldO2Timer;
__instance.LifeSuppDuration = CustomGameOptions.SkeldO2Timer;
__instance.CompletedConsoles.Clear();
__instance.IsDirty = true;
return false;
}

return true;
}
}
Loading

0 comments on commit 9b721de

Please sign in to comment.