diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index 12af8dc0ad5901..1dcb81886d771d 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -227,6 +227,22 @@ public bool TryAddToChemicals(EntityUid uid, Solution solution, BloodstreamCompo return _solutionContainerSystem.TryAddSolution(uid, component.ChemicalSolution, solution); } + public bool FlushChemicals(EntityUid uid, string excludedReagentID, FixedPoint2 quantity, BloodstreamComponent? component = null) { + if (!Resolve(uid, ref component, false)) + return false; + + for (var i = component.ChemicalSolution.Contents.Count - 1; i >= 0; i--) + { + var (reagentId, _) = component.ChemicalSolution.Contents[i]; + if (reagentId != excludedReagentID) + { + _solutionContainerSystem.TryRemoveReagent(uid, component.ChemicalSolution, reagentId, quantity); + } + } + + return true; + } + public float GetBloodLevelPercentage(EntityUid uid, BloodstreamComponent? component = null) { if (!Resolve(uid, ref component)) diff --git a/Content.Server/Chemistry/ReagentEffects/ChemCleanBoodstream.cs b/Content.Server/Chemistry/ReagentEffects/ChemCleanBoodstream.cs new file mode 100644 index 00000000000000..a897c582479c6b --- /dev/null +++ b/Content.Server/Chemistry/ReagentEffects/ChemCleanBoodstream.cs @@ -0,0 +1,24 @@ +using Content.Shared.Chemistry.Reagent; +using JetBrains.Annotations; +using Content.Server.Body.Systems; + +namespace Content.Server.Chemistry.ReactionEffects +{ + /// + /// Basically smoke and foam reactions. + /// + [UsedImplicitly] + public sealed class ChemCleanBoodstream : ReagentEffect + { + [DataField("cleanseRate")] + public float CleanseRate = 3.0f; + public override void Effect(ReagentEffectArgs args) + { + if (args.Source == null) + return; + + var bloodstreamSys = EntitySystem.Get(); + bloodstreamSys.FlushChemicals(args.SolutionEntity, args.Reagent.ID, CleanseRate); + } + } +} diff --git a/Resources/Locale/en-US/reagents/meta/elements.ftl b/Resources/Locale/en-US/reagents/meta/elements.ftl index cc1878699df674..70cd57bc8f6157 100644 --- a/Resources/Locale/en-US/reagents/meta/elements.ftl +++ b/Resources/Locale/en-US/reagents/meta/elements.ftl @@ -1,9 +1,15 @@ reagent-name-aluminium = aluminium reagent-desc-aluminium = A silver, soft, non-magnetic, and ductile metal. +reagent-name-ash = ash +reagent-desc-ash = A light grey powdery residue + reagent-name-carbon = carbon reagent-desc-carbon = A black, crystalline solid. +reagent-name-charcoal = charcoal +reagent-desc-charcoal = A black, porous solid + reagent-name-chlorine = chlorine reagent-desc-chlorine = A yellow-green gas which is toxic to humans. diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml index d9232130c1f788..3a081b80caa75f 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml @@ -100,3 +100,16 @@ - type: Tag tags: - Trash + - type: SolutionContainerManager + solutions: + food: + maxVol: 50 + reagents: + - ReagentId: Ash + Quantity: 10 + - type: SolutionSpiker + sourceSolution: food + ignoreEmpty: true + - type: DeleteOnTrigger + - type: Extractable + grindableSolutionName: food diff --git a/Resources/Prototypes/Reagents/chemicals.yml b/Resources/Prototypes/Reagents/chemicals.yml index ce73aa63c3019c..b72ef7108b0305 100644 --- a/Resources/Prototypes/Reagents/chemicals.yml +++ b/Resources/Prototypes/Reagents/chemicals.yml @@ -17,3 +17,28 @@ color: "#E7EA91" boilingPoint: 55.5 meltingPoint: -50.0 + +- type: reagent + id: Charcoal + name: reagent-name-charcoal + desc: reagent-desc-charcoal + physicalDesc: reagent-physical-desc-porous + color: "#22282b" + boilingPoint: 4200.0 + meltingPoint: 3550.0 + metabolisms: + Medicine: + effects: + - !type:HealthChange + damage: + types: + Poison: -1 + - !type:ChemCleanBoodstream + cleanseRate: 3 + +- type: reagent + id: Ash + name: reagent-name-ash + desc: reagent-desc-ash + physicalDesc: reagent-physical-desc-powder + color: white \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Reactions/chemicals.yml b/Resources/Prototypes/Recipes/Reactions/chemicals.yml index f1c9369ad520b6..505e8b6bbeb327 100644 --- a/Resources/Prototypes/Recipes/Reactions/chemicals.yml +++ b/Resources/Prototypes/Recipes/Reactions/chemicals.yml @@ -339,3 +339,13 @@ amount: 1 products: Pax: 3 + +- type: reaction + id: Charcoal + reactants: + Carbon: + amount: 1 + Ash: + amount: 1 + products: + Charcoal: 1 \ No newline at end of file