Skip to content

Commit

Permalink
feat: added RequireOnlyOneIngredient and QualityResultAmountMultiplie…
Browse files Browse the repository at this point in the history
…r to RecipeConfig and ItemConfig
  • Loading branch information
MSchmoecker committed Sep 22, 2023
1 parent 2693d5f commit 95b4e17
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions JotunnLib/Configs/ItemConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ public string RepairStation
/// </summary>
public int MinStationLevel { get; set; } = 1;

/// <summary>
/// Whether this recipe requires only one of the crafting requirements to be crafted. Defaults to <c>false</c>.
/// </summary>
public bool RequireOnlyOneIngredient { get; set; } = false;

/// <summary>
/// Multiplier for the amount of items created by the recipe based on the quality of the crafting materials. Defaults to <c>1</c>.
/// </summary>
public int QualityResultAmountMultiplier { get; set; } = 1;

/// <summary>
/// Icons for this item. If more than one icon is added, this item automatically has variants.
/// </summary>
Expand Down Expand Up @@ -222,6 +232,8 @@ public Recipe GetRecipe()

recipe.m_minStationLevel = MinStationLevel;
recipe.m_resources = GetRequirements();
recipe.m_requireOnlyOneIngredient = RequireOnlyOneIngredient;
recipe.m_qualityResultAmountMultiplier = QualityResultAmountMultiplier;

return recipe;
}
Expand Down
12 changes: 12 additions & 0 deletions JotunnLib/Configs/RecipeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ public string RepairStation
/// </summary>
public int MinStationLevel { get; set; } = 1;

/// <summary>
/// Whether this recipe requires only one of the crafting requirements to be crafted. Defaults to <c>false</c>.
/// </summary>
public bool RequireOnlyOneIngredient { get; set; } = false;

/// <summary>
/// Multiplier for the amount of items created by the recipe based on the quality of the crafting materials. Defaults to <c>1</c>.
/// </summary>
public int QualityResultAmountMultiplier { get; set; } = 1;

/// <summary>
/// Array of <see cref="RequirementConfig"/>s for all crafting materials it takes to craft the recipe.
/// </summary>
Expand Down Expand Up @@ -123,6 +133,8 @@ public Recipe GetRecipe()

recipe.m_minStationLevel = MinStationLevel;
recipe.m_resources = GetRequirements();
recipe.m_requireOnlyOneIngredient = RequireOnlyOneIngredient;
recipe.m_qualityResultAmountMultiplier = QualityResultAmountMultiplier;

return recipe;
}
Expand Down

0 comments on commit 95b4e17

Please sign in to comment.