# Releases\r
| Among Us - Version| Mod Version | Link |\r
|----------|-------------|-----------------|\r
+| 2021.4.14s| v2.2.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.2/TheOtherRoles.zip)\r
| 2021.4.12s| v2.2.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.1/TheOtherRoles.zip)\r
| 2021.4.12s| v2.2.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.0/TheOtherRoles.zip)\r
| 2021.3.31.3s| v2.1.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.1.0/TheOtherRoles.zip)\r
<details>\r
<summary>Click to show the Changelog</summary>\r
\r
+**Version 2.2.2**\r
+- Among Us version 2021.4.14s compatibility\r
+- Improved the block votes on emergency meeting option\r
+\r
**Version 2.2.1**\r
- Trickster: The vent button now has a custom texture. Fixed a bug where the Trickster could clip out of bounds when his box was close to a wall.\r
- Fixed a bug where the Bad Child's kill button went on cooldown when someone else performed a kill\r
private static class VersionShowerPatch
{
static void Postfix(VersionShower __instance) {
- string spacer = new String('\n', 21);
+ string spacer = new String('\n', 8);
string fullCredentials = $"<color=#FCCE03FF>TheOtherRoles</color> v{TheOtherRolesPlugin.Major}.{TheOtherRolesPlugin.Minor}.{TheOtherRolesPlugin.Patch}:\n- Modded by <color=#FCCE03FF>Eisbison</color> and <color=#FFEB91FF>Thunderstorm584</color>\n- Balanced with <color=#FFEB91FF>Dhalucard</color>\n- Button design by <color=#FFEB91FF>Bavari</color>";
if (__instance.text.text.Contains(spacer))
- __instance.text.text += "\n" + fullCredentials;
+ __instance.text.text = __instance.text.text + "\n" + fullCredentials;
else
- __instance.text.text += spacer + fullCredentials;
+ __instance.text.text = __instance.text.text + spacer + fullCredentials;
+ __instance.text.alignment = TMPro.TextAlignmentOptions.TopLeft;
}
}
[HarmonyPatch(typeof(PingTracker), nameof(PingTracker.Update))]
private static class PingTrackerPatch
{
- static void Postfix(VersionShower __instance)
+ static void Postfix(PingTracker __instance)
{
if (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GCDONLGCMIL.Started)
__instance.text.text += "\n<color=#FCCE03FF>TheOtherRoles</color>\nModded by <color=#FCCE03FF>Eisbison</color>";
public static CustomOption tricksterLightsOutDuration;
public static CustomOption maxNumberOfMeetings;
- public static CustomOption allowSkipOnEmergencyMeetings;
+ public static CustomOption blockSkippingInEmergencyMeetings;
+ public static CustomOption noVoteIsSelfVote;
public static string cs(Color c, string s) {
return string.Format("<color=#{0:X2}{1:X2}{2:X2}{3:X2}>{4}</color>", ToByte(c.r), ToByte(c.g), ToByte(c.b), ToByte(c.a), s);
// Other options
maxNumberOfMeetings = CustomOption.Create(3, "Number Of Meetings (excluding Mayor meeting)", 10, 0, 15, 1, null, true);
- allowSkipOnEmergencyMeetings = CustomOption.Create(4, "Allow Skips On Emergency Meetings", true);
+ blockSkippingInEmergencyMeetings = CustomOption.Create(4, "Block Skipping In Emergency Meetings", false);
+ noVoteIsSelfVote = CustomOption.Create(5, "No Vote Is Self Vote", false, blockSkippingInEmergencyMeetings);
}
}
{
__instance.enabled = false;
ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.ChildLose, false);
+ return true;
}
DestroyableSingleton<HudManager>.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray<Il2CppSystem.Object>(0)));
ReviveEveryone();
{
__instance.enabled = false;
ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.JesterWin, false);
+ return true;
}
DestroyableSingleton<HudManager>.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray<Il2CppSystem.Object>(0)));
ReviveEveryone();
{
DestroyableSingleton<HudManager>.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(StringNames.GameOverTaskWin, new Il2CppReferenceArray<Il2CppSystem.Object>(0)));
__instance.Begin();
+ return true;
}
return false;
}
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
- public const string Version = "2.2.1";
+ public const string Version = "2.2.2";
public const byte Major = 2;
public const byte Minor = 2;
- public const byte Patch = 1;
+ public const byte Patch = 2;
public Harmony Harmony { get; } = new Harmony(Id);
public static TheOtherRolesPlugin Instance;
static class MapOptions {
// Set values
public static int maxNumberOfMeetings = 10;
- public static bool allowSkipOnEmergencyMeetings = true;
+ public static bool blockSkippingInEmergencyMeetings = false;
+ public static bool noVoteIsSelfVote = false;
// Updating values
public static int meetingsCount = 0;
meetingsCount = 0;
maxNumberOfMeetings = Mathf.RoundToInt(CustomOptionHolder.maxNumberOfMeetings.getSelection());
- allowSkipOnEmergencyMeetings = CustomOptionHolder.allowSkipOnEmergencyMeetings.getBool();
+ blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.getBool();
+ noVoteIsSelfVote = CustomOptionHolder.noVoteIsSelfVote.getBool();
}
}
}
\ No newline at end of file
if (__instance.GBKFCOAKLAH.All((PlayerVoteArea ps) => ps.isDead || ps.didVote))
{
// If skipping is disabled, replace skipps/no-votes with self vote
- if (target == null && !allowSkipOnEmergencyMeetings) {
+ if (target == null && blockSkippingInEmergencyMeetings && noVoteIsSelfVote) {
foreach (PlayerVoteArea playerVoteArea in __instance.GBKFCOAKLAH) {
if (playerVoteArea.votedFor < 0) playerVoteArea.votedFor = playerVoteArea.GEIOMAPOPKA; // TargetPlayerId
}
class MeetingHudUpdatePatch {
static void Postfix(MeetingHud __instance) {
// Deactivate skip Button if skipping on emergency meetings is disabled
- if (target == null && !allowSkipOnEmergencyMeetings)
+ if (target == null && blockSkippingInEmergencyMeetings)
__instance.SkipVoteButton.gameObject.SetActive(false);
}
}
public static bool Prefix(KillButtonManager __instance) {
if (__instance.isActiveAndEnabled && __instance.CurrentTarget && !__instance.isCoolingDown && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI && PlayerControl.LocalPlayer.POECPOEKKNO) { // Among Us default checks
if (Helpers.handleMurderAttempt(__instance.CurrentTarget)) { // Custom checks
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1);
- writer.Write(PlayerControl.LocalPlayer.PlayerId);
- writer.Write(__instance.CurrentTarget.PlayerId);
- AmongUsClient.Instance.FinishRpcImmediately(writer);
- RPCProcedure.uncheckedMurderPlayer(PlayerControl.LocalPlayer.PlayerId, __instance.CurrentTarget.PlayerId);
+ if (Child.child != null && PlayerControl.LocalPlayer == Child.child) { // Not checked by official servers
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1);
+ writer.Write(PlayerControl.LocalPlayer.PlayerId);
+ writer.Write(__instance.CurrentTarget.PlayerId);
+ AmongUsClient.Instance.FinishRpcImmediately(writer);
+ RPCProcedure.uncheckedMurderPlayer(PlayerControl.LocalPlayer.PlayerId, __instance.CurrentTarget.PlayerId);
+ } else { // Checked by official servers
+ PlayerControl.LocalPlayer.RpcMurderPlayer(__instance.CurrentTarget);
+ }
__instance.SetTarget(null);
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
- <Version>2.2.1</Version>
+ <Version>2.2.2</Version>
<Description>TheOtherRoles</Description>
<Authors>Eisbison</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
- <GameVersion>2021.4.12s</GameVersion>
+ <GameVersion>2021.4.14s</GameVersion>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
- <GameVersion>2021.4.21i</GameVersion>
+ <GameVersion>2021.4.14i</GameVersion>
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
</PropertyGroup>