Skip to content

Commit 40a01ac

Browse files
walksanatoraPrincess-Cheeseballsthemiassowelipililimuterumaks-xyz
authored
Solutions (Rebirth) (#5893)
## Short description <img width="1920" height="1080" alt="image" src="https://github.com/user-attachments/assets/55ef349c-731f-49ee-9aeb-dccdd1040ce3" /> _"If there is magic in my heart, can I make this overwhelming dream come true?"_ It's the entirety of the Solutions Refactor + a ton of bug fixes, and, as a result of some awkward tangled PRs, also the butchering -> slicing refactor. I'm going to split up the "list of PRs" into 2 sections, Solutions related, and Slicing related. Solutions - space-wizards/space-station-14#42814 - space-wizards/space-station-14#43447 - space-wizards/space-station-14#43576 - The big one, the Solutions Refactor: space-wizards/space-station-14#43412 - space-wizards/space-station-14#43787 - space-wizards/space-station-14#43810 - space-wizards/space-station-14#43823 - space-wizards/space-station-14#43743 - space-wizards/space-station-14#43789 - space-wizards/space-station-14#43728 - space-wizards/space-station-14#43829 - space-wizards/space-station-14#43964 - space-wizards/space-station-14#43790 - space-wizards/space-station-14#43968 - space-wizards/space-station-14#44102 - space-wizards/space-station-14#43766 - Specifically this commit from the Space-Wizards-Federation -> Wizden PR: space-wizards/space-station-14@cb5c1a8 - space-wizards/space-station-14#44087 - space-wizards/space-station-14#44741 - space-wizards/space-station-14#44344 Slicing - The main one, the Slicing Refactor: space-wizards/space-station-14#36895 - space-wizards/space-station-14#44191 - space-wizards/space-station-14#44225 - Specifically this commit from the Space-Wizards-Federation -> Wizden PR: space-wizards/space-station-14@1022d12 - space-wizards/space-station-14#44441 - space-wizards/space-station-14#44845 - space-wizards/space-station-14#44860 - space-wizards/space-station-14#45424 As I always say when I use AI, I used AI to help me with this PR. It was mainly the "busy" work, the hundreds of 2 line changes to go from solutioncontainer to solution, etc, and some C# assistance too. A lot of busy work. Since this is technically an upstream merge in a way, might not want to squash merge it? It's not in the same format as the others, so I don't know. It was cherry picked, for what it's worth. (Edit: Yeah don't squash merge this or it'll collide with the other 5 direct PRs that rely on it) ## Why we need to add this We're 7 months behind, and a lot of really good modern features (reagent fires, blood footprints, blood splatter on walls) rely on this PR to work. And to me, this PR existing in our path is a bit of a mental block, so I just want to move past it. ## Media (Video/Screenshots) <img width="395" height="345" alt="image" src="https://github.com/user-attachments/assets/d56ec186-1ea7-479f-b620-075a389d0023" /> Note, the silver jug is now 4 wide, 3 tall, instead of 3 wide, 4 tall. It bothered me when I took this picture, so I changed it later. <img width="726" height="199" alt="image" src="https://github.com/user-attachments/assets/3b4eecd9-c954-403f-bfd7-53914038721c" /> <img width="803" height="513" alt="image" src="https://github.com/user-attachments/assets/6255fe5a-b29b-48be-a8fd-90d86532acbc" /> Despite all those PRs taken, there's not actually that much to show off. ## Checks - [X] I do not require assistance to complete the PR. - [X] Before posting/requesting review of a PR, I have verified that the changes work. - [X] I have added screenshots/videos of the changes, or this PR does not change in-game mechanics. - [X] I affirm that my changes are licensed under the [MIT License](https://github.com/ss14Starlight/space-station-14/blob/Starlight/LICENSE.TXT) and grant permission for use in this repository under its conditions. **Changelog** :cl: wonderfulnewworld, Princess Cheeseballs, kosticia, slarticodefast, themias, rumaks xyz, veprolet, AreYouConfused, insoPL, whatston3, cashew 42, B Kirill, portfiend, korczoczek, deltanedas, Winkarst cpu, Wintoli - add: You can now boil snails alive in the microwave. - tweak: Blood volume has been doubled. - tweak: Many chef recipes have been changed so the final result better matches the ingredients put in. This means overall the nutritional value of the chef's meals have increased. - tweak: Many chef recipes have had their ingredients changed. - tweak: Most sliceable foods now give a lot more slices. - tweak: Reagent container sizes have been standardized, at a base of 30 units per inventory square. Most containers can now hold more than they did before. - tweak: Changed the size of the silver and gold beakers; they don't fit the standards of the others, since they cost credits. - tweak: Chemical jugs and bar jugs are now Large (2x4) items. - tweak: Buckets now hold 360u and are 3x4 items. - tweak: Nukie medical duffel bag now comes with a bicaridine jug, a mixed puncturase & tranexamic acid jug, a mixed dermaline & pyrazine jug, and a mixed saline & dexalin plus jug. - tweak: Most items with slicing tool quality now can be used for butchering. - tweak: Butchering is now predicted and called slicing! - tweak: Butter and butter slices can be mixed into solutions. - tweak: Chemical dispenser and ChemMaster transfer increments have been changed to 1u, 5u, 10u, 15u, 20u, 30u, 40u, 60u, and 120u. - tweak: Hyposprays and jet injectors no longer spill when thrown. - tweak: The salt and pepper requirements for several recipes have been heavily reduced. - tweak: Butter now requires Cream instead of Milk to create. --------- Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: themias <89101928+themias@users.noreply.github.com> Co-authored-by: Janet Blackquill <uhhadd@gmail.com> Co-authored-by: rumaks <me@rumaks.xyz> Co-authored-by: veprolet <68151557+veprolet@users.noreply.github.com> Co-authored-by: John <50085876+AreYouConfused@users.noreply.github.com> Co-authored-by: InsoPL <lukasz.lindert@protonmail.com> Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com> Co-authored-by: cashew <70486856+cashew-42@users.noreply.github.com> Co-authored-by: kosticia <kosticia46@gmail.com> Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru> Co-authored-by: Fildrance <fildrance@gmail.com> Co-authored-by: iaada <iaada@users.noreply.github.com> Co-authored-by: B_Kirill <153602297+B-Kirill@users.noreply.github.com> Co-authored-by: portfiend <109661617+portfiend@users.noreply.github.com> Co-authored-by: korczoczek <danielkorczok@gmail.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com> Co-authored-by: Wintoli <60529806+Wintoli@users.noreply.github.com> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2 parents 378e796 + 1e0d46b commit 40a01ac

527 files changed

Lines changed: 16211 additions & 18550 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Content.Client/Chemistry/Containers/EntitySystems/SolutionContainerSystem.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace Content.Client.Chemistry.Containers.EntitySystems;
44

5-
public sealed partial class SolutionContainerSystem : SharedSolutionContainerSystem
6-
{
7-
}
5+
public sealed partial class SolutionContainerSystem : SharedSolutionContainerSystem;

Content.Client/Chemistry/EntitySystems/ChemistryGuideDataSystem.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ private void OnPrototypesReloaded(PrototypesReloadedEventArgs? ev)
116116
}
117117

