Files
Delta-v/Content.Server/_CD/Traits/SynthSystem.cs
T
Falcon d94ea1d0e1 cherrypick: PR 149 and 329 from cosmatic-drift-14/cosmatic-drift (#3409)
* Synth Trait (cosmatic-drift-14/cosmatic-drift#149 and cosmatic-drift-14/cosmatic-drift#329) from cosmatic-drift-14/cosmatic-drift

* Initial trait implementation

* Fix the trait.

* Readd fields.

* fix: required comments for code changes upstream

* feat: added excluded species field to traits.yml

* fix: switching races now disables the unsupported trait

* chore: added missing comment

* fix: requested changes

* fix: CR Round 2

* chore: missed changes in foreign file
2025-04-10 13:42:24 -04:00

37 lines
1.2 KiB
C#

using Content.Server.Body.Systems;
using Content.Server.Database;
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);
}
// Give them synth blood. Ion storm notif is handled in that system
_bloodstream.ChangeBloodReagent(uid, SynthBloodReagent); // DeltaV - make strings static readonly
}
}