Skip to content

Commit

Permalink
Добавление гемофилии
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderFan committed Jun 21, 2024
1 parent 9a95663 commit dafc495
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 2 deletions.
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.Traits;

namespace Content.Server.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 @@ -6,10 +6,11 @@
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Server.Hemophilia;

namespace Content.Server.Body.Components
{
[RegisterComponent, Access(typeof(BloodstreamSystem), (typeof(ChemistrySystem)))]
[RegisterComponent, Access(typeof(BloodstreamSystem), (typeof(ChemistrySystem)), (typeof(HemophiliaSystem)))]
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.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/traits.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.
3 changes: 3 additions & 0 deletions Resources/Locale/ru-RU/ADT/traits/disabilities.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ trait-monochromacy-description = Ваши глаза получили необр
trait-nearsighted-name = Близорукость
trait-nearsighted-description = Вам требуются очки, чтобы нормально видеть.
trait-nearsighted-examined = [color=lightblue]{CAPITALIZE(POSS-ADJ($target))} глаза довольно расфокусированы. Не похоже, что {SUBJECT($target)} может видеть вещи настолько хорошо.[/color]
trait-hemophilia-name = Гемофилия
trait-hemophilia-desc = Ваша кровь сворачивается крайне плохо.
10 changes: 9 additions & 1 deletion Resources/Prototypes/ADT/Traits/neutral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
name: trait-moth-accent-name
description: trait-moth-accent-desc
components:
- type: MothAccent
- type: MothAccent

- type: trait
id: ADTHemophilia
name: trait-hemophilia-name
description: trait-hemophilia-desc
components:
- type: Hemophilia
modifier: 0.01

0 comments on commit dafc495

Please sign in to comment.