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 = (EngineerPlayer.IsPlayerEngineer(PlayerControl.LocalPlayer) || 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 bool Prefix(PlayerControl NMEAPOJFNKA)
 {
     PlayerVentTimeExtension.SetLastVent(NMEAPOJFNKA.PlayerId);
     return(true);
 }
Ejemplo n.º 3
0
 public static void Prefix(PlayerControl NMEAPOJFNKA)
 {
     PlayerVentTimeExtension.SetLastVent(NMEAPOJFNKA.PlayerId);
 }