* Revert "- fix: YAML linter fixes. (#598)" This reverts commit012bf3c357. * Revert "Automatic changelog update" This reverts commitcf1c3a9af5. * Revert "[Fix] Base Layer Prototype (#597)" This reverts commitb000423999. * Revert "Modules update (#596)" This reverts commit00fbdead77. * Revert "Automatic changelog update" This reverts commit0d7a12b2a2. * Revert "Fixes (#593)" This reverts commit943c77031c. * Revert "minor loadout fixes (#594)" This reverts commit143c010a89. * Revert "Update DryDock.yml (#595)" This reverts commit4cd0100ac7. * Revert "Automatic changelog update" This reverts commit08eadc690f. * Revert "fix: Maximum message size (#591)" This reverts commit343f3612eb. * Revert "Черри пики 7 (#592)" This reverts commit3f97bdce2f. * Revert "Automatic changelog update" This reverts commit0678eca250. * Revert "Рандомфиксы (#590)" This reverts commit2b9e5e2437. * Revert "Нижнее бельё в лодауты (#580)" This reverts commite01a47b089. * Revert "add lathe sounds (#588)" This reverts commitc80a2985f2. * Revert "Добавил параметр группы для некоторых реагентов (#585)" This reverts commit713b16bb98. * Revert "add hrp ++++ aspect (#587)" This reverts commita6a69cc60f. * Revert "Новые амбиенты и пару песен (#586)" This reverts commit48c86bd846. * Revert "Сообщения в ПДА 2 (#583)" This reverts commitcced3cc98b. * Revert "Automatic changelog update" This reverts commitabf435b11d. * Revert "Chem stuff and more (#584)" This reverts commit3608960f5c. * Revert "JobRequiremet refactor (#579)" This reverts commit9a9c9598e0. * Revert "Revert "Reapply "Нижнее бельё в лодауты""" This reverts commit44447d573f. * Revert "Reapply "Нижнее бельё в лодауты"" This reverts commit0c4d082ad3. * Revert "Revert "Нижнее бельё в лодауты"" This reverts commit56473c5492. * Revert "Нижнее бельё в лодауты" This reverts commitd1cb0cb364. * Revert "DryDock and WhiteMoose update (#578)" This reverts commit14755808af. * Revert "Automatic changelog update" This reverts commit0133f82722. * Revert "Fixes (#576)" This reverts commitb7cc49896c. * Revert "порт системы регенерации солюшена цинки (#574)" This reverts commita22cf3d50b. * Revert "Воровские перчатки (#573)" This reverts commitbb7140f3d4. * Revert "mood resprite (#572)" This reverts commit4db96dc569. * Revert "fix missing letter (#571)" This reverts commit94ea756794. * Revert "Сообщения в ПДА (#564)" This reverts commitd023d29e54. * Revert "- fix: No visible aghost." This reverts commit27e7f25f7e. * Revert "- tweak: Nerf cult shield." This reverts commit6a384246b8.
187 lines
6.9 KiB
C#
187 lines
6.9 KiB
C#
using Content.Server.Body.Systems;
|
|
using Content.Server.Chemistry.EntitySystems;
|
|
using Content.Server._White.Medical.BodyScanner;
|
|
using Content.Shared.Chemistry.Components;
|
|
using Content.Shared.Chemistry.Reagent;
|
|
using Content.Shared.Damage;
|
|
using Content.Shared.Damage.Prototypes;
|
|
using Content.Shared.FixedPoint;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Server.Body.Components
|
|
{
|
|
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), typeof(BodyScannerConsoleSystem))] // WD EDIT
|
|
public sealed partial class BloodstreamComponent : Component
|
|
{
|
|
public static string DefaultChemicalsSolutionName = "chemicals";
|
|
public static string DefaultBloodSolutionName = "bloodstream";
|
|
public static string DefaultBloodTemporarySolutionName = "bloodstreamTemporary";
|
|
public readonly string BloodAlertPrototypeID = "Bleed";
|
|
|
|
/// <summary>
|
|
/// The next time that blood level will be updated and bloodloss damage dealt.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
public TimeSpan NextUpdate;
|
|
|
|
/// <summary>
|
|
/// The interval at which this component updates.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(3);
|
|
|
|
/// <summary>
|
|
/// How much is this entity currently bleeding?
|
|
/// Higher numbers mean more blood lost every tick.
|
|
///
|
|
/// Goes down slowly over time, and items like bandages
|
|
/// or clotting reagents can lower bleeding.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This generally corresponds to an amount of damage and can't go above 100.
|
|
/// </remarks>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public float BleedAmount;
|
|
|
|
/// <summary>
|
|
/// How much should bleeding be reduced every update interval?
|
|
/// </summary>
|
|
[DataField]
|
|
public float BleedReductionAmount = 0.33f;
|
|
|
|
/// <summary>
|
|
/// How high can <see cref="BleedAmount"/> go?
|
|
/// </summary>
|
|
[DataField]
|
|
public float MaxBleedAmount = 10.0f;
|
|
|
|
/// <summary>
|
|
/// What percentage of current blood is necessary to avoid dealing blood loss damage?
|
|
/// </summary>
|
|
[DataField]
|
|
public float BloodlossThreshold = 0.9f;
|
|
|
|
/// <summary>
|
|
/// The base bloodloss damage to be incurred if below <see cref="BloodlossThreshold"/>
|
|
/// The default values are defined per mob/species in YML.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public DamageSpecifier BloodlossDamage = new();
|
|
|
|
/// <summary>
|
|
/// The base bloodloss damage to be healed if above <see cref="BloodlossThreshold"/>
|
|
/// The default values are defined per mob/species in YML.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public DamageSpecifier BloodlossHealDamage = new();
|
|
|
|
// TODO shouldn't be hardcoded, should just use some organ simulation like bone marrow or smth.
|
|
/// <summary>
|
|
/// How much reagent of blood should be restored each update interval?
|
|
/// </summary>
|
|
[DataField]
|
|
public FixedPoint2 BloodRefreshAmount = 1.0f;
|
|
|
|
/// <summary>
|
|
/// How much blood needs to be in the temporary solution in order to create a puddle?
|
|
/// </summary>
|
|
[DataField]
|
|
public FixedPoint2 BleedPuddleThreshold = 1.0f;
|
|
|
|
/// <summary>
|
|
/// A modifier set prototype ID corresponding to how damage should be modified
|
|
/// before taking it into account for bloodloss.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// For example, piercing damage is increased while poison damage is nullified entirely.
|
|
/// </remarks>
|
|
[DataField]
|
|
public ProtoId<DamageModifierSetPrototype> DamageBleedModifiers = "BloodlossHuman";
|
|
|
|
/// <summary>
|
|
/// The sound to be played when a weapon instantly deals blood loss damage.
|
|
/// </summary>
|
|
[DataField]
|
|
public SoundSpecifier InstantBloodSound = new SoundCollectionSpecifier("blood");
|
|
|
|
/// <summary>
|
|
/// The sound to be played when some damage actually heals bleeding rather than starting it.
|
|
/// </summary>
|
|
[DataField]
|
|
public SoundSpecifier BloodHealedSound = new SoundPathSpecifier("/Audio/Effects/lightburn.ogg");
|
|
|
|
// TODO probably damage bleed thresholds.
|
|
|
|
/// <summary>
|
|
/// Max volume of internal chemical solution storage
|
|
/// </summary>
|
|
[DataField]
|
|
public FixedPoint2 ChemicalMaxVolume = FixedPoint2.New(250);
|
|
|
|
/// <summary>
|
|
/// Max volume of internal blood storage,
|
|
/// and starting level of blood.
|
|
/// </summary>
|
|
[DataField]
|
|
public FixedPoint2 BloodMaxVolume = FixedPoint2.New(300);
|
|
|
|
/// <summary>
|
|
/// Which reagent is considered this entities 'blood'?
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Slime-people might use slime as their blood or something like that.
|
|
/// </remarks>
|
|
[DataField]
|
|
public ProtoId<ReagentPrototype> BloodReagent = "Blood";
|
|
|
|
/// <summary>Name/Key that <see cref="BloodSolution"/> is indexed by.</summary>
|
|
[DataField]
|
|
public string BloodSolutionName = DefaultBloodSolutionName;
|
|
|
|
/// <summary>Name/Key that <see cref="ChemicalSolution"/> is indexed by.</summary>
|
|
[DataField]
|
|
public string ChemicalSolutionName = DefaultChemicalsSolutionName;
|
|
|
|
/// <summary>Name/Key that <see cref="TemporarySolution"/> is indexed by.</summary>
|
|
[DataField]
|
|
public string BloodTemporarySolutionName = DefaultBloodTemporarySolutionName;
|
|
|
|
/// <summary>
|
|
/// Internal solution for blood storage
|
|
/// </summary>
|
|
[DataField]
|
|
public Entity<SolutionComponent>? BloodSolution;
|
|
|
|
/// <summary>
|
|
/// Internal solution for reagent storage
|
|
/// </summary>
|
|
[DataField]
|
|
public Entity<SolutionComponent>? ChemicalSolution;
|
|
|
|
/// <summary>
|
|
/// Temporary blood solution.
|
|
/// When blood is lost, it goes to this solution, and when this
|
|
/// solution hits a certain cap, the blood is actually spilled as a puddle.
|
|
/// </summary>
|
|
[DataField]
|
|
public Entity<SolutionComponent>? TemporarySolution;
|
|
|
|
/// <summary>
|
|
/// Variable that stores the amount of status time added by having a low blood level.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public TimeSpan StatusTime;
|
|
|
|
//WD-EDIT
|
|
|
|
/// <summary>
|
|
/// Bool for bleeding alert.
|
|
/// </summary>
|
|
public bool IsBleeding => BleedAmount > 0;
|
|
|
|
//WD-EDIT
|
|
}
|
|
}
|