mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
[ADD] Blue blood trait (#1050)
* trait * en ftl * Update traits.yml * Update Content.Server/_White/Traits/BlueBloodTraitSystem.cs Co-authored-by: Remuchi <72476615+Remuchi@users.noreply.github.com> * metabolizer --------- Co-authored-by: Remuchi <72476615+Remuchi@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
using Content.Server.Limbus.Traits;
|
||||
using Content.Server._White.Traits; //wwdp blue blood trait
|
||||
|
||||
namespace Content.Server.Body.Components
|
||||
{
|
||||
@@ -46,7 +47,7 @@ namespace Content.Server.Body.Components
|
||||
/// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
[Access(typeof(MetabolizerSystem), typeof(LiquorLifelineSystem), typeof(VampirismSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
|
||||
[Access(typeof(MetabolizerSystem), typeof(LiquorLifelineSystem), typeof(VampirismSystem), typeof(BlueBloodTraitSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends //wwdp blue blood trait
|
||||
public HashSet<ProtoId<MetabolizerTypePrototype>>? MetabolizerTypes = null;
|
||||
|
||||
/// <summary>
|
||||
|
||||
14
Content.Server/_White/Traits/BlueBloodTraitComponent.cs
Normal file
14
Content.Server/_White/Traits/BlueBloodTraitComponent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Content.Shared.Body.Prototypes;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server._White.Traits;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class BlueBloodTraitComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public HashSet<ProtoId<MetabolizerTypePrototype>> MetabolizerPrototype = new() { "Arachnid" };
|
||||
|
||||
[DataField]
|
||||
public string Blood = "CopperBlood";
|
||||
}
|
||||
50
Content.Server/_White/Traits/BlueBloodTraitSystem.cs
Normal file
50
Content.Server/_White/Traits/BlueBloodTraitSystem.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Shared._Shitmed.Body.Organ;
|
||||
using Content.Shared.Body.Organ;
|
||||
using Content.Shared.Body.Systems;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using static Content.Server.Power.Pow3r.PowerState;
|
||||
|
||||
namespace Content.Server._White.Traits;
|
||||
public sealed class BlueBloodTraitSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
|
||||
[Dependency] private readonly SharedBodySystem _bodySys = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<BlueBloodTraitComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, BlueBloodTraitComponent component, MapInitEvent args)
|
||||
{
|
||||
if (TryComp<BloodstreamComponent>(uid, out var bloodstream))
|
||||
{
|
||||
_bloodstream.TryModifyBloodLevel(uid, 0, bloodstream, false);
|
||||
_bloodstream.ChangeBloodReagent(uid, component.Blood, bloodstream);
|
||||
_bloodstream.TryModifyBloodLevel(uid, bloodstream.BloodMaxVolume, bloodstream, false);
|
||||
}
|
||||
|
||||
if (TryGetMetabolizer(uid, out var metabolizer) && metabolizer != null)
|
||||
metabolizer.Value.Comp.MetabolizerTypes = component.MetabolizerPrototype;
|
||||
}
|
||||
|
||||
private bool TryGetMetabolizer(EntityUid uid, out Entity<MetabolizerComponent>? metabolizer)
|
||||
{
|
||||
metabolizer = null;
|
||||
|
||||
foreach (var (organId, _) in _bodySys.GetBodyOrgans(uid))
|
||||
{
|
||||
if (TryComp(organId, out MetabolizerComponent? metabolizerComp))
|
||||
{
|
||||
metabolizer = (organId, metabolizerComp);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -6,3 +6,6 @@ trait-description-Contract = You signed paper with your own blood, what could go
|
||||
|
||||
trait-name-StudioVisor = Studio Visor
|
||||
trait-description-StudioVisor = A studio-grade visor is installed in your vision sensors, which significantly reduces the intensity of CRT-like visual effects and glitches caused by damage or low health.
|
||||
|
||||
trait-name-BlueBlood = Blue Blood
|
||||
trait-description-BlueBlood = The hemocyanin in your blood uses copper to transport oxygen. As a result, your blood is blue and requires copper instead of iron to replenish it.
|
||||
|
||||
@@ -6,3 +6,6 @@ trait-description-Contract = Вы подписали какую-то бумаж
|
||||
|
||||
trait-name-StudioVisor = Студийный визор
|
||||
trait-description-StudioVisor = В ваши оптические сенсоры встроен визор студийного класса, который значительно снижает интенсивность визуальных ЭЛТ-эффектов и глитчей, вызванных повреждениями или низким уровнем заряда.
|
||||
|
||||
trait-name-BlueBlood = Синяя кровь
|
||||
trait-description-BlueBlood = Гемоцианин в вашей крови использует медь для переноса кислорода. В результате кровь синяя, а для ее восстановления необходима медь, а не железо.
|
||||
|
||||
@@ -33,3 +33,21 @@
|
||||
- type: DeleteOnTrigger
|
||||
- type: SpawnOnTrigger
|
||||
proto: giber
|
||||
|
||||
- type: trait
|
||||
id: BlueBlood
|
||||
category: Physical
|
||||
points: 0
|
||||
slots: 0
|
||||
requirements:
|
||||
- !type:CharacterSpeciesRequirement
|
||||
inverted: true
|
||||
species:
|
||||
- IPC
|
||||
- Arachnid
|
||||
- SlimePerson
|
||||
- Shadowkin
|
||||
functions:
|
||||
- !type:TraitAddComponent
|
||||
components:
|
||||
- type: BlueBloodTrait
|
||||
|
||||
Reference in New Issue
Block a user