Cooking simulator 3: Pies (#1540)

* enum -> prototype

* move sprites

* more dirt sprites

* some food data stucking fixing

* pumpkin fix

* pie move sprites

* refactor components

* pie refactor

* remove outdated proto

* new pie types

* Update SliceableFoodSystem.cs

* Refactor food cooking system and add fat flavor

Added 'Fat' to the flavor profile. Refactored food cooking logic to use CreateFoodData and UpdateFoodDataVisuals instead of CookFood and ApplyFoodVisuals. Introduced RenameCooker property to CP14FoodCookerComponent to control entity renaming during cooking. Improved separation of food data creation and visual updates.

* Update migration.yml

* Refactor food visual and sliceable logic in cooking system

Moved sliceable food logic from OnCookFinished to UpdateFoodDataVisuals for better encapsulation. Made UpdateFoodDataVisuals overridable and updated its usage in random food initialization. Added Rename field to CP14RandomFoodDataComponent and cleaned up unused BecomeSliceable field in CP14FoodCookerComponent. Updated pie_pan.yml to add SliceableFood and a new random food entity.

* Update pie_pan.yml

* fill levels
This commit is contained in:
Red
2025-07-20 15:45:59 +03:00
committed by GitHub
parent 6b98c91f73
commit 8721f736e1
79 changed files with 581 additions and 700 deletions

View File

@@ -23,18 +23,16 @@ public sealed class CP14ClientCookingSystem : CP14SharedCookingSystem
{
base.Initialize();
SubscribeLocalEvent<CP14FoodVisualsComponent, AfterAutoHandleStateEvent>(OnAfterHandleState);
SubscribeLocalEvent<CP14FoodVisualsComponent, AppearanceChangeEvent>(OnAppearanceChange);
SubscribeLocalEvent<CP14FoodHolderComponent, AfterAutoHandleStateEvent>(OnAfterHandleState);
SubscribeLocalEvent<CP14FoodHolderComponent, AppearanceChangeEvent>(OnAppearanceChange);
}
private void OnAppearanceChange(Entity<CP14FoodVisualsComponent> ent, ref AppearanceChangeEvent args)
private void OnAppearanceChange(Entity<CP14FoodHolderComponent> ent, ref AppearanceChangeEvent args)
{
var solutionId = string.Empty;
if (TryComp<CP14FoodHolderComponent>(ent, out var holder))
solutionId = holder.SolutionId;
else if (TryComp<CP14FoodCookerComponent>(ent, out var cooker))
solutionId = cooker.SolutionId;
UpdateVisuals(
ent,
@@ -46,14 +44,12 @@ public sealed class CP14ClientCookingSystem : CP14SharedCookingSystem
ent.Comp.FoodData);
}
private void OnAfterHandleState(Entity<CP14FoodVisualsComponent> ent, ref AfterAutoHandleStateEvent args)
private void OnAfterHandleState(Entity<CP14FoodHolderComponent> ent, ref AfterAutoHandleStateEvent args)
{
var solutionId = string.Empty;
if (TryComp<CP14FoodHolderComponent>(ent, out var holder))
solutionId = holder.SolutionId;
else if (TryComp<CP14FoodCookerComponent>(ent, out var cooker))
solutionId = cooker.SolutionId;
UpdateVisuals(
ent,

View File

@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Linq;
using Content.Shared._CP14.Cooking;
using Content.Shared._CP14.Cooking.Prototypes;
using Content.Shared._CP14.Cooking.Requirements;
using Content.Shared.Chemistry.Components;
using Content.Shared.Tag;
@@ -20,7 +21,6 @@ namespace Content.IntegrationTests.Tests._CP14;
[TestFixture]
public sealed class CP14Cooking
{
[Test]
public async Task TestAllCookingRecipeIsCookable()
{

View File

@@ -673,11 +673,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
return false;
}
//CP14 spill event for cooking subscription
var ev = new CP14BeforeSpillEvent();
RaiseLocalEvent(uid, ev);
//CP14 end
return TrySpillAt(transformComponent.Coordinates, solution, out puddleUid, sound: sound);
}

View File

@@ -1,10 +1,11 @@
using Content.Server._CP14.Cooking;
using Content.Server.Nutrition.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server.Nutrition.Components;
[RegisterComponent, Access(typeof(SliceableFoodSystem))]
[RegisterComponent, Access(typeof(SliceableFoodSystem), typeof(CP14CookingSystem))]
public sealed partial class SliceableFoodComponent : Component
{
/// <summary>

View File

@@ -85,6 +85,10 @@ public sealed class SliceableFoodSystem : EntitySystem
if (!TryComp<UtensilComponent>(usedItem, out var utensil) || (utensil.Types & UtensilType.Knife) == 0)
return false;
//CP14 transfer flavors
TryComp<FlavorProfileComponent>(uid, out var flavorProfile);
//CP14 end
var sliceVolume = solution.Volume / FixedPoint2.New(component.TotalCount);
for (int i = 0; i < component.TotalCount; i++)
{
@@ -93,6 +97,17 @@ public sealed class SliceableFoodSystem : EntitySystem
var lostSolution =
_solutionContainer.SplitSolution(soln.Value, sliceVolume);
//CP14 - transfer flavors
if (flavorProfile is not null)
{
var sliceFlavors = EnsureComp<FlavorProfileComponent>(sliceUid);
foreach (var newFlavor in flavorProfile.Flavors)
{
sliceFlavors.Flavors.Add(newFlavor);
}
}
//CP14 end
// Fill new slice
FillSlice(sliceUid, lostSolution);
}

View File

@@ -5,11 +5,12 @@
using System.Linq;
using System.Numerics;
using Content.Server.Nutrition.Components;
using Content.Server.Temperature.Systems;
using Content.Shared._CP14.Cooking;
using Content.Shared._CP14.Cooking.Components;
using Content.Shared._CP14.Temperature;
using Content.Shared.Nutrition.Components;
using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.Random;
namespace Content.Server._CP14.Cooking;
@@ -17,6 +18,7 @@ namespace Content.Server._CP14.Cooking;
public sealed class CP14CookingSystem : CP14SharedCookingSystem
{
[Dependency] private readonly TemperatureSystem _temperature = default!;
[Dependency] private readonly IRobustRandom _random = default!;
public override void Initialize()
{
@@ -24,25 +26,30 @@ public sealed class CP14CookingSystem : CP14SharedCookingSystem
SubscribeLocalEvent<CP14RandomFoodDataComponent, MapInitEvent>(OnRandomFoodMapInit);
SubscribeLocalEvent<CP14FoodVisualsComponent, CP14BeforeSpillEvent>(OnSpilled);
SubscribeLocalEvent<CP14FoodHolderComponent, CP14BeforeSpillEvent>(OnHolderSpilled);
SubscribeLocalEvent<CP14FoodCookerComponent, CP14BeforeSpillEvent>(OnCookerSpilled);
SubscribeLocalEvent<CP14FoodHolderComponent, SolutionContainerChangedEvent>(OnHolderChanged);
}
private void OnCookerSpilled(Entity<CP14FoodCookerComponent> ent, ref CP14BeforeSpillEvent args)
protected override bool TryTransferFood(Entity<CP14FoodHolderComponent> target, Entity<CP14FoodHolderComponent> source)
{
ent.Comp.HoldFood = false;
Dirty(ent);
if (base.TryTransferFood(target, source))
{
//Sliceable
if (source.Comp.FoodData?.SliceProto is not null)
{
var sliceable = EnsureComp<SliceableFoodComponent>(target);
sliceable.Slice = source.Comp.FoodData.SliceProto;
sliceable.TotalCount = source.Comp.FoodData.SliceCount;
}
}
return true;
}
private void OnHolderSpilled(Entity<CP14FoodHolderComponent> ent, ref CP14BeforeSpillEvent args)
private void OnHolderChanged(Entity<CP14FoodHolderComponent> ent, ref SolutionContainerChangedEvent args)
{
ent.Comp.HoldFood = false;
Dirty(ent);
}
if (args.Solution.Volume != 0)
return;
private void OnSpilled(Entity<CP14FoodVisualsComponent> ent, ref CP14BeforeSpillEvent args)
{
ent.Comp.FoodData = null;
Dirty(ent);
}
@@ -55,26 +62,17 @@ public sealed class CP14CookingSystem : CP14SharedCookingSystem
if (!_random.Prob(ent.Comp.Prob))
return;
//TODO: Fuck this dublication logic, and randomization visual
var randomFood = _random.Pick(OrderedRecipes.Where(r => r.FoodType == holder.FoodType).ToList());
//Name and Description
if (randomFood.FoodData.Name is not null)
_metaData.SetEntityName(ent, Loc.GetString(randomFood.FoodData.Name));
if (randomFood.FoodData.Desc is not null)
_metaData.SetEntityDescription(ent, Loc.GetString(randomFood.FoodData.Desc));
var foodVisuals = EnsureComp<CP14FoodVisualsComponent>(ent);
//Visuals
foodVisuals.FoodData = randomFood.FoodData;
//Some randomize
foreach (var layer in foodVisuals.FoodData.Visuals)
var filteredRecipes = OrderedRecipes.Where(r => r.FoodType == holder.FoodType).ToList();
if (filteredRecipes.Count == 0)
{
if (_random.Prob(0.5f))
layer.Scale = new Vector2(-1, 1);
Log.Error($"No recipes found for food type {holder.FoodType}");
return;
}
var randomFood = _random.Pick(filteredRecipes);
UpdateFoodDataVisuals((ent, holder), randomFood.FoodData, ent.Comp.Rename);
Dirty(ent.Owner, holder);
}
@@ -89,6 +87,20 @@ public sealed class CP14CookingSystem : CP14SharedCookingSystem
Spawn(ent.Comp.BurntAdditionalSpawn, Transform(ent).Coordinates);
}
protected override void UpdateFoodDataVisuals(Entity<CP14FoodHolderComponent> ent, CP14FoodData data, bool rename = true)
{
base.UpdateFoodDataVisuals(ent, data, rename);
if (ent.Comp.FoodData?.SliceProto is null)
return;
if (!TryComp<SliceableFoodComponent>(ent, out var sliceable))
return;
sliceable.Slice = ent.Comp.FoodData.SliceProto;
sliceable.TotalCount = ent.Comp.FoodData.SliceCount;
}
protected override void OnCookFinished(Entity<CP14FoodCookerComponent> ent, ref CP14CookingDoAfter args)
{
if (args.Cancelled || args.Handled)
@@ -125,10 +137,3 @@ public sealed class CP14CookingSystem : CP14SharedCookingSystem
}
}
}
/// <summary>
/// It is invoked on the entity from which all reagents are spilled.
/// </summary>
public sealed class CP14BeforeSpillEvent : EntityEventArgs
{
}

View File

@@ -11,4 +11,7 @@ public sealed partial class CP14RandomFoodDataComponent : Component
/// </summary>
[DataField]
public float Prob = 0.75f;
[DataField]
public bool Rename = true;
}

