Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to support 0.18 #3

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
# makefile with local settings
local.mk

# build directory
build/
77 changes: 77 additions & 0 deletions .luacheckrc
@@ -0,0 +1,77 @@
std = "lua52c"

max_line_length = false

read_globals = {
log = {},
serpent = {
fields = {
'block',
'line'
}
},
table = {
fields = {
'deepcopy'
}
},
util = {
fields = {
'combine_icons',
'parse_energy',
'by_pixel'
}
},
settings = {
fields = {
'startup',
'global'
}
},
'mods',
'defines'
}

local data_settings = {
read_globals = {
data = {
fields = {
raw = {
read_only = false,
other_fields = true
},
'extend'
}
},
'accumulator_picture'
},
globals = {
'HighlyDerivative',
'heat_glow_tint',
'pipecoverspictures'
}
}

local control_settings = {
read_globals = {
'game',
'defines',
'script',
'remote'
},
globals = {
'global',
}
}

files["migration_helper/control.lua"] = control_settings

files["control.lua"] = control_settings
files["scripts/**/*.lua"] = control_settings

files["settings.lua"] = data_settings
files["data.lua"] = data_settings
files["data-updates.lua"] = data_settings
files["data-final-fixes.lua"] = data_settings
files["prototypes/**/*.lua"] = data_settings
files["integrations/**/*.lua"] = data_settings
20 changes: 20 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "factoriomod",
"request": "launch",
"name": "Factorio Mod Debug",
"factorioPath": "C:\\Program Files\\Factorio\\bin\\x64\\factorio.exe",
"preLaunchTask": "make",
"hookData": true,
"adjustMods": {
"Fission-and-Fusion": true
},
"useInstrumentMode": true
}
]
}
35 changes: 35 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,35 @@
{
"Lua.runtime.version": "Lua 5.2",
"Lua.diagnostics.globals": [
"game",
"script",
"remote",
"commands",
"settings",
"rcon",
"rendering",
"global",
"log",
"defines",
"data", /* data */
"mods", /* data */
"serpent",
"table_size",
"bit32",
"util",
/* data stage has a *lot* of globals,
* you may need to add more if you use them
*/
"circuit_connector_definitions", /* data */
"universal_connector_template", /* data */
"heat_glow_tint",
"pipecoverspictures"
],
"Lua.diagnostics.disable": [
"lowercase-global"
],
"Lua.workspace.library": {
/* Adjust this to match your Factorio install path */
// "C:/Progam Files/Factorio/data/core/lualib": true
}
}
17 changes: 17 additions & 0 deletions .vscode/tasks.json
@@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make",
"type": "shell",
"command": "make",
"group": "build",
"runOptions": {
"runOn": "folderOpen"
},
"problemMatcher": []
}
]
}
14 changes: 14 additions & 0 deletions Fission-and-Fusion.code-workspace
@@ -0,0 +1,14 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"Lua.workspace.library": {
"C:/Progam Files/Factorio/data/core/lualib": true
},
"terminal.integrated.shell.windows": "C:\\WINDOWS\\system32\\wsl.exe",
"terminal.integrated.automationShell.windows": "C:\\WINDOWS\\system32\\wsl.exe",
}
}
70 changes: 70 additions & 0 deletions GNUmakefile
@@ -0,0 +1,70 @@
# commands
LUAC := luac
LUACHECK := luacheck
ZIP := zip -r

# directories
FACTORIO_MODS := ~/.Factorio/mods

# override the above with local values in the optional local.mk
-include local.mk

PACKAGE_NAME := $(shell cat info.json|jq -r .name)
VERSION_STRING := $(shell cat info.json|jq -r .version)
FACTORIO_VERSION_STRING := $(shell cat info.json|jq -r .factorio_version)

OUTPUT_NAME := $(PACKAGE_NAME)_$(VERSION_STRING)
OUTPUT_DIR := build/$(OUTPUT_NAME)

