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>
This commit is contained in:
Debug
2024-01-15 00:48:30 +01:00
committed by GitHub
co-authored by Tad Taddy Johnson DEATHB4DEFEAT
parent 3fe758ade9
commit ec51232977
46 changed files with 646 additions and 2 deletions
@@ -0,0 +1,26 @@
using Content.Shared.DeltaV.Biscuit;
using Robust.Client.GameObjects;
namespace Content.Client.DeltaV.Biscuit;
public sealed class BiscuitSystem : VisualizerSystem<BiscuitVisualsComponent>
{
[Dependency] private readonly AppearanceSystem _appearance = default!;
protected override void OnAppearanceChange(EntityUid uid, BiscuitVisualsComponent component,
ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
_appearance.TryGetData(uid, BiscuitStatus.Cracked, out bool cracked);
args.Sprite.LayerSetVisible(BiscuitVisualLayers.Top, !cracked);
}
}
public enum BiscuitVisualLayers : byte
{
Base,
Top
}
@@ -0,0 +1,5 @@
namespace Content.Client.DeltaV.Biscuit;
[RegisterComponent]
public sealed partial class BiscuitVisualsComponent : Component
{}
@@ -0,0 +1,10 @@
using Content.Shared.DeltaV.Biscuit;
namespace Content.Server.DeltaV.Biscuit;
[RegisterComponent]
public sealed partial class BiscuitComponent : SharedBiscuitComponent
{
[DataField]
public bool Cracked { get; set; }
}
@@ -0,0 +1,49 @@
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);
}
}
+4
View File
@@ -16,6 +16,10 @@ public sealed partial class PaperComponent : SharedPaperComponent
[DataField("stampedBy")]
public List<StampDisplayInfo> StampedBy { get; set; } = new();
[DataField("canEdit")]
[ViewVariables(VVAccess.ReadWrite)]
public bool CanEdit { get; set; } = true; // DeltaV - Used for paper slips
/// <summary>
/// Stamp to be displayed on the paper, state from beauracracy.rsi
/// </summary>
+1 -1
View File
@@ -102,7 +102,7 @@ namespace Content.Server.Paper
{
// only allow editing if there are no stamps or when using a cyberpen
var editable = paperComp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, "WriteIgnoreStamps");
if (_tagSystem.HasTag(args.Used, "Write") && editable)
if (_tagSystem.HasTag(args.Used, "Write") && editable && paperComp.CanEdit)
{
var writeEvent = new PaperWriteEvent(uid, args.User);
RaiseLocalEvent(args.Used, ref writeEvent);
@@ -0,0 +1,12 @@
using Robust.Shared.Serialization;
namespace Content.Shared.DeltaV.Biscuit;
public abstract partial class SharedBiscuitComponent : Component
{}
[Serializable, NetSerializable]
public enum BiscuitStatus : byte
{
Cracked
}
Binary file not shown.
@@ -0,0 +1,3 @@
crack1.ogg taken from
https://github.com/tgstation/tgstation/blob/ebc2e02e59d36214aff1eff8250b70a7970ff43d/sound/effects/wounds/crack1.ogg
licensed under CC BY-NC-SA 3.0
@@ -0,0 +1 @@
biscuit-verb-crack = Crack
@@ -47,3 +47,5 @@ id-card-access-level-external = External
id-card-access-level-nuclear-operative = Nuclear Operative
id-card-access-level-syndicate-agent = Syndicate Agent
id-card-access-level-unused = You shouldn't see this
@@ -37,7 +37,7 @@
- id: ClothingOuterArmorCaptainCarapace
- id: NukeDisk
- id: PinpointerNuclear
- id: CaptainIDCard
# - id: CaptainIDCard # DeltaV - Replaced by the spare ID system
- id: ClothingHeadHatCaptain
- id: ClothingHandsGlovesInspection # DeltaV - ClothingHandsGlovesCaptain replaced in favour of inspection gloves
- id: ClothingNeckCloakCap
@@ -0,0 +1,3 @@
- type: accessLevel
id: DV-SpareSafe
name: id-card-access-level-unused
@@ -0,0 +1,186 @@
# Biscuits for the slips
- type: entity
parent: BaseItem
id: PaperBiscuit
name: biscuit card
description: A biscuit card. On the back, 'DO NOT DIGEST' is printed in large lettering.
components:
- type: Sprite
sprite: DeltaV/Objects/Misc/biscuits.rsi
layers:
- state: biscuit
- state: biscuit_paper
map: [ "biscuit_paper" ]
visible: false
- state: biscuit_top
map: [ "enum.BiscuitVisualLayers.Top" ]
- type: Item
size: 5
- type: Tag
tags:
- Document
- type: Appearance
- type: Damageable
damageModifierSet: Wood
- type: Biscuit
- type: BiscuitVisuals
- type: ItemSlots
slots:
PaperSlip:
name: Slip
whitelist:
tags:
- PaperSlip
locked: true
- type: ContainerContainer
containers:
PaperSlip: !type:ContainerSlot {}
- type: ItemMapper
sprite: DeltaV/Objects/Misc/biscuits.rsi
mapLayers:
biscuit_paper:
whitelist:
components:
- Paper
spriteLayers:
- biscuit_paper
- type: entity
parent: PaperBiscuit
id: PaperBiscuitFilled
suffix: Filled
components:
- type: ItemSlots
slots:
PaperSlip:
startingItem: PaperSlip
name: Slip
whitelist:
tags:
- PaperSlip
locked: true
- type: entity
parent: PaperBiscuit
id: PaperBiscuitCorporate
name: confidential biscuit card
description: A confidential biscuit card. The tasteful blue color and NT logo on the front makes it look a little like a chocolate bar.
components:
- type: Sprite
sprite: DeltaV/Objects/Misc/biscuits.rsi
layers:
- state: biscuit_secret
map: [ "enum.BiscuitVisualLayers.Base" ]
- state: biscuit_paper_corp
map: [ "biscuit_paper" ]
visible: false
- state: biscuit_secret_top
map: [ "enum.BiscuitVisualLayers.Top" ]
visible: true
- type: entity
parent: PaperBiscuitCorporate
id: PaperBiscuitCorporateFilled
suffix: Filled
components:
- type: ItemSlots
slots:
PaperSlip:
startingItem: PaperSlipCorporate
name: Slip
whitelist:
tags:
- PaperSlip
locked: true
- type: entity
parent: PaperBiscuitCorporate
id: PaperBiscuitCorporateSpareID
name: emergency access biscuit
components:
- type: ItemSlots
slots:
PaperSlip:
startingItem: PaperSlipSpareID
name: Slip
whitelist:
tags:
- PaperSlip
locked: true
# Paper slips
- type: entity
parent: BaseItem
id: PaperSlip
name: paper slip
description: A little slip of paper left over after a larger piece was cut. Whoa.
components:
- type: Sprite
sprite: DeltaV/Objects/Misc/biscuits.rsi
layers:
- state: slip
- state: slip_words
map: [ "enum.PaperVisualLayers.Writing" ]
visible: false
- type: Paper
- type: ActivatableUI
key: enum.PaperUiKey.Key
closeOnHandDeselect: false
- type: UserInterface
interfaces:
- key: enum.PaperUiKey.Key
type: PaperBoundUserInterface
- type: Item
size: 1
- type: Tag
tags:
- Document
- PaperSlip
- type: Appearance
- type: PaperVisuals
- type: Damageable
damageModifierSet: Wood
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 15
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
Ash:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
parent: PaperSlip
id: PaperSlipCorporate
name: corporate plastic card
description: A plastic card for confidential corporate matters.
components:
- type: Paper
canEdit: false
- type: Sprite
layers:
- state: corpslip
- state: corpslip_words
map: [ "enum.PaperVisualLayers.Writing" ]
visible: false
- type: PaperVisuals
backgroundImagePath: "/Textures/DeltaV/Interface/Paper/paper_background_corpcard.svg.96dpi.png"
contentMargin: 70.0, 16.0, 70.0, 16.0
maxWritableArea: 400.0, 600.0
- type: entity
parent: PaperSlipCorporate
id: PaperSlipSpareID
suffix: SpareID
name: emergency access card
description: A plastic card for confidential corporate matters. It has a magnetic strip on the back.
components:
- type: Access
tags:
- DV-SpareSafe
@@ -0,0 +1,36 @@
- type: entity
parent: FireAxeCabinet
id: SpareIdCabinet
name: spare id cabinet
description: There is a small label that reads "For emergency use only".
components:
- type: Sprite
sprite: DeltaV/Structures/Wallmounts/idcard_cabinet.rsi
layers:
- state: cabinet
- state: card
map: ["enum.ItemCabinetVisualLayers.ContainsItem"]
visible: true
- state: glass
map: ["enum.ItemCabinetVisualLayers.Door"]
- type: ItemCabinet
cabinetSlot:
ejectOnInteract: true
whitelist:
components:
- IdCard
- type: AccessReader
access: [["DV-SpareSafe"]]
- type: entity
id: SpareIdCabinetFilled
parent: [SpareIdCabinet,FireAxeCabinetFilled]
suffix: Filled
components:
- type: ItemCabinet
cabinetSlot:
startingItem: CaptainIDCard
ejectOnInteract: true
whitelist:
components:
- IdCard
+3
View File
@@ -35,3 +35,6 @@
- type: Tag
id: Wheat
- type: Tag
id: PaperSlip
@@ -43,6 +43,9 @@
whitelist:
components:
- Paper
blacklist:
tags:
- PaperSlip # DeltaV - Prevent the faxing of paper slips.
- type: GenericVisualizer
visuals:
enum.PowerDeviceVisuals.Powered:
@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100mm"
height="100mm"
viewBox="0 0 99.99999 100.00008"
id="SVGRoot"
version="1.1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="paper_background_corpcard.svg"
inkscape:export-filename="paper_background_corpcard.svg.96dpi.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
inkscape:document-units="mm"
inkscape:zoom="1.4142136"
inkscape:cx="-2.8284271"
inkscape:cy="199.05056"
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
showguides="false"
inkscape:window-width="1920"
inkscape:window-height="991"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<sodipodi:guide
position="116.74331,129.81159"
orientation="0,-1"
id="guide1"
inkscape:locked="false" />
<sodipodi:guide
position="0,101.00002"
orientation="0,540.47244"
id="guide2"
inkscape:locked="false" />
<sodipodi:guide
position="143,101.00002"
orientation="835.27559,0"
id="guide3"
inkscape:locked="false" />
<sodipodi:guide
position="143,-120.00003"
orientation="0,-540.47244"
id="guide4"
inkscape:locked="false" />
<sodipodi:guide
position="0,-120.00003"
orientation="-835.27559,0"
id="guide5"
inkscape:locked="false" />
</sodipodi:namedview>
<defs
id="defs1">
<inkscape:path-effect
effect="fillet_chamfer"
id="path-effect17"
is_visible="true"
lpeversion="1"
nodesatellites_param="F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1"
radius="0"
unit="px"
method="auto"
mode="F"
chamfer_steps="1"
flexible="false"
use_knot_distance="true"
apply_no_radius="true"
apply_with_radius="true"
only_selected="false"
hide_knots="false" />
<inkscape:path-effect
effect="fillet_chamfer"
id="path-effect16"
is_visible="true"
lpeversion="1"
nodesatellites_param="F,0,0,1,0,5,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,5,0,1"
radius="0"
unit="px"
method="auto"
mode="F"
chamfer_steps="1"
flexible="false"
use_knot_distance="true"
apply_no_radius="true"
apply_with_radius="true"
only_selected="false"
hide_knots="false" />
<inkscape:path-effect
effect="fillet_chamfer"
id="path-effect15"
is_visible="true"
lpeversion="1"
nodesatellites_param="F,0,0,1,0,0,0,1 @ F,0,0,1,0,5,0,1 @ F,0,0,1,0,5,0,1 @ F,0,0,1,0,0,0,1"
radius="0"
unit="px"
method="auto"
mode="F"
chamfer_steps="1"
flexible="false"
use_knot_distance="true"
apply_no_radius="true"
apply_with_radius="true"
only_selected="false"
hide_knots="false" />
<inkscape:path-effect
effect="fillet_chamfer"
id="path-effect12"
is_visible="true"
lpeversion="1"
nodesatellites_param="F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1"
radius="0"
unit="px"
method="auto"
mode="F"
chamfer_steps="1"
flexible="false"
use_knot_distance="true"
apply_no_radius="true"
apply_with_radius="true"
only_selected="false"
hide_knots="false" />
<linearGradient
id="linearGradient11"
inkscape:collect="always">
<stop
style="stop-color:#245ccc;stop-opacity:1;"
offset="0"
id="stop10" />
<stop
style="stop-color:#003399;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient5"
inkscape:collect="always">
<stop
style="stop-color:#003399;stop-opacity:1;"
offset="0"
id="stop5" />
<stop
style="stop-color:#245ccc;stop-opacity:1;"
offset="1"
id="stop6" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5"
id="linearGradient6"
x1="0"
y1="50"
x2="15.975"
y2="50"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11"
id="linearGradient10"
gradientUnits="userSpaceOnUse"
x1="0"
y1="50"
x2="15.975"
y2="50"
gradientTransform="translate(84.024996)" />
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
id="rect11"
transform="matrix(0.99343066,0,0,1,0.10494526,0)"
d="M 7.947263,0 H 86.46306 V 100 H 7.947263 Z"
style="fill:#ffffff;stroke:none;stroke-width:1554.8;stroke-dasharray:none"
inkscape:path-effect="#path-effect17"
inkscape:original-d="M 7.947263,0 H 86.46306 V 100 H 7.947263 Z"
sodipodi:nodetypes="ccccc" />
<path
id="rect1-5"
style="fill:url(#linearGradient6);stroke-width:484.814"
d="M 5,0 H 15.975 V 100 H 5 A 5,5 45 0 1 0,95 V 5 A 5,5 135 0 1 5,0 Z"
inkscape:path-effect="#path-effect16"
inkscape:original-d="M 0,0 H 15.975 V 100 H 0 Z" />
<path
id="rect1-5-3"
style="fill:url(#linearGradient10);stroke-width:484.814"
d="M 84.025002,0 H 95 a 5,5 45 0 1 5,5 v 90 a 5,5 135 0 1 -5,5 H 84.025002 Z"
inkscape:path-effect="#path-effect15"
inkscape:original-d="M 84.025002,0 H 100 V 100 H 84.025002 Z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

@@ -0,0 +1,2 @@
sample:
filter: true
Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

@@ -0,0 +1,41 @@
{
"version": 1,
"copyright": "Taken from TG station at https://github.com/tgstation/tgstation/blob/eda6bbfd866e4e0c8beb4d563e6d4e14c694e23e/icons/obj/service/bureaucracy.dmi | biscuit_paper_corp modified by @DebugOk on GitHub",
"license": "CC-BY-SA-3.0",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "slip"
},
{
"name": "slip_words"
},
{
"name": "corpslip"
},
{
"name": "corpslip_words"
},
{
"name": "biscuit"
},
{
"name": "biscuit_secret"
},
{
"name": "biscuit_secret_top"
},
{
"name": "biscuit_top"
},
{
"name": "biscuit_paper"
},
{
"name": "biscuit_paper_corp"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

@@ -0,0 +1,53 @@
{
"version": 1,
"license": "CC0-1.0",
"copyright": "Original work by TJohnson.",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "cabinet-empty-closed"
},
{
"name": "cabinet-empty-open"
},
{
"name": "cabinet-filled-open"
},
{
"name": "cabinet-filled-closed"
},
{
"name": "cabinet"
},
{
"name": "card"
},
{
"name": "glass"
},
{
"name": "glass-1"
},
{
"name": "glass-2"
},
{
"name": "glass-3"
},
{
"name": "glass-4"
},
{
"name": "glass-up"
},
{
"name": "unlocked"
},
{
"name": "locked"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B