mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
* actually not overhauled but tweaked i think * forgot to stage this one * make shocking 60% chance instead of 80%, and make shock dmg 5-20 random. * update comment * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * okay this should work + remember to mention new changesa asdas asd * I ALREADY STAGED ALL * important summary comments to give more important info when someone's too lazy to check the rule * fix some stuff * signs of shock * Update Resources/Prototypes/_DV/Traits/meta.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: wesker <53323309+weskified@users.noreply.github.com> * Update Resources/Prototypes/_DV/Traits/meta.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: wesker <53323309+weskified@users.noreply.github.com> * Update Resources/Locale/en-US/_DV/traits/traits.ftl Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: wesker <53323309+weskified@users.noreply.github.com> * changessss --------- Signed-off-by: wesker <53323309+weskified@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com>
65 lines
2.6 KiB
C#
65 lines
2.6 KiB
C#
using Content.Server.Body.Systems;
|
|
using Content.Server.Database;
|
|
using Content.Shared.Body.Components;
|
|
using Content.Shared.Chat.Prototypes;
|
|
using Content.Shared.Chat.TypingIndicator;
|
|
using Content.Shared.Chemistry.Reagent;
|
|
using Content.Shared.Speech.Components;
|
|
using Content.Shared.Tag;
|
|
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";
|
|
private static readonly ProtoId<TagPrototype> SyntheticEmotesTag = "SyntheticEmotes";
|
|
private static readonly ProtoId<EmoteSoundsPrototype> SyntheticEmoteSounds = "SyntheticEmoteSounds";
|
|
// End DeltaV
|
|
|
|
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
|
|
[Dependency] private readonly TagSystem _tag = default!;
|
|
[Dependency] private readonly IPrototypeManager _proto = 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
|
|
|
|
// Begin DeltaV - Add SyntheticEmotes tag and merge synthetic emote sounds into species sounds
|
|
_tag.AddTag(uid, SyntheticEmotesTag);
|
|
|
|
if (TryComp<VocalComponent>(uid, out var vocal)
|
|
&& _proto.TryIndex(SyntheticEmoteSounds, out var synthSounds)
|
|
&& vocal.EmoteSounds is { } currentSoundsId
|
|
&& _proto.TryIndex(currentSoundsId, out var currentSounds))
|
|
{
|
|
foreach (var (emoteId, sound) in synthSounds.Sounds)
|
|
{
|
|
currentSounds.Sounds.TryAdd(emoteId, sound);
|
|
}
|
|
Dirty(uid, vocal);
|
|
}
|
|
// End DeltaV
|
|
}
|
|
} |