From d201735ba5e8277129806279f57bd92105b4e3f0 Mon Sep 17 00:00:00 2001 From: Fooksy2304 Date: Thu, 9 Jul 2026 13:04:26 +0600 Subject: [PATCH 1/4] =?UTF-8?q?=D1=8B=D1=8B=D1=8B=D1=8B=D1=8B=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/Silicons/Borgs/BorgSystem.cs | 10 +++ .../_Lust/Borgs/BorgSystem.StandingVisuals.cs | 82 +++++++++++++++++++ .../Borgs/Components/BorgChassisComponent.cs | 12 +++ .../Mobs/Cyborgs/base_borg_chassis.yml | 5 ++ .../Entities/Mobs/Cyborgs/borg_chassis.yml | 8 ++ 5 files changed, 117 insertions(+) create mode 100644 Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs diff --git a/Content.Client/Silicons/Borgs/BorgSystem.cs b/Content.Client/Silicons/Borgs/BorgSystem.cs index 517027d0821..225cd204d7d 100644 --- a/Content.Client/Silicons/Borgs/BorgSystem.cs +++ b/Content.Client/Silicons/Borgs/BorgSystem.cs @@ -74,6 +74,13 @@ private void UpdateBorgAppearance(Entity(ent.Owner, MobStateVisuals.State, out var state, ent.Comp2)) { if (state != MobState.Alive) @@ -90,6 +97,9 @@ private void UpdateBorgAppearance(Entity ent, ref bool handled); + private void OnMMIAppearanceChanged(EntityUid uid, MMIComponent component, ref AppearanceChangeEvent args) { if (args.Sprite == null) diff --git a/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs b/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs new file mode 100644 index 00000000000..de9a3743081 --- /dev/null +++ b/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs @@ -0,0 +1,82 @@ +using Content.Shared.Mobs; +using Content.Shared.Silicons.Borgs.Components; +using Content.Shared.Standing; +using Robust.Client.GameObjects; +using Robust.Client.Graphics; + +// Lust edit start - визуал сидения боргов в отдельном файле +#pragma warning disable IDE0130 +namespace Content.Client.Silicons.Borgs; + +public sealed partial class BorgSystem +{ + partial void UpdateLustBorgStandingVisuals( + Entity ent, + ref bool handled) + { + if (!TryGetLayerState(ent, BorgVisualLayers.Body, out var bodyState)) + return; + + var alive = !_appearance.TryGetData(ent.Owner, MobStateVisuals.State, out var mobState, ent.Comp2) + || mobState == MobState.Alive; + var resting = alive + && TryComp(ent, out var standing) + && !standing.Standing; + + if (TrySetDerivedLayerState(ent, BorgVisualLayers.Resting, bodyState, "rest")) + _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Resting, resting); + + if (TrySetDerivedLayerState(ent, BorgVisualLayers.Wrecked, bodyState, "wreck")) + _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Wrecked, !alive); + + _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Body, alive && !resting); + + if (alive && !resting) + return; + + _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Light, false); + + if (_sprite.LayerExists((ent.Owner, ent.Comp3), BorgVisualLayers.LightStatus)) + _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.LightStatus, false); + + handled = true; + } + + private bool TryGetLayerState( + Entity ent, + BorgVisualLayers layer, + out string state) + { + state = string.Empty; + + if (!_sprite.LayerExists((ent.Owner, ent.Comp3), layer)) + return false; + + var stateId = _sprite.LayerGetRsiState((ent.Owner, ent.Comp3), layer, RSI.StateId.Invalid); + if (!stateId.IsValid || stateId.Name == null) + return false; + + state = stateId.Name; + return true; + } + + private bool TrySetDerivedLayerState( + Entity ent, + BorgVisualLayers layer, + string bodyState, + string suffix) + { + if (!_sprite.LayerExists((ent.Owner, ent.Comp3), layer)) + return false; + + var state = $"{bodyState}_{suffix}"; + var rsi = _sprite.LayerGetEffectiveRsi((ent.Owner, ent.Comp3), layer, RSI.StateId.Invalid); + if (rsi == null || !rsi.TryGetState(state, out _)) + return false; + + _sprite.LayerSetRsiState((ent.Owner, ent.Comp3), layer, state); + return true; + } +} +#pragma warning restore IDE0130 +// Lust edit end diff --git a/Content.Shared/Silicons/Borgs/Components/BorgChassisComponent.cs b/Content.Shared/Silicons/Borgs/Components/BorgChassisComponent.cs index d7b90a1ac2c..e58c610b74f 100644 --- a/Content.Shared/Silicons/Borgs/Components/BorgChassisComponent.cs +++ b/Content.Shared/Silicons/Borgs/Components/BorgChassisComponent.cs @@ -172,4 +172,16 @@ public enum BorgVisualLayers : byte /// Layer for the borg flashlight status. /// LightStatus, + + // Lust edit start - визуальные слои сидящего и сломанного борга + /// + /// Layer for the borg's voluntary resting state. + /// + Resting, + + /// + /// Layer for the borg's wrecked state. + /// + Wrecked, + // Lust edit end } diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 32b8eabc295..ea2ee7cec90 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -259,6 +259,11 @@ - type: Puller needsHands: false - type: StandingState + # Lust edit start - борги используют общий механизм сидения/вставания + - type: Crawler + standTime: 1 + speedModifier: 0 + # Lust edit end - type: Tag tags: - DoorBumpOpener diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml index fd66713d9cd..644e1e50ba9 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml @@ -15,6 +15,14 @@ shader: unshaded map: ["light","enum.BorgVisualLayers.LightStatus"] visible: false + # Lust edit start - слои общего визуала сидения и поломки боргов + - state: robot_rest + map: ["enum.BorgVisualLayers.Resting"] + visible: false + - state: robot_wreck + map: ["enum.BorgVisualLayers.Wrecked"] + visible: false + # Lust edit end - type: BorgChassis # Default borg can take no modules until selected type. maxModules: 0 From 0c1e9523b89c36b397776325ba66104d29ba576c Mon Sep 17 00:00:00 2001 From: Fooksy2304 Date: Thu, 9 Jul 2026 14:44:47 +0600 Subject: [PATCH 2/4] =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89?= =?UTF-8?q?=D0=B0=D0=B5=D0=BC=20=D0=B1=D0=BE=D1=80=D0=B3=D0=B0=D0=BC=20?= =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D0=B8=D0=B4=D0=B5=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Lust/Borgs/BorgSystem.StandingVisuals.cs | 6 +- .../Components/BorgRestActionComponent.cs | 32 +++++++ .../_Lust/Borgs/SharedBorgRestActionSystem.cs | 96 +++++++++++++++++++ .../en-US/_prototypes/actions/borgs.ftl | 2 + .../ru-RU/_prototypes/actions/borgs.ftl | 2 + Resources/Prototypes/Actions/borgs.yml | 15 +++ .../Entities/Mobs/Cyborgs/borg_chassis.yml | 2 + 7 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs create mode 100644 Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs diff --git a/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs b/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs index de9a3743081..2c773e0dae7 100644 --- a/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs +++ b/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs @@ -1,6 +1,6 @@ +using Content.Shared._Lust.Borgs.Components; using Content.Shared.Mobs; using Content.Shared.Silicons.Borgs.Components; -using Content.Shared.Standing; using Robust.Client.GameObjects; using Robust.Client.Graphics; @@ -19,9 +19,7 @@ partial void UpdateLustBorgStandingVisuals( var alive = !_appearance.TryGetData(ent.Owner, MobStateVisuals.State, out var mobState, ent.Comp2) || mobState == MobState.Alive; - var resting = alive - && TryComp(ent, out var standing) - && !standing.Standing; + var resting = alive && HasComp(ent); if (TrySetDerivedLayerState(ent, BorgVisualLayers.Resting, bodyState, "rest")) _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Resting, resting); diff --git a/Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs b/Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs new file mode 100644 index 00000000000..db306a02cc5 --- /dev/null +++ b/Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs @@ -0,0 +1,32 @@ +using Content.Shared._Lust.Borgs; +using Content.Shared.Actions; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Lust.Borgs.Components; + +/// +/// Adds a borg action that toggles voluntary resting. +/// +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +[Access(typeof(SharedBorgRestActionSystem))] +public sealed partial class BorgRestActionComponent : Component +{ + /// + /// Action prototype used to sit down or stand up. + /// + [DataField] + public EntProtoId ToggleAction = "ActionBorgToggleRest"; + + /// + /// Action entity currently granted to the borg. + /// + [DataField, AutoNetworkedField] + public EntityUid? ToggleActionEntity; +} + +[RegisterComponent, NetworkedComponent] +[Access(typeof(SharedBorgRestActionSystem))] +public sealed partial class BorgRestingComponent : Component; + +public sealed partial class BorgToggleRestActionEvent : InstantActionEvent; diff --git a/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs b/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs new file mode 100644 index 00000000000..91e4cd6eec2 --- /dev/null +++ b/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs @@ -0,0 +1,96 @@ +using Content.Shared._Lust.Borgs.Components; +using Content.Shared.Actions; +using Content.Shared.Rotation; +using Content.Shared.Stunnable; + +namespace Content.Shared._Lust.Borgs; + +public sealed class SharedBorgRestActionSystem : EntitySystem +{ + [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly SharedActionsSystem _actions = default!; + [Dependency] private readonly SharedStunSystem _stun = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnStartup); + SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnToggleRest); + SubscribeLocalEvent(OnRestingStartup); + SubscribeLocalEvent(OnRestingRemove); + SubscribeLocalEvent(OnKnockedDownRemove); + } + + private void OnStartup(Entity ent, ref ComponentStartup args) + { + _actions.AddAction(ent, ref ent.Comp.ToggleActionEntity, ent.Comp.ToggleAction); + UpdateActionState(ent); + } + + private void OnShutdown(Entity ent, ref ComponentShutdown args) + { + _actions.RemoveAction(ent.Owner, ent.Comp.ToggleActionEntity); + } + + private void OnToggleRest(Entity ent, ref BorgToggleRestActionEvent args) + { + if (args.Handled) + return; + + args.Handled = true; + + if (HasComp(ent)) + { + RemComp(ent); + RemComp(ent); + } + else + { + EnsureComp(ent); + + if (_stun.TryKnockdown(ent.Owner, null, refresh: true, autoStand: false, drop: false, force: true)) + SetRestingVisualRotation(ent); + else + RemComp(ent); + } + + UpdateActionState(ent); + } + + private void OnRestingStartup(Entity ent, ref ComponentStartup args) + { + if (TryComp(ent, out var borgRest)) + { + SetRestingVisualRotation(ent.Owner); + UpdateActionState((ent.Owner, borgRest)); + } + } + + private void OnRestingRemove(Entity ent, ref ComponentRemove args) + { + if (TryComp(ent, out var borgRest)) + UpdateActionState((ent.Owner, borgRest), resting: false); + } + + private void OnKnockedDownRemove(Entity ent, ref ComponentRemove args) + { + RemCompDeferred(ent); + } + + private void UpdateActionState(Entity ent) + { + UpdateActionState(ent, HasComp(ent)); + } + + private void UpdateActionState(Entity ent, bool resting) + { + _actions.SetToggled(ent.Comp.ToggleActionEntity, resting); + } + + private void SetRestingVisualRotation(EntityUid uid) + { + _appearance.SetData(uid, RotationVisuals.RotationState, RotationState.Vertical); + } +} diff --git a/Resources/Locale/en-US/_prototypes/actions/borgs.ftl b/Resources/Locale/en-US/_prototypes/actions/borgs.ftl index be6b7a6eff8..ebbda1e8b10 100644 --- a/Resources/Locale/en-US/_prototypes/actions/borgs.ftl +++ b/Resources/Locale/en-US/_prototypes/actions/borgs.ftl @@ -2,3 +2,5 @@ ent-ActionViewLaws = View Laws .desc = View the laws that you must follow. ent-ActionSelectBorgType = Select Cyborg Type .desc = { "" } +ent-ActionBorgToggleRest = Sit down + .desc = Sit down or stand up. diff --git a/Resources/Locale/ru-RU/_prototypes/actions/borgs.ftl b/Resources/Locale/ru-RU/_prototypes/actions/borgs.ftl index f577d4aa7e6..80bbae6828a 100644 --- a/Resources/Locale/ru-RU/_prototypes/actions/borgs.ftl +++ b/Resources/Locale/ru-RU/_prototypes/actions/borgs.ftl @@ -2,3 +2,5 @@ ent-ActionViewLaws = Просмотреть законы .desc = Просмотреть законы, которым вы должны следовать. ent-ActionSelectBorgType = Select Cyborg Type .desc = { "" } +ent-ActionBorgToggleRest = Сесть + .desc = Сесть или встать. diff --git a/Resources/Prototypes/Actions/borgs.yml b/Resources/Prototypes/Actions/borgs.yml index 59c008352c2..7552d58d421 100644 --- a/Resources/Prototypes/Actions/borgs.yml +++ b/Resources/Prototypes/Actions/borgs.yml @@ -26,3 +26,18 @@ useDelay: 0.5 - type: InstantAction event: !type:BorgToggleSelectTypeEvent + +- type: entity + parent: BaseToggleAction + id: ActionBorgToggleRest + name: Sit down + description: Sit down or stand up. + components: + - type: Action + itemIconStyle: NoItem + icon: + sprite: _Lust/Mobs/Silicon/chassis.rsi + state: robot_rest + useDelay: 0.5 + - type: InstantAction + event: !type:BorgToggleRestActionEvent diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml index 644e1e50ba9..d7447cd8356 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml @@ -28,6 +28,8 @@ maxModules: 0 hasMindState: robot_e noMindState: robot_e_r + # Lust edit - кнопка сидения для боргов с resting-спрайтами + - type: BorgRestAction - type: BorgTransponder sprite: sprite: Mobs/Silicon/chassis.rsi From b97c3a10937b5d137ad49b4a4cb8aa3bd1f1bd11 Mon Sep 17 00:00:00 2001 From: Fooksy2304 Date: Thu, 9 Jul 2026 17:29:50 +0600 Subject: [PATCH 3/4] =?UTF-8?q?=D1=80=D0=B5=D0=B2=D1=8C=D1=8E=20=D0=BA?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=D0=B8=D0=BA=D0=B0,=20=D0=BF=D0=BE=D1=87?= =?UTF-8?q?=D1=82=D0=B8=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=20=D0=BA=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Lust/Borgs/BorgSystem.StandingVisuals.cs | 16 +++- .../Components/BorgRestActionComponent.cs | 9 +- .../_Lust/Borgs/SharedBorgRestActionSystem.cs | 85 ++++++++++++++----- Resources/Prototypes/Actions/borgs.yml | 4 +- .../Mobs/Cyborgs/base_borg_chassis.yml | 5 -- .../Entities/Mobs/Cyborgs/borg_chassis.yml | 5 ++ 6 files changed, 95 insertions(+), 29 deletions(-) diff --git a/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs b/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs index 2c773e0dae7..1f15b648f82 100644 --- a/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs +++ b/Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs @@ -19,13 +19,19 @@ partial void UpdateLustBorgStandingVisuals( var alive = !_appearance.TryGetData(ent.Owner, MobStateVisuals.State, out var mobState, ent.Comp2) || mobState == MobState.Alive; - var resting = alive && HasComp(ent); + var resting = alive + && _appearance.TryGetData(ent.Owner, BorgRestVisuals.Resting, out var restingVisual, ent.Comp2) + && restingVisual; if (TrySetDerivedLayerState(ent, BorgVisualLayers.Resting, bodyState, "rest")) _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Resting, resting); + else + HideLayer(ent, BorgVisualLayers.Resting); if (TrySetDerivedLayerState(ent, BorgVisualLayers.Wrecked, bodyState, "wreck")) _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Wrecked, !alive); + else + HideLayer(ent, BorgVisualLayers.Wrecked); _sprite.LayerSetVisible((ent.Owner, ent.Comp3), BorgVisualLayers.Body, alive && !resting); @@ -58,6 +64,14 @@ private bool TryGetLayerState( return true; } + private void HideLayer( + Entity ent, + BorgVisualLayers layer) + { + if (_sprite.LayerExists((ent.Owner, ent.Comp3), layer)) + _sprite.LayerSetVisible((ent.Owner, ent.Comp3), layer, false); + } + private bool TrySetDerivedLayerState( Entity ent, BorgVisualLayers layer, diff --git a/Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs b/Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs index db306a02cc5..78dcd8baa89 100644 --- a/Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs +++ b/Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs @@ -2,6 +2,7 @@ using Content.Shared.Actions; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; +using Robust.Shared.Serialization; namespace Content.Shared._Lust.Borgs.Components; @@ -21,7 +22,7 @@ public sealed partial class BorgRestActionComponent : Component /// /// Action entity currently granted to the borg. /// - [DataField, AutoNetworkedField] + [AutoNetworkedField] public EntityUid? ToggleActionEntity; } @@ -30,3 +31,9 @@ public sealed partial class BorgRestActionComponent : Component public sealed partial class BorgRestingComponent : Component; public sealed partial class BorgToggleRestActionEvent : InstantActionEvent; + +[Serializable, NetSerializable] +public enum BorgRestVisuals : byte +{ + Resting, +} diff --git a/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs b/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs index 91e4cd6eec2..2bf555437a7 100644 --- a/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs +++ b/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs @@ -1,7 +1,10 @@ using Content.Shared._Lust.Borgs.Components; using Content.Shared.Actions; +using Content.Shared.Mobs.Systems; using Content.Shared.Rotation; +using Content.Shared.Silicons.Borgs.Components; using Content.Shared.Stunnable; +using Robust.Shared.Player; namespace Content.Shared._Lust.Borgs; @@ -9,6 +12,7 @@ public sealed class SharedBorgRestActionSystem : EntitySystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedActionsSystem _actions = default!; + [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SharedStunSystem _stun = default!; public override void Initialize() @@ -39,37 +43,20 @@ private void OnToggleRest(Entity ent, ref BorgToggleRes if (args.Handled) return; - args.Handled = true; - - if (HasComp(ent)) - { - RemComp(ent); - RemComp(ent); - } - else - { - EnsureComp(ent); - - if (_stun.TryKnockdown(ent.Owner, null, refresh: true, autoStand: false, drop: false, force: true)) - SetRestingVisualRotation(ent); - else - RemComp(ent); - } - - UpdateActionState(ent); + if (TryToggleRest(ent)) + args.Handled = true; } private void OnRestingStartup(Entity ent, ref ComponentStartup args) { if (TryComp(ent, out var borgRest)) - { - SetRestingVisualRotation(ent.Owner); UpdateActionState((ent.Owner, borgRest)); - } } private void OnRestingRemove(Entity ent, ref ComponentRemove args) { + ClearRestingVisual(ent.Owner); + if (TryComp(ent, out var borgRest)) UpdateActionState((ent.Owner, borgRest), resting: false); } @@ -89,8 +76,64 @@ private void UpdateActionState(Entity ent, bool resting _actions.SetToggled(ent.Comp.ToggleActionEntity, resting); } + public bool TryToggleRest(Entity ent) + { + if (!CanToggleRest(ent)) + return false; + + if (HasComp(ent)) + DoStandUp(ent); + else + DoRest(ent); + + return true; + } + + public bool CanToggleRest(Entity ent) + { + if (HasComp(ent)) + return true; + + if (!TryComp(ent, out var borg) || borg.BrainEntity == null) + return false; + + if (!HasComp(ent)) + return false; + + return _mobState.IsAlive(ent); + } + + private void DoRest(Entity ent) + { + if (!_stun.TryKnockdown(ent.Owner, null, refresh: true, autoStand: false, drop: false, force: true)) + { + ClearRestingVisual(ent); + return; + } + + EnsureComp(ent); + SetRestingVisual(ent, true); + } + + private void DoStandUp(Entity ent) + { + RemComp(ent); + RemComp(ent); + } + private void SetRestingVisualRotation(EntityUid uid) { _appearance.SetData(uid, RotationVisuals.RotationState, RotationState.Vertical); } + + private void SetRestingVisual(EntityUid uid, bool resting) + { + _appearance.SetData(uid, BorgRestVisuals.Resting, resting); + SetRestingVisualRotation(uid); + } + + private void ClearRestingVisual(EntityUid uid) + { + SetRestingVisual(uid, false); + } } diff --git a/Resources/Prototypes/Actions/borgs.yml b/Resources/Prototypes/Actions/borgs.yml index 7552d58d421..df7dfe4153b 100644 --- a/Resources/Prototypes/Actions/borgs.yml +++ b/Resources/Prototypes/Actions/borgs.yml @@ -33,11 +33,13 @@ name: Sit down description: Sit down or stand up. components: + # Lust edit start - действие сидения для боргов - type: Action itemIconStyle: NoItem icon: sprite: _Lust/Mobs/Silicon/chassis.rsi - state: robot_rest + state: robot useDelay: 0.5 - type: InstantAction event: !type:BorgToggleRestActionEvent + # Lust edit end diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index ea2ee7cec90..32b8eabc295 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -259,11 +259,6 @@ - type: Puller needsHands: false - type: StandingState - # Lust edit start - борги используют общий механизм сидения/вставания - - type: Crawler - standTime: 1 - speedModifier: 0 - # Lust edit end - type: Tag tags: - DoorBumpOpener diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml index d7447cd8356..1b965e09a3a 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml @@ -30,6 +30,11 @@ noMindState: robot_e_r # Lust edit - кнопка сидения для боргов с resting-спрайтами - type: BorgRestAction + # Lust edit start - борги с кнопкой сидения используют общий механизм вставания + - type: Crawler + standTime: 1 + speedModifier: 0 + # Lust edit end - type: BorgTransponder sprite: sprite: Mobs/Silicon/chassis.rsi From 3c1253ff90f32a32bad079e59aa6d2ee3ac83f39 Mon Sep 17 00:00:00 2001 From: Fooksy2304 Date: Sat, 25 Jul 2026 10:39:19 +0600 Subject: [PATCH 4/4] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=D1=8B,=20=D0=BA?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Lust/Borgs/SharedBorgRestActionSystem.cs | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs b/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs index 2bf555437a7..4e6fb702093 100644 --- a/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs +++ b/Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs @@ -43,7 +43,7 @@ private void OnToggleRest(Entity ent, ref BorgToggleRes if (args.Handled) return; - if (TryToggleRest(ent)) + if (TryToggleRest(ent.AsNullable())) args.Handled = true; } @@ -76,21 +76,36 @@ private void UpdateActionState(Entity ent, bool resting _actions.SetToggled(ent.Comp.ToggleActionEntity, resting); } - public bool TryToggleRest(Entity ent) + /// + /// Пытается переключить состояние отдыха борга. + /// + public bool TryToggleRest(Entity ent) { + if (!Resolve(ent, ref ent.Comp)) + return false; + if (!CanToggleRest(ent)) return false; + Entity borgRest = (ent.Owner, ent.Comp); + if (HasComp(ent)) - DoStandUp(ent); - else - DoRest(ent); + { + DoStandUp(borgRest); + return true; + } - return true; + return DoRest(borgRest); } - public bool CanToggleRest(Entity ent) + /// + /// Проверяет, может ли борг переключить состояние отдыха. + /// + public bool CanToggleRest(Entity ent, bool quiet = false) { + if (!Resolve(ent, ref ent.Comp)) + return false; + if (HasComp(ent)) return true; @@ -103,16 +118,17 @@ public bool CanToggleRest(Entity ent) return _mobState.IsAlive(ent); } - private void DoRest(Entity ent) + private bool DoRest(Entity ent) { if (!_stun.TryKnockdown(ent.Owner, null, refresh: true, autoStand: false, drop: false, force: true)) { ClearRestingVisual(ent); - return; + return false; } EnsureComp(ent); SetRestingVisual(ent, true); + return true; } private void DoStandUp(Entity ent)