[#20285 fix] Carp Plush and Rehydratables can now be put into mop bucket (#33079)

* Make shark plush janitor-bucketable

* fix bucketed grey shark texture

* Make sprites less shiny and adapt copyright notice

* Made shark way way less shiny

* Allow carp plush and rehydratables in mop bucket.

* Remove old mop bucket shark sprites

* Fix post-merge bugs

* Fix errors

* Move ReactiveContainer stuff to shared

That should mean it is now predicted.

* Custom eject verb for the mop bucket

* Fixes OnSolutionChange, removes pop-up as there already is one.

* .ftl is not necessary as the custom pop-up was removed

* Review fixes

* Update Content.Shared/Chemistry/Components/ReactiveContainerComponent.cs

* Update Content.Shared/Chemistry/EntitySystems/ReactiveContainerSystem.cs

---------

Co-authored-by: Psychpsyo <psychpsyo@gmail.com>
Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
SlamBamActionman
2024-10-31 19:46:19 +01:00
committed by GitHub
parent 1c2a96590b
commit 4626904fa8
12 changed files with 112 additions and 15 deletions

View File

@@ -0,0 +1,21 @@
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!;
}

View File

@@ -0,0 +1,53 @@
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);
}
}
}

View File

@@ -1,5 +1,6 @@
# mop bucket
mop-bucket-slot-component-slot-name-shark = Shark
mop-bucket-slot-component-slot-name-item = Item
mop-bucket-slot-component-eject-verb = Take out
# janitorial trolley
janitorial-trolley-slot-component-slot-name-plunger = Plunger
janitorial-trolley-slot-component-slot-name-sign = Sign

View File

@@ -599,6 +599,11 @@
path: /Audio/Effects/bite.ogg
angle: 0
animation: WeaponArcBite # Rrrr!
- type: Tag
tags:
- Payload
- ClothMade
- PlushieCarp
- type: entity
parent: PlushieCarp

View File

@@ -47,19 +47,30 @@
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
@@ -70,7 +81,7 @@
containers:
storagebase: !type:Container
ents: []
shark_slot: !type:ContainerSlot {}
item_slot: !type:ContainerSlot {}
- type: GuideHelp
guides:
- Janitorial

View File

@@ -1071,6 +1071,9 @@
- type: Tag
id: Plunger
- type: Tag
id: PlushieCarp
- type: Tag
id: PlushieGhost

View File

@@ -39,15 +39,6 @@
{
"name": "grey-inhand-right",
"directions": 4
},
{
"name": "mopbucket_shark_blue"
},
{
"name": "mopbucket_shark_pink"
},
{
"name": "mopbucket_shark_grey"
}
]
}

View File

@@ -1,7 +1,7 @@
{
"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
@@ -25,6 +25,18 @@
{
"name": "mopbucket_water-3"
},
{
"name": "mopbucket_shark_blue"
},
{
"name": "mopbucket_shark_pink"
},
{
"name": "mopbucket_shark_grey"
},
{
"name": "mopbucket_carpplush"
},
{
"name": "inhand-left",
"directions": 4

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B