Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Гемофилия #162

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Content.Server/ADT/Hemophilia/HemophiliaSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Server.Body.Components;
using Content.Shared.ADT.Traits;

namespace Content.Server.ADT.Hemophilia;

public sealed partial class HemophiliaSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HemophiliaComponent, MapInitEvent>(OnInitHemophilia);
SubscribeLocalEvent<HemophiliaComponent, ComponentShutdown>(OnShutdown);

}

private void OnInitHemophilia(EntityUid uid, HemophiliaComponent component, MapInitEvent args)
{
if (TryComp<BloodstreamComponent>(uid, out var bldcomp))
{
bldcomp.BleedReductionAmount *= component.Modifier;
}
}
private void OnShutdown(EntityUid uid, HemophiliaComponent component, ComponentShutdown args)
{
if (TryComp<BloodstreamComponent>(uid, out var bldcomp))
{
bldcomp.BleedReductionAmount /= component.Modifier;
}
}
}
3 changes: 2 additions & 1 deletion Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Content.Server.ADT.Hemophilia;

namespace Content.Server.Body.Components
{
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem))]
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), (typeof(HemophiliaSystem)))] // ADT Hemophilia
public sealed partial class BloodstreamComponent : Component
{
public static string DefaultChemicalsSolutionName = "chemicals";
Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/ADT/hemophilia/HemophiliaComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.Shared.ADT.Traits;

[RegisterComponent]
public sealed partial class HemophiliaComponent : Component
{
[DataField]
public float Modifier = 0.3f;


}
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/ADT/traits/disabilities.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trait-hemophilia-name = Hemophilia
trait-hemophilia-desc = Your blood is clotting extremely badly.
5 changes: 4 additions & 1 deletion Resources/Locale/ru-RU/ADT/traits/disabilities.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
trait-hemophilia-name = Гемофилия
trait-hemophilia-desc = Ваша кровь сворачивается крайне плохо.
1Stepka1 marked this conversation as resolved.
Show resolved Hide resolved

trait-monochromacy-name = Цветовая слепота
trait-monochromacy-description = Ваши глаза получили необратимые повреждения, из-за чего вы видите только в оттенках серого.
trait-monochromacy-description = Ваши глаза получили необратимые повреждения, из-за чего вы видите только в оттенках серого.
9 changes: 9 additions & 0 deletions Resources/Prototypes/ADT/Traits/disabilities.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
- type: trait
id: ADTHemophilia
name: trait-hemophilia-name
description: trait-hemophilia-desc
category: Disabilities
components:
- type: Hemophilia
modifier: 0.01

# Simple Station

- type: trait
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/ADT/Traits/speech.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
cost: 1
components:
- type: DeutschAccent

Loading