# Releases
| Among Us - Version| Mod Version | Link |
|----------|-------------|-----------------|
+| 2021.6.30s| v2.8.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.8.1/TheOtherRoles.zip)
| 2021.6.30s| v2.8.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.8.0/TheOtherRoles.zip)
| 2021.6.30s| v2.7.3| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.7.3/TheOtherRoles.zip)
| 2021.6.15s| v2.7.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.7.1/TheOtherRoles.zip)
<details>
<summary>Click to show the Changelog</summary>
+**Hotfix 2.8.1**
+- Fixed a game breaking bug where killing the Bait resulted in a ban of the Bait
+
**Version 2.8.0**
- **New Role:** [Bait](#bait) created by [Mallöris](https://github.com/Mallaris)
- Added Tracker Option: "Tracker Reset Target After Meeting" (feature created by [MaximeGillot](https://github.com/MaximeGillot))
return true;
}
+ public static void handleVampireBiteOnBodyReport() {
+ // Murder the bitten player before the meeting starts or reset the bitten player
+ if (Vampire.bitten != null && !Vampire.bitten.Data.IsDead && Helpers.handleMurderAttempt(Vampire.bitten, true)) {
+ MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
+ AmongUsClient.Instance.FinishRpcImmediately(killWriter);
+ RPCProcedure.vampireTryKill();
+ } else {
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
+ writer.Write(byte.MaxValue);
+ writer.Write(byte.MaxValue);
+ AmongUsClient.Instance.FinishRpcImmediately(writer);
+ RPCProcedure.vampireSetBitten(byte.MaxValue, byte.MaxValue);
+ }
+ }
+
public static void refreshRoleDescription(PlayerControl player) {
if (player == null) return;
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
- public const string VersionString = "2.8.0";
+ public const string VersionString = "2.8.1";
public static System.Version Version = System.Version.Parse(VersionString);
public Harmony Harmony { get; } = new Harmony(Id);
Bait.reportDelay -= Time.fixedDeltaTime;
DeadPlayer deadPlayer = deadPlayers?.Where(x => x.player?.PlayerId == Bait.bait.PlayerId)?.FirstOrDefault();
if (deadPlayer.killerIfExisting != null && Bait.reportDelay <= 0f) {
- deadPlayer.killerIfExisting.CmdReportDeadBody(Bait.bait.Data);
+
+ Helpers.handleVampireBiteOnBodyReport(); // Manually call Vampire handling, since the CmdReportDeadBody Prefix won't be called
+ RPCProcedure.uncheckedCmdReportDeadBody(deadPlayer.killerIfExisting.PlayerId, Bait.bait.PlayerId);
+
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedCmdReportDeadBody, Hazel.SendOption.Reliable, -1);
+ writer.Write(deadPlayer.killerIfExisting.PlayerId);
+ writer.Write(Bait.bait.PlayerId);
+ AmongUsClient.Instance.FinishRpcImmediately(writer);
Bait.reported = true;
}
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.CmdReportDeadBody))]
class PlayerControlCmdReportDeadBodyPatch {
public static void Prefix(PlayerControl __instance) {
- // Murder the bitten player before the meeting starts or reset the bitten player
- if (Vampire.bitten != null && !Vampire.bitten.Data.IsDead && Helpers.handleMurderAttempt(Vampire.bitten, true)) {
- MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
- AmongUsClient.Instance.FinishRpcImmediately(killWriter);
- RPCProcedure.vampireTryKill();
- } else {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
- writer.Write(byte.MaxValue);
- writer.Write(byte.MaxValue);
- AmongUsClient.Instance.FinishRpcImmediately(writer);
- RPCProcedure.vampireSetBitten(byte.MaxValue, byte.MaxValue);
- }
+ Helpers.handleVampireBiteOnBodyReport();
}
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.RpcMurderPlayer))]
VersionHandshake,
UseUncheckedVent,
UncheckedMurderPlayer,
+ UncheckedCmdReportDeadBody,
// Role functionality
if (source != null && target != null) source.MurderPlayer(target);
}
+ public static void uncheckedCmdReportDeadBody(byte sourceId, byte targetId) {
+ PlayerControl source = Helpers.playerById(sourceId);
+ PlayerControl target = Helpers.playerById(targetId);
+ if (source != null && target != null) source.ReportDeadBody(target.Data);
+ }
+
+
// Role functionality
public static void engineerFixLights() {
byte target = reader.ReadByte();
RPCProcedure.uncheckedMurderPlayer(source, target);
break;
+ case (byte)CustomRPC.UncheckedCmdReportDeadBody:
+ byte reportSource = reader.ReadByte();
+ byte reportTarget = reader.ReadByte();
+ RPCProcedure.uncheckedCmdReportDeadBody(reportSource, reportTarget);
+ break;
// Role functionality
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
- <Version>2.8.0</Version>
+ <Version>2.8.1</Version>
<Description>TheOtherRoles</Description>
<Authors>Eisbison</Authors>
</PropertyGroup>