View File

@@ -1,3 +1,4 @@
using Content.Shared._CP14.Cooking;
using Content.Shared.Chemistry.Components;
using Content.Shared.Database;
using Content.Shared.DoAfter;

View File

@@ -20,5 +20,6 @@ public sealed partial class FlavorProfileComponent : Component
"Nutriment",
"Vitamin",
"Protein",
"Fat", //CP14
};
}

View File

@@ -4,10 +4,10 @@
*/
using Content.Shared._CP14.Cooking.Components;
using Content.Shared._CP14.Cooking.Prototypes;
using Content.Shared.DoAfter;
using Content.Shared.Temperature;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
@@ -55,10 +55,14 @@ public abstract partial class CP14SharedCookingSystem
if (args.Cancelled || args.Handled)
return;
if (!TryComp<CP14FoodHolderComponent>(ent, out var holder))
return;
if (!_proto.TryIndex(args.Recipe, out var indexedRecipe))
return;
CookFood(ent, indexedRecipe);
CreateFoodData(ent, indexedRecipe);
UpdateFoodDataVisuals((ent, holder), ent.Comp.RenameCooker);
args.Handled = true;
}
@@ -117,7 +121,10 @@ public abstract partial class CP14SharedCookingSystem
if (!_container.TryGetContainer(ent, ent.Comp.ContainerId, out var container))
return;
if (container.ContainedEntities.Count <= 0 && !ent.Comp.HoldFood)
if (!TryComp<CP14FoodHolderComponent>(ent, out var holder))
return;
if (container.ContainedEntities.Count <= 0 && holder.FoodData is null)
{
StopCooking(ent);
return;
@@ -128,7 +135,7 @@ public abstract partial class CP14SharedCookingSystem
ent.Comp.LastHeatingTime = _timing.CurTime;
DirtyField(ent.Owner,ent.Comp, nameof(CP14FoodCookerComponent.LastHeatingTime));
if (!_doAfter.IsRunning(ent.Comp.DoAfterId) && !ent.Comp.HoldFood)
if (!_doAfter.IsRunning(ent.Comp.DoAfterId) && holder.FoodData is null)
{
var recipe = GetRecipe(ent);
if (recipe is not null)

View File

@@ -14,25 +14,25 @@ public abstract partial class CP14SharedCookingSystem
private void InitTransfer()
{
SubscribeLocalEvent<CP14FoodHolderComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<CP14FoodCookerComponent, AfterInteractEvent>(OnInteractUsing);
SubscribeLocalEvent<CP14FoodHolderComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<CP14FoodCookerComponent, ContainerIsInsertingAttemptEvent>(OnInsertAttempt);
}
private void OnAfterInteract(Entity<CP14FoodHolderComponent> ent, ref AfterInteractEvent args)
private void OnInteractUsing(Entity<CP14FoodHolderComponent> target, ref InteractUsingEvent args)
{
if (!TryComp<CP14FoodCookerComponent>(args.Target, out var cooker))
if (!TryComp<CP14FoodHolderComponent>(args.Used, out var used))
return;
MoveFoodToHolder(ent, (args.Target.Value, cooker));
TryTransferFood(target, (args.Used, used));
}
private void OnInteractUsing(Entity<CP14FoodCookerComponent> ent, ref AfterInteractEvent args)
private void OnAfterInteract(Entity<CP14FoodHolderComponent> ent, ref AfterInteractEvent args)
{
if (!TryComp<CP14FoodHolderComponent>(args.Target, out var holder))
if (!TryComp<CP14FoodHolderComponent>(args.Target, out var target))
return;
MoveFoodToHolder((args.Target.Value, holder), ent);
TryTransferFood(ent, (args.Target.Value, target));
}
private void OnInsertAttempt(Entity<CP14FoodCookerComponent> ent, ref ContainerIsInsertingAttemptEvent args)
@@ -40,7 +40,10 @@ public abstract partial class CP14SharedCookingSystem
if (args.Cancelled)
return;
if (ent.Comp.HoldFood)
if (!TryComp<CP14FoodHolderComponent>(ent, out var holder))
return;
if (holder.FoodData is not null)
{
_popup.PopupEntity(Loc.GetString("cp14-cooking-popup-not-empty", ("name", MetaData(ent).EntityName)), ent);
args.Cancel();

View File

@@ -6,6 +6,7 @@
using System.Linq;
using System.Numerics;
using Content.Shared._CP14.Cooking.Components;
using Content.Shared._CP14.Cooking.Prototypes;
using Content.Shared.Audio;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
@@ -16,7 +17,6 @@ using Content.Shared.Fluids;
using Content.Shared.Nutrition.Components;
using Content.Shared.Popups;
using Content.Shared.Tag;
using Content.Shared.Throwing;
using Robust.Shared.Containers;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
@@ -26,17 +26,17 @@ namespace Content.Shared._CP14.Cooking;
public abstract partial class CP14SharedCookingSystem : EntitySystem
{
[Dependency] protected readonly IPrototypeManager _proto = default!;
[Dependency] protected readonly SharedContainerSystem _container = default!;
[Dependency] protected readonly IRobustRandom _random = default!;
[Dependency] protected readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] protected readonly SharedSolutionContainerSystem _solution = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedPuddleSystem _puddle = default!;
[Dependency] private readonly INetManager _net = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedAmbientSoundSystem _ambientSound = default!;
[Dependency] protected readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
/// <summary>
/// When overcooking food, we will replace the reagents inside with this reagent.
@@ -61,7 +61,7 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
CacheAndOrderRecipes();
SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnPrototypesReloaded);
SubscribeLocalEvent<CP14FoodVisualsComponent, ExaminedEvent>(OnExaminedEvent);
SubscribeLocalEvent<CP14FoodHolderComponent, ExaminedEvent>(OnExaminedEvent);
}
public override void Update(float frameTime)
@@ -85,7 +85,7 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
CacheAndOrderRecipes();
}
private void OnExaminedEvent(Entity<CP14FoodVisualsComponent> ent, ref ExaminedEvent args)
private void OnExaminedEvent(Entity<CP14FoodHolderComponent> ent, ref ExaminedEvent args)
{
if (ent.Comp.FoodData?.Name is null)
return;
@@ -107,31 +107,32 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
/// <summary>
/// Transfer food data from cooker to holder
/// </summary>
private void MoveFoodToHolder(Entity<CP14FoodHolderComponent> holder, Entity<CP14FoodCookerComponent> cooker)
protected virtual bool TryTransferFood(Entity<CP14FoodHolderComponent> target,
Entity<CP14FoodHolderComponent> source)
{
if (holder.Comp.HoldFood || !cooker.Comp.HoldFood)
return;
if (!source.Comp.CanGiveFood || !target.Comp.CanAcceptFood)
return false;
if (holder.Comp.FoodType != cooker.Comp.FoodType)
return;
if (target.Comp.FoodType != source.Comp.FoodType)
return false;
if (!TryComp<FoodComponent>(holder, out var holderFoodComp))
return;
if (source.Comp.FoodData is null)
return false;
if (!TryComp<CP14FoodVisualsComponent>(cooker, out var cookerFoodVisuals) || cookerFoodVisuals.FoodData is null)
return;
if (!TryComp<FoodComponent>(target, out var holderFoodComp))
return false;
if (!_solution.TryGetSolution(cooker.Owner, cooker.Comp.SolutionId, out var cookerSoln, out var cookerSolution))
return;
if (!_solution.TryGetSolution(source.Owner, source.Comp.SolutionId, out var cookerSoln, out var cookerSolution))
return false;
//Solutions
if (_solution.TryGetSolution(holder.Owner, holderFoodComp.Solution, out var holderSoln, out var solution))
if (_solution.TryGetSolution(target.Owner, holderFoodComp.Solution, out var holderSoln, out var solution))
{
if (solution.Volume > 0)
{
_popup.PopupEntity(Loc.GetString("cp14-cooking-popup-not-empty", ("name", MetaData(holder).EntityName)),
holder);
return;
_popup.PopupEntity(Loc.GetString("cp14-cooking-popup-not-empty", ("name", MetaData(target).EntityName)),
target);
return false;
}
_solution.TryTransferSolution(holderSoln.Value, cookerSolution, solution.MaxVolume);
@@ -139,63 +140,77 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
//Trash
//If we have a lot of trash, we put 1 random trash in each plate. If it's a last plate (out of solution in cooker), we put all the remaining trash in it.
if (cookerFoodVisuals.FoodData.Trash.Count > 0)
if (source.Comp.FoodData?.Trash.Count > 0)
{
if (cookerSolution.Volume <= 0)
{
holderFoodComp.Trash.AddRange(cookerFoodVisuals.FoodData.Trash);
holderFoodComp.Trash.AddRange(source.Comp.FoodData.Trash);
}
else
{
if (_net.IsServer)
{
var newTrash = _random.Pick(cookerFoodVisuals.FoodData.Trash);
cookerFoodVisuals.FoodData.Trash.Remove(newTrash);
var newTrash = _random.Pick(source.Comp.FoodData.Trash);
source.Comp.FoodData.Trash.Remove(newTrash);
holderFoodComp.Trash.Add(newTrash);
}
}
}
if (source.Comp.FoodData is not null)
UpdateFoodDataVisuals(target, source.Comp.FoodData);
Dirty(target);
Dirty(source);
_solution.UpdateChemicals(cookerSoln.Value);
return true;
}
private void UpdateFoodDataVisuals(
Entity<CP14FoodHolderComponent> ent,
bool rename = true)
{
var data = ent.Comp.FoodData;
if (data is null)
return;
UpdateFoodDataVisuals(ent, data, rename);
}
protected virtual void UpdateFoodDataVisuals(
Entity<CP14FoodHolderComponent> ent,
CP14FoodData data,
bool rename = true)
{
//Name and Description
if (cookerFoodVisuals.FoodData.Name is not null)
_metaData.SetEntityName(holder, Loc.GetString(cookerFoodVisuals.FoodData.Name));
if (cookerFoodVisuals.FoodData.Desc is not null)
_metaData.SetEntityDescription(holder, Loc.GetString(cookerFoodVisuals.FoodData.Desc));
if (rename)
{
if (data.Name is not null)
_metaData.SetEntityName(ent, Loc.GetString(data.Name));
if (data.Desc is not null)
_metaData.SetEntityDescription(ent, Loc.GetString(data.Desc));
}
//Flavors
EnsureComp<FlavorProfileComponent>(holder, out var flavorComp);
foreach (var flavor in cookerFoodVisuals.FoodData.Flavors)
EnsureComp<FlavorProfileComponent>(ent, out var flavorComp);
foreach (var flavor in data.Flavors)
{
flavorComp.Flavors.Add(flavor);
}
//Visuals
var holderFoodVisuals = EnsureComp<CP14FoodVisualsComponent>(holder);
holderFoodVisuals.FoodData = new CP14FoodData(cookerFoodVisuals.FoodData);
//Visual random
foreach (var layer in holderFoodVisuals.FoodData.Visuals)
ent.Comp.FoodData = new CP14FoodData(data);
foreach (var layer in data.Visuals)
{
if (_random.Prob(0.5f))
layer.Scale = new Vector2(-1, 1);
}
//Clear cooker data
if (cookerSolution.Volume <= 0)
{
cookerFoodVisuals.FoodData = null;
cooker.Comp.HoldFood = false;
}
holder.Comp.HoldFood = true;
Dirty(holder, holderFoodVisuals);
Dirty(cooker, cookerFoodVisuals);
Dirty(holder);
Dirty(cooker);
_solution.UpdateChemicals(cookerSoln.Value);
//Sliceable
// > on server overrided side
}
public CP14CookingRecipePrototype? GetRecipe(Entity<CP14FoodCookerComponent> ent)
@@ -218,7 +233,9 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
return GetRecipe(ent.Comp.FoodType, solution, allTags);
}
public CP14CookingRecipePrototype? GetRecipe(CP14FoodType foodType, Solution? solution, List<ProtoId<TagPrototype>> allTags)
public CP14CookingRecipePrototype? GetRecipe(ProtoId<CP14FoodTypePrototype> foodType,
Solution? solution,
List<ProtoId<TagPrototype>> allTags)
{
if (OrderedRecipes.Count == 0)
{
@@ -252,7 +269,7 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
return selectedRecipe;
}
protected void CookFood(Entity<CP14FoodCookerComponent> ent, CP14CookingRecipePrototype recipe)
protected void CreateFoodData(Entity<CP14FoodCookerComponent> ent, CP14CookingRecipePrototype recipe)
{
if (!_solution.TryGetSolution(ent.Owner, ent.Comp.SolutionId, out var soln, out var solution))
return;
@@ -260,18 +277,7 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
if (!_container.TryGetContainer(ent, ent.Comp.ContainerId, out var container))
return;
var newData = new CP14FoodData
{
Visuals = new List<PrototypeLayerData>(recipe.FoodData.Visuals),
Trash = new List<EntProtoId>(recipe.FoodData.Trash),
Flavors = new HashSet<LocId>(recipe.FoodData.Flavors),
Name = recipe.FoodData.Name,
Desc = recipe.FoodData.Desc,
CurrentRecipe = recipe
};
newData.Name = recipe.FoodData.Name;
newData.Desc = recipe.FoodData.Desc;
var newData = new CP14FoodData(recipe.FoodData);
//Process entities
foreach (var contained in container.ContainedEntities)
@@ -307,36 +313,36 @@ public abstract partial class CP14SharedCookingSystem : EntitySystem
if (solution.Volume <= 0)
return;
var foodVisuals = EnsureComp<CP14FoodVisualsComponent>(ent.Owner);
foodVisuals.FoodData = newData;
ent.Comp.HoldFood = true;
if (TryComp<CP14FoodHolderComponent>(ent.Owner, out var holder))
{
holder.FoodData = newData;
Dirty(ent.Owner, holder);
}
Dirty(ent);
Dirty(ent, foodVisuals);
}
protected void BurntFood(Entity<CP14FoodCookerComponent> ent)
{
if (!TryComp<CP14FoodVisualsComponent>(ent, out var foodVisuals) || foodVisuals.FoodData is null)
if (!TryComp<CP14FoodHolderComponent>(ent, out var holder) || holder.FoodData is null)
return;
if (!_solution.TryGetSolution(ent.Owner, ent.Comp.SolutionId, out var soln, out var solution))
return;
//Brown visual
foreach (var visuals in foodVisuals.FoodData.Visuals)
foreach (var visuals in holder.FoodData.Visuals)
{
visuals.Color = Color.FromHex("#212121");
}
foodVisuals.FoodData.Name = Loc.GetString("cp14-meal-recipe-burned-trash-name");
foodVisuals.FoodData.Desc = Loc.GetString("cp14-meal-recipe-burned-trash-desc");
holder.FoodData.Name = Loc.GetString("cp14-meal-recipe-burned-trash-name");
holder.FoodData.Desc = Loc.GetString("cp14-meal-recipe-burned-trash-desc");
var replacedVolume = solution.Volume / 2;
solution.SplitSolution(replacedVolume);
solution.AddReagent(_burntFoodReagent, replacedVolume / 2);
DirtyField(ent.Owner, foodVisuals, nameof(CP14FoodVisualsComponent.FoodData));
DirtyField(ent.Owner, holder, nameof(CP14FoodHolderComponent.FoodData));
}
}

View File

@@ -3,6 +3,7 @@
* https://github.com/space-wizards/space-station-14/blob/master/LICENSE.TXT
*/
using Content.Shared._CP14.Cooking.Prototypes;
using Content.Shared.DoAfter;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
@@ -10,14 +11,14 @@ using Robust.Shared.Serialization;
namespace Content.Shared._CP14.Cooking.Components;
/// <summary>
/// Prepares food from ingredients and places it in the FoodHolderComponent
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), Access(typeof(CP14SharedCookingSystem))]
public sealed partial class CP14FoodCookerComponent : Component
{
[DataField]
public bool HoldFood = false;
[DataField(required: true)]
public CP14FoodType FoodType;
public ProtoId<CP14FoodTypePrototype> FoodType;
[DataField]
public string ContainerId;
@@ -50,6 +51,9 @@ public sealed partial class CP14FoodCookerComponent : Component
[DataField]
public float BurntAdditionalSpawnProb = 0.2f;
[DataField]
public bool RenameCooker = false;
}
[Serializable]
@@ -64,6 +68,8 @@ public sealed partial class CP14FoodData
Visuals = new List<PrototypeLayerData>(data.Visuals);
Trash = new List<EntProtoId>(data.Trash);
Flavors = new HashSet<LocId>(data.Flavors);
SliceProto = data.SliceProto;
SliceCount = data.SliceCount;
}
[DataField]
@@ -83,12 +89,12 @@ public sealed partial class CP14FoodData
[DataField]
public HashSet<LocId> Flavors = new();
}
public enum CP14FoodType
{
Meal,
Soup,
[DataField]
public EntProtoId? SliceProto;
[DataField]
public ushort SliceCount = 5;
}
[Serializable, NetSerializable]

View File

@@ -3,20 +3,47 @@
* https://github.com/space-wizards/space-station-14/blob/master/LICENSE.TXT
*/
using Content.Shared._CP14.Cooking.Prototypes;
using Robust.Shared.GameStates;
using Robust.Shared.Utility;
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.Cooking.Components;
[RegisterComponent, NetworkedComponent, Access(typeof(CP14SharedCookingSystem))]
/// <summary>
/// Food of the specified type can be transferred to this entity.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), Access(typeof(CP14SharedCookingSystem))]
public sealed partial class CP14FoodHolderComponent : Component
{
/// <summary>
/// What food is currently stored here?
/// </summary>
[DataField, AutoNetworkedField]
public CP14FoodData? FoodData;
[DataField]
public bool HoldFood = false;
public bool CanAcceptFood = false;
[DataField]
public bool CanGiveFood = false;
[DataField(required: true)]
public CP14FoodType FoodType;
public ProtoId<CP14FoodTypePrototype> FoodType;
[DataField]
public string? SolutionId;
[DataField]
public int MaxDisplacementFillLevels = 8;
[DataField]
public string? DisplacementRsiPath;
/// <summary>
/// target layer, where new layers will be added. This allows you to control the order of generative layers and static layers.
/// </summary>
[DataField]
public string TargetLayerMap = "cp14_foodLayers";
public HashSet<string> RevealedLayers = new();
}

