diff --git a/Content.Server/_CP14/Workbench/CP14WorkbenchSystem.cs b/Content.Server/_CP14/Workbench/CP14WorkbenchSystem.cs index 2f2e27fd16..e6ec9ba3f2 100644 --- a/Content.Server/_CP14/Workbench/CP14WorkbenchSystem.cs +++ b/Content.Server/_CP14/Workbench/CP14WorkbenchSystem.cs @@ -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(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; } diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/dough.yml b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/dough.yml index bde6eb6a0d..d326ff1ced 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/dough.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/dough.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/pie.yml b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/pie.yml new file mode 100644 index 0000000000..dd0fedf36d --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/pie.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/plate.yml b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/plate.yml index 976d4762ee..4df2c6f1a1 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/plate.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Food/plate.yml @@ -10,4 +10,21 @@ state: plate - type: Item shape: - - 0,0,1,0 \ No newline at end of file + - 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 diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml index a9deca924a..1139eedea0 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/misc.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/misc.yml new file mode 100644 index 0000000000..c29cb6d8e4 --- /dev/null +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/misc.yml @@ -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 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/pies.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/pies.yml new file mode 100644 index 0000000000..96ff92d288 --- /dev/null +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/pies.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/seeds.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/seeds.yml new file mode 100644 index 0000000000..8a5b72e4a1 --- /dev/null +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/CookingTable/seeds.yml @@ -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 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/cooking_table.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/cooking_table.yml deleted file mode 100644 index 9bb8aa1cdb..0000000000 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/cooking_table.yml +++ /dev/null @@ -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 diff --git a/Resources/Prototypes/_CP14/tags.yml b/Resources/Prototypes/_CP14/tags.yml index 4284d5ebc9..0703c94707 100644 --- a/Resources/Prototypes/_CP14/tags.yml +++ b/Resources/Prototypes/_CP14/tags.yml @@ -81,3 +81,6 @@ - type: Tag id: CP14Arrow + +- type: Tag + id: CP14PlatePie diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/dough_medium_flat.png b/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/dough_medium_flat.png index 082b08d601..e217d6a586 100644 Binary files a/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/dough_medium_flat.png and b/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/dough_medium_flat.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/meta.json b/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/meta.json index 3d04dd8d3e..f7c67328e7 100644 --- a/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/meta.json +++ b/Resources/Textures/_CP14/Objects/Consumable/Food/dough.rsi/meta.json @@ -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 diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/apple.png b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/apple.png new file mode 100644 index 0000000000..20b2b1b512 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/apple.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/apple_raw.png b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/apple_raw.png new file mode 100644 index 0000000000..20c11be77a Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/apple_raw.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/fish.png b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/fish.png new file mode 100644 index 0000000000..780839b568 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/fish.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/fisht_raw.png b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/fisht_raw.png new file mode 100644 index 0000000000..4ab392ace8 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/fisht_raw.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meat.png b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meat.png new file mode 100644 index 0000000000..ea80b7910f Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meat.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meat_raw.png b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meat_raw.png new file mode 100644 index 0000000000..5a80f7129e Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meat_raw.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meta.json b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meta.json new file mode 100644 index 0000000000..9fb32be55c --- /dev/null +++ b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/meta.json @@ -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" + } + ] +} diff --git a/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/tin.png b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/tin.png new file mode 100644 index 0000000000..c926b65c9c Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Food/pie.rsi/tin.png differ