118118

119-
if (extractableComponent.GrindableSolution is { } grindableSolutionId &&
120-
entProto.TryGetComponent<SolutionContainerManagerComponent>(out var manager, EntityManager.ComponentFactory) &&
121-
_solutionContainer.TryGetSolution(manager, grindableSolutionId, out var grindableSolution))
119+
if (extractableComponent.GrindableSolutionName is { } grindableSolutionId &&
120+
_solutionContainer.TryGetSolution(entProto, grindableSolutionId, out var grindableSolution))
122121
{
123122
var data = new ReagentEntitySourceData(
124123
new() { DefaultGrindCategory },

Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ private List<ReagentButton> CreateReagentTransferButtons(ReagentId reagent, bool
138138
("10", ChemMasterReagentAmount.U10, StyleClass.ButtonOpenBoth),
139139
("15", ChemMasterReagentAmount.U15, StyleClass.ButtonOpenBoth),
140140
("20", ChemMasterReagentAmount.U20, StyleClass.ButtonOpenBoth),
141-
("25", ChemMasterReagentAmount.U25, StyleClass.ButtonOpenBoth),
142141
("30", ChemMasterReagentAmount.U30, StyleClass.ButtonOpenBoth),
143-
("50", ChemMasterReagentAmount.U50, StyleClass.ButtonOpenBoth),
144-
("100", ChemMasterReagentAmount.U100, StyleClass.ButtonOpenBoth),
142+
("40", ChemMasterReagentAmount.U40, StyleClass.ButtonOpenBoth),
143+
("60", ChemMasterReagentAmount.U60, StyleClass.ButtonOpenBoth),
144+
("120", ChemMasterReagentAmount.U120, StyleClass.ButtonOpenBoth),
145145
(Loc.GetString("chem-master-window-buffer-all-amount"), ChemMasterReagentAmount.All, StyleClass.ButtonOpenLeft),
146146
};
147147

Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Columns="3"
1616
HorizontalAlignment="Center"
1717
Margin="5"
18-
ButtonList="1,5,10,15,20,25,30,50,100"
18+
ButtonList="1,5,10,15,20,30,40,60,120"
1919
RadioGroup="True">
2020
</ui:ButtonGrid>
2121
<!-- Starlight-start -->

Content.Client/_Starlight/Kitchen/EntitySystems/SharpSystem.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

Content.Client/_Starlight/Plumbing/UI/PlumbingSmartDispenserWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Columns="3"
1515
HorizontalAlignment="Center"
1616
Margin="5 4"
17-
ButtonList="1,5,10,15,20,25,30,50,100"
17+
ButtonList="1,5,10,15,20,30,40,60,120"
1818
RadioGroup="True" />
1919

2020
<Control VerticalExpand="True" />

Content.IntegrationTests/Tests/CargoTest.cs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using Content.IntegrationTests.Fixtures;
55
using Content.Server.Cargo.Components;
66
using Content.Server.Cargo.Systems;
7-
using Content.Server.Nutrition.Components;
8-
using Content.Server.Nutrition.EntitySystems;
97
using Content.Shared.Cargo.Components;
108
using Content.Shared.Cargo.Prototypes;
119
using Content.Shared.Mobs.Components;
@@ -15,6 +13,8 @@
1513
using Robust.Shared.GameObjects;
1614
using Robust.Shared.Map;
1715
using Robust.Shared.Prototypes;
16+
using Content.Shared.Storage;
17+
using Content.Shared.Tools.Components;
1818

1919
namespace Content.IntegrationTests.Tests;
2020

@@ -153,7 +153,6 @@ public async Task NoSliceableBountyArbitrageTest()
153153
var componentFactory = server.ResolveDependency<IComponentFactory>();
154154
var whitelist = entManager.System<EntityWhitelistSystem>();
155155
var cargo = entManager.System<CargoSystem>();
156-
var sliceableSys = entManager.System<SliceableFoodSystem>();
157156

158157
var bounties = protoManager.EnumeratePrototypes<CargoBountyPrototype>().ToList();
159158

@@ -166,14 +165,14 @@ await server.WaitAssertion(() =>
166165
var sliceableEntityProtos = protoManager.EnumeratePrototypes<EntityPrototype>()
167166
.Where(p => !p.Abstract)
168167
.Where(p => !pair.IsTestPrototype(p))
169-
.Where(p => p.TryGetComponent<SliceableFoodComponent>(out _, componentFactory))
168+
.Where(p => p.TryGetComponent<ToolRefinableComponent>(out _, componentFactory))
170169
.Select(p => p.ID)
171170
.ToList();
172171

173172
foreach (var proto in sliceableEntityProtos)
174173
{
175174
var ent = entManager.SpawnEntity(proto, coord);
176-
var sliceable = entManager.GetComponent<SliceableFoodComponent>(ent);
175+
var sliceable = entManager.GetComponent<ToolRefinableComponent>(ent);
177176

178177
// Check each bounty
179178
foreach (var bounty in bounties)
@@ -186,19 +185,32 @@ await server.WaitAssertion(() =>
186185
continue;
187186

188187
// Spawn a slice
189-
var slice = entManager.SpawnEntity(sliceable.Slice, coord);
190188

191-
// See if the slice also counts for this bounty entry
192-
if (!cargo.IsValidBountyEntry(slice, entry))
189+
var sliceCountByProtoId = EntitySpawnCollection.GetSpawns(sliceable.RefineResult)
190+
.GroupBy(x => x)
191+
.ToDictionary(x => x.Key, x => x.Count());
192+
193+
foreach (var (sliceProtoId, sliceCount) in sliceCountByProtoId)
193194
{
194-
entManager.DeleteEntity(slice);
195-
continue;
196-
}
195+
var slice = entManager.SpawnEntity(sliceProtoId, coord);
197196

198-
entManager.DeleteEntity(slice);
197+
// See if the slice also counts for this bounty entry
198+
if (!cargo.IsValidBountyEntry(slice, entry))
199+
{
200+
entManager.DeleteEntity(slice);
201+
continue;
202+
}
199203

200-
// If for some reason it can only make one slice, that's okay, I guess
201-
Assert.That(sliceable.TotalCount, Is.EqualTo(1), $"{proto} counts as part of cargo bounty {bounty.ID} and slices into {sliceable.TotalCount} slices which count for the same bounty!");
204+
entManager.DeleteEntity(slice);
205+
206+
// If for some reason it can only make one slice, that's okay, I guess
207+
Assert.That(
208+
sliceCount,
209+
Is.EqualTo(1),
210+
$"{proto} counts as part of cargo bounty {bounty.ID} "
211+
+ $"and slices into {sliceCount} slices which count for the same bounty!"
212+
);
213+
}
202214
}
203215
}
204216

Content.IntegrationTests/Tests/Chemistry/DrainTest.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ public sealed class DrainTest : InteractionTest
2020

2121
[TestPrototypes]
2222
private static readonly string Prototypes = @$"
23-
- type: entity
24-
parent: Puddle
25-
id: PuddleBloodTest
26-
suffix: Blood (30u)
27-
components:
28-
- type: SolutionContainerManager
29-
solutions:
30-
puddle:
31-
maxVol: 1000
32-
reagents:
33-
- ReagentId: {BloodReagent}
34-
Quantity: {PuddleVolume}
35-
";
23+
- type: entity
24+
parent: Puddle
25+
id: PuddleBloodTest
26+
suffix: Blood
27+
components:
28+
- type: Solution
29+
id: puddle
30+
solution:
31+
maxVol: 1000
32+
reagents:
33+
- ReagentId: {BloodReagent}
34+
Quantity: {PuddleVolume}
35+
";
3636

3737

3838
/// <summary>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using Content.IntegrationTests.Fixtures;
2+
using Content.IntegrationTests.Fixtures.Attributes;
3+
using Content.Shared.Chemistry.Components;
4+
using Content.Shared.Chemistry.EntitySystems;
5+
using Content.Shared.Chemistry.Reagent;
6+
using Content.Shared.FixedPoint;
7+
using Robust.Shared.GameObjects;
8+
using Robust.Shared.Prototypes;
9+
10+
namespace Content.IntegrationTests.Tests.Chemistry;
11+
12+
[TestFixture]
13+
[TestOf(typeof(SolutionRegenerationSystem))]
14+
[TestOf(typeof(SolutionPurgeSystem))]
15+
public sealed class SolutionPurgeRegenerationTests : GameTest
16+
{
17+
private static readonly EntProtoId AdvancedMop = "AdvMopItem";
18+
private static readonly ProtoId<ReagentPrototype> Water = "Water";
19+
private static readonly ProtoId<ReagentPrototype> NotWater = "DexalinPlus";
20+
21+
[SidedDependency(Side.Server)] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
22+
23+
[Test]
24+
public async Task TestMop()
25+
{
26+
var testMap = await Pair.CreateTestMap();
27+
28+
EntityUid mop = default!;
29+
Entity<SolutionComponent> solution = default!;
30+
await Server.WaitPost(() =>
31+
{
32+
mop = SSpawnAtPosition(AdvancedMop, testMap.GridCoords);
33+
34+
var generated = SComp<SolutionRegenerationComponent>(mop).Generated;
35+
var purge = SComp<SolutionPurgeComponent>(mop);
36+
Assume.That(generated.ContainsPrototype(Water));
37+
Assume.That(purge.Preserve, Does.Not.Contain(NotWater));
38+
39+
40+
Assert.That(_solutionContainer.TryGetSolution(mop, "absorbed", out var mopSolution, out _));
41+
solution = mopSolution!.Value;
42+
Assert.That(_solutionContainer.AddSolution(solution, new Solution(NotWater, 50)), Is.EqualTo(FixedPoint2.New(50)));
43+
});
44+
45+
await PoolManager.WaitUntil(Server, () => !solution.Comp.Solution.ContainsPrototype(NotWater));
46+
await PoolManager.WaitUntil(Server, () => solution.Comp.Solution.Volume == solution.Comp.Solution.MaxVolume);
47+
}
48+
}

Content.IntegrationTests/Tests/Chemistry/SolutionRoundingTest.cs

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,52 +18,52 @@ public sealed class SolutionRoundingTest : GameTest
1818

1919
[TestPrototypes]
2020
private const string Prototypes = @"
21-
- type: entity
22-
id: SolutionRoundingTestContainer
23-
components:
24-
- type: SolutionContainerManager
25-
solutions:
26-
beaker:
27-
maxVol: 100
28-
29-
# This is the Chloral Hydrate recipe fyi.
30-
- type: reagent
31-
id: SolutionRoundingTestReagentA
32-
name: reagent-name-nothing
33-
desc: reagent-desc-nothing
34-
physicalDesc: reagent-physical-desc-nothing
35-
36-
- type: reagent
37-
id: SolutionRoundingTestReagentB
38-
name: reagent-name-nothing
39-
desc: reagent-desc-nothing
40-
physicalDesc: reagent-physical-desc-nothing
41-
42-
- type: reagent
43-
id: SolutionRoundingTestReagentC
44-
name: reagent-name-nothing
45-
desc: reagent-desc-nothing
46-
physicalDesc: reagent-physical-desc-nothing
47-
48-
- type: reagent
49-
id: SolutionRoundingTestReagentD
50-
name: reagent-name-nothing
51-
desc: reagent-desc-nothing
52-
physicalDesc: reagent-physical-desc-nothing
53-
54-
- type: reaction
55-
id: SolutionRoundingTestReaction
56-
impact: Medium
57-
reactants:
58-
SolutionRoundingTestReagentA:
59-
amount: 3
60-
SolutionRoundingTestReagentB:
61-
amount: 1
62-
SolutionRoundingTestReagentC:
63-
amount: 1
64-
products:
65-
SolutionRoundingTestReagentD: 1
66-
";
21+
- type: entity
22+
id: SolutionRoundingTestContainer
23+
components:
24+
- type: Solution
25+
id: beaker
26+
solution:
27+
maxVol: 100
28+
29+
# This is the Chloral Hydrate recipe fyi.
30+
- type: reagent
31+
id: SolutionRoundingTestReagentA
32+
name: reagent-name-nothing
33+
desc: reagent-desc-nothing
34+
physicalDesc: reagent-physical-desc-nothing
35+
36+
- type: reagent
37+
id: SolutionRoundingTestReagentB
38+
name: reagent-name-nothing
39+
desc: reagent-desc-nothing
40+
physicalDesc: reagent-physical-desc-nothing
41+
42+
- type: reagent
43+
id: SolutionRoundingTestReagentC
44+
name: reagent-name-nothing
45+
desc: reagent-desc-nothing
46+
physicalDesc: reagent-physical-desc-nothing
47+
48+
- type: reagent
49+
id: SolutionRoundingTestReagentD
50+
name: reagent-name-nothing
51+
desc: reagent-desc-nothing
52+
physicalDesc: reagent-physical-desc-nothing
53+
54+
- type: reaction
55+
id: SolutionRoundingTestReaction
56+
impact: Medium
57+
reactants:
58+
SolutionRoundingTestReagentA:
59+
amount: 3
60+
SolutionRoundingTestReagentB:
61+
amount: 1
62+
SolutionRoundingTestReagentC:
63+
amount: 1
64+
products:
65+
SolutionRoundingTestReagentD: 1
66+
";
6767

6868
private const string SolutionRoundingTestReagentA = "SolutionRoundingTestReagentA";
6969
private const string SolutionRoundingTestReagentB = "SolutionRoundingTestReagentB";

0 commit comments

Comments
 (0)