Replace Houdini's magical piloting locker with buckle (#1336)

This commit is contained in:
DrSmugleaf
2020-07-26 12:12:53 +02:00
committed by GitHub
parent 4e1597eeb3
commit 96ec60adab
9 changed files with 308 additions and 53 deletions

View File

@@ -81,6 +81,7 @@ namespace Content.Server.GameObjects.Components.Strap
}
/// <summary>
/// DO NOT CALL THIS DIRECTLY.
/// Adds a buckled entity. Called from <see cref="BuckleComponent.TryBuckle"/>
/// </summary>
/// <param name="buckle">The component to add</param>
@@ -107,6 +108,8 @@ namespace Content.Server.GameObjects.Components.Strap
appearance.SetData(StrapVisuals.RotationAngle, _rotation);
}
SendMessage(new StrapMessage(buckle.Owner, Owner));
return true;
}
@@ -120,6 +123,7 @@ namespace Content.Server.GameObjects.Components.Strap
if (_buckledEntities.Remove(buckle.Owner))
{
_occupiedSize -= buckle.Size;
SendMessage(new UnStrapMessage(buckle.Owner, Owner));
}
}
@@ -157,6 +161,11 @@ namespace Content.Server.GameObjects.Components.Strap
_occupiedSize = 0;
}
public override ComponentState GetComponentState()
{
return new StrapComponentState(Position);
}
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
{
if (!eventArgs.User.TryGetComponent(out BuckleComponent buckle))