mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00:00
* 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
37 lines
1.2 KiB
C#
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
|
|
}
|
|
}
|