View File

@@ -1,36 +0,0 @@
/*
* This file is sublicensed under MIT License
* https://github.com/space-wizards/space-station-14/blob/master/LICENSE.TXT
*/
using Robust.Shared.GameStates;
using Robust.Shared.Utility;
namespace Content.Shared._CP14.Cooking.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true, true), Access(typeof(CP14SharedCookingSystem))]
public sealed partial class CP14FoodVisualsComponent : Component
{
/// <summary>
/// What food is currently stored here?
/// </summary>
[DataField, AutoNetworkedField]
public CP14FoodData? FoodData;
[DataField]
public int MaxDisplacementFillLevels = 8;
[DataField]
public string? DisplacementRsiPath = null;
[DataField]
public string? SolutionId;
/// <summary>
/// target layer, where new layers will be added. This allows you to control the order of generative layers and static layers.
/// </summary>
[DataField]
public string TargetLayerMap = "cp14_foodLayers";
public HashSet<string> RevealedLayers = new();
}

View File

@@ -7,7 +7,7 @@ using Content.Shared._CP14.Cooking.Components;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.Cooking;
namespace Content.Shared._CP14.Cooking.Prototypes;
[Prototype("CP14CookingRecipe")]
public sealed class CP14CookingRecipePrototype : IPrototype
@@ -28,8 +28,8 @@ public sealed class CP14CookingRecipePrototype : IPrototype
[DataField]
public CP14FoodData FoodData = new();
[DataField]
public CP14FoodType FoodType = CP14FoodType.Meal;
[DataField(required: true)]
public ProtoId<CP14FoodTypePrototype> FoodType;
[DataField]
public TimeSpan CookingTime = TimeSpan.FromSeconds(20f);

View File

@@ -0,0 +1,15 @@
/*
* This file is sublicensed under MIT License
* https://github.com/space-wizards/space-station-14/blob/master/LICENSE.TXT
*/
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.Cooking.Prototypes;
[Prototype("CP14FoodType")]
public sealed class CP14FoodTypePrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
}

View File

@@ -30,6 +30,6 @@ public sealed partial class TagBlocked : CP14CookingCraftRequirement
public override float GetComplexity()
{
return 1;
return Tags.Count * -1;
}
}

View File

@@ -6,8 +6,10 @@
using System.Linq;
using Content.Shared._CP14.Cooking;
using Content.Shared._CP14.Cooking.Components;
using Content.Shared._CP14.Cooking.Prototypes;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.FixedPoint;
using Content.Shared.Nutrition.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
@@ -28,16 +30,16 @@ public sealed partial class FoodResource : CP14WorkbenchCraftRequirement
var solutionSys = entManager.System<SharedSolutionContainerSystem>();
foreach (var ent in placedEntities)
{
if (!entManager.TryGetComponent<CP14FoodVisualsComponent>(ent, out var foodVisuals))
if (!entManager.TryGetComponent<CP14FoodHolderComponent>(ent, out var foodHolder))
continue;
if (entManager.HasComponent<CP14FoodHolderComponent>(ent))
if (!entManager.HasComponent<FoodComponent>(ent))
continue;
if (foodVisuals.FoodData?.CurrentRecipe != Recipe)
if (foodHolder.FoodData?.CurrentRecipe != Recipe)
continue;
if (!solutionSys.TryGetSolution(ent, foodVisuals.SolutionId, out _, out var solution))
if (!solutionSys.TryGetSolution(ent, foodHolder.SolutionId, out _, out var solution))
continue;
if (solution.Volume < Count)
@@ -57,16 +59,16 @@ public sealed partial class FoodResource : CP14WorkbenchCraftRequirement
foreach (var ent in placedEntities)
{
if (!entManager.TryGetComponent<CP14FoodVisualsComponent>(ent, out var foodVisuals))
if (!entManager.TryGetComponent<CP14FoodHolderComponent>(ent, out var foodHolder))
continue;
if (entManager.HasComponent<CP14FoodHolderComponent>(ent))
if (!entManager.HasComponent<FoodComponent>(ent))
continue;
if (foodVisuals.FoodData?.CurrentRecipe != Recipe)
if (foodHolder.FoodData?.CurrentRecipe != Recipe)
continue;
if (!solutionSys.TryGetSolution(ent, foodVisuals.SolutionId, out _, out var solution))
if (!solutionSys.TryGetSolution(ent, foodHolder.SolutionId, out _, out var solution))
continue;
if (solution.Volume < Count)

View File

@@ -0,0 +1,2 @@
cp14-soup-recipe-pie-name = pie
cp14-soup-recipe-pie-desc = It's time to get a knife and cut the pie to see what's inside!

View File

@@ -0,0 +1,2 @@
cp14-soup-recipe-pie-name = пирог
cp14-soup-recipe-pie-desc = Самое время достать нож, и порезать пирог, чтобы узнать что у него внутри!

View File

@@ -14,12 +14,11 @@
solutions:
food:
maxVol: 30
- type: CP14FoodVisuals
displacementRsiPath: _CP14/Objects/Consumable/Food/Soups/displacement.rsi
solutionId: food
- type: CP14FoodHolder
foodType: Soup
solutionId: food
displacementRsiPath: _CP14/Objects/Consumable/Food/Soups/displacement.rsi
canAcceptFood: true
- type: Appearance
- type: SolutionContainerVisuals
- type: Food
@@ -27,6 +26,8 @@
path: /Audio/Items/drink.ogg
utensil: Spoon
transferAmount: 2.5
- type: Spillable
solution: food
- type: entity
id: CP14BowlWooden

View File

@@ -0,0 +1,64 @@
- type: entity
parent: FoodInjectableBase
id: CP14FoodPiePieceBase
abstract: true
categories: [ ForkFiltered ]
components:
- type: Item
size: Tiny
- type: Temperature
- type: Sprite
sprite: _CP14/Objects/Consumable/Food/Pies/pieces.rsi
- type: SolutionContainerManager
solutions:
food:
maxVol: 10
reagents:
- ReagentId: Nutriment
Quantity: 7
- ReagentId: Protein
Quantity: 2
- type: entity
id: CP14FoodPiePieceTrash
parent: CP14FoodPiePieceBase
name: a piece of disgusting pie
description: On the outside, it looked appealing and delicious, but on the inside, it was simply awful.
components:
- type: Sprite
layers:
- state: blank
- state: trash
- type: entity
id: CP14FoodPiePieceMeat
parent: CP14FoodPiePieceBase
name: a piece of meat pie
description: Pie with juicy meat.
components:
- type: Sprite
layers:
- state: blank
- state: meat
- type: entity
id: CP14FoodPiePiecePumpkin
parent: CP14FoodPiePieceBase
name: a piece of pumpkin pie
description: Pumpkin pie. Sweet and delicate.
components:
- type: Sprite
layers:
- state: blank
- state: pumpkin
- type: entity
id: CP14FoodPiePieceVeg
parent: CP14FoodPiePieceBase
name: a piece of vegetable pie
description: Vegetables and herbs inside
components:
- type: Sprite
layers:
- state: blank
- state: veg

View File

@@ -15,16 +15,17 @@
solutions:
food:
maxVol: 20
- type: CP14FoodVisuals
displacementRsiPath: _CP14/Objects/Consumable/Food/Meals/displacement.rsi
solutionId: food
- type: CP14FoodHolder
displacementRsiPath: _CP14/Objects/Consumable/Food/Meals/displacement.rsi
foodType: Meal
solutionId: food
canAcceptFood: true
- type: Appearance
- type: SolutionContainerVisuals
- type: Food
transferAmount: 2.5
- type: Spillable
solution: food
- type: entity
id: CP14PlateWooden

View File

@@ -1,23 +1,3 @@
- type: entity
id: CP14PlatePie
parent: BaseItem
name: pie plate
description: A mould for making a delicious pie.
categories: [ ForkFiltered ]
components:
- type: Sprite
sprite: _CP14/Objects/Consumable/Food/pie.rsi
state: tin
- type: Item
shape:
- 0,0,1,0
- type: Tag
tags:
- CP14PlatePie
- type: PhysicalComposition
materialComposition:
CP14Iron: 10 # 1 iron bar = 1 plate pie in craft
- type: entity
parent: BaseItem
id: CP14Fork

View File

@@ -1,358 +0,0 @@
# base
- type: entity
parent: FoodInjectableBase
id: CP14FoodPieBase
abstract: true
categories: [ ForkFiltered ]
components:
- type: Item
size: Normal
storedRotation: -90
- type: Temperature
- type: FlavorProfile
flavors:
- sweet
- type: Sprite
sprite: _CP14/Objects/Consumable/Food/pie.rsi
- type: SolutionContainerManager
solutions:
food:
maxVol: 20
reagents:
- ReagentId: Nutriment
Quantity: 12
- ReagentId: Protein
Quantity: 5
- type: Food
trash:
- CP14PlatePie
- type: Tag
tags:
- Pie
- type: StaticPrice
price: 6 # price for crafting and plate
- type: PhysicalComposition
materialComposition:
CP14Iron: 10 # 1 iron bar = 1 plate pie in craft
- type: entity
parent: FoodInjectableBase
id: CP14FoodPieBaseRaw
abstract: true
categories: [ ForkFiltered ]
components:
- type: Item
size: Normal
storedRotation: -90
- type: Temperature
- type: FlavorProfile
flavors:
- raw dough
- type: Sprite
sprite: _CP14/Objects/Consumable/Food/pie.rsi
- type: SolutionContainerManager
solutions:
food:
maxVol: 20
reagents:
- ReagentId: Nutriment
Quantity: 12
- ReagentId: UncookedAnimalProteins
Quantity: 5
- type: Food
trash:
- CP14PlatePie
- type: PhysicalComposition
materialComposition:
CP14Iron: 10 # 1 iron bar = 1 plate pie in craft
# pie
- type: entity
name: raw apple pie
parent: CP14FoodPieBaseRaw
id: CP14FoodPieAppleRaw
description: Raw dough with apples seems like a cnr you shouldn't be eating right now.
components:
- type: FlavorProfile
flavors:
- raw dough
- apple
- type: SolutionContainerManager
solutions:
food:
maxVol: 20
reagents:
- ReagentId: Nutriment
Quantity: 6
- ReagentId: UncookedAnimalProteins
Quantity: 2
- ReagentId: Vitamin
Quantity: 5
- type: Sprite
layers:
- state: tin
- state: apple_raw
- type: Tag
tags:
- Fruit
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPieApple
- type: entity
name: apple pie
parent: CP14FoodPieBase
id: CP14FoodPieApple
description: Apple pie beckons with its smells.
components:
- type: FlavorProfile
flavors:
- sweet
- apple
- type: SolutionContainerManager
solutions:
food:
maxVol: 20
reagents:
- ReagentId: Nutriment
Quantity: 15
- ReagentId: Protein
Quantity: 4
- ReagentId: Vitamin
Quantity: 14
- type: Sprite
layers:
- state: tin
- state: apple
- type: Tag
tags:
- Fruit
- Pie
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPieBurnt
- type: entity
name: raw meat pie
parent: CP14FoodPieBaseRaw
id: CP14FoodPieMeatRaw
description: Raw dough with raw meat, not the best dish at the moment.
components:
- type: FlavorProfile
flavors:
- raw dough
- meaty
- type: SolutionContainerManager
solutions:
food:
maxVol: 34
reagents:
- ReagentId: Nutriment
Quantity: 16
- ReagentId: UncookedAnimalProteins
Quantity: 13
- ReagentId: Vitamin
Quantity: 2
- type: Sprite
layers:
- state: tin
- state: meat_raw
- type: Tag
tags:
- Meat
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPieMeat
- type: entity
name: meat pie
parent: CP14FoodPieBase
id: CP14FoodPieMeat
description: Oh that wonderful aroma of bread and meat, I could eat that right now.
components:
- type: FlavorProfile
flavors:
- meaty
- type: SolutionContainerManager
solutions:
food:
maxVol: 34
reagents:
- ReagentId: Nutriment
Quantity: 16
- ReagentId: Protein
Quantity: 13
- ReagentId: Vitamin
Quantity: 2
- type: Sprite
layers:
- state: tin
- state: meat
- type: Tag
tags:
- Meat
- Pie
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPieBurnt
- type: entity
name: raw fish pie
parent: CP14FoodPieBaseRaw
id: CP14FoodPieFishRaw
description: Raw dough with raw fish..... Where did they get the fish?!
components:
- type: FlavorProfile
flavors:
- raw dough
- fishy
- type: Sprite
layers:
- state: tin
- state: fisht_raw
- type: Tag
tags:
- Meat
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPieFish
- type: StaticPrice
price: 20
- type: entity
name: fish pie
parent: CP14FoodPieBase
id: CP14FoodPieFish
description: Fish pie, a good alternative among meat dishes.
components:
- type: FlavorProfile
flavors:
- fishy
- type: SolutionContainerManager
solutions:
food:
maxVol: 30
reagents:
- ReagentId: Nutriment
Quantity: 15
- ReagentId: Protein
Quantity: 8
- ReagentId: Vitamin
Quantity: 6
- type: Sprite
layers:
- state: tin
- state: fish
- type: Tag
tags:
- Meat
- Pie
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPieBurnt
- type: entity
name: raw pumpkin pie
parent: CP14FoodPieBaseRaw
id: CP14FoodPiePumpkinRaw
description: Raw dough with pumpkin, can be a satisfyingly flavorful dish.
components:
- type: FlavorProfile
flavors:
- raw dough
- pumpkin
- type: Sprite
layers:
- state: tin
- state: pumpkin_raw
- type: SolutionContainerManager
solutions:
food:
maxVol: 20
reagents:
- ReagentId: Nutriment
Quantity: 2
- ReagentId: UncookedAnimalProteins
Quantity: 2
- ReagentId: PumpkinFlesh
Quantity: 10
- ReagentId: Vitamin
Quantity: 4
- type: Tag
tags:
- Fruit
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPiePumpkin
- type: entity
name: pumpkin pie
parent: CP14FoodPieBase
id: CP14FoodPiePumpkin
description: Delicious pumpkin pie, with a toasted crust on the outside.
components:
- type: FlavorProfile
flavors:
- pumpkin
- type: Sprite
layers:
- state: tin
- state: pumpkin
- type: SolutionContainerManager
solutions:
food:
maxVol: 20
reagents:
- ReagentId: Nutriment
Quantity: 4
- ReagentId: Protein
Quantity: 2
- ReagentId: PumpkinFlesh
Quantity: 10
- ReagentId: Vitamin
Quantity: 4
- type: Tag
tags:
- Fruit
- Pie
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14FoodPieBurnt
- type: entity
name: burnt pie
parent: CP14FoodPieBaseRaw
id: CP14FoodPieBurnt
description: The pie is burnt and is a burnt and inedible mass. It's best to clean that up with a knife.
components:
- type: FlavorProfile
flavors:
- terrible
- type: Sprite
layers:
- state: tin
- state: burnt_pie
- type: SolutionContainerManager
solutions:
food:
maxVol: 15
reagents:
- ReagentId: Nutriment
Quantity: 2
- ReagentId: CP14BurntFood
Quantity: 8
- type: Butcherable
butcheringType: Knife
spawned:
- id: CP14PlatePie
amount: 1

View File

@@ -21,9 +21,6 @@
burn:
True: { visible: true }
False: { visible: false }
- type: Item
size: Ginormous
- type: MultiHandedItem
- type: ContainerContainer
containers:
storagebase: !type:Container
@@ -32,7 +29,6 @@
maxItemSize: Normal
grid:
- 0,0,3,3
- 0,0,2,2
whitelist:
components:
- Food

View File

@@ -5,7 +5,7 @@
description: Container for cooking Grand Soup.
components:
- type: Sprite
sprite: _CP14/Objects/Specific/Cooking/cooking_pot.rsi
sprite: _CP14/Objects/Consumable/Food/Soups/cooking_pot.rsi
layers:
- state: base
map: ["enum.StorageVisualLayers.Base"]
@@ -23,13 +23,18 @@
solutions:
cooker:
maxVol: 150
- type: CP14FoodVisuals
- type: CP14FoodHolder
foodType: Soup
solutionId: cooker
displacementRsiPath: _CP14/Objects/Consumable/Food/Soups/displacement_pot.rsi
maxDisplacementFillLevels: 2
canGiveFood: true
- type: CP14FoodCooker
foodType: Soup
solutionId: cooker
- type: Item
size: Ginormous
- type: MultiHandedItem
- type: RefillableSolution
solution: cooker
- type: Spillable

View File

@@ -5,7 +5,7 @@
description: "You can always watch three things: how fire burns, how water flows, and how delicious meat is cooked."
components:
- type: Sprite
sprite: _CP14/Objects/Specific/Cooking/frying_pan.rsi
sprite: _CP14/Objects/Consumable/Food/Meals/frying_pan.rsi
layers:
- state: base
map: ["enum.StorageVisualLayers.Base"]
@@ -35,10 +35,15 @@
solutions:
cooker:
maxVol: 100
- type: CP14FoodVisuals
- type: CP14FoodHolder
foodType: Meal
solutionId: cooker
displacementRsiPath: _CP14/Objects/Consumable/Food/Meals/displacement_pan.rsi
maxDisplacementFillLevels: 2
canGiveFood: true
- type: Item
size: Ginormous
- type: MultiHandedItem
- type: CP14FoodCooker
foodType: Meal
solutionId: cooker

View File

@@ -0,0 +1,84 @@
- type: entity
id: CP14PlatePie
parent: CP14CookerBase
name: pie plate
description: A mould for making a delicious pie.
categories: [ ForkFiltered ]
components:
- type: Sprite
sprite: _CP14/Objects/Consumable/Food/Pies/plate.rsi
layers:
- state: iron
- map: ["cp14_foodLayers"]
- map: ["enum.StorageFillLayers.Fill"]
- type: Item
size: Normal
shape:
- 0,0,1,1
- type: PhysicalComposition
materialComposition:
CP14Iron: 10 # 1 iron bar = 1 plate pie in craft
- type: CP14FoodCooker
foodType: Pie
solutionId: cooker
- type: CP14FoodHolder
foodType: Pie
solutionId: cooker
- type: Storage
maxItemSize: Small
grid:
- 0,0,2,2
cP14Ignorelist:
components:
- CP14FoodHolder
- FoodSequenceStartPoint
- Sharp
- CP14Sharpened
- type: Appearance
- type: StorageFillVisualizer
maxFillLevels: 3
fillBaseName: raw
- type: SolutionContainerManager
solutions:
cooker:
maxVol: 50
- type: AmbientSound
sound:
path: /Audio/_CP14/Ambience/pan_frying.ogg
- type: GenericVisualizer
visuals:
enum.CP14CookingVisuals.Cooking:
cook:
True: { visible: true }
False: { visible: false }
enum.CP14CookingVisuals.Burning:
burn:
True: { visible: true }
False: { visible: false }
- type: Food
solution: cooker
transferAmount: 2.5
trash:
- CP14PlatePie
- type: Spillable
solution: cooker
- type: SolutionContainerVisuals
- type: SliceableFood
- type: entity
id: CP14PlatePieRandom
suffix: Random food
parent: CP14PlatePie
components:
- type: CP14RandomFoodData
- type: SolutionContainerManager
solutions:
cooker:
maxVol: 50
reagents:
- ReagentId: Nutriment
Quantity: 20
- ReagentId: Protein
Quantity: 20
- ReagentId: Fat
Quantity: 10

View File

@@ -0,0 +1,8 @@
- type: CP14FoodType
id: Meal
- type: CP14FoodType
id: Soup
- type: CP14FoodType
id: Pie

View File

@@ -0,0 +1,61 @@
- type: CP14CookingRecipe
id: InediblePie
foodType: Pie
foodData:
name: cp14-soup-recipe-pie-name
desc: cp14-soup-recipe-pie-desc
visuals:
- sprite: _CP14/Objects/Consumable/Food/Pies/misc.rsi
state: veg
sliceProto: CP14FoodPiePieceTrash
requirements:
- !type:AlwaysMet
# 1 Req
- type: CP14CookingRecipe
id: PieVeg
foodType: Pie
foodData:
name: cp14-soup-recipe-pie-name
desc: cp14-soup-recipe-pie-desc
visuals:
- sprite: _CP14/Objects/Consumable/Food/Pies/misc.rsi
state: veg
sliceProto: CP14FoodPiePieceVeg
requirements:
- !type:TagRequired
tags:
- CP14Salad
- CP14Vegetable
- type: CP14CookingRecipe
id: PieMeat
foodType: Pie
foodData:
name: cp14-soup-recipe-pie-name
desc: cp14-soup-recipe-pie-desc
visuals:
- sprite: _CP14/Objects/Consumable/Food/Pies/misc.rsi
state: meat
sliceProto: CP14FoodPiePieceMeat
requirements:
- !type:TagRequired
tags:
- CP14Meat
- CP14MeatSlice
- type: CP14CookingRecipe
id: PiePumpkin
foodType: Pie
foodData:
name: cp14-soup-recipe-pie-name
desc: cp14-soup-recipe-pie-desc
visuals:
- sprite: _CP14/Objects/Consumable/Food/Pies/misc.rsi
state: meat
sliceProto: CP14FoodPiePiecePumpkin
requirements:
- !type:TagRequired
tags:
- CP14Pumpkin

View File

@@ -1,59 +0,0 @@
- type: CP14Recipe
id: CP14FoodPieAppleRaw
tag: CP14RecipeCooking
craftTime: 5
requirements:
- !type:ProtoIdResource
protoId: CP14PlatePie
- !type:ProtoIdResource
protoId: CP14FoodDoughMediumFlat
- !type:ProtoIdResource
protoId: CP14FoodAppleSlice
count: 4
result: CP14FoodPieAppleRaw
- type: CP14Recipe
id: CP14FoodPieMeatRaw
tag: CP14RecipeCooking
craftTime: 5
requirements:
- !type:ProtoIdResource
protoId: CP14PlatePie
- !type:ProtoIdResource
protoId: CP14FoodDoughMediumFlat
- !type:ProtoIdResource
protoId: CP14FoodMeatPigSlice
count: 3
result: CP14FoodPieMeatRaw
- type: CP14Recipe
id: CP14FoodPiePumpkinRaw
tag: CP14RecipeCooking
craftTime: 5
requirements:
- !type:ProtoIdResource
protoId: CP14PlatePie
- !type:ProtoIdResource
protoId: CP14FoodDoughMediumFlat
- !type:ProtoIdResource
protoId: CP14FoodPumpkinSlice
count: 5
result: CP14FoodPiePumpkinRaw
# preobaly just a placeholder until we get actaul fish
- type: CP14Recipe
id: CP14FoodPieFishRaw
tag: CP14RecipeCooking
craftTime: 5
requirements:
- !type:ProtoIdResource
protoId: CP14PlatePie
- !type:ProtoIdResource
protoId: CP14FoodDoughMediumFlat
- !type:ProtoIdResource
protoId: CP14FoodMeatFlemTorso
- !type:ProtoIdResource
protoId: CP14FoodMeatFlemLeg
count: 2
result: CP14FoodPieFishRaw

View File

@@ -73,9 +73,6 @@
- type: Tag
id: CP14Arrow
- type: Tag
id: CP14PlatePie
- type: Tag
id: CP14FarmFood

View File

@@ -52,7 +52,7 @@
reputationLevel: 1
uiPosition: 2
icon:
sprite: _CP14/Objects/Specific/Cooking/frying_pan.rsi
sprite: _CP14/Objects/Consumable/Food/Meals/frying_pan.rsi
state: base
service: !type:CP14BuyItemsService
product: CP14FryingPan
@@ -64,7 +64,7 @@
reputationLevel: 1
uiPosition: 3
icon:
sprite: _CP14/Objects/Specific/Cooking/cooking_pot.rsi
sprite: _CP14/Objects/Consumable/Food/Soups/cooking_pot.rsi
state: base
service: !type:CP14BuyItemsService
product: CP14CookingPot

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

View File

@@ -7,6 +7,9 @@
"y": 32
},
"states": [
{
"name": "dirt"
},
{
"name": "wooden"
},

View File

@@ -0,0 +1,20 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-4.0",
"copyright": "Created by Artista",
"states": [
{
"name": "fruit"
},
{
"name": "veg"
},
{
"name": "meat"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

View File

@@ -0,0 +1,26 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-4.0",
"copyright": "Created by TheShuEd",
"states": [
{
"name": "blank"
},
{
"name": "meat"
},
{
"name": "pumpkin"
},
{
"name": "trash"
},
{
"name": "veg"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

View File

@@ -0,0 +1,23 @@
{
"version": 1,
"license": "All right reserved",
"copyright": "Created by Prazat",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "iron"
},
{
"name": "raw-0"
},
{
"name": "raw-1"
},
{
"name": "raw-2"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

View File

@@ -7,6 +7,9 @@
"y": 32
},
"states": [
{
"name": "dirt"
},
{
"name": "wooden"
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

View File

@@ -1,41 +0,0 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-4.0",
"copyright": "Created by Artista, pumpkin by aeoli (discord), burnt_pie by nimfar11",
"states": [
{
"name": "apple"
},
{
"name": "apple_raw"
},
{
"name": "fish"
},
{
"name": "fisht_raw"
},
{
"name": "meat"
},
{
"name": "meat_raw"
},
{
"name": "pumpkin"
},
{
"name": "pumpkin_raw"
},
{
"name": "burnt_pie"
},
{
"name": "tin"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 435 B

View File

@@ -371,7 +371,12 @@ CP14WoodenClosetGuardCommanderFilled: null
#2025-13-07
CP14Plate: CP14PlateWooden
CP14FoodPieApple: null
CP14FoodPieAppleRaw: null
CP14FoodPieFish: null
CP14FoodPieFishRaw: null
CP14FoodPieMeat: null
CP14FoodPieMeatRaw: null
# <---> CrystallEdge migration zone end