commit 5c51be9567339c41b5fe9ed2be91ebf71b6aa014 Author: Brevven Date: Sun May 16 01:43:54 2021 -0700 working alpha diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..80fce1c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2021 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. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e95244 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +# General makefile for factorio mods. +# +# Presumes the development work is done in a /dev// +# directory where this makefile resides. This directory must be parallel to +# the /mods/ directory where mods are installed. Run `make +# install` from dev/ 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 + +pwd = $(shell pwd) +v = $(shell basename "$(pwd)")_$(shell jq -r .version info.json) + +copy: + 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" + +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 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d670cf --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# Tungsten + +[factorio mod page](https://mods.factorio.com/mod/bztungsten) + +Adds tungsten ore (wolframite), tungsten plates, tungsten carbide, and rocket engine nozzles to factorio. +Modifies several recipes to use new resources and intermediates. + +## Version History +See changelog.txt + +## Created by + +- [brevven](https://mods.factorio.com/user/brevven) (code, design, graphics) + +### Thanks to +- [Gregersenpai](https://mods.factorio.com/user/Gregersenpai) for [early ideas](https://mods.factorio.com/mod/bztitanium/discussion/608eb5b4012c5f47810bf252) +- [snouz](https://mods.factorio.com/user/snouz) (alpha graphics borrowed from Titanium mod) + + +### Localization diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..72f0235 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,6 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.0.1 +Date: 2021-05-16 + Features: + - Tungsten added to game. + - Compatible with space exploration, krastorio2, deadlock stacking/crating, etc. diff --git a/data-final-fixes.lua b/data-final-fixes.lua new file mode 100644 index 0000000..d465df9 --- /dev/null +++ b/data-final-fixes.lua @@ -0,0 +1,15 @@ +require("modules") +require("tungsten-recipe-final-stacking") +require("tungsten-recipe-final-rrr") +-- require("tungsten-recipe-final-5d") + + + +local util = require("__bztungsten__.util"); + +-- Only burners can make tungsten carbide in vanilla +for i, entity in pairs(data.raw.furnace) do + if entity.energy_source.type == "burner" then + table.insert(entity.crafting_categories,"smelting-carbon") + end +end diff --git a/data-updates.lua b/data-updates.lua new file mode 100644 index 0000000..81a5323 --- /dev/null +++ b/data-updates.lua @@ -0,0 +1,4 @@ +require("tungsten-recipe-updates") +require("tungsten-matter") +require("omni") +require("map-gen-preset-updates") diff --git a/data.lua b/data.lua new file mode 100644 index 0000000..80762dc --- /dev/null +++ b/data.lua @@ -0,0 +1,6 @@ +require("tungsten-ore") +require("tungsten-ore-particle") +require("tungsten-recipe") +require("tungsten-enriched") -- Enriched for Krastorio 2 +require("tungsten-recipe-se") -- Space Exploration special recipes (depends on K2 if present) +require("tungsten-compressed") diff --git a/graphics/entity/ores/hr-tungsten-ore.png b/graphics/entity/ores/hr-tungsten-ore.png new file mode 100644 index 0000000..d5d90d1 Binary files /dev/null and b/graphics/entity/ores/hr-tungsten-ore.png differ diff --git a/graphics/entity/ores/hr-tungsten-ore.xcf b/graphics/entity/ores/hr-tungsten-ore.xcf new file mode 100644 index 0000000..2e888e0 Binary files /dev/null and b/graphics/entity/ores/hr-tungsten-ore.xcf differ diff --git a/graphics/entity/ores/tungsten-ore.png b/graphics/entity/ores/tungsten-ore.png new file mode 100644 index 0000000..dded6bc Binary files /dev/null and b/graphics/entity/ores/tungsten-ore.png differ diff --git a/graphics/entity/ores/tungsten-ore.xcf b/graphics/entity/ores/tungsten-ore.xcf new file mode 100644 index 0000000..ee8e86b Binary files /dev/null and b/graphics/entity/ores/tungsten-ore.xcf differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-1.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-1.png new file mode 100644 index 0000000..e241086 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-1.png differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-2.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-2.png new file mode 100644 index 0000000..7099218 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-2.png differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-3.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-3.png new file mode 100644 index 0000000..cf15c66 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-3.png differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-4.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-4.png new file mode 100644 index 0000000..307d7cd Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-4.png differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-1.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-1.png new file mode 100644 index 0000000..ebef3b3 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-1.png differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-2.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-2.png new file mode 100644 index 0000000..b9fc4f5 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-2.png differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-3.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-3.png new file mode 100644 index 0000000..a3b24e4 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-3.png differ diff --git a/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-4.png b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-4.png new file mode 100644 index 0000000..02cca1a Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-4.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-1.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-1.png new file mode 100644 index 0000000..1b76c18 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-1.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-2.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-2.png new file mode 100644 index 0000000..0bf7c6b Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-2.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-3.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-3.png new file mode 100644 index 0000000..35c156a Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-3.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-4.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-4.png new file mode 100644 index 0000000..9f5115c Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-4.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-1.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-1.png new file mode 100644 index 0000000..89bfee9 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-1.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-2.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-2.png new file mode 100644 index 0000000..7834934 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-2.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-3.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-3.png new file mode 100644 index 0000000..6ef2544 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-3.png differ diff --git a/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-4.png b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-4.png new file mode 100644 index 0000000..a8aa006 Binary files /dev/null and b/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-4.png differ diff --git a/graphics/icons/Untitled.png b/graphics/icons/Untitled.png new file mode 100644 index 0000000..07b9dde Binary files /dev/null and b/graphics/icons/Untitled.png differ diff --git a/graphics/icons/enriched-tungsten-2.png b/graphics/icons/enriched-tungsten-2.png new file mode 100644 index 0000000..ecaa89e Binary files /dev/null and b/graphics/icons/enriched-tungsten-2.png differ diff --git a/graphics/icons/enriched-tungsten-3.png b/graphics/icons/enriched-tungsten-3.png new file mode 100644 index 0000000..ecaa89e Binary files /dev/null and b/graphics/icons/enriched-tungsten-3.png differ diff --git a/graphics/icons/enriched-tungsten-4.png b/graphics/icons/enriched-tungsten-4.png new file mode 100644 index 0000000..ecaa89e Binary files /dev/null and b/graphics/icons/enriched-tungsten-4.png differ diff --git a/graphics/icons/enriched-tungsten.png b/graphics/icons/enriched-tungsten.png new file mode 100644 index 0000000..ecaa89e Binary files /dev/null and b/graphics/icons/enriched-tungsten.png differ diff --git a/graphics/icons/enriched-tungsten.xcf b/graphics/icons/enriched-tungsten.xcf new file mode 100644 index 0000000..423bc18 Binary files /dev/null and b/graphics/icons/enriched-tungsten.xcf differ diff --git a/graphics/icons/large-rocket-engine-nozzle.xcf b/graphics/icons/large-rocket-engine-nozzle.xcf new file mode 100644 index 0000000..1fe6be8 Binary files /dev/null and b/graphics/icons/large-rocket-engine-nozzle.xcf differ diff --git a/graphics/icons/rocket-engine-nozzle.png b/graphics/icons/rocket-engine-nozzle.png new file mode 100644 index 0000000..e87748b Binary files /dev/null and b/graphics/icons/rocket-engine-nozzle.png differ diff --git a/graphics/icons/rocket-engine-nozzle.xcf b/graphics/icons/rocket-engine-nozzle.xcf new file mode 100644 index 0000000..1fe6be8 Binary files /dev/null and b/graphics/icons/rocket-engine-nozzle.xcf differ diff --git a/graphics/icons/stacked/enriched-tungsten-stacked.png b/graphics/icons/stacked/enriched-tungsten-stacked.png new file mode 100644 index 0000000..3359e50 Binary files /dev/null and b/graphics/icons/stacked/enriched-tungsten-stacked.png differ diff --git a/graphics/icons/stacked/enriched-tungsten-stacked.xcf b/graphics/icons/stacked/enriched-tungsten-stacked.xcf new file mode 100644 index 0000000..1ace521 Binary files /dev/null and b/graphics/icons/stacked/enriched-tungsten-stacked.xcf differ diff --git a/graphics/icons/stacked/rocket-engine-nozzle-stacked.png b/graphics/icons/stacked/rocket-engine-nozzle-stacked.png new file mode 100644 index 0000000..57c4d60 Binary files /dev/null and b/graphics/icons/stacked/rocket-engine-nozzle-stacked.png differ diff --git a/graphics/icons/stacked/rocket-engine-nozzle-stacked.xcf b/graphics/icons/stacked/rocket-engine-nozzle-stacked.xcf new file mode 100644 index 0000000..22e0445 Binary files /dev/null and b/graphics/icons/stacked/rocket-engine-nozzle-stacked.xcf differ diff --git a/graphics/icons/stacked/tungsten-carbide-stacked.png b/graphics/icons/stacked/tungsten-carbide-stacked.png new file mode 100644 index 0000000..90beb09 Binary files /dev/null and b/graphics/icons/stacked/tungsten-carbide-stacked.png differ diff --git a/graphics/icons/stacked/tungsten-carbide-stacked.xcf b/graphics/icons/stacked/tungsten-carbide-stacked.xcf new file mode 100644 index 0000000..f55b7dd Binary files /dev/null and b/graphics/icons/stacked/tungsten-carbide-stacked.xcf differ diff --git a/graphics/icons/stacked/tungsten-ore-stacked.png b/graphics/icons/stacked/tungsten-ore-stacked.png new file mode 100644 index 0000000..9310015 Binary files /dev/null and b/graphics/icons/stacked/tungsten-ore-stacked.png differ diff --git a/graphics/icons/stacked/tungsten-ore-stacked.xcf b/graphics/icons/stacked/tungsten-ore-stacked.xcf new file mode 100644 index 0000000..ec38443 Binary files /dev/null and b/graphics/icons/stacked/tungsten-ore-stacked.xcf differ diff --git a/graphics/icons/stacked/tungsten-plate-stacked.png b/graphics/icons/stacked/tungsten-plate-stacked.png new file mode 100644 index 0000000..befd08c Binary files /dev/null and b/graphics/icons/stacked/tungsten-plate-stacked.png differ diff --git a/graphics/icons/stacked/tungsten-plate-stacked.xcf b/graphics/icons/stacked/tungsten-plate-stacked.xcf new file mode 100644 index 0000000..c46f61b Binary files /dev/null and b/graphics/icons/stacked/tungsten-plate-stacked.xcf differ diff --git a/graphics/icons/tungsten-carbide.png b/graphics/icons/tungsten-carbide.png new file mode 100644 index 0000000..a49f0cf Binary files /dev/null and b/graphics/icons/tungsten-carbide.png differ diff --git a/graphics/icons/tungsten-carbide.xcf b/graphics/icons/tungsten-carbide.xcf new file mode 100644 index 0000000..8bbcb8a Binary files /dev/null and b/graphics/icons/tungsten-carbide.xcf differ diff --git a/graphics/icons/tungsten-ore-2.png b/graphics/icons/tungsten-ore-2.png new file mode 100644 index 0000000..42785a7 Binary files /dev/null and b/graphics/icons/tungsten-ore-2.png differ diff --git a/graphics/icons/tungsten-ore-2.xcf b/graphics/icons/tungsten-ore-2.xcf new file mode 100644 index 0000000..575ca35 Binary files /dev/null and b/graphics/icons/tungsten-ore-2.xcf differ diff --git a/graphics/icons/tungsten-ore-3.png b/graphics/icons/tungsten-ore-3.png new file mode 100644 index 0000000..4448caf Binary files /dev/null and b/graphics/icons/tungsten-ore-3.png differ diff --git a/graphics/icons/tungsten-ore-3.xcf b/graphics/icons/tungsten-ore-3.xcf new file mode 100644 index 0000000..57285aa Binary files /dev/null and b/graphics/icons/tungsten-ore-3.xcf differ diff --git a/graphics/icons/tungsten-ore-4.png b/graphics/icons/tungsten-ore-4.png new file mode 100644 index 0000000..6e43280 Binary files /dev/null and b/graphics/icons/tungsten-ore-4.png differ diff --git a/graphics/icons/tungsten-ore-4.xcf b/graphics/icons/tungsten-ore-4.xcf new file mode 100644 index 0000000..fae2c9f Binary files /dev/null and b/graphics/icons/tungsten-ore-4.xcf differ diff --git a/graphics/icons/tungsten-ore-n-2.xcf b/graphics/icons/tungsten-ore-n-2.xcf new file mode 100644 index 0000000..522525d Binary files /dev/null and b/graphics/icons/tungsten-ore-n-2.xcf differ diff --git a/graphics/icons/tungsten-ore-n-3.xcf b/graphics/icons/tungsten-ore-n-3.xcf new file mode 100644 index 0000000..7f7f6e3 Binary files /dev/null and b/graphics/icons/tungsten-ore-n-3.xcf differ diff --git a/graphics/icons/tungsten-ore-n-4.xcf b/graphics/icons/tungsten-ore-n-4.xcf new file mode 100644 index 0000000..f3bcb6e Binary files /dev/null and b/graphics/icons/tungsten-ore-n-4.xcf differ diff --git a/graphics/icons/tungsten-ore-n.xcf b/graphics/icons/tungsten-ore-n.xcf new file mode 100644 index 0000000..05bba25 Binary files /dev/null and b/graphics/icons/tungsten-ore-n.xcf differ diff --git a/graphics/icons/tungsten-ore-stacked-new.xcf b/graphics/icons/tungsten-ore-stacked-new.xcf new file mode 100644 index 0000000..924e57a Binary files /dev/null and b/graphics/icons/tungsten-ore-stacked-new.xcf differ diff --git a/graphics/icons/tungsten-ore-x-2.xcf b/graphics/icons/tungsten-ore-x-2.xcf new file mode 100644 index 0000000..f029d1d Binary files /dev/null and b/graphics/icons/tungsten-ore-x-2.xcf differ diff --git a/graphics/icons/tungsten-ore-x-3.xcf b/graphics/icons/tungsten-ore-x-3.xcf new file mode 100644 index 0000000..1d19b35 Binary files /dev/null and b/graphics/icons/tungsten-ore-x-3.xcf differ diff --git a/graphics/icons/tungsten-ore-x-4.xcf b/graphics/icons/tungsten-ore-x-4.xcf new file mode 100644 index 0000000..b0111a9 Binary files /dev/null and b/graphics/icons/tungsten-ore-x-4.xcf differ diff --git a/graphics/icons/tungsten-ore-x.xcf b/graphics/icons/tungsten-ore-x.xcf new file mode 100644 index 0000000..8390c02 Binary files /dev/null and b/graphics/icons/tungsten-ore-x.xcf differ diff --git a/graphics/icons/tungsten-ore.png b/graphics/icons/tungsten-ore.png new file mode 100644 index 0000000..02a9c13 Binary files /dev/null and b/graphics/icons/tungsten-ore.png differ diff --git a/graphics/icons/tungsten-ore.xcf b/graphics/icons/tungsten-ore.xcf new file mode 100644 index 0000000..bad4f2b Binary files /dev/null and b/graphics/icons/tungsten-ore.xcf differ diff --git a/graphics/icons/tungsten-plate-2.xcf b/graphics/icons/tungsten-plate-2.xcf new file mode 100644 index 0000000..b8f17d1 Binary files /dev/null and b/graphics/icons/tungsten-plate-2.xcf differ diff --git a/graphics/icons/tungsten-plate.png b/graphics/icons/tungsten-plate.png new file mode 100644 index 0000000..393ec8f Binary files /dev/null and b/graphics/icons/tungsten-plate.png differ diff --git a/graphics/icons/tungsten-plate.xcf b/graphics/icons/tungsten-plate.xcf new file mode 100644 index 0000000..cc96537 Binary files /dev/null and b/graphics/icons/tungsten-plate.xcf differ diff --git a/graphics/icons/tungsten-powder.png b/graphics/icons/tungsten-powder.png new file mode 100644 index 0000000..59b3153 Binary files /dev/null and b/graphics/icons/tungsten-powder.png differ diff --git a/graphics/icons/tungsten-powder.xcf b/graphics/icons/tungsten-powder.xcf new file mode 100644 index 0000000..a38e73a Binary files /dev/null and b/graphics/icons/tungsten-powder.xcf differ diff --git a/graphics/technology/tungsten-processing.png b/graphics/technology/tungsten-processing.png new file mode 100644 index 0000000..63d2900 Binary files /dev/null and b/graphics/technology/tungsten-processing.png differ diff --git a/graphics/technology/tungsten-processing.xcf b/graphics/technology/tungsten-processing.xcf new file mode 100644 index 0000000..9ea1530 Binary files /dev/null and b/graphics/technology/tungsten-processing.xcf differ diff --git a/info.json b/info.json new file mode 100644 index 0000000..bb4d5f8 --- /dev/null +++ b/info.json @@ -0,0 +1,18 @@ +{ + "name": "bztungsten", + "version": "0.0.1", + "factorio_version": "1.1", + "title": "Tungsten", + "author": "Brevven", + "contact": "", + "homepage": "", + "dependencies": [ + "base >= 1.1.0", + "? space-exploration", + "? Krastorio2", + "? deadlock-beltboxes-loaders", + "? DeadlockCrating" + ], + "description": "Adds tungsten ore (wolframite), tungsten plates, tungsten carbide and rocket engine nozzles to the base game.\n\nAvailable after green science, tungsten and the various intermediates are used throughout the vanilla game. Compatible with Space Exploration and Krastorio 2, as well as several other mods. More compatibility forthcoming." +} + diff --git a/locale/en/tungsten.cfg b/locale/en/tungsten.cfg new file mode 100644 index 0000000..3b7f967 --- /dev/null +++ b/locale/en/tungsten.cfg @@ -0,0 +1,48 @@ +[entity-name] +tungsten-ore=Wolframite +tungsten-chest=Tungsten chest + +[autoplace-control-names] +tungsten-ore=[item=tungsten-ore] Wolframite + +[item-name] +tungsten-ore=Wolframite +tungsten-dust=Tungsten dust +tungsten-plate=Tungsten plate +tungsten-carbide=Tungsten carbide +rocket-engine-nozzle=Rocket engine nozzle +enriched-tungsten=Enriched tungsten +tungsten-chest=Tungsten chest +compressed-tungsten-ore=Compressed tungsten ore + +[item-description] +tungsten-ore=Can be smelted into tungsten plates +enriched-tungsten=Can be efficiently smelted into tungsten plates + +[technology-name] +tungsten-processing=Tungsten processing +enriched-tungsten=Enriched tungsten +tungsten-matter-processing=Tungsten conversion + +[technology-description] +enriched-tungsten=Enrich tungsten ore, purifying with ammonia [fluid=ammonia] and water [fluid=water], improving the final yield. Produce dirty water [fluid=dirty-water] as a byproduct. + +[recipe-name] +enriched-tungsten=__ITEM__enriched-tungsten__ +tungsten-plate=__ITEM__tungsten-plate__ +smelt-compressed-tungsten-ore=__ITEM__tungsten-plate__ +tungsten-dust=__ITEM__tungsten-dust__ +dirty-water-filtration-tungsten=Filter dirty water [item=tungsten-ore] + +[recipe-description] +enriched-tungsten=Enrich tungsten ore, purifying with ammonia [fluid=ammonia] and water [fluid=water], improving the final yield. Produce dirty water [fluid=dirty-water] as a byproduct. + +dirty-water-filtration-tungsten=Filter dirty water, giving wolframite [item=tungsten-ore] and stone [item=stone] (probabilistically). + +# Settings + +[mod-setting-name] +bztungsten-avoid-military=Avoid military science pack + +[mod-setting-description] +bztungsten-avoid-military=If 'yes', rocketry will no longer require military science. diff --git a/map-gen-preset-updates.lua b/map-gen-preset-updates.lua new file mode 100644 index 0000000..fe01881 --- /dev/null +++ b/map-gen-preset-updates.lua @@ -0,0 +1,14 @@ +local base_ore = "iron-ore" +if mods["angelssmelting"] then + base_ore = "angels-ore1" +end +if 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[base_ore] then + preset.basic_settings.autoplace_controls["tungsten-ore"] = preset.basic_settings.autoplace_controls[base_ore] + end + end +end diff --git a/modules.lua b/modules.lua new file mode 100644 index 0000000..4498cdb --- /dev/null +++ b/modules.lua @@ -0,0 +1,27 @@ +-- Enable prod modules for all tungsten plate and ore recipes + +recipes = {"tungsten-plate", "tungsten-carbide", "rocket-engine-nozzle"} +if mods["Krastorio2"] then + table.insert(recipes, "enriched-tungsten-plate") + table.insert(recipes, "enriched-tungsten") +end +if mods["space-exploration"] then + table.insert(recipes, "tungsten-smelting-vulcanite") + if mods["Krastorio2"] then + table.insert(recipes, "enriched-tungsten-smelting-vulcanite") + end +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 diff --git a/omni.lua b/omni.lua new file mode 100644 index 0000000..a2624db --- /dev/null +++ b/omni.lua @@ -0,0 +1,6 @@ +if (not mods["pyrawores"] and not mods["bobplates"] and not mods["angelssmelting"]) then +if omni and omni.matter then + omni.matter.add_resource("tungsten-ore", omni.matter.get_ore_tier("iron-ore")) +end +end + diff --git a/settings.lua b/settings.lua new file mode 100644 index 0000000..f03c18a --- /dev/null +++ b/settings.lua @@ -0,0 +1,10 @@ +data:extend( +{ + { + type = "string-setting", + name = "bztungsten-avoid-military", + setting_type = "startup", + default_value = "no", + allowed_values = {"yes", "no"}, + }, +}) diff --git a/thumbnail.png b/thumbnail.png new file mode 100644 index 0000000..b4eca2b Binary files /dev/null and b/thumbnail.png differ diff --git a/thumbnail.xcf b/thumbnail.xcf new file mode 100644 index 0000000..6dd1f09 Binary files /dev/null and b/thumbnail.xcf differ diff --git a/tungsten-compressed.lua b/tungsten-compressed.lua new file mode 100644 index 0000000..fcbae24 --- /dev/null +++ b/tungsten-compressed.lua @@ -0,0 +1,32 @@ + +if simpleCompress then + if simpleCompress.ores then + simpleCompress.currentSubgroup = "intermediate-product" + if data.raw.item["tungsten-ore"] then + SimpleCompress_AddTintedItem("tungsten-ore", "ore4-tungsten", "ore", {r=0.90, g=0.90, b=0.75}) + SimpleCompress_UnlockOreTechAndRecipe("tungsten-ore") + end + end + if simpleCompress.plates then + simpleCompress.currentSubgroup = "intermediate-product" + if data.raw.item["tungsten-plate"] then + SimpleCompress_AddTintedItem("tungsten-plate", "plates4-tungsten", "plate3", {r=0.90, g=0.90, b=0.75}) + SimpleCompress_UnlockPlateTechAndRecipe("tungsten-plate") + local tungstenRecipe = data.raw.recipe["decompress-tungsten-plate"] + tungstenRecipe.order = "d[tungsten-plate]" + end + end + if simpleCompress.smelting then + if data.raw.item["tungsten-plate"] and data.raw.item["tungsten-plate"] then + SimpleCompress_AddSmeltingRecipe("tungsten-ore", "tungsten-plate") + SimpleCompress_UnlockOreSmeltingTech("tungsten-ore") + local tungstenRecipe = data.raw.recipe["smelt-compressed-tungsten-ore"] + tungstenRecipe.results = { + {type="item", name = "tungsten-plate", amount=simpleCompress.CompressedSmeltAmount}, + } + tungstenRecipe.icons = {{ icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 64 }} + tungstenRecipe.subgroup = "raw-material" + tungstenRecipe.order = "d[tungsten-plate]" + end + end +end diff --git a/tungsten-enriched.lua b/tungsten-enriched.lua new file mode 100644 index 0000000..b6a1333 --- /dev/null +++ b/tungsten-enriched.lua @@ -0,0 +1,166 @@ +-- Enriched Titanium for Krastorio2 +local util = require("__bztungsten__.util"); + +if mods["Krastorio2"] then +data:extend({ + { + type = "item", + name = "enriched-tungsten", + icon_size = 64, icon_mipmaps = 3, + icon = "__bztungsten__/graphics/icons/enriched-tungsten.png", + pictures = { + {filename="__bztungsten__/graphics/icons/enriched-tungsten.png", size=64, scale=0.25}, + {filename="__bztungsten__/graphics/icons/enriched-tungsten-2.png", size=64, scale=0.25}, + {filename="__bztungsten__/graphics/icons/enriched-tungsten-3.png", size=64, scale=0.25}, + {filename="__bztungsten__/graphics/icons/enriched-tungsten-4.png", size=64, scale=0.25}, + }, + subgroup = "raw-material", + order = "e05-a[enriched-ores]-a1[enriched-tungsten]", + stack_size = util.get_stack_size(100), + }, + { + type = "recipe", + name = "enriched-tungsten", + icon = "__bztungsten__/graphics/icons/enriched-tungsten.png", + icon_size = 64, + category = "chemistry", + energy_required = 3, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = + { + {type = "fluid", name = "ammonia", amount = 10}, + {type = "fluid", name = "water", amount = 25, catalyst_amount = 25}, + {type = "item", name = "tungsten-ore", amount = 9} + }, + results = + { + {type = "item", name = "enriched-tungsten", amount = 6}, + {type = "fluid", name = "dirty-water", amount = 25, catalyst_amount = 25} + }, + crafting_machine_tint = + { + primary = {r = 0.721, g = 0.525, b = 0.043, a = 0.000}, + secondary = {r = 0.200, g = 0.680, b = 0.300, a = 0.357}, + tertiary = {r = 0.690, g = 0.768, b = 0.870, a = 0.000}, + quaternary = {r = 0.0, g = 0.980, b = 0.603, a = 0.900} + }, + subgroup = "raw-material", + order = "e03[enriched-tungsten]" + }, + { + type = "recipe", + name = "enriched-tungsten-plate", + icons = + { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 64, icon_mipmaps = 3, }, + { icon = "__bztungsten__/graphics/icons/enriched-tungsten.png", icon_size = 64}, + }, + category = "smelting", + energy_required = 16, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = + { + {"enriched-tungsten", 5} + }, + result = "tungsten-plate", + result_count = 5, + order = "b[tungsten-plate]-b[enriched-tungsten-plate]" + }, + { + type = "technology", + name = "enriched-tungsten", + icons = + { + { + icon = "__Krastorio2__/graphics/technologies/enriched-ores.png", + icon_size = 256, + tint = { a=1.0, b=0.75, r=0.75, g=0.75 } + }, + { + icon = "__bztungsten__/graphics/icons/enriched-tungsten.png", + icon_size = 64, + scale = 2, + shift = {48, 48} + } + }, + effects = + { + { + type = "unlock-recipe", + recipe = "enriched-tungsten" + }, + { + type = "unlock-recipe", + recipe = "enriched-tungsten-plate" + }, + { + type = "unlock-recipe", + recipe = "dirty-water-filtration-tungsten", + } + }, + prerequisites = {"kr-enriched-ores", util.tungsten_processing}, + unit = + { + count = 150, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1} + }, + time = 30 + } + }, + { + type = "recipe", + name = "dirty-water-filtration-tungsten", + category = "fluid-filtration", + icons = + { + { + icon = data.raw.fluid["dirty-water"].icon, + icon_size = data.raw.fluid["dirty-water"].icon_size + }, + { + icon = data.raw.item["tungsten-ore"].icon, + icon_size = data.raw.item["tungsten-ore"].icon_size, + scale = 0.20 * (data.raw.fluid["dirty-water"].icon_size/data.raw.item["tungsten-ore"].icon_size), + shift = {0, 4} + } + }, + icon_size = data.raw.fluid["dirty-water"].icon_size, + energy_required = 2, + enabled = false, + allow_as_intermediate = false, + always_show_made_in = true, + always_show_products = true, + ingredients = + { + {type = "fluid", name = "dirty-water", amount = 100, catalyst_amount = 100}, + }, + results = + { + {type = "fluid", name = "water", amount = 100, catalyst_amount = 100}, + {type = "item", name = "stone", probability = 0.30, amount = 1}, + {type = "item", name = "tungsten-ore", probability = 0.05, amount = 1} + }, + crafting_machine_tint = + { + primary = {r = 0.60, g = 0.20, b = 0, a = 0.6}, + secondary = {r = 1.0, g = 0.843, b = 0.0, a = 0.9} + }, + subgroup = "raw-material", + order = "w013[dirty-water-filtration-tungsten]" + } +} +) +util.add_effect("kr-enriched-ores", { type = "unlock-recipe", recipe = "enriched-tungsten" }) +util.add_effect("kr-enriched-ores", { type = "unlock-recipe", recipe = "enriched-tungsten-plate" }) +util.add_effect("kr-enriched-ores", { type = "unlock-recipe", recipe = "dirty-water-filtration-tungsten" }) +end diff --git a/tungsten-matter.lua b/tungsten-matter.lua new file mode 100644 index 0000000..57e050a --- /dev/null +++ b/tungsten-matter.lua @@ -0,0 +1,61 @@ +-- Matter recipes for Krastorio2 +if mods["Krastorio2"] then +local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") + +data:extend( +{ + { + type = "technology", + name = "tungsten-matter-processing", + icons = + { + { + icon = "__Krastorio2__/graphics/technologies/matter-stone.png", + icon_size = 256, + }, + { + icon = "__bztungsten__/graphics/icons/tungsten-ore.png", + icon_size = 64, icon_mipmaps = 3, + scale = 1.25, + } + }, + prerequisites = {"kr-matter-processing"}, + unit = + { + count = 350, + ingredients = + { + {"production-science-pack", 1}, + {"utility-science-pack", 1}, + {"matter-tech-card", 1} + }, + time = 45 + } + }, +}) + +local tungsten_ore_matter = + { + item_name = "tungsten-ore", + minimum_conversion_quantity = 10, + matter_value = 6, + energy_required = 1, + need_stabilizer = false, + unlocked_by_technology = "tungsten-matter-processing" + } +matter.createMatterRecipe(tungsten_ore_matter) + + +local tungsten_plate_matter = + { + item_name = "tungsten-plate", + minimum_conversion_quantity = 10, + matter_value = 10, + energy_required = 2, + only_deconversion = true, + need_stabilizer = true, + unlocked_by_technology = "tungsten-matter-processing" + } +matter.createMatterRecipe(tungsten_plate_matter) + +end diff --git a/tungsten-ore-particle.lua b/tungsten-ore-particle.lua new file mode 100644 index 0000000..283e5bb --- /dev/null +++ b/tungsten-ore-particle.lua @@ -0,0 +1,144 @@ +data:extend( +{ + { + type = "optimized-particle", + name = "tungsten-ore-particle", + flags = {"not-on-map"}, + life_time = 180, + pictures = + { + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-1.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-1.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + }, + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-2.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-2.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + }, + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-3.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-3.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + }, + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-4.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-4.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + } + }, + shadows = + { + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-1.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-1.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + }, + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-2.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-2.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + }, + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-3.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-3.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + }, + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/tungsten-ore-particle-shadow-4.png", + priority = "extra-high", + width = 16, + height = 16, + frame_count = 1, + hr_version = + { + filename = "__bztungsten__/graphics/entity/tungsten-ore-particle/hr-tungsten-ore-particle-shadow-4.png", + priority = "extra-high", + width = 32, + height = 32, + frame_count = 1, + scale = 0.5 + } + } + } + } +} +) diff --git a/tungsten-ore.lua b/tungsten-ore.lua new file mode 100644 index 0000000..e8fa46b --- /dev/null +++ b/tungsten-ore.lua @@ -0,0 +1,87 @@ +local resource_autoplace = require('resource-autoplace'); + +local util = require("__bztungsten__.util"); + +if mods["FactorioExtended-Plus-Core"] then + util.remove_raw("item", "tungsten-ore") +end + +data:extend({ + { + type = "autoplace-control", + category = "resource", + name = "tungsten-ore", + richness = true, + order = "b-e" + }, + { + type = "noise-layer", + name = "tungsten-ore" + }, + { + type = "resource", + icon_size = 64, icon_mipmaps = 3, + name = "tungsten-ore", + icon = "__bztungsten__/graphics/icons/tungsten-ore.png", + flags = {"placeable-neutral"}, + order="a-b-a", + map_color = {r=0.90, g=0.90, b=0.80}, + minable = + { + hardness = 1, + mining_particle = "tungsten-ore-particle", + mining_time = 2, + fluid_amount=(mods["Krastorio2"] and 1 or 10), + required_fluid=(mods["Krastorio2"] and "mineral-water" or "water"), + result = "tungsten-ore" + }, + 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 = "tungsten-ore", + order = "b-z", + base_density = 4, + has_starting_area_placement = false, + regular_rq_factor_multiplier = 1.0 + }, + + stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80}, + stages = + { + sheet = + { + filename = "__bztungsten__/graphics/entity/ores/tungsten-ore.png", + priority = "extra-high", + size = 64, + frame_count = 8, + variation_count = 8, + hr_version = + { + filename = "__bztungsten__/graphics/entity/ores/hr-tungsten-ore.png", + priority = "extra-high", + size = 128, + frame_count = 8, + variation_count = 8, + scale = 0.5 + } + } + }, + }, + { + type = "item", + name = "tungsten-ore", + icon_size = 64, icon_mipmaps = 3, + icon = "__bztungsten__/graphics/icons/tungsten-ore.png", + pictures = { + {filename="__bztungsten__/graphics/icons/tungsten-ore.png", size=64, scale=0.25}, + {filename="__bztungsten__/graphics/icons/tungsten-ore-2.png", size=64, scale=0.25}, + {filename="__bztungsten__/graphics/icons/tungsten-ore-3.png", size=64, scale=0.25}, + {filename="__bztungsten__/graphics/icons/tungsten-ore-4.png", size=64, scale=0.25}, + }, + subgroup = "raw-resource", + order = "t-c-a", + stack_size = util.get_stack_size(50) + }, +}) + diff --git a/tungsten-recipe-final-rrr.lua b/tungsten-recipe-final-rrr.lua new file mode 100644 index 0000000..fff4492 --- /dev/null +++ b/tungsten-recipe-final-rrr.lua @@ -0,0 +1,15 @@ +local util = require("__bztungsten__.util"); + +if mods["Rich-Rocks-Requiem"] then + if data.raw.recipe["rrr-stone-processing"] then + table.insert(data.raw.recipe["rrr-stone-processing"].results, + {name = "tungsten-ore", probability = 0.05, amount = 2} + ) + end + + if data.raw.recipe["rrr-raw-ores-processing"] then + table.insert(data.raw.recipe["rrr-raw-ores-processing"].results, + {name = "tungsten-ore", probability = 0.50, amount = 10} + ) + end +end diff --git a/tungsten-recipe-final-stacking.lua b/tungsten-recipe-final-stacking.lua new file mode 100644 index 0000000..992d31d --- /dev/null +++ b/tungsten-recipe-final-stacking.lua @@ -0,0 +1,25 @@ +-- Deadlock stacking recipes + +local util = require("__bztungsten__.util"); + +if deadlock then + deadlock.add_stack("tungsten-ore", "__bztungsten__/graphics/icons/stacked/tungsten-ore-stacked.png", "deadlock-stacking-2", 64) + deadlock.add_stack("tungsten-plate", "__bztungsten__/graphics/icons/stacked/tungsten-plate-stacked.png" , "deadlock-stacking-2", 64) + deadlock.add_stack("tungsten-carbide", "__bztungsten__/graphics/icons/stacked/tungsten-carbide-stacked.png" , "deadlock-stacking-2", 128) + deadlock.add_stack("rocket-engine-nozzle", "__bztungsten__/graphics/icons/stacked/rocket-engine-nozzle-stacked.png" , "deadlock-stacking-2", 128) + if mods["Krastorio2"] then + deadlock.add_stack("enriched-tungsten", "__bztungsten__/graphics/icons/stacked/enriched-tungsten-stacked.png" , "deadlock-stacking-2", 64) + end +end + +-- Deadlock crating recipes +if deadlock_crating then + deadlock_crating.add_crate("tungsten-ore", "deadlock-crating-2") + deadlock_crating.add_crate("tungsten-plate", "deadlock-crating-2") + deadlock_crating.add_crate("tungsten-carbide", "deadlock-crating-2") + deadlock_crating.add_crate("rocket-engine-nozzle", "deadlock-crating-2") + if mods["Krastorio2"] then + deadlock_crating.add_crate("enriched-tungsten", "deadlock-crating-2") + end +end + diff --git a/tungsten-recipe-se.lua b/tungsten-recipe-se.lua new file mode 100644 index 0000000..b6ad1ad --- /dev/null +++ b/tungsten-recipe-se.lua @@ -0,0 +1,64 @@ +-- Additional recipes if Space Exploration mod is enabled +local util = require("__bztungsten__.util"); + +if mods["space-exploration"] then + se_delivery_cannon_recipes["tungsten-ore"] = {name= "tungsten-ore"} + se_delivery_cannon_recipes["tungsten_plate"] = {name= "tungsten_plate"} + if mods["Krastorio2"] then + data:extend({ + { + type = "recipe", + name = "enriched-tungsten-smelting-vulcanite", + category = "smelting", + order = "d[tungsten-plate]", + energy_required = 24, + enabled = false, + always_show_made_in = true, + allow_as_intermediate = false, + ingredients = { + {name = "enriched-tungsten", amount = 8}, + {name = "se-vulcanite-block", amount = 1}, + }, + results = { + {name = util.tungsten_plate, amount = 12}, + }, + icons = + { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 64, icon_mipmaps = 3 }, + { icon = "__space-exploration-graphics__/graphics/icons/vulcanite-block.png", icon_size = 64, scale=0.25, shift= {-10, -10}}, + }, + }, + }) + table.insert(data.raw.technology["se-processing-vulcanite"].effects, + {type = "unlock-recipe", recipe= "enriched-tungsten-smelting-vulcanite"}) + data.raw.recipe["enriched-tungsten-plate"].order= "d[tungsten-plate]" + se_delivery_cannon_recipes["enriched-tungsten"] = {name= "enriched-tungsten"} + else + data:extend({ + { + type = "recipe", + name = "tungsten-smelting-vulcanite", + category = "smelting", + order = "d[tungsten-plate]", + energy_required = 48, + enabled = false, + always_show_made_in = true, + allow_as_intermediate = false, + ingredients = { + {name = "tungsten-ore", amount = 20}, + {name = "se-vulcanite-block", amount = 1}, + }, + results = { + {name = util.tungsten_plate, amount = 30}, + }, + icons = + { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 64, icon_mipmaps = 3,}, + { icon = "__space-exploration-graphics__/graphics/icons/vulcanite-block.png", icon_size = 64, scale=0.25, shift= {-10, -10}}, + }, + }, + }) + table.insert(data.raw.technology["se-processing-vulcanite"].effects, + {type = "unlock-recipe", recipe= "tungsten-smelting-vulcanite"}) + end +end diff --git a/tungsten-recipe-updates.lua b/tungsten-recipe-updates.lua new file mode 100644 index 0000000..4ba7477 --- /dev/null +++ b/tungsten-recipe-updates.lua @@ -0,0 +1,154 @@ +local util = require("__bztungsten__.util"); + +-- Lamps +util.add_prerequisite("optics", "tungsten-processing") +util.set_tech_recipe("optics", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) +util.add_ingredient("small-lamp", "tungsten-plate", 1) + +-- Rail signals use lamps +util.add_prerequisite("rail-signals", "optics") +util.add_ingredient("rail-signal", "small-lamp", 1) +util.add_ingredient("rail-chain-signal", "small-lamp", 1) + +-- Ammunition +util.add_prerequisite("military-2", "tungsten-processing") +util.replace_ingredient("piercing-rounds-magazine", "copper-plate", "tungsten-plate") +util.replace_ingredient("piercing-shotgun-shell", "copper-plate", "tungsten-plate") +util.replace_ingredient("cannon-shell", "copper-plate", "tungsten-plate") + + +-- Tooling +util.add_prerequisite("automation-2", "tungsten-processing") +util.replace_some_ingredient("assembling-machine-2", "steel-plate", 1, "tungsten-carbide", 1) +util.add_ingredient("assembling-machine-3", "tungsten-carbide", 4) +util.add_ingredient("chemical-plant", "tungsten-carbide", 2) +util.add_ingredient("electric-furnace", "tungsten-carbide", 1) + +-- Electrodes & spark plugs +util.replace_ingredient("accumulator", "iron-plate", "tungsten-plate") +util.add_ingredient("oil-refinery", "tungsten-plate", 1) +util.add_ingredient("chemical-plant", "tungsten-plate", 1) +util.add_prerequisite("engine", "tungsten-processing") +util.add_ingredient("engine-unit", "tungsten-plate", 1) + + +-- Hot stuff +util.add_prerequisite("advanced-materials-processing-2", "tungsten-processing") +util.replace_some_ingredient("electric-furnace", "stone-brick", 5, "tungsten-plate", 10) +util.replace_some_ingredient("heat-exchanger", "copper-plate", 50, "tungsten-plate", 50) +util.add_ingredient("nuclear-reactor", "tungsten-plate", 500) +util.add_ingredient("flamethrower-turret", "tungsten-plate", 5) + +-- Rocket engine nozzle techs +util.add_effect("rocketry", { type = "unlock-recipe", recipe = "rocket-engine-nozzle" }) +util.add_prerequisite("rocket-silo", "rocketry") +if util.get_setting("bztungsten-avoid-military") == "yes" then + util.set_tech_recipe("rocketry", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) +end + +-- Rocket engine nozzle uses +util.add_ingredient("rocket-part", "rocket-engine-nozzle", mods["space-exploration"] and 5 or 10) +util.add_ingredient("rocket", "rocket-engine-nozzle", 1) +util.add_ingredient("satellite", "rocket-engine-nozzle", 10) +util.add_ingredient("artillery-shell", "rocket-engine-nozzle", 3) +util.add_ingredient("atomic-bomb", "rocket-engine-nozzle", 7) +util.add_ingredient("atomic-bomb", "tungsten-plate", 1) + + +-- Airplanes +util.add_prerequisite("afterburner", "rocketry") +util.add_ingredient("afterburner", "rocket-engine-nozzle", 1) + +-- Jetpack +util.add_prerequisite("jetpack-1", "rocketry") +util.add_ingredient("jetpack-1", "rocket-engine-nozzle", 6) + + +-- Other lights +util.add_ingredient("balloon-light", "tungsten-plate", 1) +util.add_ingredient("short-balloon-light", "tungsten-plate", 1) +util.add_ingredient("LargeLamp", "tungsten-plate", 1) +util.add_ingredient("StadiumLamp", "tungsten-plate", 10) +util.set_tech_recipe("optics-2", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) +util.set_tech_recipe("bright-lamp", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + + +---- K2 +if mods["Krastorio2"] then + util.set_tech_recipe("engine", {{"basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + util.set_tech_recipe("fluid-handling", {{"basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + util.set_tech_recipe("optics", {{"basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + util.set_tech_recipe("oil-processing", {{"basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + util.set_tech_recipe("plastics", {{"basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + if util.get_setting("bztungsten-avoid-military") == "yes" then + util.set_tech_recipe("rocketry", {{"basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + end + util.remove_prerequisite("kr-sentinel", "optics") + + + util.add_prerequisite("tungsten-processing", "kr-mineral-water-gathering") + util.remove_prerequisite("kr-mineral-water-gathering", "fluid-handling") + + -- engines come later with Tungten. + util.replace_ingredient("kr-filtration-plant", "engine-unit", "pipe") + + -- Heat related + util.add_ingredient("kr-fusion-reactor", "tungsten-plate", 350) + util.add_ingredient("energy-control-unit", "tungsten-plate", 3) + util.replace_some_ingredient("kr-advanced-furnace", "rare-metals", 40, "tungsten-plate", 40) + + -- Other + util.add_ingredient("matter-research-data", "tungsten-plate", 5) + + -- Ammunition + util.replace_ingredient("piercing-magazine", "steel-plate", "tungsten-plate") + util.replace_ingredient("armor-piercing-rifle-magazine", "steel-plate", "tungsten-plate") + util.replace_ingredient("armor-piercing-anti-material-rifle-magazine", "steel-plate", "tungsten-plate") + util.replace_ingredient("basic-railgun-shell", "steel-plate", "tungsten-plate") + + -- Rocket things + util.add_ingredient("heavy-rocket", "rocket-engine-nozzle", 4) + util.add_ingredient("explosive-turret-rocket", "rocket-engine-nozzle", 3) + + -- Tooling + util.add_ingredient("kr-electric-mining-drill-mk2", "tungsten-carbide", 5) + util.add_ingredient("kr-quarry-drill", "tungsten-carbide", 20) + util.replace_some_ingredient("kr-advanced-chemical-plant", "rare-metals", 40, "tungsten-carbide", 20) +end + + +-- SE +if mods["space-exploration"] then + -- Heat Shielding + util.replace_some_ingredient("se-heat-shielding", "steel-plate", 1, "tungsten-plate", 3) + util.replace_some_ingredient("se-heat-shielding-iridium", "stone-tablet", 3, "tungsten-plate", 3) + + -- Hot stuff + util.add_ingredient("se-space-electromagnetics-laboratory", "tungsten-plate", 20) + util.add_ingredient("se-space-radiator", "tungsten-plate", 4) + util.add_ingredient("se-delivery-cannon-weapon-capsule", "tungsten-plate", 10) + + -- Data + util.add_ingredient("se-electromagnetic-field-data", "tungsten-plate", 1) + util.add_product("se-electromagnetic-field-data", {name="tungsten-plate", amount=1, probability=0.95}) + util.add_ingredient("se-hot-thermodynamics-data", "tungsten-plate", 1) + util.add_product("se-hot-thermodynamics-data", {name="tungsten-plate", amount=1, probability=0.50}) + util.add_ingredient("se-particle-beam-shielding-data", "tungsten-plate", 1) + util.add_product("se-particle-beam-shielding-data", {name="tungsten-plate", amount=1, probability=0.20}) + + --rocket + util.add_ingredient("se-rocket-science-pack", "rocket-engine-nozzle", 1) + util.add_ingredient("se-spaceship-rocket-engine", "rocket-engine-nozzle", 4) + util.add_ingredient("se-cargo-rocket-section", "rocket-engine-nozzle", 5) + util.add_ingredient("se-cargo-rocket-section-beryllium", "rocket-engine-nozzle", 5) + + --Tooling + util.add_ingredient("se-space-assembling-machine", "tungsten-carbide", 8) + util.add_ingredient("se-core-miner", "tungsten-carbide", 40) + util.add_ingredient("se-space-mechanical-laboratory", "tungsten-carbide", 40) + util.add_ingredient("se-recyling-facility", "tungsten-carbide", 10) +end +if mods["aai-industry"]then + util.add_ingredient("area-mining-drill", "tungsten-carbide", 8) +end + diff --git a/tungsten-recipe.lua b/tungsten-recipe.lua new file mode 100644 index 0000000..9a4d131 --- /dev/null +++ b/tungsten-recipe.lua @@ -0,0 +1,193 @@ +-- Lead smelting + +local util = require("__bztungsten__.util"); + +data:extend({ + { type = "recipe-category", name = "smelting-carbon"}, +}) +data:extend( +{ + { + type = "recipe", + name = util.tungsten_plate, + category = "smelting", + subgroup = "raw-material", + order = "d[tungsten-plate]", + icons = (mods["Krastorio2"] and + { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 64, icon_mipmaps = 3, }, + { icon = "__bztungsten__/graphics/icons/tungsten-ore.png", icon_size = 64, icon_mipmaps = 3, scale=0.25, shift= {-8, -8}}, + } or { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 64, icon_mipmaps = 3, }, + } +), + normal = (mods["Krastorio2"] and + { + enabled = false, + energy_required = 16, + ingredients = {{"tungsten-ore", 10}}, + result = util.tungsten_plate, + result_count = 5, + } or + { + enabled = false, + energy_required = 32/15, + ingredients = {{"tungsten-ore", 2}}, + result = util.tungsten_plate, + }), + expensive = + { + enabled = false, + energy_required = 9.6, + ingredients = {{"tungsten-ore", 3}}, + result = util.tungsten_plate + } + }, + { + type = "item", + name = util.tungsten_plate, + icon = "__bztungsten__/graphics/icons/tungsten-plate.png", + icon_size = 64, icon_mipmaps = 3, + subgroup = "raw-material", + order = "b[tungsten-plate]", + stack_size = util.get_stack_size(100) + }, + { + type = "technology", + name = "tungsten-processing", + icon_size = 256, icon_mipmaps = 4, + icon = "__bztungsten__/graphics/technology/tungsten-processing.png", + effects = + { + { + type = "unlock-recipe", + recipe = util.tungsten_plate + }, + { + type = "unlock-recipe", + recipe = "tungsten-carbide", + }, + mods["TheBigFurnace"] and { + type = "unlock-recipe", + recipe = "big-tungsten-plate", + } or nil, + }, + unit = + { + count = 75, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1} + }, + time = 30, + }, + prerequisites = {"advanced-material-processing"}, + order = "b-b" + }, + mods["TheBigFurnace"] and { + type = "recipe", + name = "big-tungsten-plate", + icons = { { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 64 }, }, + subgroup = "raw-material", + category = "big-smelting", + order = "d[tungsten-plate]", + normal = + { + enabled = false, + energy_required = 6, --TODO + ingredients = {{"tungsten-ore", 100}}, + results = { + {type="item", name = util.tungsten_plate, amount=50}, + } + }, + expensive = + { + enabled = false, + energy_required = 15, --TODO + ingredients = {{"tungsten-ore", 99}}, + results = { + {type="item", name = util.tungsten_plate, amount=33}, + } + } + } or nil, +}) + +data:extend({ + { + type = "item", + name = "tungsten-carbide", + icon = "__bztungsten__/graphics/icons/tungsten-carbide.png", + icon_size = 128, + subgroup = "raw-material", + order = "z[tungsten-carbide]", + stack_size = util.get_stack_size(100) + }, + { + type = "recipe", + name = "tungsten-carbide", + category = (mods["Krastorio2"] and "smelting" or "smelting-carbon"), + subgroup = "raw-material", + order = "z[tungsten-carbide]", + icons = { { icon = "__bztungsten__/graphics/icons/tungsten-carbide.png", icon_size = 128} }, + normal = (mods["Krastorio2"] and + { + enabled = false, + energy_required = 48, + ingredients = {{"tungsten-plate", 10}, {"coke", 5}}, + result = "tungsten-carbide", + result_count = 4, + } or + { + enabled = false, + energy_required = 25.6, + ingredients = {{"tungsten-plate", 5}}, + result = "tungsten-carbide", + result_count = 2, + }), + expensive = + { + enabled = false, + energy_required = 25.6, + ingredients = {{"tungsten-plate", 5}}, + result = "tungsten-carbide", + } + }, +}) + +data:extend({ + { + type = "item", + name = "rocket-engine-nozzle", + icon = "__bztungsten__/graphics/icons/rocket-engine-nozzle.png", + icon_size = 128, + subgroup = "intermediate-product", + order = "z[rocket-engine-nozzle]", + stack_size = util.get_stack_size(100) + }, + { + type = "recipe", + name = "rocket-engine-nozzle", + category = "crafting", + subgroup = "intermediate-product", + order = "z[rocket-engine-nozzle]", + icons = { + { icon = "__bztungsten__/graphics/icons/rocket-engine-nozzle.png", icon_size = 128} + }, + normal = + { + enabled = false, + energy_required = 5, + ingredients = {{"tungsten-plate", 2}}, + result = "rocket-engine-nozzle", + }, + expensive = + { + enabled = false, + energy_required = 5, + ingredients = {{"tungsten-plate", 3}}, + result = "rocket-engine-nozzle", + } + } +}) + diff --git a/util.lua b/util.lua new file mode 100644 index 0000000..00fa9bb --- /dev/null +++ b/util.lua @@ -0,0 +1,178 @@ +local util = {} + +util.tungsten_ore = "tungsten-ore" +util.tungsten_plate = "tungsten-plate" + +function util.get_setting(name) + if settings.startup[name] == nil then + return nil + end + return settings.startup[name].value +end + +function util.get_stack_size(default) + if mods["Krastorio2"] then + size = tonumber(krastorio.general.getSafeSettingValue("kr-stack-size")) + return size or default + end + return default +end + +-- check if a table contains a sought value +function util.contains(table, sought) + for i, value in pairs(table) do + if value == sought then + return true + end + end + return false +end + +-- Add a prerequisite to a given technology +function util.add_prerequisite(technology_name, prerequisite) + technology = data.raw.technology[technology_name] + if technology and data.raw.technology[prerequisite] then + if technology.prerequisites then + table.insert(technology.prerequisites, prerequisite) + else + technology.prerequisites = {prerequisite} + end + end +end + +-- Remove a prerequisite from a given technology +function util.remove_prerequisite(technology_name, prerequisite) + technology = data.raw.technology[technology_name] + local index = -1 + if technology and data.raw.technology[prerequisite] then + for i, prereq in pairs(technology.prerequisites) do + if prereq == prerequisite then + index = i + break + end + end + if index > -1 then + table.remove(technology.prerequisites, index) + end + end +end + +-- Add an effect to a given technology +function util.add_effect(technology_name, effect) + technology = data.raw.technology[technology_name] + if technology then + table.insert(technology.effects, effect) + end +end + +-- Set technology ingredients +function util.set_tech_recipe(technology_name, ingredients) + technology = data.raw.technology[technology_name] + if technology then + technology.unit.ingredients = ingredients + end +end + +-- Add a given quantity of ingredient to a given recipe +function util.add_ingredient(recipe_name, ingredient, quantity) + if data.raw.recipe[recipe_name] then + add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) + add_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity) + add_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity) + end +end + +function add_ingredient(recipe, ingredient, quantity) + if recipe ~= nil and recipe.ingredients ~= nil then + table.insert(recipe.ingredients, {ingredient, quantity}) + end +end + +-- Add a given quantity of product to a given recipe. +-- Only works for recipes with multiple products +function util.add_product(recipe_name, product) + if data.raw.recipe[recipe_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 and recipe.results ~= nil then + table.insert(recipe.results, product) + end +end + +-- Replace one ingredient with another in a recipe +function util.replace_ingredient(recipe_name, old, new) + if data.raw.recipe[recipe_name] then + replace_ingredient(data.raw.recipe[recipe_name], old, new) + replace_ingredient(data.raw.recipe[recipe_name].normal, old, new) + replace_ingredient(data.raw.recipe[recipe_name].expensive, old, new) + end +end + +function replace_ingredient(recipe, old, new) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, ingredient in pairs(recipe.ingredients) do + -- For final fixes + if ingredient.name == old then ingredient.name = new end + -- For updates + if ingredient[1] == old then ingredient[1] = new end + end + end +end + +-- Remove an ingredient from a recipe +function util.remove_ingredient(recipe_name, old) + if data.raw.recipe[recipe_name] then + 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 + +function remove_ingredient(recipe, old) + index = -1 + if recipe ~= nil and recipe.ingredients ~= nil then + for i, ingredient in pairs(recipe.ingredients) do + if ingredient.name == old or ingredient[1] == old then + index = i + break + end + end + if index > -1 then + table.remove(recipe.ingredients, index) + end + end +end + + +-- Replace an amount of an ingredient in a recipe. Keep at least 1 of old. +function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amount) + if data.raw.recipe[recipe_name] then + replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount) + replace_some_ingredient(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount) + replace_some_ingredient(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount) + end +end + +function replace_some_ingredient(recipe, old, old_amount, new, new_amount) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, ingredient in pairs(recipe.ingredients) do + -- For final fixes + if ingredient.name == old then + ingredient.amount = math.max(1, ingredient.amount - old_amount) + end + -- For updates + if ingredient[1] == old then + ingredient[2] = math.max(1, ingredient[2] - old_amount) + end + end + add_ingredient(recipe, new, new_amount) + end +end + + +return util