Add injectors + injected reagent metabolism via BloodstreamCompo… (#730)

* Add BloodstreamComponent and BloodstreamSystem

New component for metabolizing reagents that other organs like the stomach pass their input reagents to.

* Change StomachComponent to put ingested reagents in bloodstream after delay

Now StomachComponent does not metabolize any reagents. Instead, it tracks how long each reagent has been inside it, and once they pass "digestionDelay" they'll be put inside the bloodstream, where the bloodstream will handle metabolism of the reagent.

* Add reagent injectors

Injects reagents straight into the bloodstream when used on mobs with bloodstreams. Also allows draw/inject from beakers. Does not support drawing blood/reagents from the bloodstream yet.

* Address code review

Make use of `Loc` static class instead of using `ILocalizationManager`. Localize InjectorToggleMode enum properly.
This commit is contained in:
moneyl
2020-02-23 19:47:33 -05:00
committed by GitHub
parent d8291ed9c4
commit 1b7860aeda
16 changed files with 648 additions and 41 deletions

View File

@@ -0,0 +1,39 @@
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Chemistry
{
/// <summary>
/// Shared class for injectors & syringes
/// </summary>
public class SharedInjectorComponent : Component
{
public override string Name => "Injector";
public sealed override uint? NetID => ContentNetIDs.REAGENT_INJECTOR;
/// <summary>
/// Component data used for net updates. Used by client for item status ui
/// </summary>
[Serializable, NetSerializable]
protected sealed class InjectorComponentState : ComponentState
{
public int CurrentVolume { get; }
public int TotalVolume { get; }
public InjectorToggleMode CurrentMode { get; }
public InjectorComponentState(int currentVolume, int totalVolume, InjectorToggleMode currentMode) : base(ContentNetIDs.REAGENT_INJECTOR)
{
CurrentVolume = currentVolume;
TotalVolume = totalVolume;
CurrentMode = currentMode;
}
}
protected enum InjectorToggleMode
{
Inject,
Draw
}
}
}