Evac shuttle (#8931)

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-06-26 15:20:45 +10:00
committed by GitHub
parent f647c8a658
commit 521ed99766
73 changed files with 5336 additions and 188 deletions

View File

@@ -8,14 +8,11 @@ using Robust.Shared.Prototypes;
namespace Content.Server.AI.Components
{
[RegisterComponent]
[ComponentReference(typeof(IMobMoverComponent))]
[Virtual]
public class AiControllerComponent : Component, IMobMoverComponent, IMoverComponent
public class AiControllerComponent : Component
{
[DataField("logic")] private float _visionRadius = 8.0f;
public bool CanMove { get; set; } = true;
// TODO: Need to ECS a lot more of the AI first before we can ECS this
/// <summary>
/// Whether the AI is actively iterated.
@@ -46,59 +43,6 @@ namespace Content.Server.AI.Components
set => _visionRadius = value;
}
/// <inheritdoc />
protected override void Initialize()
{
base.Initialize();
// This component requires a physics component.
Owner.EnsureComponent<PhysicsComponent>();
}
/// <summary>
/// Movement speed (m/s) that the entity walks, after modifiers
/// </summary>
[ViewVariables]
public float CurrentWalkSpeed
{
get
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? component))
{
return component.CurrentWalkSpeed;
}
return MovementSpeedModifierComponent.DefaultBaseWalkSpeed;
}
}
/// <summary>
/// Movement speed (m/s) that the entity walks, after modifiers
/// </summary>
[ViewVariables]
public float CurrentSprintSpeed
{
get
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? component))
{
return component.CurrentSprintSpeed;
}
return MovementSpeedModifierComponent.DefaultBaseSprintSpeed;
}
}
public Angle LastGridAngle { get => Angle.Zero; set {} }
/// <inheritdoc />
[ViewVariables(VVAccess.ReadWrite)]
public float PushStrength { get; set; } = IMobMoverComponent.PushStrengthDefault;
/// <inheritdoc />
[ViewVariables(VVAccess.ReadWrite)]
public float GrabRange { get; set; } = IMobMoverComponent.GrabRangeDefault;
/// <summary>
/// Is the entity Sprinting (running)?
/// </summary>
@@ -111,17 +55,6 @@ namespace Content.Server.AI.Components
[ViewVariables]
public Vector2 VelocityDir { get; set; }
(Vector2 walking, Vector2 sprinting) IMoverComponent.VelocityDir =>
Sprinting ? (Vector2.Zero, VelocityDir) : (VelocityDir, Vector2.Zero);
public EntityCoordinates LastPosition { get; set; }
[ViewVariables(VVAccess.ReadWrite)]
public float StepSoundDistance { get; set; }
public void SetVelocityDirection(Direction direction, ushort subTick, bool enabled) { }
public void SetSprinting(ushort subTick, bool walking) { }
public virtual void Update(float frameTime) {}
}
}