mirror of
https://github.com/Brybry16/BetterPolus.git
synced 2026-10-20 11:39:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c146466a56 | ||
|
|
ef4991efcc | ||
|
|
036922e884 | ||
|
|
6384dab6fb | ||
|
|
25c7e6fcfb | ||
|
|
625bd71063 | ||
|
|
6e362617c1 | ||
|
|
c3ec98d024 | ||
|
|
fc638835a0 | ||
|
|
da82e1066e | ||
|
|
197163893f | ||
|
|
0efbce9fb4 | ||
|
|
3bbe0e432d | ||
|
|
48c1e8ac39 | ||
|
|
137db3e1a1 | ||
|
|
e764e1daac | ||
|
|
46614ad6c8 | ||
|
|
ba8edb7ef6 | ||
|
|
47e7dec597 | ||
|
|
8dfb3b246b | ||
|
|
67069bf466 | ||
|
|
9266ea52a4 | ||
|
|
d953dd1c03 |
No files matched your search
@@ -1,21 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Version>1.1.2</Version>
|
||||
<GameVersion>2021.3.31.3s</GameVersion>
|
||||
<Mappings>NuclearPowered/Mappings:0.3.0</Mappings>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>1.2.3</Version>
|
||||
|
||||
<Description>Mod allowing some enhancements in Polus Map</Description>
|
||||
<Description>An Among Us mod that tweaks Polus, allowing a more balanced experience.</Description>
|
||||
<Authors>Brybry</Authors>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Deobfuscate Include="$(AmongUs)\BepInEx\plugins\Reactor-$(GameVersion).dll" />
|
||||
|
||||
<PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="0.3.0" />
|
||||
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.11.18" />
|
||||
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.697" />
|
||||
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Copy" AfterTargets="Reobfuscate">
|
||||
<Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" Condition="'$(Configuration)' == 'Debug'" />
|
||||
|
||||
<Target Name="Copy" AfterTargets="Build">
|
||||
<Copy SourceFiles="$(OutputPath)$(AssemblyName).dll" DestinationFiles="$(AmongUs)/BepInEx/plugins/$(AssemblyName).dll" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,37 +1,33 @@
|
||||
using BepInEx;
|
||||
using BepInEx.IL2CPP;
|
||||
using BepInEx.Configuration;
|
||||
using BepInEx.Logging;
|
||||
using HarmonyLib;
|
||||
using Reactor;
|
||||
using Reactor.Patches;
|
||||
using BepInEx.Unity.IL2CPP;
|
||||
|
||||
namespace BetterPolus
|
||||
namespace BetterPolus;
|
||||
|
||||
[BepInPlugin(Id, Name, Version)]
|
||||
[BepInProcess("Among Us.exe")]
|
||||
public class BetterPolusPlugin : BasePlugin
|
||||
{
|
||||
[BepInPlugin(Id)]
|
||||
[BepInProcess("Among Us.exe")]
|
||||
[BepInDependency(ReactorPlugin.Id)]
|
||||
public class BetterPolusPlugin : BasePlugin
|
||||
private const string Id = "ch.brybry.betterpolus";
|
||||
private const string Name = "BetterPolus Mod";
|
||||
public const string Version = "1.2.3";
|
||||
|
||||
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()
|
||||
{
|
||||
public const string Id = "ch.brybry.betterpolus";
|
||||
Logger = Log;
|
||||
|
||||
public Harmony Harmony { get; } = new Harmony(Id);
|
||||
public static ManualLogSource log;
|
||||
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
log = 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("BetterPolus Mod loaded");
|
||||
Logger.LogMessage($"{Name} loaded");
|
||||
|
||||
ReactorVersionShower.TextUpdated += (text) =>
|
||||
{
|
||||
int index = text.Text.LastIndexOf('\n');
|
||||
text.Text = text.Text.Insert(index == -1 ? text.Text.Length - 1 : index,
|
||||
"\nLoaded [5E4CA6FF]BetterPolus v1.1.2-R []by Brybry");
|
||||
};
|
||||
|
||||
Harmony.PatchAll();
|
||||
}
|
||||
Harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BetterPolus.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(AmongUsClient))]
|
||||
public static class AmongUsClientPatches
|
||||
{
|
||||
[HarmonyPatch(nameof(AmongUsClient.Awake))]
|
||||
[HarmonyPrefix]
|
||||
private static void AwakePrefix()
|
||||
{
|
||||
DestroyableSingleton<ModManager>.Instance.ShowModStamp();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using Il2CppSystem.Text;
|
||||
|
||||
namespace BetterPolus.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(NormalPlayerTask))]
|
||||
public static class NormalPlayerTaskPatches
|
||||
{
|
||||
private static readonly List<TaskTypes> TaskTypesToPatch = new()
|
||||
{ TaskTypes.RebootWifi, TaskTypes.RecordTemperature, TaskTypes.ChartCourse };
|
||||
|
||||
[HarmonyPatch(nameof(NormalPlayerTask.AppendTaskText))]
|
||||
[HarmonyPrefix]
|
||||
private static bool AppendTaskTextPrefix(NormalPlayerTask __instance, StringBuilder sb)
|
||||
{
|
||||
if (!BetterPolusPlugin.Enabled.Value || !ShipStatus.Instance || ShipStatus.Instance.Type != ShipStatus.MapType.Pb) return true;
|
||||
if (!TaskTypesToPatch.Contains(__instance.TaskType)) return true;
|
||||
var flag = __instance.ShouldYellowText();
|
||||
if (flag)
|
||||
{
|
||||
sb.Append(__instance.IsComplete ? "<color=#00DD00FF>" : "<color=#FFFF00FF>");
|
||||
}
|
||||
|
||||
var room = GetUpdatedRoom(__instance);
|
||||
|
||||
sb.Append(DestroyableSingleton<TranslationController>.Instance.GetString(room));
|
||||
sb.Append(": ");
|
||||
sb.Append(DestroyableSingleton<TranslationController>.Instance.GetString(__instance.TaskType));
|
||||
if (__instance is { ShowTaskTimer: true, TimerStarted: NormalPlayerTask.TimerState.Started })
|
||||
{
|
||||
sb.Append(" (");
|
||||
sb.Append(DestroyableSingleton<TranslationController>.Instance.GetString(StringNames.SecondsAbbv,
|
||||
(int)__instance.TaskTimer));
|
||||
sb.Append(")");
|
||||
}
|
||||
else if (__instance.ShowTaskStep)
|
||||
{
|
||||
sb.Append(" (");
|
||||
sb.Append(__instance.taskStep);
|
||||
sb.Append("/");
|
||||
sb.Append(__instance.MaxStep);
|
||||
sb.Append(")");
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
sb.Append("</color>");
|
||||
}
|
||||
|
||||
sb.AppendLine();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static SystemTypes GetUpdatedRoom(NormalPlayerTask task)
|
||||
{
|
||||
return task.TaskType switch
|
||||
{
|
||||
TaskTypes.RecordTemperature => SystemTypes.Outside,
|
||||
TaskTypes.RebootWifi => SystemTypes.Dropship,
|
||||
TaskTypes.ChartCourse => SystemTypes.Comms,
|
||||
_ => task.StartAt
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using Il2CppSystem;
|
||||
|
||||
namespace BetterPolus.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(ReactorSystemType))]
|
||||
public static class ReactorSystemTypePatches
|
||||
{
|
||||
[HarmonyPatch(nameof(ReactorSystemType.UpdateSystem))]
|
||||
[HarmonyPrefix]
|
||||
private static bool UpdateSystemPrefix(ReactorSystemType __instance, PlayerControl player, MessageReader msgReader)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BetterPolus.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(ShipStatus))]
|
||||
public static class ShipStatusPatches
|
||||
{
|
||||
// Positions
|
||||
public static readonly Vector3 DvdScreenNewPos = new Vector3(26.635f, -15.92f, 1f);
|
||||
public static readonly Vector3 VitalsNewPos = new Vector3(31.275f, -6.45f, 1f);
|
||||
|
||||
public static readonly Vector3 WifiNewPos = new Vector3(15.975f, 0.084f, 1f);
|
||||
public static readonly Vector3 NavNewPos = new Vector3(11.07f, -15.298f, -0.015f);
|
||||
|
||||
public static readonly Vector3 TempColdNewPos = new Vector3(7.772f, -17.103f, -0.017f);
|
||||
|
||||
// Scales
|
||||
public const float DvdScreenNewScale = 0.75f;
|
||||
|
||||
// Checks
|
||||
public static bool IsAdjustmentsDone;
|
||||
public static bool IsObjectsFetched;
|
||||
public static bool IsRoomsFetched;
|
||||
public static bool IsVentsFetched;
|
||||
|
||||
// Tasks Tweak
|
||||
public static Console WifiConsole;
|
||||
public static Console NavConsole;
|
||||
|
||||
// Vitals Tweak
|
||||
public static SystemConsole Vitals;
|
||||
public static GameObject DvdScreenOffice;
|
||||
|
||||
// Vents Tweak
|
||||
public static Vent ElectricBuildingVent;
|
||||
public static Vent ElectricalVent;
|
||||
public static Vent ScienceBuildingVent;
|
||||
public static Vent StorageVent;
|
||||
|
||||
// TempCold Tweak
|
||||
public static Console TempCold;
|
||||
|
||||
// Rooms
|
||||
public static GameObject Comms;
|
||||
public static GameObject DropShip;
|
||||
public static GameObject Outside;
|
||||
public static GameObject Science;
|
||||
|
||||
private static void ApplyChanges(ShipStatus instance)
|
||||
{
|
||||
if (instance.Type == ShipStatus.MapType.Pb && BetterPolusPlugin.Enabled.Value)
|
||||
{
|
||||
FindPolusObjects();
|
||||
AdjustPolus();
|
||||
}
|
||||
}
|
||||
|
||||
public static void FindPolusObjects()
|
||||
{
|
||||
FindVents();
|
||||
FindRooms();
|
||||
FindObjects();
|
||||
}
|
||||
|
||||
public static void AdjustPolus()
|
||||
{
|
||||
if (IsObjectsFetched && IsRoomsFetched)
|
||||
{
|
||||
MoveVitals();
|
||||
SwitchNavWifi();
|
||||
MoveTempCold();
|
||||
}
|
||||
else
|
||||
{
|
||||
BetterPolusPlugin.Logger.LogError("Couldn't move elements as not all of them have been fetched.");
|
||||
}
|
||||
|
||||
AdjustVents();
|
||||
|
||||
IsAdjustmentsDone = true;
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// - Objects Fetching -
|
||||
// --------------------
|
||||
|
||||
public static void FindVents()
|
||||
{
|
||||
var ventsList = Object.FindObjectsOfType<Vent>().ToList();
|
||||
|
||||
if (ElectricBuildingVent == null)
|
||||
{
|
||||
ElectricBuildingVent = ventsList.Find(vent => vent.gameObject.name == "ElectricBuildingVent");
|
||||
}
|
||||
|
||||
if (ElectricalVent == null)
|
||||
{
|
||||
ElectricalVent = ventsList.Find(vent => vent.gameObject.name == "ElectricalVent");
|
||||
}
|
||||
|
||||
if (ScienceBuildingVent == null)
|
||||
{
|
||||
ScienceBuildingVent = ventsList.Find(vent => vent.gameObject.name == "ScienceBuildingVent");
|
||||
}
|
||||
|
||||
if (StorageVent == null)
|
||||
{
|
||||
StorageVent = ventsList.Find(vent => vent.gameObject.name == "StorageVent");
|
||||
}
|
||||
|
||||
IsVentsFetched = ElectricBuildingVent != null && ElectricalVent != null && ScienceBuildingVent != null &&
|
||||
StorageVent != null;
|
||||
}
|
||||
|
||||
public static void FindRooms()
|
||||
{
|
||||
if (Comms == null)
|
||||
{
|
||||
Comms = Object.FindObjectsOfType<GameObject>().ToList().Find(o => o.name == "Comms");
|
||||
}
|
||||
|
||||
if (DropShip == null)
|
||||
{
|
||||
DropShip = GameObject.Find("PolusShip(Clone)")?.transform?.FindChild("Dropship")?.gameObject;
|
||||
}
|
||||
|
||||
if (Outside == null)
|
||||
{
|
||||
Outside = Object.FindObjectsOfType<GameObject>().ToList().Find(o => o.name == "Outside");
|
||||
}
|
||||
|
||||
if (Science == null)
|
||||
{
|
||||
Science = Object.FindObjectsOfType<GameObject>().ToList().Find(o => o.name == "Science");
|
||||
}
|
||||
|
||||
IsRoomsFetched = Comms != null && DropShip != null && Outside != null && Science != null;
|
||||
}
|
||||
|
||||
public static void FindObjects()
|
||||
{
|
||||
if (WifiConsole == null)
|
||||
{
|
||||
WifiConsole = Object.FindObjectsOfType<Console>().ToList()
|
||||
.Find(console => console.name == "panel_wifi");
|
||||
}
|
||||
|
||||
if (NavConsole == null)
|
||||
{
|
||||
NavConsole = Object.FindObjectsOfType<Console>().ToList()
|
||||
.Find(console => console.name == "panel_nav");
|
||||
}
|
||||
|
||||
if (Vitals == null)
|
||||
{
|
||||
Vitals = Object.FindObjectsOfType<SystemConsole>().ToList()
|
||||
.Find(console => console.name == "panel_vitals");
|
||||
}
|
||||
|
||||
if (DvdScreenOffice == null)
|
||||
{
|
||||
GameObject DvdScreenAdmin = Object.FindObjectsOfType<GameObject>().ToList()
|
||||
.Find(o => o.name == "dvdscreen");
|
||||
|
||||
if (DvdScreenAdmin != null)
|
||||
{
|
||||
DvdScreenOffice = Object.Instantiate(DvdScreenAdmin);
|
||||
}
|
||||
}
|
||||
|
||||
if (TempCold == null)
|
||||
{
|
||||
TempCold = Object.FindObjectsOfType<Console>().ToList()
|
||||
.Find(console => console.name == "panel_tempcold");
|
||||
}
|
||||
|
||||
IsObjectsFetched = WifiConsole != null && NavConsole != null && Vitals != null &&
|
||||
DvdScreenOffice != null && TempCold != null;
|
||||
}
|
||||
|
||||
// -------------------
|
||||
// - Map Adjustments -
|
||||
// -------------------
|
||||
|
||||
public static void AdjustVents()
|
||||
{
|
||||
if (IsVentsFetched)
|
||||
{
|
||||
ElectricBuildingVent.Left = ElectricalVent;
|
||||
ElectricalVent.Center = ElectricBuildingVent;
|
||||
|
||||
ScienceBuildingVent.Left = StorageVent;
|
||||
StorageVent.Center = ScienceBuildingVent;
|
||||
}
|
||||
else
|
||||
{
|
||||
BetterPolusPlugin.Logger.LogError("Couldn't adjust Vents as not all objects have been fetched.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void MoveTempCold()
|
||||
{
|
||||
if (TempCold.transform.position != TempColdNewPos)
|
||||
{
|
||||
Transform tempColdTransform = TempCold.transform;
|
||||
tempColdTransform.parent = Outside.transform;
|
||||
tempColdTransform.position = TempColdNewPos;
|
||||
|
||||
// Fixes collider being too high
|
||||
BoxCollider2D collider = TempCold.GetComponent<BoxCollider2D>();
|
||||
collider.isTrigger = false;
|
||||
collider.size += new Vector2(0f, -0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SwitchNavWifi()
|
||||
{
|
||||
if (WifiConsole.transform.position != WifiNewPos)
|
||||
{
|
||||
Transform wifiTransform = WifiConsole.transform;
|
||||
wifiTransform.parent = DropShip.transform;
|
||||
wifiTransform.position = WifiNewPos;
|
||||
}
|
||||
|
||||
if (NavConsole.transform.position != NavNewPos)
|
||||
{
|
||||
Transform navTransform = NavConsole.transform;
|
||||
navTransform.parent = Comms.transform;
|
||||
navTransform.position = NavNewPos;
|
||||
|
||||
// Prevents crewmate being able to do the task from outside
|
||||
NavConsole.checkWalls = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void MoveVitals()
|
||||
{
|
||||
if (Vitals.transform.position != VitalsNewPos)
|
||||
{
|
||||
// Vitals
|
||||
Transform vitalsTransform = Vitals.gameObject.transform;
|
||||
vitalsTransform.parent = Science.transform;
|
||||
vitalsTransform.position = VitalsNewPos;
|
||||
}
|
||||
|
||||
if (DvdScreenOffice.transform.position != DvdScreenNewPos)
|
||||
{
|
||||
// DvdScreen
|
||||
Transform dvdScreenTransform = DvdScreenOffice.transform;
|
||||
dvdScreenTransform.position = DvdScreenNewPos;
|
||||
|
||||
var localScale = dvdScreenTransform.localScale;
|
||||
localScale =
|
||||
new Vector3(DvdScreenNewScale, localScale.y,
|
||||
localScale.z);
|
||||
dvdScreenTransform.localScale = localScale;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(nameof(ShipStatus.Begin))]
|
||||
[HarmonyPrefix]
|
||||
private static void BeginPrefix(ShipStatus __instance)
|
||||
{
|
||||
ApplyChanges(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPatch(nameof(ShipStatus.Awake))]
|
||||
[HarmonyPrefix]
|
||||
private static void AwakePrefix(ShipStatus __instance)
|
||||
{
|
||||
ApplyChanges(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPatch(nameof(ShipStatus.FixedUpdate))]
|
||||
[HarmonyPrefix]
|
||||
private static void FixedUpdate(ShipStatus __instance)
|
||||
{
|
||||
if (IsObjectsFetched && IsAdjustmentsDone) return;
|
||||
ApplyChanges(__instance);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BetterPolus.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(VersionShower))]
|
||||
public static class VersionShowerPatches
|
||||
{
|
||||
[HarmonyPatch(nameof(VersionShower.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void StartPostfix(VersionShower __instance)
|
||||
{
|
||||
__instance.text.text += $"<size=70%> + <color=#5E4CA6FF>BetterPolus v{BetterPolusPlugin.Version}</color> by Brybry</size>";
|
||||
}
|
||||
}
|
||||
@@ -1,298 +0,0 @@
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BetterPolus
|
||||
{
|
||||
[HarmonyPatch(typeof(ShipStatus))]
|
||||
public static class ShipStatusPatch
|
||||
{
|
||||
// Positions
|
||||
public static readonly Vector3 DvdScreenNewPos = new Vector3(26.635f, -15.92f, 1f);
|
||||
public static readonly Vector3 VitalsNewPos = new Vector3(31.275f, -6.45f, 1f);
|
||||
|
||||
public static readonly Vector3 WifiNewPos = new Vector3(15.975f, 0.084f, 1f);
|
||||
public static readonly Vector3 NavNewPos = new Vector3(11.07f, -15.298f, -0.015f);
|
||||
|
||||
public static readonly Vector3 TempColdNewPos = new Vector3(7.772f, -17.103f, -0.017f);
|
||||
|
||||
// Scales
|
||||
public const float DvdScreenNewScale = 0.75f;
|
||||
|
||||
// Checks
|
||||
public static bool IsAdjustmentsDone;
|
||||
public static bool IsObjectsFetched;
|
||||
public static bool IsRoomsFetched;
|
||||
public static bool IsVentsFetched;
|
||||
|
||||
// Tasks Tweak
|
||||
public static Console WifiConsole;
|
||||
public static Console NavConsole;
|
||||
|
||||
// Vitals Tweak
|
||||
public static SystemConsole Vitals;
|
||||
public static GameObject DvdScreenOffice;
|
||||
|
||||
// Vents Tweak
|
||||
public static Vent ElectricBuildingVent;
|
||||
public static Vent ElectricalVent;
|
||||
public static Vent ScienceBuildingVent;
|
||||
public static Vent StorageVent;
|
||||
|
||||
// TempCold Tweak
|
||||
public static Console TempCold;
|
||||
|
||||
// Rooms
|
||||
public static GameObject Comms;
|
||||
public static GameObject DropShip;
|
||||
public static GameObject Outside;
|
||||
public static GameObject Science;
|
||||
|
||||
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.Begin))]
|
||||
public static class ShipStatusBeginPatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch]
|
||||
public static void Prefix(ShipStatus __instance)
|
||||
{
|
||||
ApplyChanges(__instance);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.Awake))]
|
||||
public static class ShipStatusAwakePatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch]
|
||||
public static void Prefix(ShipStatus __instance)
|
||||
{
|
||||
ApplyChanges(__instance);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.FixedUpdate))]
|
||||
public static class ShipStatusFixedUpdatePatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch]
|
||||
public static void Prefix(ShipStatus __instance)
|
||||
{
|
||||
if (!IsObjectsFetched || !IsAdjustmentsDone)
|
||||
{
|
||||
ApplyChanges(__instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyChanges(ShipStatus instance)
|
||||
{
|
||||
if (instance.Type == ShipStatus.MapType.Pb)
|
||||
{
|
||||
FindPolusObjects();
|
||||
AdjustPolus();
|
||||
}
|
||||
}
|
||||
|
||||
public static void FindPolusObjects()
|
||||
{
|
||||
FindVents();
|
||||
FindRooms();
|
||||
FindObjects();
|
||||
}
|
||||
|
||||
public static void AdjustPolus()
|
||||
{
|
||||
if (IsObjectsFetched && IsRoomsFetched)
|
||||
{
|
||||
MoveVitals();
|
||||
SwitchNavWifi();
|
||||
MoveTempCold();
|
||||
}
|
||||
else
|
||||
{
|
||||
BetterPolusPlugin.log.LogError("Couldn't move elements as not all of them have been fetched.");
|
||||
}
|
||||
|
||||
AdjustVents();
|
||||
|
||||
IsAdjustmentsDone = true;
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// - Objects Fetching -
|
||||
// --------------------
|
||||
|
||||
public static void FindVents()
|
||||
{
|
||||
var ventsList = Object.FindObjectsOfType<Vent>().ToList();
|
||||
|
||||
if (ElectricBuildingVent == null)
|
||||
{
|
||||
ElectricBuildingVent = ventsList.Find(vent => vent.gameObject.name == "ElectricBuildingVent");
|
||||
}
|
||||
|
||||
if (ElectricalVent == null)
|
||||
{
|
||||
ElectricalVent = ventsList.Find(vent => vent.gameObject.name == "ElectricalVent");
|
||||
}
|
||||
|
||||
if (ScienceBuildingVent == null)
|
||||
{
|
||||
ScienceBuildingVent = ventsList.Find(vent => vent.gameObject.name == "ScienceBuildingVent");
|
||||
}
|
||||
|
||||
if (StorageVent == null)
|
||||
{
|
||||
StorageVent = ventsList.Find(vent => vent.gameObject.name == "StorageVent");
|
||||
}
|
||||
|
||||
IsVentsFetched = ElectricBuildingVent != null && ElectricalVent != null && ScienceBuildingVent != null &&
|
||||
StorageVent != null;
|
||||
}
|
||||
|
||||
public static void FindRooms()
|
||||
{
|
||||
if (Comms == null)
|
||||
{
|
||||
Comms = Object.FindObjectsOfType<GameObject>().ToList().Find(o => o.name == "Comms");
|
||||
}
|
||||
|
||||
if (DropShip == null)
|
||||
{
|
||||
DropShip = Object.FindObjectsOfType<GameObject>().ToList().Find(o => o.name == "Dropship");
|
||||
}
|
||||
|
||||
if (Outside == null)
|
||||
{
|
||||
Outside = Object.FindObjectsOfType<GameObject>().ToList().Find(o => o.name == "Outside");
|
||||
}
|
||||
|
||||
if (Science == null)
|
||||
{
|
||||
Science = Object.FindObjectsOfType<GameObject>().ToList().Find(o => o.name == "Science");
|
||||
}
|
||||
|
||||
IsRoomsFetched = Comms != null && DropShip != null && Outside != null && Science != null;
|
||||
}
|
||||
|
||||
public static void FindObjects()
|
||||
{
|
||||
if (WifiConsole == null)
|
||||
{
|
||||
WifiConsole = Object.FindObjectsOfType<Console>().ToList()
|
||||
.Find(console => console.name == "panel_wifi");
|
||||
}
|
||||
|
||||
if (NavConsole == null)
|
||||
{
|
||||
NavConsole = Object.FindObjectsOfType<Console>().ToList()
|
||||
.Find(console => console.name == "panel_nav");
|
||||
}
|
||||
|
||||
if (Vitals == null)
|
||||
{
|
||||
Vitals = Object.FindObjectsOfType<SystemConsole>().ToList()
|
||||
.Find(console => console.name == "panel_vitals");
|
||||
}
|
||||
|
||||
if (DvdScreenOffice == null)
|
||||
{
|
||||
GameObject DvdScreenAdmin = Object.FindObjectsOfType<GameObject>().ToList()
|
||||
.Find(o => o.name == "dvdscreen");
|
||||
|
||||
if (DvdScreenAdmin != null)
|
||||
{
|
||||
DvdScreenOffice = Object.Instantiate(DvdScreenAdmin);
|
||||
}
|
||||
}
|
||||
|
||||
if (TempCold == null)
|
||||
{
|
||||
TempCold = Object.FindObjectsOfType<Console>().ToList()
|
||||
.Find(console => console.name == "panel_tempcold");
|
||||
}
|
||||
|
||||
IsObjectsFetched = WifiConsole != null && NavConsole != null && Vitals != null &&
|
||||
DvdScreenOffice != null && TempCold != null;
|
||||
}
|
||||
|
||||
// -------------------
|
||||
// - Map Adjustments -
|
||||
// -------------------
|
||||
|
||||
public static void AdjustVents()
|
||||
{
|
||||
if (IsVentsFetched)
|
||||
{
|
||||
ElectricBuildingVent.Left = ElectricalVent;
|
||||
ElectricalVent.Center = ElectricBuildingVent;
|
||||
|
||||
ScienceBuildingVent.Left = StorageVent;
|
||||
StorageVent.Center = ScienceBuildingVent;
|
||||
}
|
||||
else
|
||||
{
|
||||
BetterPolusPlugin.log.LogError("Couldn't adjust Vents as not all objects have been fetched.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void MoveTempCold()
|
||||
{
|
||||
if (TempCold.transform.position != TempColdNewPos)
|
||||
{
|
||||
Transform tempColdTransform = TempCold.transform;
|
||||
tempColdTransform.parent = Outside.transform;
|
||||
tempColdTransform.position = TempColdNewPos;
|
||||
|
||||
// Fixes collider being too high
|
||||
BoxCollider2D collider = TempCold.GetComponent<BoxCollider2D>();
|
||||
collider.isTrigger = false;
|
||||
collider.size += new Vector2(0f, -0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SwitchNavWifi()
|
||||
{
|
||||
if (WifiConsole.transform.position != WifiNewPos)
|
||||
{
|
||||
Transform wifiTransform = WifiConsole.transform;
|
||||
wifiTransform.parent = DropShip.transform;
|
||||
wifiTransform.position = WifiNewPos;
|
||||
}
|
||||
|
||||
if (NavConsole.transform.position != NavNewPos)
|
||||
{
|
||||
Transform navTransform = NavConsole.transform;
|
||||
navTransform.parent = Comms.transform;
|
||||
navTransform.position = NavNewPos;
|
||||
|
||||
// Prevents crewmate being able to do the task from outside
|
||||
NavConsole.checkWalls = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void MoveVitals()
|
||||
{
|
||||
if (Vitals.transform.position != VitalsNewPos)
|
||||
{
|
||||
// Vitals
|
||||
Transform vitalsTransform = Vitals.gameObject.transform;
|
||||
vitalsTransform.parent = Science.transform;
|
||||
vitalsTransform.position = VitalsNewPos;
|
||||
}
|
||||
|
||||
if (DvdScreenOffice.transform.position != DvdScreenNewPos)
|
||||
{
|
||||
// DvdScreen
|
||||
Transform dvdScreenTransform = DvdScreenOffice.transform;
|
||||
dvdScreenTransform.position = DvdScreenNewPos;
|
||||
|
||||
var localScale = dvdScreenTransform.localScale;
|
||||
localScale =
|
||||
new Vector3(DvdScreenNewScale, localScale.y,
|
||||
localScale.z);
|
||||
dvdScreenTransform.localScale = localScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,12 +54,17 @@ An Among Us mod that tweaks Polus, allowing a more balanced experience.
|
||||
</details></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>The <b>Seismic Stabilizers Sabotage</b> (also known as Reactor Meltdown) has been <b>buffed</b>.
|
||||
<ul>
|
||||
<li>The countdown will now start at <b>40 seconds left</b> (instead of 60 seconds).</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
## Technology
|
||||
This mod has been created using **[Reactor Modding Framework](https://github.com/NuclearPowered/Reactor)**. The game is patched at runtime via **[Reactor BepInEx](https://github.com/NuclearPowered/BepInEx)** and no game file is actually altered.
|
||||
The game is patched at runtime via **[BepInEx Bleeding Edge](https://github.com/BepInEx/BepInEx)** and no game file is actually altered.
|
||||
|
||||
For the moment, this mod supports **Among Us v2020.12.9s** *(Steam version)*.
|
||||
For the moment, this mod supports **Among Us v2023.10.24**.
|
||||
|
||||
## Installation
|
||||
For a better experience, every player in your lobby should download BetterPolus. You *can* play with people that don't have the mod installed but keep in mind that they won't see the same things as you (for example Vitals location).
|
||||
@@ -71,27 +76,75 @@ There are two ways to install the mod :
|
||||
### All-in-one pack
|
||||
1. Download the pack for your game version in the **[Releases section](#releases)** below.
|
||||
2. Extract the content of the zip file into your game folder (**`Steam/steamapps/common/Among Us`**).
|
||||
3. Run the game from Steam.
|
||||
3. Run the game. The mod should be installed and it should work.
|
||||
|
||||
### Custom install
|
||||
1. Install Reactor BepInEx by following **[these instructions](https://docs.reactor.gg/docs/basic/install_bepinex/)**.
|
||||
2. Install Reactor by following **[these instructions](https://docs.reactor.gg/docs/basic/install_reactor)**.
|
||||
1. Download the latest build of BepInEx Bleeding Edge **[on this page](https://builds.bepinex.dev/projects/bepinex_be)** (select `BepInEx Unity (IL2CPP) for Windows (x86) games`).
|
||||
2. Unzip the file in your Among Us directory and run the game once. Close the game once you see the title screen.
|
||||
3. Download the **dll file** for your game version in the **[Releases section](#releases)** below.
|
||||
4. Copy the dll file into **`Among Us/BepInEx/plugins`**.
|
||||
5. (Optional) If you want to play on official servers, you must do the following (**doesn't work anymore since v2021.3.31s**) :
|
||||
- Open **`Among us/BepInEx/config/gg.reactor.api.cfg`** with a text editor.
|
||||
- Find the line `Modded handshake = true` and change it to `Modded handshake = false`.
|
||||
- Save and close your editor.
|
||||
5. Run the game. The mod should be installed and it should work.
|
||||
|
||||
## Releases
|
||||
| Among Us Version | Mod Version | All-in-one pack | DLL file |
|
||||
| ---------------- | ----------- | :-------------: | :------: |
|
||||
| v2021.3.31.3 | Ver. 1.1.2 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.2/BetterPolus_All-in-one-Pack-1.1.2.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.2/BetterPolus-2021.3.31.3s.dll)** |
|
||||
| v2021.3.5s | Ver. 1.1.1 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.1/BetterPolus_All-in-one-Pack-1.1.1.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.1/BetterPolus-2021.3.5s.dll)** |
|
||||
| v2020.12.9s | Ver. 1.1 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1/BetterPolus_All-in-one-Pack-1.1.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1/BetterPolus-2020.12.9s.dll)** |
|
||||
| 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)** |
|
||||
| Among Us Version | Mod Version | All-in-one pack | DLL file |
|
||||
|------------------|-----------------|:---------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------:|
|
||||
| v2025.11.18+ | Ver. 1.2.3 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.3/BetterPolus_All-in-one-Pack-1.2.3.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.2.3/BetterPolus.dll)** |
|
||||
| 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)** |
|
||||
| v2021.11.9.5+ | Ver. 1.1.4 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.4/BetterPolus_All-in-one-Pack-1.1.4.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.4/BetterPolus-1.1.4.dll)** |
|
||||
| v2021.6.30 | Ver. 1.1.3 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.3/BetterPolus_All-in-one-Pack-1.1.3.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.3/BetterPolus-1.1.3.dll)** |
|
||||
| v2021.3.31.3 | Ver. 1.1.2 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.2/BetterPolus_All-in-one-Pack-1.1.2.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.2/BetterPolus-2021.3.31.3s.dll)** |
|
||||
| v2021.3.5s | Ver. 1.1.1 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.1/BetterPolus_All-in-one-Pack-1.1.1.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1.1/BetterPolus-2021.3.5s.dll)** |
|
||||
| v2020.12.9s | Ver. 1.1 | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1/BetterPolus_All-in-one-Pack-1.1.zip)** | **[Download](https://github.com/Brybry16/BetterPolus/releases/download/v1.1/BetterPolus-2020.12.9s.dll)** |
|
||||
| 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.3</summary>
|
||||
<ul>
|
||||
<li>Fixed a bug causing the "Reboot Wifi" task to not being moved correctly to Dropship.</li>
|
||||
</ul>
|
||||
</details>
|
||||
<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>
|
||||
<li>Added compatibility with Among Us v2023.7.12s</li>
|
||||
<li>Seismic Stabilizers Sabotage duration is customizable in config file (40s by default)</li>
|
||||
<li>Polus map modifications can be disabled in config file (enabled by default)</li>
|
||||
<li>The names of tasks room that have been moved appear correctly</li>
|
||||
</ul>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Version 1.2.0</summary>
|
||||
<ul>
|
||||
<li>Added compatibility with the .net6.0-based BepInEx BE</li>
|
||||
<li>Seismic Stabilizers Sabotage got buffed (sabotage duration went from 60s to 40s)</li>
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Version 1.1.4</summary>
|
||||
<ul>
|
||||
<li>Added compatibility with Among Us v2021.11.9.5s</li>
|
||||
<li>Removed Reactor dependencies</li>
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Version 1.1.3</summary>
|
||||
<ul>
|
||||
<li>Added compatibility with Among Us v2021.6.30s</li>
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Version 1.1.2</summary>
|
||||
<ul>
|
||||
@@ -139,7 +192,6 @@ There are two ways to install the mod :
|
||||
```
|
||||
-- BepInEx/
|
||||
-- mono/
|
||||
-- changelog.txt
|
||||
-- doorstop_config.ini
|
||||
-- steam_appid.txt
|
||||
-- winhttp.dll
|
||||
@@ -147,22 +199,24 @@ There are two ways to install the mod :
|
||||
|
||||
## Q&A
|
||||
**How do I know if BetterPolus is correctly installed?**<br>
|
||||
Just check that there is a line saying that BetterPolus has been loaded in the top left of the main menu.
|
||||
Just check that there is a line saying that BetterPolus has been loaded in the bottom left of the main menu.
|
||||
|
||||
**Does this works with (Better-)CrewLink (Proximity Chat)?**<br>
|
||||
Of course!
|
||||
|
||||
**Do I risk anything if I play on official Servers?**<br>
|
||||
There is currently no permaban system for the game so it's safe to play on official servers. However, I still recommend you to host your own custom server to be safe. For more information, you can check these repositories :
|
||||
There is currently no permaban system for the game so it's safe to play on official servers. However, I still recommend you to host your own custom server to be safe. For more information, you can check this repository :
|
||||
- **[Impostor/Impostor](https://github.com/Impostor/Impostor):** A custom server that allows you to create your own plugins.
|
||||
- **[NuclearPowered/Impostor](https://github.com/NuclearPowered/Impostor):** Impostor but maintained by the team behind Reactor. <ins>Use this if you want to play with plugins that need Reactor's Custom RPC API or Modded Handshake.</ins>
|
||||
|
||||
**Can you use BetterPolus with Woodi's Sheriff Mod?**<br>
|
||||
Reactor doesn't support Woodi's Sheriff Mod. **However**, you can use [**Reactor-Sheriff**](https://github.com/Brybry16/Reactor-Sheriff) which is an adapted version of Woodi's Sheriff Mod that can run with and BetterPolus.
|
||||
As of version 1.1.4, you you can use Woodi's Sheriff Mod!<br>
|
||||
~~Reactor doesn't support Woodi's Sheriff Mod. **However**, you can use [**Reactor-Sheriff**](https://github.com/Brybry16/Reactor-Sheriff) which is an adapted version of Woodi's Sheriff Mod that can run with and BetterPolus.~~
|
||||
|
||||
**How can I get started at Among Us Modding?**<br>
|
||||
Look at the **[Reactor documentation](https://docs.reactor.gg/)** to get started, and join **[Reactor's Discord](https://discord.gg/Zcmsb9UGuq)** to get more help from the community.
|
||||
Try to look how other plugins/mods are developed. It's really helpful to have a base to start with! Otherwise, you can try to use Reactor if you want. Look at the **[Reactor documentation](https://docs.reactor.gg/)** to get started, and join **[Reactor's Discord](https://discord.gg/Zcmsb9UGuq)** to get more help from the community.
|
||||
|
||||
## Licensing
|
||||
BetterPolus is distrbuted under the **[MIT License](LICENSE)**. While you don't have to credit me if you use or modify this mod, it's greatly appreciated!<br>
|
||||
[BepInEx](https://github.com/BepInEx/BepInEx) is distributed under the **LGPL-2.1 License**.
|
||||
|
||||
*This mod is not affiliated with Among Us or Innersloth LLC, and the content contained therein is not endorsed or otherwise sponsored by Innersloth LLC. Portions of the materials contained herein are property of Innersloth LLC. © Innersloth LLC.*
|
||||
Reference in new issue
Block a user