-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds the first steps for a blood extraction and filtration system. Again.
- Loading branch information
Showing
23 changed files
with
201 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
Content.Server/_NF/Chemistry/Components/ReplaceEntityOnSolutionEmptyComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Nutrition.EntitySystems; | ||
|
||
[RegisterComponent] | ||
public sealed partial class ReplaceEntityOnSolutionEmptyComponent : Component | ||
{ | ||
/// <summary> | ||
/// The solution to check for entity replacement. | ||
/// </summary> | ||
[DataField] | ||
public string Solution = "solution"; | ||
|
||
/// <summary> | ||
/// The entity to replace the existing one. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public EntProtoId ReplacementEntity; | ||
} |
55 changes: 55 additions & 0 deletions
55
Content.Server/_NF/Chemistry/Systems/ReplaceEntityOnSolutionEmptySystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using Content.Server.Nutrition.EntitySystems; | ||
using Content.Shared.Chemistry.Components.SolutionManager; | ||
using Content.Shared.Chemistry.EntitySystems; | ||
using Robust.Server.Containers; | ||
using Robust.Server.GameObjects; | ||
|
||
namespace Content.Server._NF.Chemistry.Systems; | ||
|
||
public sealed class ReplaceEntityOnSolutionEmptySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedSolutionContainerSystem _solution = default!; | ||
[Dependency] private readonly TransformSystem _transform = default!; | ||
[Dependency] private readonly ContainerSystem _container = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ReplaceEntityOnSolutionEmptyComponent, MapInitEvent>(OnMapInit); | ||
SubscribeLocalEvent<ReplaceEntityOnSolutionEmptyComponent, SolutionContainerChangedEvent>(OnSolutionChange); | ||
} | ||
|
||
public void OnMapInit(Entity<ReplaceEntityOnSolutionEmptyComponent> entity, ref MapInitEvent args) | ||
{ | ||
CheckSolutions(entity); | ||
} | ||
|
||
public void OnSolutionChange(Entity<ReplaceEntityOnSolutionEmptyComponent> entity, ref SolutionContainerChangedEvent args) | ||
{ | ||
CheckSolutions(entity); | ||
} | ||
|
||
public void CheckSolutions(Entity<ReplaceEntityOnSolutionEmptyComponent> entity) | ||
{ | ||
if (!EntityManager.HasComponent<SolutionContainerManagerComponent>(entity)) | ||
return; | ||
|
||
if (_solution.TryGetSolution(entity.Owner, entity.Comp.Solution, out _, out var solution) && solution.Volume <= 0) | ||
ReplaceEntity(entity); | ||
} | ||
|
||
public void ReplaceEntity(Entity<ReplaceEntityOnSolutionEmptyComponent> entity) | ||
{ | ||
var position = _transform.GetMapCoordinates(entity); | ||
var inContainer = _container.TryGetContainingContainer((entity, null), out var container); | ||
var replacementEntity = entity.Comp.ReplacementEntity; | ||
|
||
Del(entity); | ||
|
||
if (inContainer && container != null) | ||
SpawnInContainerOrDrop(replacementEntity, container.Owner, container.ID); | ||
else | ||
Spawn(replacementEntity, position); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+126 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-left-fill-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+137 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-left-fill-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+158 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-left-fill-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+261 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+128 Bytes
...urces/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-right-fill-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+140 Bytes
...urces/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-right-fill-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+155 Bytes
...urces/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-right-fill-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+269 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/inhand-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions
65
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Taken from cev-eris at https://github.com/discordia-space/CEV-Eris/commit/740ff31a81313086cf16761f3677cf1e2ab46c93 and Taken from tgstation at https://github.com/tgstation/tgstation/blob/623290915c2292b56da11048deb62d758e1e3fb4/icons/obj/bloodpack.dmi, Blood pack redone by Ubaser, edited by dustylens(github)", | ||
"size": | ||
{ | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "inhand-left", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-left-fill-1", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-left-fill-2", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-left-fill-3", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-right", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-right-fill-1", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-right-fill-2", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-right-fill-3", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "reagentbag-base" | ||
}, | ||
{ | ||
"name": "reagentbag-base-1" | ||
}, | ||
{ | ||
"name": "reagentbag-base-2" | ||
}, | ||
{ | ||
"name": "reagentbag-base-3" | ||
}, | ||
{ | ||
"name": "reagentbag-base-4" | ||
}, | ||
{ | ||
"name": "reagentbag-base-5" | ||
}, | ||
{ | ||
"name": "reagentbag-base-6" | ||
} | ||
] | ||
} |
Binary file added
BIN
+1.08 KB
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/reagentbag-base-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.13 KB
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/reagentbag-base-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+191 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/reagentbag-base-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.15 KB
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/reagentbag-base-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.18 KB
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/reagentbag-base-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+254 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/reagentbag-base-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+486 Bytes
Resources/Textures/_NF/Objects/Specific/Medical/medical.rsi/reagentbag-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.