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

@@ -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