Files
wwdpublic/Content.Server/DeltaV/Biscuit/BiscuitSystem.cs
Debug ec51232977 Spare ID safe (#671)
* Initial commit

* Unused access level

* Update meta.json

* Update SharedBiscuitComponent.cs

* Unneeded DataField and VVAccess

Editing it in VV does nothing anyways, it wont magically unlock the item slot

* Big smart

* Add safe sprite

Thanks @TadJohnson00

Co-Authored-By: Tad "Taddy" Johnson <120885811+TadJohnson00@users.noreply.github.com>

* Prevent faxing slips

* Custom background for corperate slip

* Localize crack verb

* Update paperslips.yml

* Update paperslips.yml

* Remove default comments

* Update paperslips.yml

* Pro

* Remove default id card

* Update Resources/Prototypes/DeltaV/Entities/Objects/Specific/Command/safe.yml

Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
Signed-off-by: Debug <49997488+DebugOk@users.noreply.github.com>

---------

Signed-off-by: Debug <49997488+DebugOk@users.noreply.github.com>
Co-authored-by: Tad "Taddy" Johnson <120885811+TadJohnson00@users.noreply.github.com>
Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
2024-01-15 00:48:30 +01:00

50 lines
1.5 KiB
C#

using Content.Shared.Containers.ItemSlots;
using Content.Shared.DeltaV.Biscuit;
using Content.Shared.Verbs;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
namespace Content.Server.DeltaV.Biscuit;
public sealed class BiscuitSystem : EntitySystem
{
[Dependency] private readonly AppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly ItemSlotsSystem _slotSystem = default!;
[Dependency] private readonly AudioSystem _audioSystem = default!;
public override void Initialize()
{
SubscribeLocalEvent<BiscuitComponent, GetVerbsEvent<AlternativeVerb>>(AddCrackVerb);
}
private void AddCrackVerb(EntityUid uid, BiscuitComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanInteract || !args.CanAccess || component.Cracked)
return;
AlternativeVerb verb = new()
{
Act = () =>
{
CrackBiscuit(uid, component);
},
Text = Loc.GetString("biscuit-verb-crack"),
Priority = 2
};
args.Verbs.Add(verb);
}
private void CrackBiscuit(EntityUid uid, BiscuitComponent component)
{
component.Cracked = true;
_appearanceSystem.SetData(uid, BiscuitStatus.Cracked, true);
_audioSystem.PlayPvs("/Audio/DeltaV/Effects/crack1.ogg", uid,
AudioParams.Default.WithVariation(0.2f).WithVolume(-4f));
_slotSystem.SetLock(uid, "PaperSlip", false);
}
}