Module:ProfessionList: Difference between revisions
in the case of co-op recipes that share a name with a non co-op recipe, the correct data will be preserved (within generate_recipe_table)
(p.unknown_value_edit_cell supports a list of pages, all of which will be linked) |
(in the case of co-op recipes that share a name with a non co-op recipe, the correct data will be preserved (within generate_recipe_table)) |
||
Line 155:
-- perform the full recipe tree search on the product
local fullRecipe = search.main(item.product)
-- overwrite any parameters from the original recipe with their counterparts from the full recipe▼
-- also search for the recipe and compare to the provided recipe
-- parameters which dont exist in the fullRecipe wont be overwritten,▼
--
local lastStepRecipe = search.getRecipe(item.product)
-- increase the full recice values by the difference
fullRecipe.xp = fullRecipe.xp and lastStepRecipe.xp and item.xp and fullRecipe.xp + (item.xp - lastStepRecipe.xp)
fullRecipe.kp = fullRecipe.kp and lastStepRecipe.kp and item.kp and fullRecipe.kp + (item.kp - lastStepRecipe.kp)
fullRecipe.duration = fullRecipe.duration and lastStepRecipe.duration and item.duration and fullRecipe.duration + (item.duration - lastStepRecipe.duration)
▲ -- otherwise overwrite any parameters from the original recipe with their counterparts from the full recipe
-- need to pre-nil the xp, kp, and duration so that if they are nil in the full recipe, they stay nil
item.xp = nil
item.kp = nil
Line 164 ⟶ 173:
item[key] = value
end
-- include the price of selling the product
local sell = search.getShopSellPrice(item.product)
|