Ejemplo n.º 1
0
            static bool Prefix(ref KillButtonManager __instance)
            {
                if (IsSheriff(PlayerControl.LocalPlayer.PlayerId) && __instance.isActiveAndEnabled &&
                    __instance.CurrentTarget && !__instance.isCoolingDown &&
                    !PlayerControl.LocalPlayer.Data.IsImpostor && PlayerControl.LocalPlayer.CanMove)
                {
                    if (__instance.CurrentTarget.Data.IsImpostor) // target is an impostor
                    {
                        PlayerControl_FixedUpdate.RpcSheriffKill(PlayerControl.LocalPlayer,
                                                                 __instance.CurrentTarget.PlayerId);
                    }
                    else
                    {
                        if (CustomGameOptionsData.customGameOptions.doKillSheriffsTarget.value)
                        {
                            // TODO: uhm
                            PlayerControl_FixedUpdate.RpcSheriffKill(__instance.CurrentTarget,
                                                                     __instance.CurrentTarget.PlayerId);
                        }

                        PlayerControl_FixedUpdate.RpcSheriffKill(PlayerControl.LocalPlayer,
                                                                 PlayerControl.LocalPlayer.PlayerId);
                    }

                    __instance.SetTarget(null);
                    return(false);
                }

                return(true);
            }
Ejemplo n.º 2
0
            static bool Prefix(ref KillButtonManager __instance)
            {
                if (IsSheriff(PlayerControl.LocalPlayer.PlayerId) && __instance.isActiveAndEnabled &&
                    __instance.CurrentTarget && !__instance.isCoolingDown &&
                    !PlayerControl.LocalPlayer.JLGGIOLCDFC.DLPCKPBIJOE && PlayerControl.LocalPlayer.GEBLLBHGHLD)
                {
                    if (__instance.CurrentTarget.JLGGIOLCDFC.DAPKNDBLKIA) // target is an impostor
                    {
                        PlayerControl_FixedUpdate.RpcSheriffKill(PlayerControl.LocalPlayer, __instance.CurrentTarget.PlayerId);
                    }
                    else
                    {
                        if (OptionsPatches.doKillSheriffsTarget)
                        {
                            // TODO: uhm
                            PlayerControl_FixedUpdate.RpcSheriffKill(__instance.CurrentTarget, __instance.CurrentTarget.PlayerId);
                        }
                        PlayerControl_FixedUpdate.RpcSheriffKill(PlayerControl.LocalPlayer, PlayerControl.LocalPlayer.PlayerId);
                    }
                    __instance.SetTarget(null);
                    return(false);
                }

                return(true);
            }