Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sec rework #413

Merged
merged 22 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Content.Client.SurveillanceCamera;
[RegisterComponent]
public sealed partial class ActiveSurveillanceCameraMonitorVisualsComponent : Component
{
public float TimeLeft = 10f;
public float TimeLeft = 2f; //ADT

public Action? OnFinish;
}
9 changes: 9 additions & 0 deletions Content.Shared/ADT/NeedTagToUse/NeedTagToUseComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Content.Shared.ADT.NeedTagToUse
{
[RegisterComponent]
public sealed partial class NeedTagToUseComponent : Component
{
[DataField]
public string Tag = "ADTBorgUse";
}
}
36 changes: 36 additions & 0 deletions Content.Shared/ADT/NeedTagToUse/NeedTagToUseSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.Tag;

namespace Content.Shared.ADT.NeedTagToUse
{
public sealed class NeedTagToUseSystem : EntitySystem
{
[Dependency] private readonly TagSystem _tagSystem = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NeedTagToUseComponent, InteractionAttemptEvent>(OnInteractionAttempt);
SubscribeLocalEvent<NeedTagToUseComponent, PickupAttemptEvent>(OnAttempt);
}

private void OnInteractionAttempt(EntityUid uid, NeedTagToUseComponent component, InteractionAttemptEvent args)
{
if (args.Target != null && !HasComp<UnremoveableComponent>(args.Target))
args.Cancelled = true;

if (HasComp<ItemComponent>(args.Target) && !HasComp<UnremoveableComponent>(args.Target))
{
if (!_tagSystem.HasAnyTag(args.Target.Value, component.Tag))
args.Cancelled = true;
}
}
private void OnAttempt(EntityUid uid, NeedTagToUseComponent component, PickupAttemptEvent args)
{
if (!_tagSystem.HasAnyTag(args.Item, component.Tag))
args.Cancel();
}
}
}
2 changes: 2 additions & 0 deletions Content.Shared/Cuffs/Components/HandcuffComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public sealed partial class HandcuffComponent : Component

[DataField, ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier EndUncuffSound = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_takeoff_end.ogg");

[DataField, ViewVariables(VVAccess.ReadWrite)] public bool BorgUse = false; ///ADT secborg
}

/// <summary>
Expand Down
66 changes: 61 additions & 5 deletions Content.Shared/Cuffs/SharedCuffableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using PullableComponent = Content.Shared.Movement.Pulling.Components.PullableComponent;
using Content.Shared.Stacks;
using System.Diagnostics.CodeAnalysis;

