Add headbutting open airlocks when you have no hands (#1433)

This commit is contained in:
DrSmugleaf
2020-07-20 16:03:05 +02:00
committed by GitHub
parent 20ca4ccd4a
commit 8e1ecb5476
3 changed files with 15 additions and 2 deletions

View File

@@ -2,12 +2,16 @@
using System.Linq;
using Content.Server.GameObjects.Components.Access;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.Interfaces.GameObjects;
using Content.Shared.GameObjects.Components.Doors;
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
@@ -145,7 +149,14 @@ namespace Content.Server.GameObjects
Deny();
return;
}
Open();
if (user.TryGetComponent(out HandsComponent hands) && hands.Count == 0)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/bang.ogg", Owner,
AudioParams.Default.WithVolume(-2));
}
}
public void Open()

View File

@@ -55,6 +55,8 @@ namespace Content.Server.GameObjects
// Mostly arbitrary.
public const float PickupRange = 2;
[ViewVariables] public int Count => _orderedHands.Count;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);

Binary file not shown.