Files
tbd-station-14/Content.Server/AI/Operators/Bots/InjectOperator.cs
Rane 57206eb49c Port medibot + bot spawners from nyano (#9854)
* 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
2022-07-25 10:33:31 -05:00

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;
}
}
}