static bool Prefix(MethodBase __originalMethod) { if (PlayerControlPatch.isSheriff(FFGALNAPKCD.LocalPlayer)) { if (PlayerControlPatch.SheriffKillTimer() == 0) { var dist = PlayerControlPatch.getDistBetweenPlayers(FFGALNAPKCD.LocalPlayer, PlayerControlPatch.closestPlayer); if (dist < KMOGFLPJLLK.JMLGACIOLIK[FFGALNAPKCD.GameOptions.DLIBONBKPKL]) { if (PlayerControlPatch.closestPlayer.NDGFFHMFGIG.DAPKNDBLKIA == false) { MessageWriter writer = FMLLKEACGIO.Instance.StartRpcImmediately(FFGALNAPKCD.LocalPlayer.NetId, (byte)CustomRPC.SheriffKill, Hazel.SendOption.None, -1); writer.Write(FFGALNAPKCD.LocalPlayer.PlayerId); writer.Write(FFGALNAPKCD.LocalPlayer.PlayerId); FMLLKEACGIO.Instance.FinishRpcImmediately(writer); FFGALNAPKCD.LocalPlayer.MurderPlayer(FFGALNAPKCD.LocalPlayer); } else { MessageWriter writer = FMLLKEACGIO.Instance.StartRpcImmediately(FFGALNAPKCD.LocalPlayer.NetId, (byte)CustomRPC.SheriffKill, Hazel.SendOption.None, -1); writer.Write(FFGALNAPKCD.LocalPlayer.PlayerId); writer.Write(PlayerControlPatch.closestPlayer.PlayerId); FMLLKEACGIO.Instance.FinishRpcImmediately(writer); FFGALNAPKCD.LocalPlayer.MurderPlayer(PlayerControlPatch.closestPlayer); } PlayerControlPatch.lastKilled = DateTime.UtcNow; } } return(false); } return(true); }
public static void Postfix(PIEFJFEOGOL __instance) { KillButton = __instance.KillButton; if (OOCJALPKPEP.Instance != null) { updateOOCJALPKPEP(OOCJALPKPEP.Instance); } UpdateGameSettingsText(__instance); if (FFGALNAPKCD.AllPlayerControls.Count > 1 & PlayerControlPatch.Sheriff != null) { if (PlayerControlPatch.isSheriff(FFGALNAPKCD.LocalPlayer)) { FFGALNAPKCD.LocalPlayer.nameText.Color = new Color(1, (float)(204.0 / 255.0), 0, 1); if (FFGALNAPKCD.LocalPlayer.NDGFFHMFGIG.DLPCKPBIJOE) { KillButton.gameObject.SetActive(false); KillButton.isActive = false; } else { KillButton.gameObject.SetActive(true); KillButton.isActive = true; KillButton.SetCoolDown(PlayerControlPatch.SheriffKillTimer(), FFGALNAPKCD.GameOptions.IGHCIKIDAMO + 15.0f); PlayerControlPatch.closestPlayer = PlayerControlPatch.getClosestPlayer(FFGALNAPKCD.LocalPlayer); double dist = PlayerControlPatch.getDistBetweenPlayers(FFGALNAPKCD.LocalPlayer, PlayerControlPatch.closestPlayer); if (dist < KMOGFLPJLLK.JMLGACIOLIK[FFGALNAPKCD.GameOptions.DLIBONBKPKL]) { KillButton.SetTarget(PlayerControlPatch.closestPlayer); } if (Input.GetKeyInt(KeyCode.Q)) { KillButton.PerformKill(); } } } else if (FFGALNAPKCD.LocalPlayer.NDGFFHMFGIG.DAPKNDBLKIA) { if (FFGALNAPKCD.LocalPlayer.NDGFFHMFGIG.DLPCKPBIJOE) { KillButton.gameObject.SetActive(false); KillButton.isActive = false; } else { KillButton.gameObject.SetActive(true); KillButton.isActive = true; } } } if (counter < 30) { counter++; return; } counter = 0; if (GameOptionMenuPatch.showSheriffOption != null && GameOptionMenuPatch.SheriffCooldown != null) { var isOptionsMenuActive = GameObject.FindObjectsOfType <PHCKLDDNJNP>().Count != 0; GameOptionMenuPatch.showSheriffOption.gameObject.SetActive(isOptionsMenuActive); GameOptionMenuPatch.SheriffCooldown.gameObject.SetActive(isOptionsMenuActive); } }