Skip to content

Commit

Permalink
add AI defense turret + let AI unlock buttons (#2665)
Browse files Browse the repository at this point in the history
* change locking to use ComplexInteraction

* add AI defense turret

* :trollface:

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Jan 9, 2025
1 parent 91fc0ba commit eabd05d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Content.Shared/Lock/LockSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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!;
Expand Down Expand Up @@ -246,7 +247,7 @@ public bool IsLocked(Entity<LockComponent?> ent)
/// </summary>
public bool CanToggleLock(EntityUid uid, EntityUid user, bool quiet = true)
{
if (!HasComp<HandsComponent>(user))
if (!_actionBlocker.CanComplexInteract(user))
return false;

var ev = new LockToggleAttemptEvent(user, quiet);
Expand Down
17 changes: 17 additions & 0 deletions Resources/Prototypes/_DV/Entities/Objects/Weapons/Guns/turrets.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit eabd05d

Please sign in to comment.