# Releases\r
| Among Us - Version| Mod Version | Link |\r
|----------|-------------|-----------------|\r
+| 2021.5.10s| v2.6.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.6.2/TheOtherRoles.zip)\r
| 2021.4.14s| v2.6.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.6.1/TheOtherRoles.zip)\r
| 2021.4.14s| v2.6.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.6.0/TheOtherRoles.zip)\r
| 2021.4.14s| v2.5.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.5.1/TheOtherRoles.zip)\r
<details>\r
<summary>Click to show the Changelog</summary>\r
\r
+**Version 2.6.2**\r
+- The Other Roles now supports the new Among Us version **2021.5.10s**\r
+- Added a chat command to kick players as the host of a lobby (/kick playerName)\r
+\r
**Version 2.6.1**\r
- Fixed a bug where the Sheriff was unable to kill the Arsonist\r
- Fixed a bug in the role assignment system\r
using System;
namespace TheOtherRoles {
+
[HarmonyPatch(typeof(OpenDoorConsole), nameof(OpenDoorConsole.Use))]
- class ToiletDoorFix {
+ class ToiletDoorFix { // Synchronize opening toilet doors among clients
public static void Prefix(OpenDoorConsole __instance) {
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.OpenToiletDoor, SendOption.None, -1);
writer.Write(__instance.MyDoor.Id);
}
}
- [HarmonyPatch(typeof(MatchMaker), nameof(MatchMaker.Start))]
- public static class MatchMakerPatch { // Reactor Region Fix
- public static void Prefix(MatchMaker __instance) {
- var parent = __instance.GetComponentInParent<Transform>().parent;
- if (parent == null) return; // Local
- var tmps = parent.GetComponentsInChildren<TextMeshPro>();
- foreach (var tmp in tmps) {
- if (tmp.name == "RegionText_TMP") {
- var region = DestroyableSingleton<ServerManager>.Instance.CurrentRegion;
- var name = DestroyableSingleton<TranslationController>.Instance.GetStringWithDefault(region.TranslateName, region.Name, Array.Empty<Il2CppSystem.Object>());
- tmp.text = name;
- break;
- }
- }
- }
- }
-
[HarmonyPatch(typeof(NotificationPopper), nameof(NotificationPopper.Update))]
- public static class NotificationPopperUpdatePatch { // Reactor Region Fix
+ public static class NotificationPopperUpdatePatch { // Fix position of notifications (e.g. player disconnected)
public static void Postfix(NotificationPopper __instance) {
if (__instance.alphaTimer > 0f) {
var pos = __instance.transform.localPosition;
- __instance.transform.localPosition = new Vector3(pos.x + 0.5f, pos.y, pos.z);
+ __instance.transform.localPosition += new Vector3(0.5f, 0f, 0f);
}
}
}
+
}
\ No newline at end of file
using BepInEx.IL2CPP;
using HarmonyLib;
using UnityEngine;
+using System.Linq;
using UnhollowerBaseLib;
namespace TheOtherRoles {
SaveManager.BodyColor = (byte)colorId;
if (PlayerControl.LocalPlayer)
PlayerControl.LocalPlayer.CmdCheckColor(colorId);
- }
+ } else if (text.ToLower().StartsWith("/kick ")) {
+ string playerName = text.Substring(6);
+ PlayerControl target = PlayerControl.AllPlayerControls.ToArray().ToList().FirstOrDefault(x => x.Data.PlayerName.Equals(playerName));
+ if (target != null && AmongUsClient.Instance != null && AmongUsClient.Instance.CanBan()) {
+ var client = AmongUsClient.Instance.GetClient(target.OwnerId);
+ if (client != null) {
+ AmongUsClient.Instance.KickPlayer(client.Id, false);
+ handled = true;
+ }
+ }
+ }
}
}
if (handled) {
public class CustomColors {
protected static Dictionary<int, string> ColorStrings = new Dictionary<int, string>();
public static List<int> lighterColors = new List<int>(){ 3, 4, 5, 7, 10, 11};
- public static int pickableColors = 12;
+ public static uint pickableColors = 12;
public static void Load() {
List<StringNames> longlist = Enumerable.ToList<StringNames>(Palette.ColorNames);
shadow = new Color32(0, 61, 54, byte.MaxValue),
isLighterColor = false });
- pickableColors += colors.Count; // Colors to show in Tab
+ pickableColors += (uint)colors.Count; // Colors to show in Tab
/** Hidden Colors **/
colors.Add(new CustomColor { longname = "Panda", shortname = "PANDA",
color = new Color32(255, 255, 255, 0),
}
public static void Postfix() {
if (!needsPatch) return;
- SaveManager.colorConfig %= (uint)CustomColors.pickableColors;
+ SaveManager.colorConfig %= CustomColors.pickableColors;
needsPatch = false;
}
}
if (isTaken(__instance, color) || color >= Palette.PlayerColors.Length) {
int num = 0;
while (num++ < 50 && (color >= CustomColors.pickableColors || isTaken(__instance, color))) {
- color = (color + 1) % (uint)CustomColors.pickableColors;
+ color = (color + 1) % CustomColors.pickableColors;
}
}
__instance.RpcSetColor((byte)color);
}
}
- [HarmonyPatch(typeof(IntroCutscene.Nested_0), nameof(IntroCutscene.Nested_0.MoveNext))]
+ [HarmonyPatch(typeof(IntroCutscene._CoBegin_d__11), nameof(IntroCutscene._CoBegin_d__11.MoveNext))]
class IntroPatch
{
- static void Prefix(IntroCutscene.Nested_0 __instance)
+ static void Prefix(IntroCutscene._CoBegin_d__11 __instance)
{
// Intro solo teams
if (PlayerControl.LocalPlayer == Jester.jester || PlayerControl.LocalPlayer == Jackal.jackal || PlayerControl.LocalPlayer == Arsonist.arsonist) {
}
// Intro display role
- static void Postfix(IntroCutscene.Nested_0 __instance)
+ static void Postfix(IntroCutscene._CoBegin_d__11 __instance)
{
List<RoleInfo> infos = RoleInfo.getRoleInfoForPlayer(PlayerControl.LocalPlayer);
if (infos.Count == 0) return;
if (PlayerControl.LocalPlayer == Lovers.lover1 || PlayerControl.LocalPlayer == Lovers.lover2)
{
PlayerControl otherLover = PlayerControl.LocalPlayer == Lovers.lover1 ? Lovers.lover2 : Lovers.lover1;
- __instance.__this.Title.text = PlayerControl.LocalPlayer.Data.IsImpostor ? "<color=#FF1919FF>Imp</color><color=#FC03BEFF>Lover</color>" : "<color=#FC03BEFF>Lover</color>";
- __instance.__this.Title.color = PlayerControl.LocalPlayer.Data.IsImpostor ? Color.white : Lovers.color;
- __instance.__this.ImpostorText.text = "You are in <color=#FC03BEFF>Love</color><color=#FFFFFFFF> with </color><color=#FC03BEFF>" + (otherLover?.Data?.PlayerName ?? "") + "</color>";
- __instance.__this.ImpostorText.gameObject.SetActive(true);
- __instance.__this.BackgroundBar.material.color = Lovers.color;
+ __instance.__4__this.Title.text = PlayerControl.LocalPlayer.Data.IsImpostor ? "<color=#FF1919FF>Imp</color><color=#FC03BEFF>Lover</color>" : "<color=#FC03BEFF>Lover</color>";
+ __instance.__4__this.Title.color = PlayerControl.LocalPlayer.Data.IsImpostor ? Color.white : Lovers.color;
+ __instance.__4__this.ImpostorText.text = "You are in <color=#FC03BEFF>Love</color><color=#FFFFFFFF> with </color><color=#FC03BEFF>" + (otherLover?.Data?.PlayerName ?? "") + "</color>";
+ __instance.__4__this.ImpostorText.gameObject.SetActive(true);
+ __instance.__4__this.BackgroundBar.material.color = Lovers.color;
}
else if (roleInfo.name == "Crewmate" || roleInfo.name == "Impostor") {}
else {
- __instance.__this.Title.text = roleInfo.name;
- __instance.__this.Title.color = roleInfo.color;
- __instance.__this.ImpostorText.gameObject.SetActive(true);
- __instance.__this.ImpostorText.text = roleInfo.introDescription;
- __instance.__this.BackgroundBar.material.color = roleInfo.color;
+ __instance.__4__this.Title.text = roleInfo.name;
+ __instance.__4__this.Title.color = roleInfo.color;
+ __instance.__4__this.ImpostorText.gameObject.SetActive(true);
+ __instance.__4__this.ImpostorText.text = roleInfo.introDescription;
+ __instance.__4__this.BackgroundBar.material.color = roleInfo.color;
}
}
}
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
- public const string VersionString = "2.6.1";
+ public const string VersionString = "2.6.2";
public static System.Version Version = System.Version.Parse(VersionString);
public Harmony Harmony { get; } = new Harmony(Id);
foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
if (!Arsonist.dousedIcons.ContainsKey(p.PlayerId)) continue;
if (p.Data.IsDead || p.Data.Disconnected) {
- Arsonist.dousedIcons[p.PlayerId].gameObject.SetActive(true);
+ Arsonist.dousedIcons[p.PlayerId].gameObject.SetActive(false);
} else {
Arsonist.dousedIcons[p.PlayerId].transform.localPosition = bottomLeft + Vector3.right * visibleCounter * 0.35f;
visibleCounter++;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
- <Version>2.6.1</Version>
+ <Version>2.6.2</Version>
<Description>TheOtherRoles</Description>
<Authors>Eisbison</Authors>
</PropertyGroup>
<PropertyGroup>
- <GameVersion>2021.4.14s</GameVersion>
- <Mappings>EoF-1141/Mappings:0.4.1</Mappings>
+ <GameVersion>2021.5.10s</GameVersion>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="*" />
+ <Reference Include="$(AmongUs)/BepInEx/core/*.dll"/>
+ <Reference Include="$(AmongUs)/BepInEx/unhollowed/*.dll"/>
</ItemGroup>
- <Target Name="Copy" AfterTargets="Reobfuscate">
- <Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" />
+ <Target Name="CopyCustomContent" AfterTargets="AfterBuild">
+ <Message Text="Second occurrence" />
+ <Copy SourceFiles="$(ProjectDir)\bin\$(Configuration)\netstandard2.1\TheOtherRoles.dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" />
</Target>
+
<!-- il2cpp newtonsoft -->
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=3.7.1.6">