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.Construction.Components;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Temperature.Components;
|
||||
using Content.Server.Temperature.Systems;
|
||||
using Content.Shared.Construction;
|
||||
using Content.Shared.Construction.EntitySystems;
|
||||
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.
|
||||
SubscribeLocalEvent<ConstructionComponent, InteractUsingEvent>(EnqueueEvent, new []{typeof(AnchorableSystem)});
|
||||
SubscribeLocalEvent<ConstructionComponent, OnTemperatureChangeEvent>(EnqueueEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -383,6 +386,24 @@ namespace Content.Server.Construction
|
||||
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
|
||||
// --- CONSTRUCTION STEP EVENT HANDLING FINISH ---
|
||||
|
||||
|
||||
@@ -36,6 +36,11 @@ namespace Content.Shared.Construction.Steps
|
||||
return typeof(MultipleTagsConstructionGraphStep);
|
||||
}
|
||||
|
||||
if (node.Has("minTemperature") || node.Has("maxTemperature"))
|
||||
{
|
||||
return typeof(TemperatureConstructionGraphStep);
|
||||
}
|
||||
|
||||
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-material-step = Add {$amount}x {LOC($material)}.
|
||||
construction-presenter-arbitrary-step = Add {LOC($name)}.
|
||||
construction-presenter-temperature-step = Heat to {$temperature}.
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
Quantity: 1
|
||||
- type: Item
|
||||
size: 5
|
||||
- type: Temperature
|
||||
currentTemperature: 290
|
||||
|
||||
- type: Tag
|
||||
id: Raw
|
||||
@@ -57,6 +59,10 @@
|
||||
- type: SliceableFood
|
||||
count: 3
|
||||
slice: FoodMeatCutlet
|
||||
- type: Construction
|
||||
graph: MeatSteak
|
||||
node: start
|
||||
defaultTarget: meat steak
|
||||
|
||||
- type: entity
|
||||
name: raw carp fillet
|
||||
@@ -130,6 +136,10 @@
|
||||
- type: SliceableFood
|
||||
count: 3
|
||||
slice: FoodMeatBearCutlet
|
||||
- type: Construction
|
||||
graph: BearSteak
|
||||
node: start
|
||||
defaultTarget: filet migrawr
|
||||
|
||||
- type: entity
|
||||
name: raw penguin meat
|
||||
@@ -151,6 +161,10 @@
|
||||
- type: SliceableFood
|
||||
count: 3
|
||||
slice: FoodMeatPenguinCutletSlice
|
||||
- type: Construction
|
||||
graph: PenguinSteak
|
||||
node: start
|
||||
defaultTarget: cooked penguin
|
||||
|
||||
- type: entity
|
||||
name: raw chicken meat
|
||||
@@ -172,6 +186,10 @@
|
||||
- type: SliceableFood
|
||||
count: 3
|
||||
slice: FoodMeatChickenCutlet
|
||||
- type: Construction
|
||||
graph: ChickenSteak
|
||||
node: start
|
||||
defaultTarget: cooked chicken
|
||||
|
||||
- type: entity
|
||||
name: raw duck meat
|
||||
@@ -193,6 +211,10 @@
|
||||
- type: SliceableFood
|
||||
count: 3
|
||||
slice: FoodMeatDuckCutlet
|
||||
- type: Construction
|
||||
graph: DuckSteak
|
||||
node: start
|
||||
defaultTarget: cooked duck
|
||||
|
||||
- type: entity
|
||||
name: prime-cut corgi meat
|
||||
@@ -231,6 +253,10 @@
|
||||
reagents:
|
||||
- ReagentId: UncookedAnimalProteins
|
||||
Quantity: 1
|
||||
- type: Construction
|
||||
graph: CrabSteak
|
||||
node: start
|
||||
defaultTarget: cooked crab
|
||||
|
||||
- type: entity
|
||||
name: raw goliath meat
|
||||
@@ -249,6 +275,10 @@
|
||||
reagents:
|
||||
- ReagentId: UncookedAnimalProteins
|
||||
Quantity: 5
|
||||
- type: Construction
|
||||
graph: GoliathSteak
|
||||
node: start
|
||||
defaultTarget: goliath steak
|
||||
|
||||
- type: entity
|
||||
name: dragon flesh
|
||||
@@ -314,6 +344,10 @@
|
||||
- type: SliceableFood
|
||||
count: 3
|
||||
slice: FoodMeatLizardCutlet
|
||||
- type: Construction
|
||||
graph: LizardSteak
|
||||
node: start
|
||||
defaultTarget: lizard steak
|
||||
|
||||
- type: entity
|
||||
name: raw plant meat
|
||||
@@ -510,7 +544,6 @@
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: plain-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -534,7 +567,6 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
netsync: true
|
||||
layers:
|
||||
@@ -566,10 +598,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: product-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -593,10 +623,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: bird-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -620,10 +648,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: bird-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -678,10 +704,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: bird-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -705,10 +729,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: crab-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -729,10 +751,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: goliath-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -753,10 +773,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: lizard-cooked
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
@@ -780,10 +798,8 @@
|
||||
tags:
|
||||
- Cooked
|
||||
- type: Food
|
||||
trash: FoodPlateSmall
|
||||
- type: Sprite
|
||||
layers:
|
||||
- state: plate-meat
|
||||
- state: spiderleg-cooked
|
||||
- type: SolutionContainerManager
|
||||
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
|
||||
FoodMeatCorgi: 1
|
||||
|
||||
- type: microwaveMealRecipe
|
||||
id: RecipeFiletMigrawr
|
||||
name: filet migrawr recipe
|
||||
result: FoodMealBearsteak
|
||||
time: 10
|
||||
solids:
|
||||
FoodMeatBear: 1
|
||||
reagents:
|
||||
Beer: 15
|
||||
|
||||
- type: microwaveMealRecipe
|
||||
id: RecipeSuperBiteBurger
|
||||
name: super bite burger recipe
|
||||
@@ -505,60 +495,6 @@
|
||||
FoodFlyAmanita: 3
|
||||
|
||||
#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
|
||||
id: RecipeCubanCarp
|
||||
|
||||
Reference in New Issue
Block a user