* Fixed sprite issues with construction system (Thanks PJB!). * Storage and Hands Systems now subscribe to Transform Parent changes, and will keep their containers in sync. * Add check in Interaction System to prevent processing client-side entities on the server.
37 lines
993 B
C#
37 lines
993 B
C#
using Content.Server.Interfaces.GameObjects;
|
|
using SS14.Server.Interfaces.GameObjects;
|
|
using System;
|
|
using SS14.Shared.Interfaces.GameObjects;
|
|
|
|
namespace Content.Server.GameObjects
|
|
{
|
|
public class ItemComponent : StoreableComponent, EntitySystems.IAttackHand
|
|
{
|
|
public override string Name => "Item";
|
|
|
|
|
|
public void RemovedFromSlot()
|
|
{
|
|
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
|
|
{
|
|
component.Visible = true;
|
|
}
|
|
}
|
|
|
|
public void EquippedToSlot()
|
|
{
|
|
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
|
|
{
|
|
component.Visible = false;
|
|
}
|
|
}
|
|
|
|
public bool Attackhand(IEntity user)
|
|
{
|
|
var hands = user.GetComponent<IHandsComponent>();
|
|
hands.PutInHand(this, hands.ActiveIndex, fallback: false);
|
|
return true;
|
|
}
|
|
}
|
|
}
|