PKG_COPY := $(shell find . -iname '*.cfg' -type f -not -path "./build/*")
PKG_COPY += $(shell find . -iname '*.png' -type f -not -path "./build/*")

SED_FILES := $(shell find . -iname '*.json' -type f -not -path "./build/*")
SED_FILES += $(shell find . -iname '*.lua' -type f -not -path "./build/*")
SED_FILES += $(shell find . -iname '*.md' -type f -not -path "./build/*")
SED_FILES += $(shell find . -iname 'changelog.txt' -type f -not -path "./build/*")

OUT_FILES := $(SED_FILES:%=$(OUTPUT_DIR)/%)

SED_EXPRS := -e 's/{{MOD_NAME}}/$(PACKAGE_NAME)/g'
SED_EXPRS += -e 's/{{VERSION}}/$(VERSION_STRING)/g'
SED_EXPRS += -e 's/{{FACTORIO_VERSION}}/$(FACTORIO_VERSION_STRING)/g'

all: clean verify package install_mod

release: clean verify package install_mod tag

package-copy:
mkdir -p $(OUTPUT_DIR)
for a in $(PKG_COPY) ; do \
cp --parents $$a $(OUTPUT_DIR) ; \
done

$(OUTPUT_DIR)/%.lua: %.lua
@mkdir -p $(@D)
@sed $(SED_EXPRS) $< > $@
$(LUAC) -p $@

$(OUTPUT_DIR)/%: %
mkdir -p $(@D)
sed $(SED_EXPRS) $< > $@

package: package-copy $(OUT_FILES)
cd $(OUTPUT_DIR) && $(ZIP) "Fission and Fusion_0.4.4".zip "migration_helper" && rm -rf "migration_helper"
cd build && $(ZIP) $(OUTPUT_NAME).zip $(OUTPUT_NAME)

clean:
rm -rf build/

verify:
$(LUACHECK) .

install_mod: package
if [ -d $(FACTORIO_MODS) ]; then \
rm -rf $(FACTORIO_MODS)/$(OUTPUT_NAME) ; \
cp -R build/$(OUTPUT_NAME) $(FACTORIO_MODS) ; \
cp -f build/$(OUTPUT_NAME)/"Fission and Fusion_0.4.4.zip" $(FACTORIO_MODS) ; \
fi;

