/// <summary> /// Pry open a door. This does not check if the user is holding the required tool. /// </summary> private bool TryPryDoor(EntityUid target, EntityUid tool, EntityUid user, DoorComponent door) { if (door.State == DoorState.Welded) { return(false); } var canEv = new BeforeDoorPryEvent(user); RaiseLocalEvent(target, canEv, false); if (canEv.Cancelled) { // mark handled, as airlock component will cancel after generating a pop-up & you don't want to pry a tile // under a windoor. return(true); } var modEv = new DoorGetPryTimeModifierEvent(); RaiseLocalEvent(target, modEv, false); _toolSystem.UseTool(tool, user, target, 0f, modEv.PryTimeModifier * door.PryTime, door.PryingQuality, new PryFinishedEvent(), new PryCancelledEvent(), target); return(true); // we might not actually succeeded, but a do-after has started }
private void OnDoorGetPryTimeModifier(EntityUid uid, FirelockComponent component, DoorGetPryTimeModifierEvent args) { if (component.IsHoldingFire() || component.IsHoldingPressure()) { args.PryTimeModifier *= component.LockedPryTimeModifier; } }