@@ -17,7 +17,6 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -227,7 +226,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
|
||||
private void ModifyComponents()
|
||||
{
|
||||
if (!_isCollidableWhenOpen && Owner.TryGetComponent<IPhysBody>(out var physics))
|
||||
if (!_isCollidableWhenOpen && Owner.TryGetComponent<IPhysicsComponent>(out var physics))
|
||||
{
|
||||
if (Open)
|
||||
{
|
||||
@@ -253,10 +252,10 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
protected virtual bool AddToContents(IEntity entity)
|
||||
{
|
||||
if (entity == Owner) return false;
|
||||
if (entity.TryGetComponent(out IPhysBody? entityPhysicsComponent))
|
||||
if (entity.TryGetComponent(out IPhysicsComponent? entityPhysicsComponent))
|
||||
{
|
||||
if(MaxSize < entityPhysicsComponent.GetWorldAABB().Size.X
|
||||
|| MaxSize < entityPhysicsComponent.GetWorldAABB().Size.Y)
|
||||
if(MaxSize < entityPhysicsComponent.WorldAABB.Size.X
|
||||
|| MaxSize < entityPhysicsComponent.WorldAABB.Size.Y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -286,7 +285,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
if(Contents.Remove(contained))
|
||||
{
|
||||
contained.Transform.WorldPosition = ContentsDumpPosition();
|
||||
if (contained.TryGetComponent<IPhysBody>(out var physics))
|
||||
if (contained.TryGetComponent<IPhysicsComponent>(out var physics))
|
||||
{
|
||||
physics.CanCollide = true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.GameObjects.Components.GUI;
|
||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||
using Content.Server.Throw;
|
||||
using Content.Shared.GameObjects;
|
||||
using Content.Shared.GameObjects.Components.Items;
|
||||
using Content.Shared.GameObjects.Components.Storage;
|
||||
@@ -13,7 +14,6 @@ using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
@@ -87,8 +87,8 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out IPhysBody physics) &&
|
||||
physics.BodyType == BodyType.Static)
|
||||
if (Owner.TryGetComponent(out IPhysicsComponent physics) &&
|
||||
physics.Anchored)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -141,22 +141,22 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
var targetLocation = eventArgs.Target.Transform.Coordinates;
|
||||
var dirVec = (targetLocation.ToMapPos(Owner.EntityManager) - sourceLocation.ToMapPos(Owner.EntityManager)).Normalized;
|
||||
|
||||
float throwForce;
|
||||
var throwForce = 1.0f;
|
||||
|
||||
switch (eventArgs.Severity)
|
||||
{
|
||||
case ExplosionSeverity.Destruction:
|
||||
throwForce = 30.0f;
|
||||
throwForce = 3.0f;
|
||||
break;
|
||||
case ExplosionSeverity.Heavy:
|
||||
throwForce = 20.0f;
|
||||
throwForce = 2.0f;
|
||||
break;
|
||||
default:
|
||||
throwForce = 10.0f;
|
||||
case ExplosionSeverity.Light:
|
||||
throwForce = 1.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
Owner.TryThrow(dirVec * throwForce);
|
||||
Owner.Throw(throwForce, targetLocation, sourceLocation, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user