Skip to content

Commit

Permalink
секборг
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratyyy committed Sep 6, 2024
1 parent 0976650 commit 61bc29d
Show file tree
Hide file tree
Showing 66 changed files with 660 additions and 18 deletions.
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 = Киборг службы безопасности
4 changes: 4 additions & 0 deletions Resources/Locale/ru-RU/ADT/Objects/Specific/borg.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ent-ADTBorgChassisSec = киборг-офицер
.desc = Прочный, сильный, быстрый, сме... справедливоносный.
ent-ADTBorgChassisPeace = мирохранитель
.desc = Создан для любви, сохранения мира и обнимашек.
6 changes: 6 additions & 0 deletions Resources/Locale/ru-RU/ADT/Objects/Specific/borg_modules.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-ADTBorgModuleDetention = модуль задержания
.desc = сожержит вспышку, кабельные стяжки и телескопическую дубинку.
ent-ADTBorgModuleHarm = модуль вреда
.desc = сожержит самозарядную лазерную винтовку и дубину для нанесения тяжких телесных повреждений.
ent-ADTBorgModuleDisabler = модуль дизаблера
.desc = сожержит дизаблер и кабельные стяжки.
12 changes: 12 additions & 0 deletions Resources/Locale/ru-RU/ADT/Objects/Specific/borg_parts.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ent-ADTLeftArmBorgSecurity = левая рука киборга-офицера
.desc = { ent-BaseBorgArmLeft.desc }
ent-ADTRightArmBorgSecurity = правая рука киборга-офицера
.desc = { ent-BaseBorgArmRight.desc }
ent-ADTLeftLegBorgSecurity = левая нога киборга-офицера
.desc = { ent-BaseBorgLegLeft.desc }
ent-ADTRightLegBorgSecurity = правая нога киборга-офицера
.desc = { ent-BaseBorgLegRight.desc }
ent-ADTHeadBorgSecurity = голова киборга-офицера
.desc = { ent-BaseBorgHead.desc }
ent-ADTTorsoBorgSecurity = туловище киборга-офицера
.desc = { ent-BaseBorgTorso.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: 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
103 changes: 103 additions & 0 deletions Resources/Prototypes/ADT/Entities/Mobs/Silicons/borg_chassis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
- type: entity
id: ADTBorgChassisPeace
parent: BaseBorgChassisNT
name: peace maker
components:
- type: Sprite
layers:
- state: peace
map: ["movement"]
- state: peace_e_r
map: ["enum.BorgVisualLayers.Light"]
shader: unshaded
visible: false
- state: peace_l
shader: unshaded
map: ["light"]
visible: false
- type: BorgChassis
maxModules: 4
moduleWhitelist:
tags:
- BorgModuleGeneric
- ADTBorgModuleSecurity
hasMindState: peace_e
noMindState: peace_e_r
- type: BorgTransponder
sprite:
sprite: Mobs/Silicon/chassis.rsi
state: peace
name: peace maker
- type: IntrinsicRadioTransmitter
channels:
- Security
- Binary
- Common
- Science
- type: ActiveRadio
channels:
- Security
- Binary
- Common
- Science
- type: AccessReader
access: [["Secutity"], ["Command"], ["Research"]]
- type: Inventory
templateId: borgTall
- type: InteractionPopup
interactSuccessString: petting-success-salvage-cyborg
interactFailureString: petting-failure-salvage-cyborg
interactSuccessSound:
path: /Audio/Ambience/Objects/periodic_beep.ogg

- type: entity
id: ADTBorgChassisSec
parent: ADTBorgChassisPeace
name: sec borg
components:
- type: Sprite
sprite: ADT/Mobs/Silicon/chassis.rsi
layers:
- state: sec
map: ["movement"]
- state: sec_e_r
map: ["enum.BorgVisualLayers.Light"]
shader: unshaded
visible: false
- state: sec_l
shader: unshaded
map: ["light"]
visible: false
- type: BorgChassis
maxModules: 4
moduleWhitelist:
tags:
- BorgModuleGeneric
- ADTBorgModuleSecurity
hasMindState: sec_e
noMindState: sec_e_r
- type: BorgTransponder
sprite:
sprite: ADT/Mobs/Silicon/chassis.rsi
state: sec
- type: Construction
node: security

- type: entity
id: ADTPlayerSecBorgGeneric
parent: ADTBorgChassisSec
suffix: Battery, Tools
components:
- type: ContainerFill
containers:
borg_brain:
- PositronicBrain
borg_module:
- ADTBorgModuleDetention
- type: ItemSlots
slots:
cell_slot:
name: power-cell-slot-component-slot-name-default
startingItem: PowerCellMedium
- type: RandomMetadata
nameSegments: [names_borg]
34 changes: 34 additions & 0 deletions Resources/Prototypes/ADT/Entities/Objects/Misc/handcuffs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- type: entity
id: ADTInfCablecuffs
parent: Zipties
sufix: lingering, 1
components:
- type: Handcuff
breakoutTime: 3
cuffedRSI: Objects/Misc/cablecuffs.rsi # cablecuffs will look fine
bodyIconState: body-overlay
breakOnRemove: true
brokenPrototype: ZiptiesBroken
startCuffSound:
path: /Audio/Items/Handcuffs/ziptie_start.ogg
endCuffSound:
path: /Audio/Items/Handcuffs/ziptie_end.ogg
startUncuffSound:
path: /Audio/Items/Handcuffs/rope_start.ogg
endUncuffSound:
path: /Audio/Items/Handcuffs/rope_breakout.ogg
startBreakoutSound:
path: /Audio/Items/Handcuffs/rope_takeoff.ogg
borgUse: true
- type: Stack
lingering: true
stackType: Zipties
count: 1

- type: stack
id: Zipties
name: zipties
icon: { sprite: "/Textures/Objects/Misc/zipties.rsi", state: cuff }
spawn: Zipties
maxCount: 5
itemSize: 2
Loading

0 comments on commit 61bc29d

Please sign in to comment.