* pie

* qwe

* recipe

* Solution

* dough

* some tweaks

* fix crafting bugs

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
Co-authored-by: Ed <edwardxperia2000@gmail.com>
This commit is contained in:
Nim
2025-01-25 13:40:16 +02:00
committed by GitHub
parent 65faa9ae63
commit 918c7d1e3b
20 changed files with 420 additions and 116 deletions

View File

@@ -94,9 +94,8 @@ public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
for (int i = 0; i < recipe.ResultCount; i++)
{
var resultEntity = Spawn(recipe.Result);
resultEntities.Add(resultEntity);
_transform.SetCoordinates(resultEntity, Transform(ent).Coordinates);
_stack.TryMergeToContacts(resultEntity);
if (recipe.TryMergeSolutions)
{
@@ -116,7 +115,9 @@ public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
var requiredCount = requiredIngredient.Value;
foreach (var placedEntity in placedEntities)
{
var metaData = MetaData(placedEntity);
if (!TryComp<MetaDataComponent>(placedEntity, out var metaData))
continue;
if (metaData.EntityPrototype is null)
continue;
@@ -131,24 +132,24 @@ public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
out var ingredientSoln,
out var ingredientSolution);
if (ingredientSoln is null ||
ingredientSolution is null)
continue;
var splitted = _solutionContainer.SplitSolution(ingredientSoln.Value,
ingredientSolution.Volume / recipe.ResultCount);
foreach (var resultEntity in resultEntities)
if (ingredientSoln is not null &&
ingredientSolution is not null)
{
_solutionContainer.TryGetSolution(resultEntity,
recipe.Solution,
out var resultSolution,
out _);
if (resultSolution is not null)
var splitted = _solutionContainer.SplitSolution(ingredientSoln.Value,
ingredientSolution.Volume / recipe.ResultCount);
foreach (var resultEntity in resultEntities)
{
resultSolution.Value.Comp.Solution.MaxVolume +=
ingredientSoln.Value.Comp.Solution.MaxVolume / recipe.ResultCount;
_solutionContainer.TryAddSolution(resultSolution.Value, splitted);
_solutionContainer.TryGetSolution(resultEntity,
recipe.Solution,
out var resultSolution,
out _);
if (resultSolution is not null)
{
resultSolution.Value.Comp.Solution.MaxVolume +=
ingredientSoln.Value.Comp.Solution.MaxVolume / recipe.ResultCount;
_solutionContainer.TryAddSolution(resultSolution.Value, splitted);
}
}
}
}
@@ -181,6 +182,12 @@ public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
}
}
//We teleport result to workbench AFTER craft.
foreach (var resultEntity in resultEntities)
{
_transform.SetCoordinates(resultEntity, Transform(ent).Coordinates);
}
UpdateUIRecipes(ent, args.User);
args.Handled = true;
}

View File

