early updates

This commit is contained in:
Brevven 2023-01-01 20:54:13 -08:00
parent a08fd9cdec
commit ecec509295
15 changed files with 1480 additions and 0 deletions

20
LICENSE.md Normal file
View file

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2022 Brevven
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

37
Makefile Normal file
View 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

12
changelog.txt Normal file
View file

@ -0,0 +1,12 @@
---------------------------------------------------------------------------------------------------
Version: 0.0.1
Date: 2022-02-01
Features:
- Alpha release.
- Adds gold, silver, platinum and palladium
- Optionally adds catalysis recipes
- Compatible with Krastorio 2
- Compatible with Space Exploration
- Compatible with Bob's Electronics
- Compatible with deadlock stacking/crating
- Compatible with many other mods

15
data-final-fixes.lua Normal file
View file

@ -0,0 +1,15 @@
require("stacking")
require("modules")
-- require("tin-recipe-final-5d")
-- require("tin-recipe-final-rrr")
local util = require("data-util");
if mods["space-exploration"] then
-- core mining balancing
-- util.add_to_product("se-core-fragment-omni", "salt", -5)
end
-- Must be last
util.create_list()

17
data-updates.lua Normal file
View file

@ -0,0 +1,17 @@
require("recipe-updates")
require("map-gen-preset-updates")
-- require("compatibility/bob")
-- require("strange-matter")
-- require("compatibility/248k")
-- require("tin-matter")
-- require("omni")
local util = require("data-util")
require("modules")
-- Must be last
util.create_list()

1197
data-util.lua Normal file

File diff suppressed because it is too large Load diff

10
data.lua Normal file
View file

@ -0,0 +1,10 @@
require("prototypes/salt")
local util = require("data-util");
if util.se6() then
-- se_delivery_cannon_recipes["salt"] = {name="salt"}
end
-- Must be last
util.create_list()

29
info.json Normal file
View file

@ -0,0 +1,29 @@
{
"name": "bzchlorine",
"version": "0.0.9",
"factorio_version": "1.1",
"title": "Salt & Chlorine",
"author": "Brevven",
"contact": "",
"homepage": "",
"dependencies": [
"base >= 1.1.0",
"? bzfoundry >= 0.2.1",
"? bztitanium >= 1.2.0",
"? bzlead >= 1.2.0",
"? bzzirconium >= 0.6.0",
"? bztungsten >= 0.6.0",
"? bzcarbon >= 0.5.5",
"? bztin >= 0.1.8",
"? bzgas",
"? space-exploration >= 0.5.100",
"? aai-industry",
"(?) aai-loaders",
"? Krastorio2",
"? bobelectronics",
"? MDbobelectronics",
"? deadlock-beltboxes-loaders",
"? DeadlockCrating"
],
"description": "Adds salt, chlorine and more to the base game. Reworks advanced circuit production.\n\nCompatible with Krastorio 2 and Space Exploration. A standalone piece of BZ Mods."
}

View file

@ -0,0 +1,10 @@
if data.raw["autoplace-control"]["gold-ore"] and data.raw["map-gen-presets"] and data.raw["map-gen-presets"].default then
for name, preset in pairs(data.raw["map-gen-presets"].default) do
if type(preset) == "table" and
preset.basic_settings and
preset.basic_settings.autoplace_controls and
preset.basic_settings.autoplace_controls["iron-ore"] then
preset.basic_settings.autoplace_controls["gold-ore"] = preset.basic_settings.autoplace_controls["iron-ore"]
end
end
end

51
me.lua Normal file
View file

@ -0,0 +1,51 @@
local me = {}
me.name = "bzchlorine"
me.list = {}
function me.starting_patch()
return (
me.get_setting("bzchlorine-early-salt") == "mining" or
me.get_setting("bzchlorine-early-salt") == "both"
)
end
function me.early_assemblers()
return (
me.get_setting("bzchlorine-early-salt") == "assembler" or
me.get_setting("bzchlorine-early-salt") == "both" or
(not me.salt())
)
end
function me.more()
if me.get_setting("bz-all-intermediates") then return true end
return me.get_setting("bzchlorine-more-intermediates") == "yes"
end
function me.salt()
return me.get_setting("bzchlorine-salt")
end
function me.get_setting(name)
if settings.startup[name] == nil then
return nil
end
return settings.startup[name].value
end
me.bypass = {}
if me.get_setting(me.name.."-recipe-bypass") then
for recipe in string.gmatch(me.get_setting(me.name.."-recipe-bypass"), '[^",%s]+') do
me.bypass[recipe] = true
end
end
function me.add_modified(name)
if me.get_setting(me.name.."-list") then
table.insert(me.list, name)
end
end
return me

19
modules.lua Normal file
View file

@ -0,0 +1,19 @@
-- Enable prod modules for some recipes
-- Recipes with very specific ratios are deliberately excluded
recipes = {}
if mods["Krastorio2"] then
end
for i, recipe in pairs(recipes) do
if data.raw.recipe[recipe] then
for j, module in pairs(data.raw.module) do
if module.effect then
for effect_name, effect in pairs(module.effect) do
if effect_name == "productivity" and effect.bonus > 0 and module.limitation and #module.limitation > 0 then
table.insert(module.limitation, recipe)
end
end
end
end
end
end

40
settings.lua Normal file
View file

@ -0,0 +1,40 @@
data:extend({
{
type = "string-setting",
name = "bzchlorine-recipe-bypass",
setting_type = "startup",
default_value = "",
allow_blank = true,
order = "a",
},
{
type = "bool-setting",
name = "bzchlorine-list",
setting_type = "startup",
default_value = false,
order = "b",
},
{
type = "bool-setting",
name = "bzchlorine-salt",
setting_type = "startup",
default_value = true,
order = "c1",
},
{
type = "string-setting",
name = "bzchlorine-early-salt",
setting_type = "startup",
default_value = "assembler",
allowed_values = {"assembler", "mining", "both"},
order = "c2",
},
{
type = "string-setting",
name = "bzchlorine-more-intermediates",
setting_type = "startup",
default_value = "yes",
allowed_values = {"yes", "no"},
order = "d",
},
})

23
stacking.lua Normal file
View file

@ -0,0 +1,23 @@
-- Deadlock stacking recipes
local util = require("data-util");
if deadlock then
deadlock.add_stack("salt", nil, "deadlock-stacking-2", 64)
deadlock.add_stack("pcb-substrate", nil, "deadlock-stacking-2", 128)
deadlock.add_stack("pcb", nil, "deadlock-stacking-2", 128)
if data.raw.item["ferric-chloride"] then
deadlock.add_stack("ferric-chloride", nil, "deadlock-stacking-2", 128)
end
end
-- Deadlock crating recipes
if deadlock_crating then
deadlock_crating.add_crate("salt", "deadlock-crating-2")
deadlock_crating.add_crate("pcb-substrate", "deadlock-crating-2")
deadlock_crating.add_crate("pcb", "deadlock-crating-2")
if data.raw.item["ferric-chloride"] then
deadlock_crating.add_crate("ferric-chloride", "deadlock-crating-2")
end
end

BIN
thumbnail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
thumbnail.xcf Normal file

Binary file not shown.