public void OnDoorInteract(DoorInteractEventArgs ev) { if (ev.Player.RoleID == 682) { if (SCP682.Config.can_PryGates && ev.Door.VDoor is PryableDoor pryableDoor) { pryableDoor.TryPryGate(); } else if (SCP682.Config.scp682_can_destroy_door) { int destroychance = Random.Range(1, 100); if (destroychance <= SCP682.Config.scp682_destroy_door_chance && ev.Door.IsBreakable) { ev.Door.TryBreakDoor(); } } } }
internal void InvokeDoorInteractEvent(Player player, Door door, ref bool allow) { if (DoorInteractEvent == null) { return; } var ev = new DoorInteractEventArgs { Player = player, Allow = allow, Door = door }; DoorInteractEvent.Invoke(ev); allow = ev.Allow; }