tag:
git tag -f $(VERSION_STRING)
12 changes: 4 additions & 8 deletions README.md
@@ -1,3 +1,7 @@
[Fission and Fusion](https://mods.factorio.com/mod/Fission%20and%20Fusion) updated for 0.18 until [undarl](https://mods.factorio.com/user/undarl) gets a [round tuit](https://en.wiktionary.org/wiki/round_tuit).

Note that to migrate a save from "Fission and Fusion" (note the spaces) to "Fission-and-Fusion", you will need to extract "Fission and Fusion_0.4.4.zip" from within "{{MOD_NAME}}_{{VERSION}}.zip" and add it to your mods folder.

# Fission and Fusion

Adds portable fission generators, radioisotope thermoelectric generators, and factory-level fusion power as well as altering portable fusion reactors and increasing their research difficulty. Each branch of this mod can be toggled on and off individually in the mod startup options.
Expand Down Expand Up @@ -29,14 +33,6 @@ Adds portable fission generators, radioisotope thermoelectric generators, and fa

**Portable Fusion Reactors:** The pinnacle of fusion technology so far, these reactor-generator units are small enough to fit in powered armor and run very efficiently on compressed deuterium gas.

## Changelog
* 0.4.2 - Merged a pull request from the helpful vctgross which patched some files for 0.16.
* 0.4.1 - Shifted fast RTG recycling to chemplants to fix a handcrafting bug; added a setting to shift it to centrifuges instead.
* 0.4.0 - Added pressure cylinders; converted portable fusion reactors to run on compressed deuterium.
* 0.3.0 - Reduced standard RTG size by half and scaled output down by 20%; reduced RTG Array ingredients and output; added a new Fast RTG that loses capacity over time.
* 0.2.0 - Increased default fusion reactor output by 50%; created a startup setting for reactor output; rebalanced fusion fuel recipes; removed workaround for generator heat capacity bug.
* 0.1.0 - Initial release

## Current Integrations with Other Mods
* [Nuclear Fuel](https://mods.factorio.com/mods/GotLag/Nuclear%20Fuel) by GotLag
* Add radioisotope chance to plutonium fuel reprocessing
Expand Down
112 changes: 112 additions & 0 deletions changelog.txt
@@ -0,0 +1,112 @@
---------------------------------------------------------------------------------------------------
Version: 0.5.0
Date: 2020-08-18

Features:
- Add support for non-vanilla portable fusion generators
Changes:
- Updated for 1.0
- Fiddled with changelog again.
Bugfixes:
- Fix stuff reported by luacheck.

---------------------------------------------------------------------------------------------------
Version: 0.4.6
Date: 2020-05-31

Bugfixes:
- Fix graphics paths to refer to the _new_ mod name, rather than the old one.

---------------------------------------------------------------------------------------------------
Version: 0.4.5
Date: 2020-05-31

Features:
- Make fusion generators input-output, just like the vanilla steam generators.
Changes:
- Add an explicit dependency from the fusion power technology on space science packs
- Deuterium gas now has a fuel value of 6.2392J (what you would get if you just set it on fire), and fusion generators are now highly efficient (the difference between fusing and burning Deuterium).
- Reduced collision box on RTG to match sprite.
- no longer requires control.lua to make the fusion generators work.
Graphics:
- improve the alignment of entity sprites for RTG and fusion reactor.
Bugfixes:
- Hide no power icon for RTG - thanks to baslr
- Updated old changelog entries

---------------------------------------------------------------------------------------------------
Version: 0.4.4
Date: 2020-05-31

Features:
- Allowed certain recipes to use productivity.
Changes:
- Updated for 0.18
- Renamed from "Fission and Fusion" to "Fission-and-Fusion", and wrote a helper to migrate the data from the old to the new name.
Translation:
- Added name for fuel categories as these are now displayed.
Graphics:
- Added glow from base nuclear reactor to the inertial confinement reactor
- Rewrote control.lua to hopefully perform better.
- Allow fusion reactor interface update to be disabled.
Bugfixes:
- Flagged RTG recycling and pressure cylinder unload recipes to not allow decomposition

---------------------------------------------------------------------------------------------------
Version: 0.4.3
Date: 2019-04-07

Changes:
- Updated for 0.17
- Reformatted changelog
- Removed quickbar flags
- Changed science pack names

---------------------------------------------------------------------------------------------------
Version: 0.4.2
Date: 2018-03-01

Changes:
- Merged a pull request from the helpful vctgross which patched some files for 0.16.

---------------------------------------------------------------------------------------------------
Version: 0.4.1
Date: 2017-07-01

Bugfixes:
- Shifted fast RTG recycling to chemplants to fix a handcrafting bug
- added a setting to shift it to centrifuges instead.

---------------------------------------------------------------------------------------------------
Version: 0.4.0
Date: 2017-06-04

Changes:
- Added pressure cylinders
- converted portable fusion reactors to run on compressed deuterium.

---------------------------------------------------------------------------------------------------
Version: 0.3.0
Date: 2017-06-03

Changes:
- Reduced standard RTG size by half and scaled output down by 20%
- reduced RTG Array ingredients and output
- added a new Fast RTG that loses capacity over time.

---------------------------------------------------------------------------------------------------
Version: 0.2.0
Date: 2017-06-02

Changes:
- Increased default fusion reactor output by 50%
- Created a startup setting for reactor output
- Rebalanced fusion fuel recipes
- Removed workaround for generator heat capacity bug.

---------------------------------------------------------------------------------------------------
Version: 0.1.0
Date: 2017-06-01

Changes:
- Initial release.