Among Us v2023.10.24 support

This commit is contained in:
Eno committed 2023-11-06 02:22:19 +01:00
1 parent 48c1e8ac39
commit 0efbce9fb4
5 files changed
+45 -14

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2023.7.11" />
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2023.10.24" />
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.672" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1">
<PrivateAssets>all</PrivateAssets>
+5 -5
View File
@@ -12,21 +12,21 @@ public class BetterPolusPlugin : BasePlugin
{
private const string Id = "ch.brybry.betterpolus";
private const string Name = "BetterPolus Mod";
public const string Version = "1.2.1";
public const string Version = "1.2.2";
public Harmony Harmony { get; } = new Harmony(Id);
public static ManualLogSource log;
private Harmony Harmony { get; } = new(Id);
public static ManualLogSource Logger { get; private set; }
public static ConfigEntry<bool> Enabled { get; private set; }
public static ConfigEntry<float> ReactorCountdown { get; private set; }
public override void Load()
{
log = Log;
Logger = Log;
Enabled = Config.Bind("Polus", "Enable Better Polus", true, "Enable Polus map modifications");
ReactorCountdown = Config.Bind("Polus", "Reactor Countdown", 40f, "Reactor sabotage countdown in Polus map");
log.LogMessage($"{Name} loaded");
Logger.LogMessage($"{Name} loaded");
Harmony.PatchAll();
}
@@ -1,18 +1,42 @@
using HarmonyLib;
using Hazel;
using Il2CppSystem;
namespace BetterPolus.Patches;
[HarmonyPatch(typeof(ReactorSystemType))]
public static class ReactorSystemTypePatches
{
[HarmonyPatch(nameof(ReactorSystemType.RepairDamage))]
[HarmonyPatch(nameof(ReactorSystemType.UpdateSystem))]
[HarmonyPrefix]
private static bool RepairDamagePrefix(ReactorSystemType __instance, PlayerControl player, byte opCode)
private static bool UpdateSystemPrefix(ReactorSystemType __instance, PlayerControl player, MessageReader msgReader)
{
if (ShipStatus.Instance.Type != ShipStatus.MapType.Pb || opCode != 128 || __instance.IsActive) return true;
__instance.Countdown = BetterPolusPlugin.ReactorCountdown.Value;
__instance.UserConsolePairs.Clear();
var self = msgReader.ReadByte();
var num = self & 3;
if (self == 128 && !__instance.IsActive)
{
__instance.Countdown = ShipStatus.Instance.Type != ShipStatus.MapType.Pb
? __instance.ReactorDuration
: BetterPolusPlugin.ReactorCountdown.Value;
__instance.UserConsolePairs.Clear();
}
else if (self == 16)
{
__instance.Countdown = 10000f;
}
else if (self.HasAnyBit(64))
{
__instance.UserConsolePairs.Add(new Tuple<byte, byte>(player.PlayerId, (byte) num));
if (__instance.UserCount >= 2)
{
__instance.Countdown = 10000f;
}
}
else if (self.HasAnyBit(32))
{
__instance.UserConsolePairs.Remove(new Tuple<byte, byte>(player.PlayerId, (byte) num));
}
__instance.IsDirty = true;
return false;
+2 -2
View File
@@ -74,7 +74,7 @@ public static class ShipStatusPatches
}
else
{
BetterPolusPlugin.log.LogError("Couldn't move elements as not all of them have been fetched.");
BetterPolusPlugin.Logger.LogError("Couldn't move elements as not all of them have been fetched.");
}
AdjustVents();
@@ -196,7 +196,7 @@ public static class ShipStatusPatches
}
else
{
BetterPolusPlugin.log.LogError("Couldn't adjust Vents as not all objects have been fetched.");
BetterPolusPlugin.Logger.LogError("Couldn't adjust Vents as not all objects have been fetched.");
}
}
+7
View File
@@ -88,6 +88,7 @@ There are two ways to install the mod :
## Releases
| Among Us Version | Mod Version | All-in-one pack | DLL file |
|------------------|-----------------|:---------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------:|
| v2023.10.24+ | Ver. 1.2.2 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.2/BetterPolus_All-in-one-Pack-1.2.2.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.2/BetterPolus.dll)** |
| v2023.7.12+ | Ver. 1.2.1 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.1/BetterPolus_All-in-one-Pack-1.2.1.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.1/BetterPolus.dll)** |
| v2023.6.13+ | Ver. 1.2.0be670 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.0/BetterPolus_All-in-one-Pack-1.2.0be670.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.0/BetterPolus.dll)** |
| v2022.10.25+ | Ver. 1.2.0 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.0/BetterPolus_All-in-one-Pack-1.2.0.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.0/BetterPolus.dll)** |
@@ -99,6 +100,12 @@ There are two ways to install the mod :
| v2020.12.9s | Ver. 1.0 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.0.0/BetterPolus_All-in-one-Pack.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.0.0/BetterPolus-2020.12.9s.dll)** |
### Changelog
<details>
<summary>Version 1.2.2</summary>
<ul>
<li>Added compatibility with Among Us v2023.10.24</li>
</ul>
</details>
<details>
<summary>Version 1.2.1</summary>
<ul>