Files
tbd-station-14/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs
Git-Nivrak 6d2882c7cf (Smaller) Construction PR - (IC Construction) (#2575)
* Disable Pulling When Buckling an entity

* Projectile Improvements

If you shoot at a person that is critted now it will only hit if you aim at that person otherwise go "above" him and hit other targets.
- Dead people are still unhitable

* Update Content.Server/GameObjects/Components/Buckle/BuckleComponent.cs

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>

* Firelock In Progress

* Revert "Projectile Improvements"

This reverts commit 5821afc798e49e530d4086d7a9ddbe097805fdc4.

* Firelock Graph

* Revert "Merge branch 'master' into test2"

This reverts commit c69661cc7d9dcdc6d8c0dd45770f9eb94b231463, reversing
changes made to 5f1de8b8d24cd52190addb3df5617cb1012fd52c.

* Bunch of stuff

- Metal Rods
- Reinforced Glass
- SetStackCount Condition
- Tables
- Lattice

* Output2 to FloorTileItemComponent

* Plating, Underplating and Tiles (+FloorTile Improvements)

* Turf Fixes

+ APC Electronics

* Reinforced Glass In-hand textures

* All the fixes

* Final Changes

* (Hopefully) Last commit

* Update Resources/Prototypes/Entities/Constructible/Doors/firelock_frame.yml

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>

* Update Content.Server/GameObjects/Components/Atmos/FirelockComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* A Few more things

* Edit FirelockComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-20 15:58:06 +01:00

64 lines
1.8 KiB
C#

using System.Threading.Tasks;
using Content.Server.GameObjects.Components.GUI;
using Content.Shared.GameObjects.Components;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components
{
[RegisterComponent]
[ComponentReference(typeof(SharedPlaceableSurfaceComponent))]
public class PlaceableSurfaceComponent : SharedPlaceableSurfaceComponent, IInteractUsing
{
private bool _isPlaceable;
[ViewVariables(VVAccess.ReadWrite)]
public override bool IsPlaceable
{
get => _isPlaceable;
set
{
if (_isPlaceable == value)
{
return;
}
_isPlaceable = value;
Dirty();
}
}
[ViewVariables]
int IInteractUsing.Priority => -10;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _isPlaceable, "IsPlaceable", true);
}
public override ComponentState GetComponentState()
{
return new PlaceableSurfaceComponentState(_isPlaceable);
}
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
{
if (!IsPlaceable)
return false;
if(!eventArgs.User.TryGetComponent<HandsComponent>(out var handComponent))
{
return false;
}
handComponent.Drop(eventArgs.Using);
eventArgs.Using.Transform.WorldPosition = eventArgs.ClickLocation.Position;
return true;
}
}
}