-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,103 @@ | ||
local PYC = require("config") | ||
|
||
local function add_ing(str_recipe, normal, expensive) | ||
expensive = expensive or normal | ||
local recipe = data.raw.recipe[str_recipe] | ||
if recipe then | ||
if recipe.normal then | ||
recipe.normal.ingredients[#recipe.normal.ingredients + 1] = normal | ||
if recipe.expensive then | ||
recipe.expensive.ingredients[#recipe.expensive.ingredients + 1] = expensive | ||
end | ||
else | ||
recipe.ingredients[#recipe.ingredients + 1] = normal | ||
end | ||
end | ||
end | ||
|
||
local function rep_ings(str_recipe, normal, expensive) | ||
expensive = expensive or normal | ||
local recipe = data.raw.recipe[str_recipe] | ||
if recipe then | ||
if recipe.normal then | ||
recipe.normal.ingredients = table.deepcopy(normal) | ||
if recipe.expensive then | ||
recipe.expensive.ingredients = table.deepcopy(expensive) | ||
end | ||
else | ||
recipe.ingredients = normal | ||
end | ||
end | ||
end | ||
|
||
if PYC.USE_CREOSOTE_RECIPES then -- flag from config.lua | ||
if PYC.USE_CREOSOTE_IN.rail then | ||
if not data.raw.recipe["bi-rail-wood"] then | ||
local newrail=data.raw.recipe["rail"] | ||
newrail.ingredients = { | ||
{"stone", 1}, | ||
{"iron-stick", 2}, | ||
{"treated-wood", 2} | ||
} | ||
rep_ings("rail", { | ||
{"stone", 1}, | ||
{"iron-stick", 2}, | ||
{"treated-wood", 2} | ||
} | ||
) | ||
end | ||
|
||
--Bio Industries | ||
if data.raw.recipe["bi-rail-wood"] then | ||
local biwoodrail = data.raw.recipe["bi-rail-wood"] | ||
biwoodrail.ingredients = { | ||
rep_ings("bi-rail-wood", { | ||
{"stone", 1}, | ||
{"iron-stick", 2}, | ||
{"treated-wood", 2} | ||
} | ||
end | ||
) | ||
end | ||
|
||
if PYC.USE_CREOSOTE_IN.power_poles then | ||
local newpole=table.deepcopy(data.raw.recipe["medium-electric-pole"]) | ||
local newpole = data.raw.recipe["medium-electric-pole"] | ||
newpole.category = "crafting-with-fluid" | ||
newpole.ingredients[#newpole.ingredients +1] = { | ||
type="fluid", name="creosote", amount=10 | ||
} | ||
data:extend({newpole}) | ||
add_ing("medium-electric-pole", {type="fluid", name="creosote", amount=10}) | ||
|
||
--Big Wooden Pole Mod | ||
if data.raw.recipe["big-wooden-pole"] then | ||
local bigpole = data.raw.recipe["big-wooden-pole"] | ||
bigpole.ingredients = { | ||
rep_ings("big-wooden-pole", | ||
{ | ||
{"treated-wood", 5}, | ||
{"copper-cable", 8} | ||
} | ||
end | ||
|
||
--Bio Industries | ||
if data.raw.recipe["bi-big-wooden-pole"] then | ||
local bibigpole = data.raw.recipe["bi-big-wooden-pole"] | ||
bibigpole.ingredients = { | ||
{"treated-wood", 5}, | ||
{"small-electric-pole", 2}, | ||
} | ||
end | ||
) | ||
end | ||
|
||
--Bio Industries | ||
rep_ings("bi-big-wooden-pole", | ||
{ | ||
{"treated-wood", 5}, | ||
{"small-electric-pole", 2}, | ||
} | ||
) | ||
|
||
--More Floors | ||
if data.raw.recipe["wood-floor"] then | ||
local woodfloor = data.raw.recipe["wood-floor"] | ||
woodfloor.ingredients = { | ||
{"treated-wood", 10}, | ||
rep_ings("wood-floor", | ||
{ | ||
{"treated-wood", 10} | ||
} | ||
end | ||
) | ||
|
||
--Bio Industries | ||
if data.raw.recipe["bi-wooden-fence"] then | ||
local fence = data.raw.recipe["bi-wooden-fence"] | ||
fence.ingredients = | ||
rep_ings("bi-wooden-fence", | ||
{ | ||
{"treated-wood", 2}, | ||
{"raw-wood", 2}, | ||
} | ||
end | ||
) | ||
end | ||
|
||
--ADDING NIOBIUM INTO LOW DENSITY STRUCTURE | ||
do | ||
local part | ||
part = data.raw.recipe["low-density-structure"] | ||
part.normal.ingredients[#part.normal.ingredients + 1] = {type = "item", name = "niobium-plate", amount = 5} | ||
part = data.raw.recipe["low-density-structure"] | ||
part.expensive.ingredients[#part.expensive.ingredients + 1] = {type = "item", name = "niobium-plate", amount = 10} | ||
local normal = {type = "item", name = "niobium-plate", amount = 5} | ||
local expensive = {type = "item", name = "niobium-plate", amount = 10} | ||
add_ing("low-density-structure", normal, expensive) | ||
end | ||
|
||
--ADDING FUELROD INTO ROCKET-FUEL INTO ROCKET-FUEL | ||
do | ||
local part = data.raw.recipe["rocket-fuel"] | ||
local normal = {type = "item", name = "fuelrod-mk01", amount = 2} | ||
local expensive = {type = "item", name = "fuelrod-mk01", amount = 4} | ||
if part.normal then | ||
part.normal.ingredients[#part.normal.ingredients + 1] = normal | ||
if part.expensive then | ||
part.expensive.ingredients[#part.expensive.ingredients + 1] = expensive | ||
end | ||
else | ||
part.ingredients[#part.ingredients + 1] = normal | ||
end | ||
add_ing("rocket-fuel", normal, expensive) | ||
end |