@@ -24,7 +24,7 @@
- ReagentId: UncookedAnimalProteins
Quantity: 2
- type: SliceableFood
count: 5
count: 4
slice: CP14FoodDoughMedium
- type: CP14TemperatureTransformation
entries:
@@ -50,7 +50,7 @@
- ReagentId: Protein
Quantity: 2
- type: SliceableFood
count: 5
count: 4
slice: CP14FoodBreadSlice
- type: CP14TemperatureTransformation
entries:
@@ -68,12 +68,12 @@
- type: SolutionContainerManager
solutions:
food:
maxVol: 6 # 1/5 bread
maxVol: 7 # 1/4 bread
reagents:
- ReagentId: Nutriment
Quantity: 4
Quantity: 5
- ReagentId: Protein
Quantity: 0.4
Quantity: 0.5
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
@@ -82,7 +82,7 @@
- type: entity
parent: FoodInjectableBase
id: CP14FoodDoughMedium
name: Medium piece of dough.
name: medium piece of dough
categories: [ ForkFiltered ]
components:
- type: Item
@@ -97,12 +97,12 @@
- type: SolutionContainerManager
solutions:
food:
maxVol: 6 # 1/5 large dough
maxVol: 7 # 1/4 large dough
reagents:
- ReagentId: Nutriment
Quantity: 4
Quantity: 5.2
- ReagentId: UncookedAnimalProteins
Quantity: 0.4
Quantity: 0.5
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
@@ -120,12 +120,12 @@
- type: SolutionContainerManager
solutions:
food:
maxVol: 6 # 1/5 large dough
maxVol: 6 # 1/4 large dough
reagents:
- ReagentId: Nutriment
Quantity: 4
Quantity: 5.2
- ReagentId: Protein
Quantity: 0.4
Quantity: 0.5
- type: SliceableFood
count: 2
slice: CP14FoodBreadBunSlice
@@ -146,12 +146,12 @@
- type: SolutionContainerManager
solutions:
food:
maxVol: 3 # 1/2 bun
maxVol: 4 # 1/2 bun
reagents:
- ReagentId: Nutriment
Quantity: 2
Quantity: 2.6
- ReagentId: Protein
Quantity: 0.2
Quantity: 0.25
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
@@ -169,12 +169,12 @@
- type: SolutionContainerManager
solutions:
food:
maxVol: 6 # 1/5 large dough
maxVol: 7 # 1/4 large dough
reagents:
- ReagentId: Nutriment
Quantity: 4
Quantity: 5.2
- ReagentId: UncookedAnimalProteins
Quantity: 0.4
Quantity: 0.5
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500

View File

@@ -0,0 +1,217 @@
# 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: 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
# 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: 10
- 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: 10
- ReagentId: Protein
Quantity: 2
- ReagentId: Vitamin
Quantity: 5
- type: Sprite
layers:
- state: tin
- state: apple
- type: Tag
tags:
- Fruit
- Pie
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14Ash1
- 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: 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: Sprite
layers:
- state: tin
- state: meat
- type: Tag
tags:
- Meat
- Pie
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14Ash1
- 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: entity
name: fish pie
parent: CP14FoodPieBase
id: CP14FoodPieFish
description: Fish pie, a good alternative among meat dishes.
components:
- type: FlavorProfile
flavors:
- fishy
- type: Sprite
layers:
- state: tin
- state: fish
- type: Tag
tags:
- Meat
- Pie
- type: CP14TemperatureTransformation
entries:
- temperatureRange: 400, 500
transformTo: CP14Ash1

View File

@@ -10,4 +10,21 @@
state: plate
- type: Item
shape:
- 0,0,1,0
- 0,0,1,0
- 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

View File

@@ -26,6 +26,15 @@
result: CP14BaseWrench
knowledgeRequired: MetallForging
- type: CP14Recipe
id: CP14PlatePie
tag: CP14RecipeAnvil
craftTime: 4
stacks:
CP14IronBar: 1
result: CP14PlatePie
knowledgeRequired: MetallForging
- type: CP14Recipe
id: CP14ClothingOuterClothingCuirass
tag: CP14RecipeAnvil

View File

@@ -0,0 +1,35 @@
- type: CP14Recipe
id: CP14FoodMeatLamb
tag: CP14RecipeCooking
craftTime: 2
entities:
CP14FoodMeatLambSlice: 2
CP14FoodEgg: 1
result: CP14FoodMeatLambCutlet
tryMergeSolutions: true
- type: CP14Recipe
id: CP14FoodDoughLarge
tag: CP14RecipeCooking
craftTime: 2
entities:
CP14FoodDoughMedium: 4
result: CP14FoodDoughLarge
tryMergeSolutions: true
- type: CP14Recipe
id: CP14FoodDoughMedium
tag: CP14RecipeCooking
craftTime: 2
entities:
CP14Wheat: 2
result: CP14FoodDoughMedium
- type: CP14Recipe
id: CP14FoodDoughMediumFlat
tag: CP14RecipeCooking
craftTime: 2
entities:
CP14FoodDoughMedium: 1
result: CP14FoodDoughMediumFlat
tryMergeSolutions: true

View File

