Cooking simulator 2: Soups (#1535)

* Update shield.yml

* Add soup bowls

Introduced new bowl entities (wooden, iron, gold, copper) for soups, including their sprites and prototype definitions. Added 'Soup' to the CP14FoodType enum and updated the food holder logic. Removed the unused CP14Plate tag from plate.yml and misc.yml.

* Add misc soup ingredient sprites and metadata

Introduced new 32x32 sprites for various soup ingredients, including flyagaric, flylumish, lumish, meat, meat2, meat_salad, mole, mud, pumpkin, sawdust, trash, and veg_stew. Added corresponding meta.json with state definitions and licensing information.

* veg soup recipe for testing

* soup displacement maps

* meal displacement eating

* fix double cookin plates

* soup cooking

* Update cooking_pot.yml

* Refactor solution handling for cooking and containers

Updated solution component names and types for cooking pots, bowls, buckets, barrels, and wells to improve consistency and functionality. Added and removed solution-related components, adjusted transfer logic, and cleaned up unused solution states and visual metadata. Also added food type checks in cooking system to prevent incorrect transfers.

* new soup recipes

* Unit test

* fix

* trading requests

* Update CP14Cooking.cs

* Update CP14Cooking.cs

* audio improve, egg and bread fix

* fix bugs

* integration
This commit is contained in:
Red
2025-07-17 17:35:13 +03:00
committed by GitHub
parent e14ae1a930
commit 759778782c
110 changed files with 1452 additions and 362 deletions

View File

@@ -0,0 +1,77 @@
/*
* This file is sublicensed under MIT License
* https://github.com/space-wizards/space-station-14/blob/master/LICENSE.TXT
*/
using System.Collections.Generic;
using System.Linq;
using Content.Shared._CP14.Cooking;
using Content.Shared._CP14.Cooking.Requirements;
using Content.Shared.Chemistry.Components;
using Content.Shared.Tag;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.IntegrationTests.Tests._CP14;
#nullable enable
[TestFixture]
public sealed class CP14Cooking
{
[Test]
public async Task TestAllCookingRecipeIsCookable()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var entManager = server.ResolveDependency<IEntityManager>();
var protoMan = server.ResolveDependency<IPrototypeManager>();
var cookSys = entManager.System<CP14SharedCookingSystem>();
await server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
foreach (var recipe in protoMan.EnumeratePrototypes<CP14CookingRecipePrototype>())
{
var solution = new Solution();
var allTags = new List<ProtoId<TagPrototype>>();
foreach (var req in recipe.Requirements)
{
switch (req)
{
case AlwaysMet:
continue;
case TagRequired tagReq:
allTags.AddRange(tagReq.Tags);
break;
case ReagentRequired reagentReq:
if (reagentReq.Reagents.Count == 0)
continue; // No reagents required, skip this requirement.
solution.AddReagent(reagentReq.Reagents.First(),
reagentReq.Amount);
break;
}
}
var selectedRecipe = cookSys.GetRecipe(recipe.FoodType, solution, allTags);
var complexity = recipe.Requirements.Sum(req => req.GetComplexity());
var selectedRecipeComplexity = selectedRecipe?.Requirements.Sum(req => req.GetComplexity()) ?? 0;
if (selectedRecipe != recipe)
{
Assert.Fail($"The {recipe.ID} recipe is impossible to cook! " +
$"Instead, the following dish was prepared: ${selectedRecipe?.ID ?? "NULL"} " +
$"\nRecipe complexity: {complexity}, selected recipe complexity: {selectedRecipeComplexity}.");
}
}
});
});
await pair.CleanReturnAsync();
}
}