moves steak cooking to use construction graphs, new temperature construction graph step (#13219)
This commit is contained in:
committed by
GitHub
parent
7575c0944b
commit
a7a4137cc7
@@ -1,6 +1,8 @@
|
|||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Construction.Components;
|
using Content.Server.Construction.Components;
|
||||||
using Content.Server.DoAfter;
|
using Content.Server.DoAfter;
|
||||||
|
using Content.Server.Temperature.Components;
|
||||||
|
using Content.Server.Temperature.Systems;
|
||||||
using Content.Shared.Construction;
|
using Content.Shared.Construction;
|
||||||
using Content.Shared.Construction.EntitySystems;
|
using Content.Shared.Construction.EntitySystems;
|
||||||
using Content.Shared.Construction.Steps;
|
using Content.Shared.Construction.Steps;
|
||||||
@@ -39,6 +41,7 @@ namespace Content.Server.Construction
|
|||||||
|
|
||||||
// Event handling. Add your subscriptions here! Just make sure they're all handled by EnqueueEvent.
|
// Event handling. Add your subscriptions here! Just make sure they're all handled by EnqueueEvent.
|
||||||
SubscribeLocalEvent<ConstructionComponent, InteractUsingEvent>(EnqueueEvent, new []{typeof(AnchorableSystem)});
|
SubscribeLocalEvent<ConstructionComponent, InteractUsingEvent>(EnqueueEvent, new []{typeof(AnchorableSystem)});
|
||||||
|
SubscribeLocalEvent<ConstructionComponent, OnTemperatureChangeEvent>(EnqueueEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -383,6 +386,24 @@ namespace Content.Server.Construction
|
|||||||
return HandleResult.DoAfter;
|
return HandleResult.DoAfter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case TemperatureConstructionGraphStep temperatureChangeStep:
|
||||||
|
{
|
||||||
|
if (ev is not OnTemperatureChangeEvent) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TryComp<TemperatureComponent>(uid, out var tempComp))
|
||||||
|
{
|
||||||
|
if ((!temperatureChangeStep.MinTemperature.HasValue || tempComp.CurrentTemperature >= temperatureChangeStep.MinTemperature.Value) &&
|
||||||
|
(!temperatureChangeStep.MaxTemperature.HasValue || tempComp.CurrentTemperature <= temperatureChangeStep.MaxTemperature.Value))
|
||||||
|
{
|
||||||
|
return HandleResult.True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return HandleResult.False;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
// --- CONSTRUCTION STEP EVENT HANDLING FINISH ---
|
// --- CONSTRUCTION STEP EVENT HANDLING FINISH ---
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ namespace Content.Shared.Construction.Steps
|
|||||||
return typeof(MultipleTagsConstructionGraphStep);
|
return typeof(MultipleTagsConstructionGraphStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.Has("minTemperature") || node.Has("maxTemperature"))
|
||||||
|
{
|
||||||
|
return typeof(TemperatureConstructionGraphStep);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using Content.Shared.Examine;
|
||||||
|
using Content.Shared.Tools;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
|
|
||||||
|
namespace Content.Shared.Construction.Steps
|
||||||
|
{
|
||||||
|
[DataDefinition]
|
||||||
|
public sealed class TemperatureConstructionGraphStep : ConstructionGraphStep
|
||||||
|
{
|
||||||
|
[DataField("minTemperature")]
|
||||||
|
public float? MinTemperature;
|
||||||
|
[DataField("maxTemperature")]
|
||||||
|
public float? MaxTemperature;
|
||||||
|
|
||||||
|
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||||
|
{
|
||||||
|
float guideTemperature = MinTemperature.HasValue ? MinTemperature.Value : (MaxTemperature.HasValue ? MaxTemperature.Value : 0);
|
||||||
|
examinedEvent.PushMarkup(Loc.GetString("construction-temperature-default", ("temperature", guideTemperature)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override ConstructionGuideEntry GenerateGuideEntry()
|
||||||
|
{
|
||||||
|
float guideTemperature = MinTemperature.HasValue ? MinTemperature.Value : (MaxTemperature.HasValue ? MaxTemperature.Value : 0);
|
||||||
|
|
||||||
|
return new ConstructionGuideEntry()
|
||||||
|
{
|
||||||
|
Localization = "construction-presenter-temperature-step",
|
||||||
|
Arguments = new (string, object)[] { ("temperature", guideTemperature) }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
construction-temperature-default = Next, heat to [color=red]{$temperature}[/color].
|
||||||
@@ -6,3 +6,4 @@ construction-presenter-step-wrapper = {$step-number}. {$text}
|
|||||||
construction-presenter-tool-step = Use a {LOC($tool)}.
|
construction-presenter-tool-step = Use a {LOC($tool)}.
|
||||||
construction-presenter-material-step = Add {$amount}x {LOC($material)}.
|
construction-presenter-material-step = Add {$amount}x {LOC($material)}.
|
||||||
construction-presenter-arbitrary-step = Add {LOC($name)}.
|
construction-presenter-arbitrary-step = Add {LOC($name)}.
|
||||||
|
construction-presenter-temperature-step = Heat to {$temperature}.
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
Quantity: 1
|
Quantity: 1
|
||||||
- type: Item
|
- type: Item
|
||||||
size: 5
|
size: 5
|
||||||
|
- type: Temperature
|
||||||
|
currentTemperature: 290
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: Raw
|
id: Raw
|
||||||
@@ -57,6 +59,10 @@
|
|||||||
- type: SliceableFood
|
- type: SliceableFood
|
||||||
count: 3
|
count: 3
|
||||||
slice: FoodMeatCutlet
|
slice: FoodMeatCutlet
|
||||||
|
- type: Construction
|
||||||
|
graph: MeatSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: meat steak
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: raw carp fillet
|
name: raw carp fillet
|
||||||
@@ -130,6 +136,10 @@
|
|||||||
- type: SliceableFood
|
- type: SliceableFood
|
||||||
count: 3
|
count: 3
|
||||||
slice: FoodMeatBearCutlet
|
slice: FoodMeatBearCutlet
|
||||||
|
- type: Construction
|
||||||
|
graph: BearSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: filet migrawr
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: raw penguin meat
|
name: raw penguin meat
|
||||||
@@ -151,6 +161,10 @@
|
|||||||
- type: SliceableFood
|
- type: SliceableFood
|
||||||
count: 3
|
count: 3
|
||||||
slice: FoodMeatPenguinCutletSlice
|
slice: FoodMeatPenguinCutletSlice
|
||||||
|
- type: Construction
|
||||||
|
graph: PenguinSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: cooked penguin
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: raw chicken meat
|
name: raw chicken meat
|
||||||
@@ -172,6 +186,10 @@
|
|||||||
- type: SliceableFood
|
- type: SliceableFood
|
||||||
count: 3
|
count: 3
|
||||||
slice: FoodMeatChickenCutlet
|
slice: FoodMeatChickenCutlet
|
||||||
|
- type: Construction
|
||||||
|
graph: ChickenSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: cooked chicken
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: raw duck meat
|
name: raw duck meat
|
||||||
@@ -193,6 +211,10 @@
|
|||||||
- type: SliceableFood
|
- type: SliceableFood
|
||||||
count: 3
|
count: 3
|
||||||
slice: FoodMeatDuckCutlet
|
slice: FoodMeatDuckCutlet
|
||||||
|
- type: Construction
|
||||||
|
graph: DuckSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: cooked duck
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: prime-cut corgi meat
|
name: prime-cut corgi meat
|
||||||
@@ -231,6 +253,10 @@
|
|||||||
reagents:
|
reagents:
|
||||||
- ReagentId: UncookedAnimalProteins
|
- ReagentId: UncookedAnimalProteins
|
||||||
Quantity: 1
|
Quantity: 1
|
||||||
|
- type: Construction
|
||||||
|
graph: CrabSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: cooked crab
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: raw goliath meat
|
name: raw goliath meat
|
||||||
@@ -249,6 +275,10 @@
|
|||||||
reagents:
|
reagents:
|
||||||
- ReagentId: UncookedAnimalProteins
|
- ReagentId: UncookedAnimalProteins
|
||||||
Quantity: 5
|
Quantity: 5
|
||||||
|
- type: Construction
|
||||||
|
graph: GoliathSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: goliath steak
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: dragon flesh
|
name: dragon flesh
|
||||||
@@ -314,6 +344,10 @@
|
|||||||
- type: SliceableFood
|
- type: SliceableFood
|
||||||
count: 3
|
count: 3
|
||||||
slice: FoodMeatLizardCutlet
|
slice: FoodMeatLizardCutlet
|
||||||
|
- type: Construction
|
||||||
|
graph: LizardSteak
|
||||||
|
node: start
|
||||||
|
defaultTarget: lizard steak
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: raw plant meat
|
name: raw plant meat
|
||||||
@@ -510,7 +544,6 @@
|
|||||||
trash: FoodPlateSmall
|
trash: FoodPlateSmall
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: plain-cooked
|
- state: plain-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -534,7 +567,6 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
netsync: true
|
netsync: true
|
||||||
layers:
|
layers:
|
||||||
@@ -566,10 +598,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: product-cooked
|
- state: product-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -593,10 +623,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: bird-cooked
|
- state: bird-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -620,10 +648,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: bird-cooked
|
- state: bird-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -678,10 +704,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: bird-cooked
|
- state: bird-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -705,10 +729,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: crab-cooked
|
- state: crab-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -729,10 +751,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: goliath-cooked
|
- state: goliath-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -753,10 +773,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: lizard-cooked
|
- state: lizard-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
@@ -780,10 +798,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- Cooked
|
- Cooked
|
||||||
- type: Food
|
- type: Food
|
||||||
trash: FoodPlateSmall
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: plate-meat
|
|
||||||
- state: spiderleg-cooked
|
- state: spiderleg-cooked
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
|
|||||||
119
Resources/Prototypes/Recipes/Construction/Graphs/food/steak.yml
Normal file
119
Resources/Prototypes/Recipes/Construction/Graphs/food/steak.yml
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
# regular steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: MeatSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: meat steak
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: meat steak
|
||||||
|
entity: FoodMeatCooked
|
||||||
|
|
||||||
|
# penguin steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: PenguinSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: cooked penguin
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: cooked penguin
|
||||||
|
entity: FoodMeatPenguinCooked
|
||||||
|
|
||||||
|
# chicken steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: ChickenSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: cooked chicken
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: cooked chicken
|
||||||
|
entity: FoodMeatChickenCooked
|
||||||
|
|
||||||
|
# duck steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: DuckSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: cooked duck
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: cooked duck
|
||||||
|
entity: FoodMeatDuckCooked
|
||||||
|
|
||||||
|
# lizard steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: LizardSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: lizard steak
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: lizard steak
|
||||||
|
entity: FoodMeatLizardCooked
|
||||||
|
|
||||||
|
# bear steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: BearSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: filet migrawr
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: filet migrawr
|
||||||
|
entity: FoodMealBearsteak
|
||||||
|
|
||||||
|
# crab steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: CrabSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: cooked crab
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: cooked crab
|
||||||
|
entity: FoodMeatCrabCooked
|
||||||
|
|
||||||
|
# crab steak
|
||||||
|
- type: constructionGraph
|
||||||
|
id: GoliathSteak
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: goliath steak
|
||||||
|
steps:
|
||||||
|
- minTemperature: 305
|
||||||
|
|
||||||
|
- node: goliath steak
|
||||||
|
entity: FoodMeatGoliathCooked
|
||||||
@@ -144,16 +144,6 @@
|
|||||||
FoodBreadBun: 1
|
FoodBreadBun: 1
|
||||||
FoodMeatCorgi: 1
|
FoodMeatCorgi: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
|
||||||
id: RecipeFiletMigrawr
|
|
||||||
name: filet migrawr recipe
|
|
||||||
result: FoodMealBearsteak
|
|
||||||
time: 10
|
|
||||||
solids:
|
|
||||||
FoodMeatBear: 1
|
|
||||||
reagents:
|
|
||||||
Beer: 15
|
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeSuperBiteBurger
|
id: RecipeSuperBiteBurger
|
||||||
name: super bite burger recipe
|
name: super bite burger recipe
|
||||||
@@ -505,60 +495,6 @@
|
|||||||
FoodFlyAmanita: 3
|
FoodFlyAmanita: 3
|
||||||
|
|
||||||
#Other
|
#Other
|
||||||
- type: microwaveMealRecipe
|
|
||||||
id: RecipeMeatSteak
|
|
||||||
name: meat steak recipe
|
|
||||||
result: FoodMeatCooked
|
|
||||||
time: 10
|
|
||||||
reagents:
|
|
||||||
TableSalt: 1
|
|
||||||
solids:
|
|
||||||
FoodMeat: 1
|
|
||||||
FoodPlateSmall: 1
|
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
|
||||||
id: RecipeMeatPenguin
|
|
||||||
name: pengin filet recipe
|
|
||||||
result: FoodMeatPenguinCooked
|
|
||||||
time: 10
|
|
||||||
reagents:
|
|
||||||
TableSalt: 1
|
|
||||||
solids:
|
|
||||||
FoodMeatPenguin: 1
|
|
||||||
FoodPlateSmall: 1
|
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
|
||||||
id: RecipeMeatChicken
|
|
||||||
name: cooked chicken recipe
|
|
||||||
result: FoodMeatChickenCooked
|
|
||||||
time: 10
|
|
||||||
reagents:
|
|
||||||
TableSalt: 1
|
|
||||||
solids:
|
|
||||||
FoodMeatChicken: 1
|
|
||||||
FoodPlateSmall: 1
|
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
|
||||||
id: RecipeMeatDuck
|
|
||||||
name: cooked duck recipe
|
|
||||||
result: FoodMeatDuckCooked
|
|
||||||
time: 10
|
|
||||||
reagents:
|
|
||||||
TableSalt: 1
|
|
||||||
solids:
|
|
||||||
FoodMeatDuck: 1
|
|
||||||
FoodPlateSmall: 1
|
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
|
||||||
id: RecipeMeatLizard
|
|
||||||
name: lizard steak recipe
|
|
||||||
result: FoodMeatLizardCooked
|
|
||||||
time: 10
|
|
||||||
reagents:
|
|
||||||
TableSalt: 1
|
|
||||||
solids:
|
|
||||||
FoodMeatLizard: 1
|
|
||||||
FoodPlateSmall: 1
|
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeCubanCarp
|
id: RecipeCubanCarp
|
||||||
|
|||||||
Reference in New Issue
Block a user