@@ -0,0 +1,21 @@
- type: CP14Recipe
id: CP14FoodPieAppleRaw
tag: CP14RecipeCooking
craftTime: 5
entities:
CP14PlatePie: 1
CP14FoodDoughMediumFlat: 1
CP14FoodAppleSlice: 4
result: CP14FoodPieAppleRaw
tryMergeSolutions: true
- type: CP14Recipe
id: CP14FoodPieMeatRaw
tag: CP14RecipeCooking
craftTime: 5
entities:
CP14PlatePie: 1
CP14FoodDoughMediumFlat: 1
CP14FoodMeatLambSlice: 3
result: CP14FoodPieMeatRaw
tryMergeSolutions: true

View File

@@ -0,0 +1,39 @@
- type: CP14Recipe
id: CP14SeedWheat
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14Wheat: 1
result: CP14SeedWheat
- type: CP14Recipe
id: CP14SeedTomato
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodTomatoesSlice: 1
result: CP14SeedTomato
- type: CP14Recipe
id: CP14SeedCabbage
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodCabbageSlice: 1
result: CP14SeedCabbage
- type: CP14Recipe
id: CP14SeedPumpkin
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodPumpkinSlice: 1
result: CP14SeedPumpkin
- type: CP14Recipe
id: CP14SeedCucumber
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodCucumber: 1
result: CP14SeedCucumber

View File

@@ -1,76 +0,0 @@
- type: CP14Recipe
id: CP14FoodMeatLamb
tag: CP14RecipeCooking
craftTime: 2
entities:
CP14FoodMeatLambSlice: 2
CP14FoodEgg: 1
result: CP14FoodMeatLambCutlet
tryMergeSolutions: true
- type: CP14Recipe
id: CP14FoodDoughLarge
tag: CP14RecipeCooking
craftTime: 3
entities:
CP14FoodDoughMedium: 5
result: CP14FoodDoughLarge
tryMergeSolutions: true
- type: CP14Recipe
id: CP14FoodDoughMedium
tag: CP14RecipeCooking
craftTime: 3
entities:
CP14FoodDoughMediumFlat: 1
result: CP14FoodDoughMedium
tryMergeSolutions: true
- type: CP14Recipe
id: CP14FoodDoughMediumFlat
tag: CP14RecipeCooking
craftTime: 3
entities:
CP14FoodDoughMedium: 1
result: CP14FoodDoughMediumFlat
tryMergeSolutions: true
- type: CP14Recipe
id: CP14SeedPumpkin
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodPumpkinSlice: 1
result: CP14SeedPumpkin
- type: CP14Recipe
id: CP14SeedCucumber
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodCucumber: 1
result: CP14SeedCucumber
- type: CP14Recipe
id: CP14SeedWheat
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14Wheat: 1
result: CP14SeedWheat
- type: CP14Recipe
id: CP14SeedTomato
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodTomatoesSlice: 1
result: CP14SeedTomato
- type: CP14Recipe
id: CP14SeedCabbage
tag: CP14RecipeCooking
craftTime: 1
entities:
CP14FoodCabbageSlice: 1
result: CP14SeedCabbage

View File

@@ -81,3 +81,6 @@
- type: Tag
id: CP14Arrow
- type: Tag
id: CP14PlatePie

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 502 B

View File

@@ -1,7 +1,7 @@
{
"version": 1,
"license": "All right reserved",
"copyright": "bun_cooked bun_cooked_slice_bottom bun_cooked_slice_top dough_medium Created by Artista.rar, bread_cooked by perzonaz (discord) & resprited by omsoyk dough_large dough_medium_flat created by TheShuEd",
"license": "CLA",
"copyright": "bun_cooked bun_cooked_slice_bottom bun_cooked_slice_top dough_medium dough_medium_flat Created by Artista.rar, bread_cooked by perzonaz (discord) & resprited by omsoyk dough_large created by TheShuEd",
"size": {
"x": 32,
"y": 32

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

View File

@@ -0,0 +1,32 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CLA",
"copyright": "Created by Artista",
"states": [
{
"name": "apple"
},
{
"name": "apple_raw"
},
{
"name": "fish"
},
{
"name": "fisht_raw"
},
{
"name": "meat"
},
{
"name": "meat_raw"
},
{
"name": "tin"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B