--- /dev/null
+namespace Content.Shared.Chemistry.Components;
+
+/// <summary>
+/// Represents a container that also contains a solution.
+/// This means that reactive entities react when inserted into the container.
+/// </summary>
+[RegisterComponent]
+public sealed partial class ReactiveContainerComponent : Component
+{
+ /// <summary>
+ /// The container that holds the solution.
+ /// </summary>
+ [DataField(required: true)]
+ public string Container = default!;
+
+ /// <summary>
+ /// The solution in the container.
+ /// </summary>
+ [DataField(required: true)]
+ public string Solution = default!;
+}
--- /dev/null
+using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.Reaction;
+using Robust.Shared.Containers;
+
+namespace Content.Shared.Chemistry.EntitySystems;
+
+public sealed class ReactiveContainerSystem : EntitySystem
+{
+ [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
+ [Dependency] private readonly ReactiveSystem _reactiveSystem = default!;
+ [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent<ReactiveContainerComponent, EntInsertedIntoContainerMessage>(OnInserted);
+ SubscribeLocalEvent<ReactiveContainerComponent, SolutionContainerChangedEvent>(OnSolutionChange);
+ }
+
+ private void OnInserted(EntityUid uid, ReactiveContainerComponent comp, EntInsertedIntoContainerMessage args)
+ {
+ // Only reactive entities can react with the solution
+ if (!HasComp<ReactiveComponent>(args.Entity))
+ return;
+
+ if (!_solutionContainerSystem.TryGetSolution(uid, comp.Solution, out _, out var solution))
+ return;
+ if (solution.Volume == 0)
+ return;
+
+ _reactiveSystem.DoEntityReaction(args.Entity, solution, ReactionMethod.Touch);
+ }
+
+ private void OnSolutionChange(EntityUid uid, ReactiveContainerComponent comp, SolutionContainerChangedEvent args)
+ {
+ if (!_solutionContainerSystem.TryGetSolution(uid, comp.Solution, out _, out var solution))
+ return;
+ if (solution.Volume == 0)
+ return;
+ if (!TryComp<ContainerManagerComponent>(uid, out var manager))
+ return;
+ if (!_containerSystem.TryGetContainer(uid, comp.Container, out var container))
+ return;
+
+ foreach (var entity in container.ContainedEntities)
+ {
+ if (!HasComp<ReactiveComponent>(entity))
+ continue;
+ _reactiveSystem.DoEntityReaction(entity, solution, ReactionMethod.Touch);
+ }
+ }
+}
whitelist:
tags:
- PlushieSharkGrey
- sprite: Objects/Fun/sharkplush.rsi
+ mopbucket_carpplush:
+ whitelist:
+ tags:
+ - PlushieCarp
+ sprite: Objects/Specific/Janitorial/janitorial.rsi
- type: Transform
noRot: true
- type: ItemSlots
slots:
- shark_slot:
- name: mop-bucket-slot-component-slot-name-shark
+ item_slot:
+ name: mop-bucket-slot-component-slot-name-item
+ ejectVerbText: mop-bucket-slot-component-eject-verb
whitelist:
tags:
- PlushieSharkBlue
- PlushieSharkPink
- PlushieSharkGrey
+ - PlushieCarp
+ components:
+ - Rehydratable
priority: 3 # Higher than drinking priority
+ - type: ReactiveContainer
+ solution: bucket
+ container: item_slot
- type: Drink
solution: bucket
- type: Appearance
containers:
storagebase: !type:Container
ents: []
- shark_slot: !type:ContainerSlot {}
+ item_slot: !type:ContainerSlot {}
- type: GuideHelp
guides:
- Janitorial
{
"version": 1,
"license": "CC-BY-SA-3.0",
- "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/f8f4aeda930fcd0805ca4cc76d9bc9412a5b3428",
+ "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/f8f4aeda930fcd0805ca4cc76d9bc9412a5b3428, mopbucket_shark_* by Psychpsyo, mopbucket_carpplush adapted by Psychpsyo from tgstation carpplush at commit https://github.com/tgstation/tgstation/commit/e1142f20f5e4661cb6845cfcf2dd69f864d67432",
"size": {
"x": 32,
"y": 32
{
"name": "mopbucket_water-3"
},
+ {
+ "name": "mopbucket_shark_blue"
+ },
+ {
+ "name": "mopbucket_shark_pink"
+ },
+ {
+ "name": "mopbucket_shark_grey"
+ },
+ {
+ "name": "mopbucket_carpplush"
+ },
{
"name": "inhand-left",
"directions": 4