namespace Content.Shared.Cuffs
{
Expand All @@ -53,6 +55,7 @@ public abstract partial class SharedCuffableSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly UseDelaySystem _delay = default!;
[Dependency] private readonly SharedStackSystem _stacks = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -450,6 +453,50 @@ private void UpdateHeldItems(EntityUid uid, EntityUid handcuff, CuffableComponen
EnsureComp<UnremoveableComponent>(virtItem2.Value);
}

///ADT secborg start
/// <summary>
/// Checks if the handcuff is stackable, and creates a new handcuff entity if the stack requires it.
/// </summary>
/// <returns></returns>
public bool TrySpawnCuffSplitStack(EntityUid handcuff, EntityUid user, EntityUid target, [NotNullWhen(true)] out EntityUid? handcuffsplit)
{
if (!HasComp<HandcuffComponent>(handcuff))
{
handcuffsplit = null;
return false;
}
if (TryComp<StackComponent>(handcuff, out var stackComp))
{
if (_stacks.GetCount(handcuff, stackComp) >= 1)
{
_stacks.Use(handcuff, 1, stackComp);

if (_net.IsServer) /// let the server spawn because client mispredicts
{
var pos = Transform(target).Coordinates;
handcuffsplit = Spawn("Zipties", pos); /// This should somehow get the proto ID instead of zipties, but fuck if I know how.
return true;
}
else
{
handcuffsplit = null;
return false;
}
}
else
{
handcuffsplit = null;
return false;
}
}
else
{
handcuffsplit = handcuff;
_hands.TryDrop(user, handcuff);
return true;
}
}
///ADT secborg end
/// <summary>
/// Add a set of cuffs to an existing CuffedComponent.
/// </summary>
Expand All @@ -462,12 +509,21 @@ public bool TryAddNewCuffs(EntityUid target, EntityUid user, EntityUid handcuff,
return false;

// Success!
_hands.TryDrop(user, handcuff);
//ADT secborg start
TrySpawnCuffSplitStack(handcuff, user, target, out EntityUid? handcuffsplit);

_container.Insert(handcuff, component.Container);
UpdateHeldItems(target, handcuff, component);
return true;
if (handcuffsplit.HasValue)
{
_container.Insert(handcuffsplit.Value, component.Container);
UpdateHeldItems(target, (EntityUid) handcuffsplit, component);
return true;
}
else
{
return false;
}
}
///ADT secborg end

/// <returns>False if the target entity isn't cuffable.</returns>
public bool TryCuffing(EntityUid user, EntityUid target, EntityUid handcuff, HandcuffComponent? handcuffComponent = null, CuffableComponent? cuffable = null)
Expand All @@ -489,7 +545,7 @@ public bool TryCuffing(EntityUid user, EntityUid target, EntityUid handcuff, Han
return true;
}

if (!_hands.CanDrop(user, handcuff))
if (!_hands.CanDrop(user, handcuff) && !handcuffComponent.BorgUse) ///ADT secbotg
{
_popup.PopupClient(Loc.GetString("handcuff-component-cannot-drop-cuffs", ("target", Identity.Name(target, EntityManager, user))), user, user);
return false;
Expand Down
8 changes: 8 additions & 0 deletions Resources/Audio/ADT/Effects/Footsteps/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

- files:
- borgwalk1.ogg
- borgwalk2.ogg
- borgwalk3.ogg
license: "CC-BY-SA-4.0"
copyright: "Recorded and modified by https://github.com/MilenVolf"
source: "https://git.arumoon.ru/Workbench-Team/space-station-14/-/merge_requests/123"
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/ADT/Job/job-description.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ job-description-senior-researcher = Обучайте новых учёных о
job-description-senior-engineer = Обучайте новых инженеров основам работы силовых установок, ремонту, атмосферике и энергоснабжению станции.

job-description-senior-officer = Обучать новых офицеров основам обыска и задержания, срокам заключения и правильному обращению с огнестрельным оружием.

job-description-ADTsecborg = Держать на станции порядок, помогать СБ выполнять свою работую
3 changes: 3 additions & 0 deletions Resources/Locale/ru-RU/ADT/Job/job-names.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ job-name-ADTSpaceSecOfficer = офицер SPACE SEC
job-name-ADTSpaceSecPilot = пилот SPACE SEC
job-name-ADTSpaceSecCommander = командир SPACE SEC
job-name-ADTSpaceSecService = сотрудник SPACE SEC

job-name-ADTSecBorg = Киборг службы безопасности
JobADTSecBorg = Киборг службы безопасности
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-ADTBorgModuleDetention = модуль задержания
.desc = сожержит вспышку, кабельные стяжки и телескопическую дубинку.
ent-ADTBorgModuleHarm = модуль вреда
.desc = сожержит самозарядную лазерную винтовку и дубину для нанесения тяжких телесных повреждений.
ent-ADTBorgModuleDisabler = модуль дизаблера
.desc = сожержит дизаблер и кабельные стяжки.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-ADTLeftArmBorgSecurity = левая рука киборга-офицера
ent-ADTRightArmBorgSecurity = правая рука киборга-офицера
ent-ADTLeftLegBorgSecurity = левая нога киборга-офицера
ent-ADTRightLegBorgSecurity = правая нога киборга-офицера
ent-ADTHeadBorgSecurity = голова киборга-офицера
ent-ADTTorsoBorgSecurity = туловище киборга-офицера
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
ent-ADTClothingNeckSecBadge = жетон Службы Безопасности
.desc = Позолоченный жетон с символикой Службы Безопасности и индивидуальным номером сотрудника. Предмет особой гордости среди офицеров.
.desc = Позолоченный жетон с символикой Службы Безопасности и индивидуальным номером сотрудника. Предмет особой гордости среди офицеров.

ent-ADTClothingNeckBodyCamera = бодикамера
.desc = Носимая камера для обеспечения подотчетности и ответственности.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ADTBorgChassisSec = киборг-офицер
.desc = Прочный, сильный, быстрый, сме... справедливоносный.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ ent-ADTEctoplasmicPistol = эктоплазменный револьвер
.desc = Разнаботано специально для GhostBusters™.

ent-ADTEctoplasmicRifle = эктоплазменная винтовка
.desc = Разнаботано специально для GhostBusters™.
.desc = Разнаботано специально для GhostBusters™.


ent-ADTWeaponLaserCarbineBorg = лазерная винтовка борга
.desc = от боргов, для боргов.

ent-ADTWeaponDisablerBorg = дизаблер борга
.desc = дизаблер, не требующий зарядки.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ADTBorgflash = вспышка
.desc = Вспышка, оборудованная модулем починки.
20 changes: 2 additions & 18 deletions Resources/Maps/cog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154219,36 +154219,20 @@ entities:
- type: Transform
pos: 31.551949,51.708954
parent: 12
- proto: RiotBulletShield
- proto: Ash
entities:
- uid: 20873
components:
- type: Transform
pos: -37.44216,65.286
parent: 12
- type: Blocking
blockingToggleActionEntity: 20777
- type: ActionsContainer
- type: ContainerContainer
containers:
actions: !type:Container
ents:
- 20777
- proto: RiotLaserShield
- proto: Ash
entities:
- uid: 20850
components:
- type: Transform
pos: -37.846073,65.249306
parent: 12
- type: Blocking
blockingToggleActionEntity: 19882
- type: ActionsContainer
- type: ContainerContainer
containers:
actions: !type:Container
ents:
- 19882
- proto: RollerBedSpawnFolded
entities:
- uid: 3815
Expand Down
28 changes: 28 additions & 0 deletions Resources/Prototypes/ADT/Entities/Clothing/Neck/bodycamera.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- type: entity
parent: Clothing
id: ADTClothingNeckBodyCamera
name: bodycamera
description: Wearable camera to ensure accountability and responsibility.
components:
- type: Item
size: Small
- type: Sprite
state: icon
sprite: ADT/Clothing/Neck/bodycam.rsi
- type: Clothing
sprite: ADT/Clothing/Neck/bodycam.rsi
quickEquip: true
slots:
- neck
- type: DeviceNetwork
deviceNetId: Wireless
receiveFrequencyId: SurveillanceCameraSecurity
transmitFrequencyId: SurveillanceCamera
- type: SurveillanceCamera
networkSet: true
nameSet: true
- type: ActiveListener
range: 3
- type: Eye
- type: WirelessNetworkConnection
range: 100
20 changes: 16 additions & 4 deletions Resources/Prototypes/ADT/Entities/Markers/Spawners/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
name: magistrat
components:
- type: SpawnPoint
job_id: Magistrat
job_id: Magistrat
- type: Sprite
layers:
- state: green
Expand All @@ -39,7 +39,7 @@
name: IAA
components:
- type: SpawnPoint
job_id: IAA
job_id: IAA
- type: Sprite
layers:
- state: green
Expand Down Expand Up @@ -105,7 +105,7 @@
layers:
- state: green
- state: seniorresearcher

- type: entity
id: SpawnPointSeniorOfficer
parent: SpawnPointJobBase
Expand All @@ -116,4 +116,16 @@
- type: Sprite
layers:
- state: green
- state: seniorofficer
- state: seniorofficer

- type: entity
id: SpawnADTSecborg
parent: ADTSpawnPointJobBase
name: secborg
components:
- type: SpawnPoint
job_id: ADTSecBorg
- type: Sprite
layers:
- state: green
- state: secborg
Loading
Loading