Ejemplo n.º 1
0
        public static bool Prefix(Vent __instance, ref float __result, [HarmonyArgument(0)] GameData.PlayerInfo pc, [HarmonyArgument(1)] out bool canUse, [HarmonyArgument(2)] out bool couldUse)
        {
            float         num         = float.MaxValue;
            PlayerControl localPlayer = pc.Object;

            couldUse = (PlayerControl.LocalPlayer.isPlayerRole("Engineer") || localPlayer.Data.IsImpostor) && !localPlayer.Data.IsDead;
            canUse   = couldUse;
            if ((DateTime.UtcNow - PlayerVentTimeExtension.GetLastVent(pc.Object.PlayerId)).TotalMilliseconds > 1000)
            {
                num     = Vector2.Distance(localPlayer.GetTruePosition(), __instance.transform.position);
                canUse &= num <= __instance.UsableDistance;
            }
            __result = num;
            return(false);
        }
Ejemplo n.º 2
0
 public static void Postfix(PlayerControl NMEAPOJFNKA)
 {
     PlayerVentTimeExtension.SetLastVent(NMEAPOJFNKA.PlayerId);
 }