Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Faz IPCs poderem receber abraços
Browse files Browse the repository at this point in the history
Maquinas também merecem amor!
  • Loading branch information
Day-OS authored and rbertoche committed Mar 4, 2024
1 parent 05bb234 commit d8712a5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Content.Shared/Lock/LockComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public sealed partial class LockComponent : Component
[AutoNetworkedField]
public bool LockOnClick;

/// <summary>
/// Whether or not the lock is toggled by simply clicking.
/// </summary>
[DataField("unlockOnClick"), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public bool UnlockOnClick = true;


/// <summary>
/// The sound played when unlocked.
/// </summary>
Expand All @@ -52,6 +60,8 @@ public sealed partial class LockComponent : Component
[AutoNetworkedField]
public bool BreakOnEmag = true;



/// <summary>
/// Amount of do-after time needed to lock the entity.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/Lock/LockSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup a

private void OnActivated(EntityUid uid, LockComponent lockComp, ActivateInWorldEvent args)
{

if (args.Handled)
return;

// Only attempt an unlock by default on Activate
if (lockComp.Locked)
{
if (!lockComp.UnlockOnClick)
return;
TryUnlock(uid, args.User, lockComp);
args.Handled = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
popUp: "silicon-power-low"
- type: Lock
locked: true
lockOnClick: false
unlockOnClick: false
- type: InteractionPopup
successChance: 1
interactSuccessString: hugging-success-generic
interactSuccessSound: /Audio/Effects/thudswoosh.ogg
messagePerceivedByOthers: hugging-success-generic-others
- type: NpcFactionMember
factions:
- NanoTrasen
Expand Down

0 comments on commit d8712a5

Please sign in to comment.