* Port medibot + bot spawners from nyano * Make the injection thresholds constants * Remove warning * Check against const in system too * resolving systems just isn't worth it * only resolve entity manager once * Reduceother resolves too * fix post-merge * woops
25 lines
694 B
C#
25 lines
694 B
C#
using Content.Server.AI.EntitySystems;
|
|
|
|
namespace Content.Server.AI.Operators.Bots
|
|
{
|
|
public sealed class InjectOperator : AiOperator
|
|
{
|
|
private EntityUid _medibot;
|
|
private EntityUid _target;
|
|
public InjectOperator(EntityUid medibot, EntityUid target)
|
|
{
|
|
_medibot = medibot;
|
|
_target = target;
|
|
}
|
|
|
|
public override Outcome Execute(float frameTime)
|
|
{
|
|
var injectSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<InjectNearbySystem>();
|
|
if (injectSystem.Inject(_medibot, _target))
|
|
return Outcome.Success;
|
|
|
|
return Outcome.Failed;
|
|
}
|
|
}
|
|
}
|