Skip to content

Commit

Permalink
Allowed reagents is now a list
Browse files Browse the repository at this point in the history
  • Loading branch information
Pspritechologist committed Jun 19, 2023
1 parent e070cc1 commit d6f27be
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public sealed class BloodstreamFillerComponent : Component
/// <remarks>
/// If null, any reagent will be allowed.
/// </remarks>
[DataField("reagent"), ViewVariables(VVAccess.ReadWrite)]
public string? Reagent = null;
[DataField("reagents"), ViewVariables(VVAccess.ReadWrite)]
public List<string> Reagents = new();

/// <summary>
/// Will this filler only fill Silicons?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void TryFill(EntityUid user, EntityUid target, EntityUid filler, Bloodst
if (!_solution.TryGetSolution(filler, fillComp.Solution!, out var fillerSolution)) // No solution
return;

if (fillComp.Reagent != null && fillComp.Reagent != bloodComp.BloodReagent) // Wrong reagent as specified by the component
if (fillComp.Reagents.Count > 0 && !fillComp.Reagents.Contains(bloodComp.BloodReagent)) // Wrong reagent as specified by the component
{
_popup.PopupCursor(Loc.GetString(fillComp.TargetInvalidPopup, ("filler", filler)), user);
return;
Expand Down Expand Up @@ -214,7 +214,7 @@ private void TryRefill(EntityUid user, EntityUid filler, EntityUid target, Blood

// Check that the tank's solution matches the filler's listed reagent.
// This is seperate from checking the actual solution to prevent any funny business.
if (fillComp.Reagent != null && targetSolution.Contents[0].ReagentId != fillComp.Reagent)
if (fillComp.Reagents.Count > 0 && !fillComp.Reagents.Contains(targetSolution.Contents[0].ReagentId))
{
_popup.PopupCursor(Loc.GetString(fillComp.RefillReagentInvalidPopup, ("tank", target)), user);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,21 @@
parent: BloodFillerBase
id: BloodFillerBlood
name: bloodfiller
description: A pump to inject blood into your body.
description: A pump to inject blood into your body. Also accepts Slime.
components:
- type: UseDelay
delay: 6
- type: BloodstreamFiller
reagent: Blood
amount: 100
amount: 60
fillTime: 1.3
reagents:
- Blood
- Slime
- Water
- type: SolutionContainerManager
solutions:
filler:
maxVol: 120

- type: entity
parent: BloodFillerBase
Expand All @@ -93,5 +103,11 @@
description: A pump to inject coolant into an IPC.
components:
- type: BloodstreamFiller
reagent: Water
amount: 200
reagents: [ Water ]
amount: 150
fillTime: 0.85
siliconOnly: true
- type: SolutionContainerManager
solutions:
filler:
maxVol: 250

0 comments on commit d6f27be

Please sign in to comment.