AI Wander & Barker (#286)

* Retrofit the AI system with new IoC features.
Fixed bug with turret rotation.

* Added new AI WanderProcessor, and it works.

* RNG walking directions are a bit more random now.

* Wander now actually uses the MoverSystem to move.
Wander now talks when he reaches his destination.

* Adds a new Static Barker AI for vending machines, so that they periodically advertise their brand.

* Barker now says some generic slogans.
Misc bug cleanup.

* Removed useless UsedImplicitly attribute from AI dependencies, suppressed unused variable warnings instead.
This commit is contained in:
Acruid
2019-08-10 05:19:52 -07:00
committed by Pieter-Jan Briers
parent 4b30c7e710
commit 8b593d28c6
8 changed files with 464 additions and 26 deletions

View File

@@ -46,7 +46,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <inheritdoc />
public override void Initialize()
{
EntityQuery = new TypeEntityQuery(typeof(PlayerInputMoverComponent));
EntityQuery = new TypeEntityQuery(typeof(IMoverComponent));
var moveUpCmdHandler = InputCmdHandler.FromDelegate(
session => HandleDirChange(session, Direction.North, true),
@@ -117,14 +117,14 @@ namespace Content.Server.GameObjects.EntitySystems
{
continue;
}
var mover = entity.GetComponent<PlayerInputMoverComponent>();
var mover = entity.GetComponent<IMoverComponent>();
var physics = entity.GetComponent<PhysicsComponent>();
UpdateKinematics(entity.Transform, mover, physics);
}
}
private void UpdateKinematics(ITransformComponent transform, PlayerInputMoverComponent mover, PhysicsComponent physics)
private void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, PhysicsComponent physics)
{
if (mover.VelocityDir.LengthSquared < 0.001 || !ActionBlockerSystem.CanMove(mover.Owner))
{