Data.Recipe classmod

Recipe class

Methods

Data.Recipe:add_ingredient(normal[, expensive]) Add an ingredient to a recipe.
Data.Recipe:remove_ingredient(normal, expensive) Remove one ingredient completely.
Data.Recipe:replace_ingredient(replace, normal[, expensive]) Replace one ingredient with another.
Data.Recipe:make_difficult([expensive_energy]) Converts a recipe to the difficulty recipe format.
Data.Recipe:change_category(category_name) Change the recipe category.
Data.Recipe:add_unlock(tech_name) Add to technology as a recipe unlock.
Data.Recipe:remove_unlock(tech_name) Remove the recipe unlock from the technology.
Data.Recipe:set_enabled(enabled) Set the enabled status of the recipe.
Data.Recipe:convert_results() Convert result type to results type.
Data.Recipe:set_main_product(main_product[, normal][, expensive]) Set the main product of the recipe.
Data.Recipe:remove_main_product([for_normal=false][, for_expensive=false]) Remove the main product of the recipe.
Data.Recipe:add_result(normal[, expensive][, main_product]) Add a new product to results, converts if needed.
Data.Recipe:remove_result([normal][, expensive][, main_product]) Remove a product from results, converts if needed.
Data.Recipe:replace_result(result_name[, normal][, expensive][, main_product]) Remove a product from results, converts if needed.

Methods

# Data.Recipe:add_ingredient(normal[, expensive])

Add an ingredient to a recipe.

Parameters: Returns:
# Data.Recipe:remove_ingredient(normal, expensive)

Remove one ingredient completely.

Parameters:
  • normal : (string)
  • expensive : (string or boolean) expensive recipe to remove, or if true remove normal recipe from both
Returns:
# Data.Recipe:replace_ingredient(replace, normal[, expensive])

Replace one ingredient with another.

Parameters:
# Data.Recipe:make_difficult([expensive_energy])

Converts a recipe to the difficulty recipe format.

Parameters:
  • expensive_energy : (number) crafting energy_required for the expensive recipe (optional)
Returns:
  • (self)
# Data.Recipe:change_category(category_name)

Change the recipe category.

Parameters:
  • category_name : (string) The new crafting category
Returns:
  • (self)
# Data.Recipe:add_unlock(tech_name)

Add to technology as a recipe unlock.

Parameters:
  • tech_name : (string) Name of the technology to add the unlock too
Returns:
  • (self)
# Data.Recipe:remove_unlock(tech_name)

Remove the recipe unlock from the technology.

Parameters:
  • tech_name : (string) Name of the technology to remove the unlock from
Returns:
  • (self)
# Data.Recipe:set_enabled(enabled)

Set the enabled status of the recipe.

Parameters:
  • enabled : (boolean) Enable or disable the recipe
Returns:
  • (self)
# Data.Recipe:convert_results()

Convert result type to results type.

Returns:
  • (self)
# Data.Recipe:set_main_product(main_product[, normal][, expensive])

Set the main product of the recipe.

Parameters:
  • main_product : (string or boolean) if boolean then use normal/expensive recipes passed as main product
  • normal : (Product or string) recipe (optional)
  • expensive : (Product or string) recipe (optional)
Returns:
  • (self)
# Data.Recipe:remove_main_product([for_normal=false][, for_expensive=false])

Remove the main product of the recipe.

Parameters:
  • for_normal : (boolean) (default: false)
  • for_expensive : (boolean) (default: false)
# Data.Recipe:add_result(normal[, expensive][, main_product])

Add a new product to results, converts if needed.

Parameters:
# Data.Recipe:remove_result([normal][, expensive][, main_product])

Remove a product from results, converts if needed.

Parameters:
# Data.Recipe:replace_result(result_name[, normal][, expensive][, main_product])

Remove a product from results, converts if needed.

Parameters: