Re-anchorable structures (#39542)

* Initial commit

* Reverted reinvention of an existing feature...

* Fixed two missed entries

* Added extra examine check

* AI core and high security doors visuals snap to always face south
This commit is contained in:
chromiumboy
2025-08-27 10:04:39 -05:00
committed by GitHub
parent 973689425c
commit 149bb4ca14
18 changed files with 73 additions and 1 deletions

View File

@@ -2,7 +2,6 @@ using Content.Shared.Construction.EntitySystems;
using Content.Shared.Tools; using Content.Shared.Tools;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Construction.Components namespace Content.Shared.Construction.Components
{ {

View File

@@ -102,6 +102,13 @@ public sealed partial class AnchorableSystem : EntitySystem
private void OnAnchoredExamine(EntityUid uid, AnchorableComponent component, ExaminedEvent args) private void OnAnchoredExamine(EntityUid uid, AnchorableComponent component, ExaminedEvent args)
{ {
var isAnchored = Comp<TransformComponent>(uid).Anchored; var isAnchored = Comp<TransformComponent>(uid).Anchored;
if (isAnchored && (component.Flags & AnchorableFlags.Unanchorable) == 0x0)
return;
if (!isAnchored && (component.Flags & AnchorableFlags.Anchorable) == 0x0)
return;
var messageId = isAnchored ? "examinable-anchored" : "examinable-unanchored"; var messageId = isAnchored ? "examinable-anchored" : "examinable-unanchored";
args.PushMarkup(Loc.GetString(messageId, ("target", uid))); args.PushMarkup(Loc.GetString(messageId, ("target", uid)));
} }

View File

@@ -170,6 +170,10 @@
- AiHolder - AiHolder
suffix: Empty suffix: Empty
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: WarpPoint - type: WarpPoint
blacklist: blacklist:
tags: tags:
@@ -195,6 +199,7 @@
- type: StationAiVision - type: StationAiVision
- type: InteractionOutline - type: InteractionOutline
- type: Sprite - type: Sprite
snapCardinals: true
sprite: Mobs/Silicon/station_ai.rsi sprite: Mobs/Silicon/station_ai.rsi
layers: layers:
- state: base - state: base

View File

@@ -5,6 +5,10 @@
name: sentry turret name: sentry turret
description: A high-tech autonomous weapons system designed to keep unauthorized personnel out of sensitive areas. description: A high-tech autonomous weapons system designed to keep unauthorized personnel out of sensitive areas.
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: Fixtures - type: Fixtures
fixtures: fixtures:
body: body:

View File

@@ -4,6 +4,10 @@
name: airlock name: airlock
description: It opens, it closes, and maybe crushes you. description: It opens, it closes, and maybe crushes you.
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: StationAiWhitelist - type: StationAiWhitelist
- type: MeleeSound - type: MeleeSound
soundGroups: soundGroups:

View File

@@ -6,9 +6,14 @@
placement: placement:
mode: SnapgridCenter mode: SnapgridCenter
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: StationAiWhitelist - type: StationAiWhitelist
- type: InteractionOutline - type: InteractionOutline
- type: Sprite - type: Sprite
snapCardinals: true
sprite: Structures/Doors/Airlocks/highsec/highsec.rsi sprite: Structures/Doors/Airlocks/highsec/highsec.rsi
layers: layers:
- state: closed - state: closed

View File

@@ -5,6 +5,10 @@
name: firelock name: firelock
description: Apply crowbar. description: Apply crowbar.
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: AtmosAlarmable - type: AtmosAlarmable
syncWith: syncWith:
- FireAlarm - FireAlarm

View File

@@ -5,6 +5,10 @@
abstract: true abstract: true
description: A door, where will it lead? description: A door, where will it lead?
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: InteractionOutline - type: InteractionOutline
- type: Sprite - type: Sprite
sprite: Structures/Doors/MineralDoors/metal_door.rsi sprite: Structures/Doors/MineralDoors/metal_door.rsi

View File

@@ -6,6 +6,10 @@
abstract: true abstract: true
description: Keeps the air in and the greytide out. description: Keeps the air in and the greytide out.
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: Sprite - type: Sprite
sprite: Structures/Doors/secret_door.rsi sprite: Structures/Doors/secret_door.rsi
layers: layers:

View File

@@ -7,6 +7,10 @@
placement: placement:
mode: SnapgridCenter mode: SnapgridCenter
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: StationAiWhitelist - type: StationAiWhitelist
- type: Sprite - type: Sprite
sprite: Structures/Doors/Shutters/shutters.rsi sprite: Structures/Doors/Shutters/shutters.rsi

View File

@@ -6,6 +6,10 @@
placement: placement:
mode: SnapgridCenter mode: SnapgridCenter
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: MeleeSound - type: MeleeSound
soundGroups: soundGroups:
Brute: Brute:

View File

@@ -6,6 +6,10 @@
snap: snap:
- Wallmount - Wallmount
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: Physics - type: Physics
canCollide: false canCollide: false
- type: Clickable - type: Clickable

View File

@@ -9,6 +9,10 @@
snap: snap:
- Wall - Wall
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: RangedDamageSound - type: RangedDamageSound
soundGroups: soundGroups:
Brute: Brute:

View File

@@ -8,6 +8,10 @@
snap: snap:
- Window - Window
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: MeleeSound - type: MeleeSound
soundGroups: soundGroups:
Brute: Brute:

View File

@@ -6,6 +6,10 @@
placement: placement:
mode: SnapgridCenter mode: SnapgridCenter
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: Clickable - type: Clickable
- type: Sprite - type: Sprite
sprite: Structures/catwalk.rsi sprite: Structures/catwalk.rsi

View File

@@ -4,6 +4,10 @@
name: cryogenic sleep unit name: cryogenic sleep unit
description: A super-cooled container that keeps crewmates safe during space travel. description: A super-cooled container that keeps crewmates safe during space travel.
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: Sprite - type: Sprite
noRot: true noRot: true
sprite: Structures/cryostorage.rsi sprite: Structures/cryostorage.rsi

View File

@@ -5,6 +5,10 @@
placement: placement:
mode: SnapgridCenter mode: SnapgridCenter
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: Sprite - type: Sprite
sprite: Structures/plastic_flaps.rsi sprite: Structures/plastic_flaps.rsi
state: plasticflaps state: plasticflaps

View File

@@ -6,6 +6,10 @@
placement: placement:
mode: SnapgridCenter mode: SnapgridCenter
components: components:
- type: Anchorable
flags:
- Anchorable
- type: Rotatable
- type: Clickable - type: Clickable
- type: Sprite - type: Sprite
sprite: Structures/stairs.rsi sprite: Structures/stairs.rsi