Example #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);
            }
Example #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);
            }
Example #3
0
 static void Postfix(ref PlayerControl __instance)
 {
     __instance.Data.IsImpostor = trueImpost;
     if (IsSheriff(__instance.PlayerId))
     {
         PlayerControl_FixedUpdate.SetSheriffKillTimer(__instance, CustomGameOptionsData.customGameOptions.sheriffKillCd.value);
     }
 }
Example #4
0
 static void Postfix()
 {
     if (DestroyableSingleton <TutorialManager> .InstanceExists || !ShipStatus.Instance.IsGameOverDueToDeath())
     {
         if (IsSheriff(PlayerControl.LocalPlayer.PlayerId) && !PlayerControl.LocalPlayer.Data.IsDead)
         {
             PlayerControl_FixedUpdate.SetSheriffKillTimer(PlayerControl.LocalPlayer,
                                                           CustomGameOptionsData.customGameOptions.sheriffKillCd.value);
         }
     }
 }
Example #5
0
            static bool Prefix(byte HKHMBLJFLMC, MessageReader ALMCIJKELCP)
            {
                switch ((CustomRpc)HKHMBLJFLMC)
                {
                case CustomRpc.SelectSheriffs:
                    sheriffs = ALMCIJKELCP.ReadBytesAndSize().ToList();
                    break;

                case CustomRpc.SheriffKill:
                    var sheriff = GameData.Instance.GetPlayerById(ALMCIJKELCP.ReadByte())?.Object;
                    PlayerControl_FixedUpdate.SheriffKill(sheriff, ALMCIJKELCP.ReadByte());
                    break;

                default:
                    return(true);
                }

                return(false);
            }
Example #6
0
 static void Postfix()
 {
     PlayerControl_FixedUpdate.SetSheriffKillTimer(PlayerControl.LocalPlayer,
                                                   10f); // FIXED: ability to kill on intro scene
 }