public static bool Prefix(KillButtonManager __instance) { // Block impostor shielded kill if (Medic.shielded != null && Medic.shielded == __instance.CurrentTarget) { MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.None, -1); AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.shieldedMurderAttempt(); return(false); } // Block impostor not fully grown child kill else if (Child.child != null && __instance.CurrentTarget == Child.child && !Child.isGrownUp()) { return(false); } return(true); }
static void Prefix(UnityEngine.Object obj) { if (ExileController.Instance != null && obj == ExileController.Instance.gameObject) { // Reset custom button timers where necessary CustomButton.MeetingEndedUpdate(); // Jester win condition if (Jester.jester != null && ExileController.Instance.exiled != null && ExileController.Instance.exiled.PlayerId == Jester.jester.PlayerId) { MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JesterWin, Hazel.SendOption.None, -1); AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.jesterWin(); } // Child win condition if (Child.child != null && ExileController.Instance.exiled != null && ExileController.Instance.exiled.PlayerId == Child.child.PlayerId && !Child.isGrownUp()) { MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ChildDied, Hazel.SendOption.None, -1); AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.childDied(); } } }