Compare commits
No commits in common. "82835bc315fc43ca82b824cfd880e4fe8e7be133" and "afc6357657d19043407cc96d3a694af3cdb1b2cb" have entirely different histories.
82835bc315
...
afc6357657
|
|
@ -1,3 +0,0 @@
|
|||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
2
.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
.idea
|
||||
*.zip
|
||||
37
Makefile
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# General makefile for factorio mods.
|
||||
#
|
||||
# Presumes the development work is done in a <factoriodir>/dev/<modname>/
|
||||
# directory where this makefile resides. This directory must be parallel to
|
||||
# the <factoriodir>/mods/ directory where mods are installed. Run `make
|
||||
# install` from dev/<modname> to install the mod as a zip file. That zip file
|
||||
# should also be ready to upload to the mod portal
|
||||
|
||||
.PHONY: copy lint-changelog install
|
||||
|
||||
libdir = "../bzlib"
|
||||
libfiles = $(shell ls $(libdir)/*.lua | grep -o '[^/]*.lua')
|
||||
pwd = $(shell pwd)
|
||||
v = $(shell basename "$(pwd)")_$(shell jq -r .version info.json)
|
||||
|
||||
link:
|
||||
for f in $(libfiles) ; do \
|
||||
echo "using $(libdir)/$$f" ;\
|
||||
cp $(libdir)/$$f .; \
|
||||
done;
|
||||
|
||||
copy: link
|
||||
rm -rf ../$(v)
|
||||
mkdir -p ../$(v)
|
||||
cp -rf * ../$(v)
|
||||
rm -f ../$(v).zip
|
||||
cd ..; zip -9 -r -y $(v).zip $(v) -x "*.xcf" -x "*.git*" -x "*.bak" -x "*.blend*"
|
||||
|
||||
install: lint-changelog copy
|
||||
cp -f ../$(v).zip ../../mods/
|
||||
|
||||
lint-changelog: copy
|
||||
python3 ../da-changelog-tools_0.0.14/changelog-checker.py --changelog ../$(v).zip
|
||||
|
||||
zorro:
|
||||
python3 ../da-changelog-tools_0.0.14/changelog-checker.py --zorro --changelog ../$(v).zip
|
||||
|
||||
14
README.md
|
|
@ -1,19 +1,21 @@
|
|||
# Noble Metals
|
||||
|
||||
[factorio mod page](https://mods.factorio.com/mod/bzgold)
|
||||
|
||||
Adds gold, silver, platinum and palladium to the game. Reworks processing units and much more.
|
||||
|
||||
This mod adds more complexity to a vanilla Factorio game, especially after chemical science, though silver shows up earlier. As always, the more BZ mods you add the more complex the game will become.
|
||||
## Version History
|
||||
See changelog.txt
|
||||
|
||||
Note, when silver from this mod is used with [Lead](https://mods.factorio.com/mod/bzlead), lead outputs a silver byproduct instead of a copper byproduct.
|
||||
## Created by
|
||||
- [brevven](https://mods.factorio.com/user/brevven) (code, design, graphics)
|
||||
|
||||
## Credits
|
||||
- Brevven ([Original mod](https://mods.factorio.com/mod/bzgold))
|
||||
- [cackling fiend](https://mods.factorio.com/user/cackling.fiend) (Update to 2.0)
|
||||
## Thanks to
|
||||
- [snouz](https://github.com/snouz) (inspiration for logo)
|
||||
|
||||
|
||||
### Localization
|
||||
- [Klarkxy](https://github.com/klarkxy) (zh-CN)
|
||||
- [Sakuro](https://mods.factorio.com/user/sakuro) (ja)
|
||||
|
||||
### Testing
|
||||
- [Sakuro](https://mods.factorio.com/user/sakuro)
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
---------------------------------------------------------------------------------------------------
|
||||
Version: 2.0.0
|
||||
Date: 19.10.2025
|
||||
Changes:
|
||||
- Update to Factorio 2.0
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
local util = require("data-util")
|
||||
|
||||
if mods.bobelectronics or mods.MDbobelectronics or mods.MDbobelectronics2 then
|
||||
util.replace_ingredient("advanced-processing-unit", "processing-electronics", "cpu", 4)
|
||||
util.remove_recipe_effect("advanced-electronics-3", "processing-electronics")
|
||||
util.remove_raw("recipe", "processing-electronics")
|
||||
util.remove_raw("item", "processing-electronics")
|
||||
|
||||
if mods["Krastorio2"] then
|
||||
data.raw.recipe["kr-crush-processing-electronics"] = nil
|
||||
end
|
||||
|
||||
if mods["248k-Redux"] then
|
||||
data.raw.recipe["fu_burn_processing-electronics_recipe"] = nil
|
||||
end
|
||||
end
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
{
|
||||
"name": "bzgold2",
|
||||
"version": "2.0.0",
|
||||
"factorio_version": "2.0",
|
||||
"title": "Noble Metals",
|
||||
"description": "Adds silver, gold, platinum, palladium and more to the base game. Reworks processing units.",
|
||||
"author": "Brevven, cackling fiend",
|
||||
"homepage": "https://discord.gg/ufvFUJtVwk",
|
||||
"dependencies": [
|
||||
"base >= 2.0.0",
|
||||
"? bzfoundry2 >= 2.0.0",
|
||||
"? bztitanium >= 2.0.26",
|
||||
"? bzlead >= 2.0.28",
|
||||
"? bzzirconium >= 2.1.13",
|
||||
"? bztungsten >= 0.6.0",
|
||||
"? bzcarbon >= 2.0.21",
|
||||
"? bztin >= 2.1.15",
|
||||
"? bzgas2",
|
||||
"? bzchlorine2",
|
||||
"? 248k-Redux >= 0.1.22",
|
||||
"? space-exploration >= 0.7.34",
|
||||
"? aai-industry",
|
||||
"(?) aai-loaders",
|
||||
"? Krastorio2",
|
||||
"? bobelectronics",
|
||||
"? MDbobelectronics2",
|
||||
"? modmashsplintergold",
|
||||
"? deadlock-beltboxes-loaders",
|
||||
"? DeadlockCrating",
|
||||
"! space-age"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"item":
|
||||
[
|
||||
["processing-electronics", "cpu"]
|
||||
]
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
-- Enable prod modules for some recipes
|
||||
-- Recipes with very specific ratios are deliberately excluded
|
||||
local util = require("data-util")
|
||||
|
||||
for i, recipe in pairs(util.me.recipes) do
|
||||
if data.raw.recipe[recipe] then
|
||||
data.raw.recipe[recipe].allow_productivity = true
|
||||
end
|
||||
end
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
local util = require("data-util");
|
||||
|
||||
local silicon = {type="item", name="stone", amount=30}
|
||||
if mods.bzsilicon then
|
||||
silicon = data.raw.item["silicon-wafer"] and {type="item", name="silicon-wafer", amount=30} or {type="item", name=mods.Krastorio2 and "kr-silicon" or "silicon", amount=15}
|
||||
elseif mods.Krastorio2 then
|
||||
silicon = data.raw.item["silicon-wafer"] and {type="item", name="silicon-wafer", amount=30} or {type="item", name="kr-silicon", amount=15}
|
||||
elseif data.raw.item["sand"] then
|
||||
silicon = {type="item", name="sand", amount=30}
|
||||
end
|
||||
|
||||
local spreader = data.raw.item["cuw"] and {type="item", name="cuw", amount=2} or {type="item", name="copper-plate", amount=2}
|
||||
data:extend({
|
||||
{
|
||||
type = "item",
|
||||
name = "cpu",
|
||||
icon = "__base__/graphics/technology/advanced-circuit.png",
|
||||
icon_size = 256,
|
||||
subgroup = "intermediate-product",
|
||||
order = "b[cpu]",
|
||||
stack_size = 200,
|
||||
},
|
||||
{
|
||||
type = "recipe",
|
||||
name = "cpu",
|
||||
category = "crafting-with-fluid",
|
||||
order = "d[cpu]",
|
||||
enabled = false,
|
||||
energy_required = 50,
|
||||
ingredients = {
|
||||
silicon, spreader, {type="item", name="gold-ingot", amount=1}, {type="item", name="electronic-circuit", amount=10},
|
||||
{type="fluid", name="sulfuric-acid", amount=50},
|
||||
},
|
||||
results = {{type="item", name="cpu", amount=10}},
|
||||
},
|
||||
})
|
||||
if mods["space-exploration"] then
|
||||
local cpui = {}
|
||||
if mods.Krastorio2 then
|
||||
cpui = {{type="item", name="se-holmium-cable", amount=2}, silicon, spreader, {type="item", name="electronic-circuit", amount=20}, {type="item", name="gold-ingot", amount=1},
|
||||
{type="fluid", name="sulfuric-acid", amount=50}}
|
||||
else
|
||||
cpui = {{type="item", name="se-holmium-cable", amount=1}, silicon, spreader, {type="item", name="electronic-circuit", amount=20}, {type="item", name="gold-ingot", amount=1},
|
||||
{type="fluid", name="sulfuric-acid", amount=50}}
|
||||
end
|
||||
data:extend({
|
||||
{
|
||||
type = "recipe",
|
||||
name = "cpu-holmium",
|
||||
icons = {
|
||||
{ icon = "__base__/graphics/technology/advanced-circuit.png", icon_size = 256, },
|
||||
{ icon = "__space-exploration-graphics__/graphics/icons/holmium-solenoid.png", icon_size = 64, scale=.25, shift={-8, -8} },
|
||||
},
|
||||
category = "crafting-with-fluid",
|
||||
order = "d[cpu]",
|
||||
enabled = false,
|
||||
energy_required = 50,
|
||||
ingredients = cpui,
|
||||
results = {{type="item", name="cpu", amount=20}},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
util.replace_ingredient("cpu", "electronic-circuit", "pcb", 10, false, {"force", true})
|
||||
util.replace_ingredient("cpu-holmium", "electronic-circuit", "pcb", 20, false, {"force", true})
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
local resource_autoplace = require('resource-autoplace');
|
||||
local item_sounds = require('__base__.prototypes.item_sounds')
|
||||
|
||||
local util = require("data-util");
|
||||
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["gold-ore"] = {}
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["gold-ore"] = {}
|
||||
resource_autoplace.initialize_patch_set("gold-ore", true)
|
||||
|
||||
data:extend({
|
||||
{
|
||||
type = "autoplace-control",
|
||||
category = "resource",
|
||||
name = "gold-ore",
|
||||
richness = true,
|
||||
order = "b-e"
|
||||
},
|
||||
{
|
||||
type = "resource",
|
||||
name = "gold-ore",
|
||||
icon = "__bzgold__/graphics/icons/gold-ore.png",
|
||||
icon_size = 128,
|
||||
flags = {"placeable-neutral"},
|
||||
order="a-b-a",
|
||||
map_color = {r=1.00, g=0.90, b=0.10},
|
||||
tree_removal_probability = 0.7,
|
||||
tree_removal_max_distance = 32 * 32,
|
||||
minable =
|
||||
{
|
||||
hardness = 1,
|
||||
mining_particle = "gold-ore-particle",
|
||||
mining_time = 1,
|
||||
results =
|
||||
util.se6() and
|
||||
{
|
||||
{type="item", name="gold-ore", amount=1, probability=.75},
|
||||
{type="item", name="stone", amount=1, probability=.25},
|
||||
} or
|
||||
{
|
||||
{type="item", name="gold-ore", amount=1, probability=.25},
|
||||
{type="item", name="stone", amount=1, probability=.75},
|
||||
}
|
||||
},
|
||||
collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
|
||||
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
|
||||
|
||||
autoplace = resource_autoplace.resource_autoplace_settings{
|
||||
name = "gold-ore",
|
||||
order = "b-z",
|
||||
base_density = 1,
|
||||
base_spots_per_km2 = 1,
|
||||
has_starting_area_placement = false,
|
||||
regular_rq_factor_multiplier = 1,
|
||||
starting_rq_factor_multiplier = 1,
|
||||
},
|
||||
|
||||
stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80},
|
||||
stages =
|
||||
{
|
||||
sheet =
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/hr-gold-ore.png",
|
||||
priority = "extra-high",
|
||||
size = 128,
|
||||
frame_count = 8,
|
||||
variation_count = 8,
|
||||
scale = 0.5
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "gold-ore",
|
||||
icon_size = 128,
|
||||
icon = "__bzgold__/graphics/icons/gold-ore.png",
|
||||
pictures = {
|
||||
{filename="__bzgold__/graphics/icons/gold-ore.png", size=128, scale=0.25},
|
||||
{filename="__bzgold__/graphics/icons/gold-ore-1.png", size=128, scale=0.25},
|
||||
{filename="__bzgold__/graphics/icons/gold-ore-2.png", size=128, scale=0.25},
|
||||
{filename="__bzgold__/graphics/icons/gold-ore-3.png", size=128, scale=0.25},
|
||||
{filename="__bzgold__/graphics/icons/gold-ore-4.png", size=128, scale=0.25},
|
||||
},
|
||||
subgroup = "raw-resource",
|
||||
order = "a-a-a",
|
||||
stack_size = 50,
|
||||
weight = 20*kg,
|
||||
inventory_move_sound = item_sounds.resource_inventory_move,
|
||||
pick_sound = item_sounds.resource_inventory_pickup,
|
||||
drop_sound = item_sounds.resource_inventory_move,
|
||||
},
|
||||
})
|
||||
|
||||
if util.se6() then
|
||||
se_resources["gold-ore"] = {
|
||||
order = "b-z-g",
|
||||
has_starting_area_placement = false,
|
||||
base_density = 1,
|
||||
base_spots_per_km2 = 1,
|
||||
}
|
||||
end
|
||||
|
||||
data:extend({
|
||||
{
|
||||
type = "optimized-particle",
|
||||
name = "gold-ore-particle",
|
||||
flags = {"not-on-map"},
|
||||
life_time = 180,
|
||||
pictures =
|
||||
{
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-1.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
},
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-2.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
},
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-3.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
},
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-4.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
}
|
||||
},
|
||||
shadows =
|
||||
{
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-shadow-1.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
},
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-shadow-2.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
},
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-shadow-3.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
},
|
||||
{
|
||||
filename = "__bzgold__/graphics/entity/ores/particle/hr-gold-ore-particle-shadow-4.png",
|
||||
priority = "extra-high",
|
||||
width = 32,
|
||||
height = 32,
|
||||
frame_count = 1,
|
||||
scale = 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
123
changelog.txt
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.15
|
||||
Date: 2023-12-29
|
||||
Changes:
|
||||
- SE: Meteor/umbrella defense tech requires rocket science packs
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.14
|
||||
Date: 2023-04-16
|
||||
Fixes:
|
||||
- SE: Fix holmium cable mainboard recipe to use correct ingredients
|
||||
Changes:
|
||||
- Processing unit recipe time has been further halved
|
||||
- K2: Rare metals are now used in mainbord recipes, not processing units
|
||||
- SE: Lifesupport canisters no longer require processing units
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.13
|
||||
Date: 2023-04-10
|
||||
Changes:
|
||||
- Catalyzed oil recipes can now use prod modules.
|
||||
Localization:
|
||||
- zh-CN thanks to Klarkxy
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.12
|
||||
Date: 2023-04-02
|
||||
Changes:
|
||||
- Silver brazing alloy will use foundry if enabled.
|
||||
- SE: Fix some possible tech/recipe deadlocks
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.11
|
||||
Date: 2023-03-29
|
||||
Fixes:
|
||||
- Several en locale strings added or fixed
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.10
|
||||
Date: 2023-03-28
|
||||
Fixes:
|
||||
- Correctly scale low res rich copper entity sprites
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.9
|
||||
Date: 2023-03-27
|
||||
Fixes:
|
||||
- When silver is disabled, do not enable an alternate electronic circuit recipe
|
||||
- Alternate electronic circuit recipe now unlocks at appropriate time in certain mod loadouts
|
||||
- Some fixes around platinum, palladium settings
|
||||
Changes:
|
||||
- Tweak silver wire icon
|
||||
- Tweak electronic circuit recipe icons
|
||||
- When used with Bob's electronics, provide alternate basic electronic components recipe
|
||||
- When used with AAI Industry (and not Natural Gas) provide alt-alt electronic circuit recipe
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.8
|
||||
Date: 2023-03-27
|
||||
Fixes:
|
||||
- Researching Advanced Electronics 2 unlocks now correctly unlocks CPUs in most mod loadouts.
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.7
|
||||
Date: 2023-03-26
|
||||
Fixes:
|
||||
- Compatibility fixes for some loadouts
|
||||
- Fix silicon in CPUs in some loadouts
|
||||
Features:
|
||||
- SE: Added setting to output a very small amount of ore in Nauvis core mining, default zero.
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.6
|
||||
Date: 2023-03-22
|
||||
Features:
|
||||
- Basic compatility with 248k, unified gold ingot items and production lines.
|
||||
Fixes:
|
||||
- SE: Satellite rocket silo no longer requires palladium, due to tech deadlock
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.5
|
||||
Date: 2023-03-19
|
||||
Features:
|
||||
- Compatible with ModMash Splinter Gold
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.4
|
||||
Date: 2023-03-18
|
||||
Fixes:
|
||||
- More locale strings (en)
|
||||
- K2, SE: Prod modules for alternate smelting chains
|
||||
Changes:
|
||||
- Recipe balance changes
|
||||
- K2: Early rare metals recipe does not output noble metals
|
||||
- SE: Post-rocket techs require rocket science packs
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.3
|
||||
Date: 2023-03-14
|
||||
Changes:
|
||||
- K2: Fix some recipes
|
||||
- SE: A bit more minor smoothing of progression
|
||||
- K2SE: Matter updates
|
||||
Fixes:
|
||||
- SE: Fix some recipe building issues, eg alternate solid fuel recipes
|
||||
- Fix some more mod load issues, as well as further playability compatibility
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.2
|
||||
Date: 2023-03-13
|
||||
Fixes:
|
||||
- Fix and add several en locale strings
|
||||
Changes:
|
||||
- Rebalance silver brazing alloy
|
||||
- SE: Smooth progression around processing units and switch around some recipes
|
||||
- SE: Alternate production chain for processing units using holmium
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.0.1
|
||||
Date: 2023-03-10
|
||||
Features:
|
||||
- Early alpha release, incomplete.
|
||||
- Adds gold, silver, platinum and palladium
|
||||
- Adds some intermediate items
|
||||
- Updates processing units production chain
|
||||
- Optionally adds catalysis recipes
|
||||
- Compatible with Krastorio 2 (more to come)
|
||||
- Compatible with Space Exploration (more to come)
|
||||
- Compatible with Bob's Electronics
|
||||
- Compatible with deadlock stacking/crating
|
||||
- Compatible with many other mods
|
||||
Known issues:
|
||||
- Gameplay balance is not tuned.
|
||||
- In Space Exploration, gold ore (and rich copper ore, without K2) will show up on Nauvis
|
||||
They should eventually only show up off of Nauvis.
|
||||
- Enriched ores need better graphics.
|
||||
- Some mod setting configurations don't currently work.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
local util = require("data-util");
|
||||
|
||||
if mods["248k-Redux"] then
|
||||
if mods["248k"] then
|
||||
local au2 = "fu_materials_gold_ingot"
|
||||
|
||||
-- Swap out all 248k gold ingot for BZ gold ingot
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
require("prototypes/tech-updates")
|
||||
require("prototypes/processing-unit-updates")
|
||||
require("compatibility/bobelectronics")
|
||||
require("prototypes/recipe-updates")
|
||||
require("prototypes/recipe-updates-se")
|
||||
require("map-gen-preset-updates")
|
||||
|
|
@ -44,7 +44,7 @@ if get_setting("bz-recipe-bypass") then
|
|||
end
|
||||
|
||||
function util.is_foundry()
|
||||
return mods.bzfoundry2 and not me.get_setting("bzfoundry-minimal")
|
||||
return mods.bzfoundry and not me.get_setting("bzfoundry-minimal")
|
||||
end
|
||||
|
||||
function should_force(options)
|
||||
|
|
@ -64,7 +64,17 @@ function util.fe_plus(sub)
|
|||
end
|
||||
end
|
||||
|
||||
function util.k2assets()
|
||||
function util.get_stack_size(default)
|
||||
if mods.Krastorio2 then
|
||||
local size = get_setting("kr-stack-size")
|
||||
if size and tonumber(size) then
|
||||
return tonumber(size)
|
||||
end
|
||||
end
|
||||
return default
|
||||
end
|
||||
|
||||
function util.k2assets()
|
||||
if mods["Krastorio2Assets"] then
|
||||
return "__Krastorio2Assets__"
|
||||
end
|
||||
|
|
@ -101,8 +111,8 @@ function util.se_landfill(params)
|
|||
category = "hard-recycling",
|
||||
order = "z-b-"..params.ore,
|
||||
subgroup = "terrain",
|
||||
results = {{type="item", name="landfill", amount=1}},
|
||||
ingredients = {{type="item", name=params.ore, amount=50}},
|
||||
result = "landfill",
|
||||
ingredients = {{params.ore, 50}},
|
||||
}
|
||||
})
|
||||
util.add_unlock("se-recycling-facility", lname)
|
||||
|
|
@ -113,7 +123,7 @@ end
|
|||
-- k2 matter
|
||||
-- params: {k2matter}, k2baseicon , {icon}
|
||||
function util.k2matter(params)
|
||||
local matter = require("__Krastorio2__/prototypes/libraries/matter")
|
||||
local matter = require("__Krastorio2__/lib/public/data-stages/matter-util")
|
||||
if mods["space-exploration"] then
|
||||
params.k2matter.need_stabilizer = true
|
||||
end
|
||||
|
|
@ -159,7 +169,7 @@ function util.k2matter(params)
|
|||
{
|
||||
{"production-science-pack", 1},
|
||||
{"utility-science-pack", 1},
|
||||
{"kr-matter-tech-card", 1}
|
||||
{"matter-tech-card", 1}
|
||||
},
|
||||
time = 45,
|
||||
},
|
||||
|
|
@ -167,7 +177,7 @@ function util.k2matter(params)
|
|||
},
|
||||
})
|
||||
end
|
||||
matter.make_recipes(params.k2matter)
|
||||
matter.createMatterRecipe(params.k2matter)
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -201,16 +211,16 @@ function util.se_matter(params)
|
|||
energy_required = params.energy_required,
|
||||
enabled = false,
|
||||
ingredients = {
|
||||
{type="item", name=sedata, amount=1},
|
||||
{sedata, 1},
|
||||
{type="fluid", name="se-particle-stream", amount=50},
|
||||
{type="fluid", name="se-space-coolant-supercooled", amount=25},
|
||||
},
|
||||
results = {
|
||||
{type="item", name=params.ore, amount=params.quant_out},
|
||||
{type="item", name="se-contaminated-scrap", amount=1},
|
||||
{type="item", name=sedata, amount=1, probability=.99},
|
||||
{type="item", name=sejunk, amount=1, probability=.01},
|
||||
{type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_productivity=25},
|
||||
{params.ore, params.quant_out},
|
||||
{"se-contaminated-scrap", 1},
|
||||
{type=item, name=sedata, amount=1, probability=.99},
|
||||
{type=item, name=sejunk, amount=1, probability=.01},
|
||||
{type="fluid", name="se-space-coolant-hot", amount=25, catalyst_amount=25},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -240,14 +250,14 @@ function util.se_matter(params)
|
|||
energy_required = 30,
|
||||
enabled = false,
|
||||
ingredients = {
|
||||
{type="item", name="se-kr-matter-liberation-data", amount=1},
|
||||
{type="item", name=params.ore, amount=params.quant_in},
|
||||
{"se-kr-matter-liberation-data", 1},
|
||||
{params.ore, params.quant_in},
|
||||
{type="fluid", name="se-particle-stream", amount=50},
|
||||
},
|
||||
results = {
|
||||
{type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99},
|
||||
{type="item", name=sejunk, amount=1, probability=.01},
|
||||
{type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_productivity=50},
|
||||
{type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99},
|
||||
{type=item, name=sejunk, amount=1, probability=.01},
|
||||
{type="fluid", name="se-particle-stream", amount=params.stream_out, catalyst_amount=50},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -274,7 +284,7 @@ function util.se_matter(params)
|
|||
{"se-astronomic-science-pack-4", 1},
|
||||
{"se-energy-science-pack-4", 1},
|
||||
{"se-material-science-pack-4", 1},
|
||||
{"kr-matter-tech-card", 1},
|
||||
{"matter-tech-card", 1},
|
||||
{"se-deep-space-science-pack-1", 1},
|
||||
}
|
||||
|
||||
|
|
@ -288,6 +298,18 @@ function util.se_matter(params)
|
|||
end
|
||||
end
|
||||
|
||||
-- Get the normal prototype for a recipe -- either .normal or the recipe itself
|
||||
function util.get_normal(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
recipe = data.raw.recipe[recipe_name]
|
||||
if recipe.normal and recipe.normal.ingredients then
|
||||
return recipe.normal
|
||||
elseif recipe.ingredients then
|
||||
return recipe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Set/override a technology's prerequisites
|
||||
function util.set_prerequisite(technology_name, prerequisites)
|
||||
local technology = data.raw.technology[technology_name]
|
||||
|
|
@ -354,7 +376,7 @@ function util.add_unlock(technology_name, recipe)
|
|||
end
|
||||
|
||||
-- Check if a tech unlocks a recipe
|
||||
function util.check_unlock(technology_name, recipe)
|
||||
function util.check_unlock(technology_name, recipe_name)
|
||||
local technology = data.raw.technology[technology_name]
|
||||
if technology and technology.effects then
|
||||
for i, effect in pairs(technology.effects) do
|
||||
|
|
@ -399,13 +421,17 @@ end
|
|||
|
||||
function util.set_enabled(recipe_name, enabled)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
data.raw.recipe[recipe_name].enabled = enabled
|
||||
if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.enabled = enabled end
|
||||
if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.enabled = enabled end
|
||||
if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].enabled = enabled end
|
||||
end
|
||||
end
|
||||
|
||||
function util.set_hidden(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
data.raw.recipe[recipe_name].hidden = true
|
||||
if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.hidden = true end
|
||||
if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.hidden = true end
|
||||
if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].hidden = true end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -415,6 +441,8 @@ function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity, option
|
|||
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
|
||||
me.add_modified(recipe_name)
|
||||
add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
|
||||
add_or_add_to_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
|
||||
add_or_add_to_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -437,6 +465,8 @@ function util.add_ingredient(recipe_name, ingredient, quantity, options)
|
|||
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then
|
||||
me.add_modified(recipe_name)
|
||||
add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid)
|
||||
add_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity, is_fluid)
|
||||
add_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity, is_fluid)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -450,7 +480,7 @@ function add_ingredient(recipe, ingredient, quantity, is_fluid)
|
|||
if is_fluid then
|
||||
table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity})
|
||||
else
|
||||
table.insert(recipe.ingredients, {type="item", name=ingredient, amount=quantity})
|
||||
table.insert(recipe.ingredients, {ingredient, quantity})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -461,6 +491,8 @@ function util.add_ingredient_raw(recipe_name, ingredient, options)
|
|||
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then
|
||||
me.add_modified(recipe_name)
|
||||
add_ingredient_raw(data.raw.recipe[recipe_name], ingredient)
|
||||
add_ingredient_raw(data.raw.recipe[recipe_name].normal, ingredient)
|
||||
add_ingredient_raw(data.raw.recipe[recipe_name].expensive, ingredient)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -484,6 +516,8 @@ function util.set_ingredient(recipe_name, ingredient, quantity, options)
|
|||
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
|
||||
me.add_modified(recipe_name)
|
||||
set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
|
||||
set_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
|
||||
set_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -507,18 +541,29 @@ end
|
|||
-- Only works for recipes with multiple products
|
||||
function util.add_product(recipe_name, product, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] and
|
||||
(data.raw.item[product.name] or data.raw.fluid[product.name]) then
|
||||
if data.raw.recipe[recipe_name] and
|
||||
(data.raw.item[product[1]] or data.raw.item[product.name] or
|
||||
data.raw.fluid[product[1]] or data.raw.fluid[product.name]
|
||||
) then
|
||||
add_product(data.raw.recipe[recipe_name], product)
|
||||
add_product(data.raw.recipe[recipe_name].normal, product)
|
||||
add_product(data.raw.recipe[recipe_name].expensive, product)
|
||||
end
|
||||
end
|
||||
|
||||
function add_product(recipe, product)
|
||||
if recipe ~= nil then
|
||||
if recipe.results == nil then
|
||||
recipe.results = {}
|
||||
if (product[1] and data.raw.item[product[1]]) or
|
||||
(product.name and data.raw[product.type][product.name]) then
|
||||
if not recipe.normal then
|
||||
if recipe.results == nil then
|
||||
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
|
||||
end
|
||||
recipe.result = nil
|
||||
recipe.result_count = nil
|
||||
table.insert(recipe.results, product)
|
||||
end
|
||||
table.insert(recipe.results, product)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -526,13 +571,18 @@ end
|
|||
function util.get_ingredient_amount(recipe_name, ingredient_name)
|
||||
local recipe = data.raw.recipe[recipe_name]
|
||||
if recipe then
|
||||
if recipe.ingredients then
|
||||
if recipe.normal and recipe.normal.ingredients then
|
||||
for i, ingredient in pairs(recipe.normal.ingredients) do
|
||||
if ingredient[1] == ingredient_name then return ingredient[2] end
|
||||
if ingredient.name == ingredient_name then return ingredient.amount end
|
||||
end
|
||||
elseif recipe.ingredients then
|
||||
for i, ingredient in pairs(recipe.ingredients) do
|
||||
if ingredient[1] == ingredient_name then return ingredient[2] end
|
||||
if ingredient.name == ingredient_name then return ingredient.amount end
|
||||
end
|
||||
end
|
||||
return 1
|
||||
return 0
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
|
@ -542,7 +592,14 @@ function util.get_amount(recipe_name, product)
|
|||
if not product then product = recipe_name end
|
||||
local recipe = data.raw.recipe[recipe_name]
|
||||
if recipe then
|
||||
if recipe.results then
|
||||
if recipe.normal and recipe.normal.results then
|
||||
for i, result in pairs(recipe.normal.results) do
|
||||
if result[1] == product then return result[2] end
|
||||
if result.name == product then return result.amount end
|
||||
end
|
||||
elseif recipe.normal and recipe.normal.result_count then
|
||||
return recipe.normal.result_count
|
||||
elseif recipe.results then
|
||||
for i, result in pairs(recipe.results) do
|
||||
if result[1] == product then return result[2] end
|
||||
if result.name == product then return result.amount end
|
||||
|
|
@ -560,7 +617,9 @@ function util.get_result_count(recipe_name, product)
|
|||
if not product then product = recipe_name end
|
||||
local recipe = data.raw.recipe[recipe_name]
|
||||
if recipe then
|
||||
if recipe.results then
|
||||
if recipe.normal and recipe.normal.results then
|
||||
return #(recipe.normal.results)
|
||||
elseif recipe.results then
|
||||
return #(recipe.results)
|
||||
end
|
||||
return 1
|
||||
|
|
@ -575,6 +634,8 @@ function util.replace_ingredient(recipe_name, old, new, amount, multiply, option
|
|||
if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then
|
||||
me.add_modified(recipe_name)
|
||||
replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply)
|
||||
replace_ingredient(data.raw.recipe[recipe_name].normal, old, new, amount, multiply)
|
||||
replace_ingredient(data.raw.recipe[recipe_name].expensive, old, new, amount, multiply)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -616,6 +677,8 @@ function util.remove_ingredient(recipe_name, old, options)
|
|||
if data.raw.recipe[recipe_name] then
|
||||
me.add_modified(recipe_name)
|
||||
remove_ingredient(data.raw.recipe[recipe_name], old)
|
||||
remove_ingredient(data.raw.recipe[recipe_name].normal, old)
|
||||
remove_ingredient(data.raw.recipe[recipe_name].expensive, old)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -641,23 +704,28 @@ function util.replace_some_product(recipe_name, old, old_amount, new, new_amount
|
|||
if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then
|
||||
me.add_modified(recipe_name)
|
||||
replace_some_product(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid)
|
||||
replace_some_product(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid)
|
||||
replace_some_product(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid)
|
||||
end
|
||||
end
|
||||
|
||||
function replace_some_product(recipe, old, old_amount, new, new_amount, is_fluid)
|
||||
function replace_some_product(recipe, old, old_amount, new, new_amount)
|
||||
if recipe ~= nil then
|
||||
if recipe.result == new then return end
|
||||
if recipe.results then
|
||||
for i, existing in pairs(recipe.results) do
|
||||
if existing.name == new then
|
||||
if existing[1] == new or existing.name == new then
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
add_product(recipe, {type=is_fluid and "fluid" or "item", name=new, amount=new_amount})
|
||||
add_product(recipe, {new, new_amount})
|
||||
for i, product in pairs(recipe.results) do
|
||||
if product.name == old then
|
||||
product.amount = math.max(1, product.amount - old_amount)
|
||||
end
|
||||
if product[1] == old then
|
||||
product[2] = math.max(1, product[2] - old_amount)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -670,6 +738,8 @@ function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amo
|
|||
if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then
|
||||
me.add_modified(recipe_name)
|
||||
replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid)
|
||||
replace_some_ingredient(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid)
|
||||
replace_some_ingredient(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -698,6 +768,8 @@ function util.set_product_amount(recipe_name, product, amount, options)
|
|||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
set_product_amount(data.raw.recipe[recipe_name], product, amount)
|
||||
set_product_amount(data.raw.recipe[recipe_name].normal, product, amount)
|
||||
set_product_amount(data.raw.recipe[recipe_name].expensive, product, amount)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -736,6 +808,8 @@ function util.multiply_recipe(recipe_name, multiple, options)
|
|||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
multiply_recipe(data.raw.recipe[recipe_name], multiple)
|
||||
multiply_recipe(data.raw.recipe[recipe_name].normal, multiple)
|
||||
multiply_recipe(data.raw.recipe[recipe_name].expensive, multiple)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -743,6 +817,8 @@ function multiply_recipe(recipe, multiple)
|
|||
if recipe then
|
||||
if recipe.energy_required then
|
||||
recipe.energy_required = recipe.energy_required * multiple
|
||||
else
|
||||
recipe.energy_required = 0.5 * multiple -- 0.5 is factorio default
|
||||
end
|
||||
if recipe.result_count then
|
||||
recipe.result_count = recipe.result_count * multiple
|
||||
|
|
@ -757,8 +833,8 @@ function multiply_recipe(recipe, multiple)
|
|||
result.amount_min = result.amount_min * multiple
|
||||
result.amount_max = result.amount_max * multiple
|
||||
end
|
||||
if result.ignored_by_productivity then
|
||||
result.ignored_by_productivity = result.ignored_by_productivity * multiple
|
||||
if result.catalyst_amount then
|
||||
result.catalyst_amount = result.catalyst_amount * multiple
|
||||
end
|
||||
end
|
||||
if result[1] then
|
||||
|
|
@ -785,8 +861,9 @@ end
|
|||
|
||||
-- Returns true if a recipe has an ingredient
|
||||
function util.has_ingredient(recipe_name, ingredient)
|
||||
return data.raw.recipe[recipe_name] and
|
||||
has_ingredient(data.raw.recipe[recipe_name], ingredient)
|
||||
return data.raw.recipe[recipe_name] and (
|
||||
has_ingredient(data.raw.recipe[recipe_name], ingredient) or
|
||||
has_ingredient(data.raw.recipe[recipe_name].normal, ingredient))
|
||||
end
|
||||
|
||||
function has_ingredient(recipe, ingredient)
|
||||
|
|
@ -806,6 +883,8 @@ function util.remove_product(recipe_name, old, options)
|
|||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
remove_product(data.raw.recipe[recipe_name], old)
|
||||
remove_product(data.raw.recipe[recipe_name].normal, old)
|
||||
remove_product(data.raw.recipe[recipe_name].expensive, old)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -828,6 +907,8 @@ function util.set_main_product(recipe_name, product, options)
|
|||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
set_main_product(data.raw.recipe[recipe_name], product)
|
||||
set_main_product(data.raw.recipe[recipe_name].normal, product)
|
||||
set_main_product(data.raw.recipe[recipe_name].expensive, product)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -841,11 +922,13 @@ end
|
|||
function util.replace_product(recipe_name, old, new, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
replace_product(data.raw.recipe[recipe_name], old, new)
|
||||
replace_product(data.raw.recipe[recipe_name], old, new, options)
|
||||
replace_product(data.raw.recipe[recipe_name].normal, old, new, options)
|
||||
replace_product(data.raw.recipe[recipe_name].expensive, old, new, options)
|
||||
end
|
||||
end
|
||||
|
||||
function replace_product(recipe, old, new)
|
||||
function replace_product(recipe, old, new, options)
|
||||
if recipe then
|
||||
if recipe.main_product == old then
|
||||
recipe.main_product = new
|
||||
|
|
@ -885,6 +968,8 @@ function util.set_recipe_time(recipe_name, time, options)
|
|||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
set_recipe_time(data.raw.recipe[recipe_name], time)
|
||||
set_recipe_time(data.raw.recipe[recipe_name].normal, time)
|
||||
set_recipe_time(data.raw.recipe[recipe_name].expensive, time)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -902,6 +987,8 @@ function util.multiply_time(recipe_name, factor, options)
|
|||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
multiply_time(data.raw.recipe[recipe_name], factor)
|
||||
multiply_time(data.raw.recipe[recipe_name].normal, factor)
|
||||
multiply_time(data.raw.recipe[recipe_name].expensive, factor)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -919,6 +1006,8 @@ function util.add_time(recipe_name, amount, options)
|
|||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
add_time(data.raw.recipe[recipe_name], amount)
|
||||
add_time(data.raw.recipe[recipe_name].normal, amount)
|
||||
add_time(data.raw.recipe[recipe_name].expensive, amount)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -942,7 +1031,7 @@ end
|
|||
-- Set recipe subgroup
|
||||
function util.set_subgroup(recipe_name, subgroup, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if data.raw.recipe[recipe_name] and data.raw["item-subgroup"][subgroup] then
|
||||
me.add_modified(recipe_name)
|
||||
data.raw.recipe[recipe_name].subgroup = subgroup
|
||||
end
|
||||
|
|
@ -961,16 +1050,34 @@ function util.add_icon(recipe_name, icon, options)
|
|||
if data.raw.recipe[recipe_name] then
|
||||
me.add_modified(recipe_name)
|
||||
if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then
|
||||
data.raw.recipe[recipe_name].icons = {}
|
||||
if data.raw.recipe[recipe_name].icon then
|
||||
data.raw.recipe[recipe_name].icons = {{
|
||||
icon=data.raw.recipe[recipe_name].icon,
|
||||
icon_size=data.raw.recipe[recipe_name].icon_size,
|
||||
icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps,
|
||||
}}
|
||||
data.raw.recipe[recipe_name].icon = nil
|
||||
data.raw.recipe[recipe_name].icon_size = nil
|
||||
end
|
||||
if data.raw.recipe[recipe_name].icon then
|
||||
data.raw.recipe[recipe_name].icons = {{
|
||||
icon=data.raw.recipe[recipe_name].icon,
|
||||
icon_size=data.raw.recipe[recipe_name].icon_size,
|
||||
icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps,
|
||||
}}
|
||||
elseif data.raw.item[data.raw.recipe[recipe_name].main_product] then
|
||||
data.raw.recipe[recipe_name].icons = {{
|
||||
icon=data.raw.item[data.raw.recipe[recipe_name].main_product].icon,
|
||||
icon_size=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_size,
|
||||
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_mipmaps,
|
||||
}}
|
||||
elseif data.raw.item[data.raw.recipe[recipe_name].result] then
|
||||
data.raw.recipe[recipe_name].icons = {{
|
||||
icon=data.raw.item[data.raw.recipe[recipe_name].result].icon,
|
||||
icon_size=data.raw.item[data.raw.recipe[recipe_name].result].icon_size,
|
||||
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].result].icon_mipmaps,
|
||||
}}
|
||||
elseif data.raw.recipe[recipe_name].normal and
|
||||
data.raw.item[data.raw.recipe[recipe_name].normal.result] then
|
||||
data.raw.recipe[recipe_name].icons = {{
|
||||
icon=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon,
|
||||
icon_size=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_size,
|
||||
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_mipmaps,
|
||||
}}
|
||||
end
|
||||
data.raw.recipe[recipe_name].icon = nil
|
||||
data.raw.recipe[recipe_name].icon_size = nil
|
||||
end
|
||||
table.insert(data.raw.recipe[recipe_name].icons, icon)
|
||||
end
|
||||
|
|
@ -1030,6 +1137,8 @@ function util.add_to_ingredient(recipe, ingredient, amount, options)
|
|||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe] then
|
||||
add_to_ingredient(data.raw.recipe[recipe], ingredient, amount)
|
||||
add_to_ingredient(data.raw.recipe[recipe].normal, ingredient, amount)
|
||||
add_to_ingredient(data.raw.recipe[recipe].expensive, ingredient, amount)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -1052,6 +1161,8 @@ function util.add_to_product(recipe_name, product, amount, options)
|
|||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
add_to_product(data.raw.recipe[recipe_name], product, amount)
|
||||
add_to_product(data.raw.recipe[recipe_name].normal, product, amount)
|
||||
add_to_product(data.raw.recipe[recipe_name].expensive, product, amount)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -1174,8 +1285,10 @@ function remove_prior_unlocks(tech, recipe)
|
|||
util.remove_recipe_effect(tech, recipe)
|
||||
if technology.prerequisites then
|
||||
for i, prerequisite in pairs(technology.prerequisites) do
|
||||
-- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :|
|
||||
remove_prior_unlocks(prerequisite, recipe)
|
||||
if string.sub(prerequisite, 1, 3) ~= 'ei_' then
|
||||
-- log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :|
|
||||
remove_prior_unlocks(prerequisite, recipe)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1217,7 +1330,9 @@ function replace_ingredients_prior_to(tech, old, new, multiplier)
|
|||
if technology.prerequisites then
|
||||
for i, prerequisite in pairs(technology.prerequisites) do
|
||||
-- log("BZZZ checking " .. prerequisite) -- Handy Debug :|
|
||||
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
|
||||
if string.sub(prerequisite, 1, 3) ~= 'ei_' then
|
||||
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
45
description.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
ALPHA RELEASE: anything can change including recipes, balance, etc.
|
||||
|
||||
----
|
||||
|
||||
"The object thinkers build the trains, and the spatial visualizers make them run." - *Temple Grandin*
|
||||
|
||||
----
|
||||
Adds gold, silver, platinum and palladium to the game. Reworks processing units and much more.
|
||||
|
||||
This mod adds more complexity to a vanailla factorio game, especially after chemical science, though silver shows up earlier. As always, the more BZ mods you add the more complex the game will become.
|
||||
|
||||
Note, when silver from this mod is used with [Lead](https://mods.factorio.com/mod/bzlead), lead outputs a silver byproduct instead of a copper byproduct.
|
||||
|
||||
Supported compatible mods:
|
||||
|
||||
- Space Exploration & AAI
|
||||
- Krastorio 2
|
||||
- Bob's electronics, 248k, Mod Mash Splinter Gold
|
||||
- Deadlock stacking, crating
|
||||
|
||||
Coming soon: RSO
|
||||
Coming soon: FE+, 5Dim's, ScienceCostTweaker, etc.
|
||||
|
||||
Many other mods are compatible but not yet fully supported. Suggestions always appreciated!
|
||||
|
||||
----
|
||||
#### Special thanks to
|
||||
|
||||
- The community, for all the suggestions, feedback, and bug reports!
|
||||
- [snouz](https://mods.factorio.com/user/snouz) (inspiration for thumbnail)
|
||||
|
||||
|
||||
##### Thanks for testing
|
||||
|
||||
[Sakuro](https://mods.factorio.com/user/sakuro),
|
||||
[Fuuryuu](https://mods.factorio.com/user/fuuryuu),
|
||||
[Shadowreaper](https://mods.factorio.com/user/shadowreaper),
|
||||
[Baisius](https://mods.factorio.com/user/baisius),
|
||||
[agmech](https://mods.factorio.com/user/agmech),
|
||||
[Wonder Ginger](https://mods.factorio.com/user/WonderGinger),
|
||||
[GeneralTank](https://mods.factorio.com/user/GeneralTank),
|
||||
[JonathanF](https://mods.factorio.com/user/JonathanF),
|
||||
[Berkelear](https://mods.factorio.com/user/Berkelear),
|
||||
[Elanu](https://mods.factorio.com/user/elanu),
|
||||
[aeosynth](https://mods.factorio.com/user/aeosynth)
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
BIN
graphics/entity/ores/gold-ore.png
Normal file
|
After Width: | Height: | Size: 438 KiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
BIN
graphics/entity/ores/particle/gold-ore-particle-1.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
graphics/entity/ores/particle/gold-ore-particle-2.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
graphics/entity/ores/particle/gold-ore-particle-3.png
Normal file
|
After Width: | Height: | Size: 240 B |
BIN
graphics/entity/ores/particle/gold-ore-particle-4.png
Normal file
|
After Width: | Height: | Size: 295 B |
BIN
graphics/entity/ores/particle/gold-ore-particle-shadow-1.png
Normal file
|
After Width: | Height: | Size: 127 B |
BIN
graphics/entity/ores/particle/gold-ore-particle-shadow-2.png
Normal file
|
After Width: | Height: | Size: 132 B |
BIN
graphics/entity/ores/particle/gold-ore-particle-shadow-3.png
Normal file
|
After Width: | Height: | Size: 128 B |
BIN
graphics/entity/ores/particle/gold-ore-particle-shadow-4.png
Normal file
|
After Width: | Height: | Size: 128 B |
|
Before Width: | Height: | Size: 565 B After Width: | Height: | Size: 565 B |
|
Before Width: | Height: | Size: 601 B After Width: | Height: | Size: 601 B |
|
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 619 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
BIN
graphics/entity/ores/rich-copper-ore.png
Normal file
|
After Width: | Height: | Size: 434 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |