From eabd05d3b633fee70bb7a33df294f2a66430bb90 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:06:00 +0000 Subject: [PATCH] add AI defense turret + let AI unlock buttons (#2665) * change locking to use ComplexInteraction * add AI defense turret * :trollface: --------- Co-authored-by: deltanedas <@deltanedas:kde.org> --- Content.Shared/Lock/LockSystem.cs | 5 +++-- .../Entities/Objects/Weapons/Guns/turrets.yml | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 Resources/Prototypes/_DV/Entities/Objects/Weapons/Guns/turrets.yml diff --git a/Content.Shared/Lock/LockSystem.cs b/Content.Shared/Lock/LockSystem.cs index 411766d8c1f..10652800953 100644 --- a/Content.Shared/Lock/LockSystem.cs +++ b/Content.Shared/Lock/LockSystem.cs @@ -1,10 +1,10 @@ using Content.Shared.Access.Components; using Content.Shared.Access.Systems; +using Content.Shared.ActionBlocker; using Content.Shared.Construction.Components; using Content.Shared.DoAfter; using Content.Shared.Emag.Systems; using Content.Shared.Examine; -using Content.Shared.Hands.Components; using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.Popups; @@ -26,6 +26,7 @@ namespace Content.Shared.Lock; public sealed class LockSystem : EntitySystem { [Dependency] private readonly AccessReaderSystem _accessReader = default!; + [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; [Dependency] private readonly ActivatableUISystem _activatableUI = default!; [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; @@ -246,7 +247,7 @@ public bool IsLocked(Entity ent) /// public bool CanToggleLock(EntityUid uid, EntityUid user, bool quiet = true) { - if (!HasComp(user)) + if (!_actionBlocker.CanComplexInteract(user)) return false; var ev = new LockToggleAttemptEvent(user, quiet); diff --git a/Resources/Prototypes/_DV/Entities/Objects/Weapons/Guns/turrets.yml b/Resources/Prototypes/_DV/Entities/Objects/Weapons/Guns/turrets.yml new file mode 100644 index 00000000000..dcd65e7c66d --- /dev/null +++ b/Resources/Prototypes/_DV/Entities/Objects/Weapons/Guns/turrets.yml @@ -0,0 +1,17 @@ +# Shoots anything and lets doors close over it, letting it be used in AI cores "under" blast doors. +- type: entity + parent: WeaponTurretAllHostile + id: WeaponTurretAI + name: AI defense turret + description: A ballistic turret that retracts into the floor. Deployable by the station AI to defend its core against urgent threats. + components: + - type: Fixtures + fixtures: + fix1: + shape: !type:PhysShapeCircle + radius: 0.45 + density: 60 + mask: + - SmallMobMask # same as mouse, lets it go under doors but not phase through walls + layer: + - SmallMobLayer