Refactor "output" to "result" for recipes/prototypes.

Remove a debug recipe from meal_recipes.yml
Add food.yml for food related reagents: sugar, flour, etc.
This commit is contained in:
FL-OZ
2020-04-29 21:04:08 -05:00
parent d0f18b2f66
commit 8e0185f892
4 changed files with 14 additions and 16 deletions

View File

@@ -105,7 +105,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
{
if (CanSatisfyRecipe(r))
{
var outputFromRecipe = r.OutPutPrototype;
var outputFromRecipe = r.Result;
_entityManager.SpawnEntity(outputFromRecipe, Owner.Transform.GridPosition);
return;
}

View File

@@ -20,12 +20,12 @@ namespace Content.Shared.Kitchen
private string _id;
private string _name;
private string _output;
private string _result;
private Dictionary<string, int> _ingredients;
public string ID => _id;
public string Name => Loc.GetString(_name);
public string OutPutPrototype => _output;
public string Result => _result;
public IReadOnlyDictionary<string, int> Ingredients => _ingredients;
public void LoadFrom(YamlMappingNode mapping)
@@ -34,7 +34,7 @@ namespace Content.Shared.Kitchen
serializer.DataField(ref _id, "id", string.Empty);
serializer.DataField(ref _name, "name", string.Empty);
serializer.DataField(ref _output, "output", string.Empty);
serializer.DataField(ref _result, "result", string.Empty);
serializer.DataField(ref _ingredients, "ingredients", new Dictionary<string, int>());
}
}

View File

@@ -1,17 +1,7 @@
- type: microwaveMealRecipe
id: RecipeCheeseburger
name: "Cheeseburger Recipe"
output: FoodCheeseburger
result: FoodCheeseburger
ingredients:
chem.H2O: 15
chem.Flour: 15
chem.Nutriment: 5
- type: microwaveMealRecipe
id: RecipeFlashlight
name: "Flashlight Recipe"
output: FlashlightLantern
ingredients:
chem.H2O: 15
chem.Nutriment: 20
chem.Glucose: 5

View File

@@ -0,0 +1,8 @@
- type: reagent
id: chem.Flour
name: Flour
desc: Used for baking.
color: "#FFFFFF"
metabolism:
- !type:DefaultFood
rate: 1