43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using Content.Server.Body.Systems;
|
|
using Content.Server.Database;
|
|
using Content.Shared.Body.Components;
|
|
using Content.Shared.Chat.TypingIndicator;
|
|
using Content.Shared.Chemistry.Reagent;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Server._CD.Traits;
|
|
|
|
public sealed class SynthSystem : EntitySystem
|
|
{
|
|
// Begin DeltaV - make strings static readonly
|
|
private static readonly ProtoId<TypingIndicatorPrototype> RobotTypingIndicator = "robot";
|
|
private static readonly ProtoId<ReagentPrototype> SynthBloodReagent = "SynthBlood";
|
|
// End DeltaV
|
|
|
|
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SynthComponent, ComponentStartup>(OnStartup);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, SynthComponent component, ComponentStartup args)
|
|
{
|
|
if (TryComp<TypingIndicatorComponent>(uid, out var indicator))
|
|
{
|
|
indicator.TypingIndicatorPrototype = RobotTypingIndicator; // DeltaV - make strings static readonly
|
|
Dirty(uid, indicator);
|
|
}
|
|
|
|
// Begin DeltaV - Change blood amount according to original BloodstreamCompoent.ReferenceSolution volume
|
|
if (TryComp<BloodstreamComponent>(uid, out var bloodstream))
|
|
{
|
|
// Give them synth blood. Ion storm notif is handled in that system
|
|
_bloodstream.ChangeBloodReagents((uid, bloodstream), new([new(SynthBloodReagent, bloodstream.BloodReferenceSolution.Volume)]));
|
|
}
|
|
// End DeltaV
|
|
}
|
|
}
|