diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..a03fe92 --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -0,0 +1,17 @@ +name: luacheck + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: apt + run: sudo apt-get install -y luarocks + - name: luacheck install + run: luarocks install --local luacheck + - name: luacheck run + run: $HOME/.luarocks/bin/luacheck ./ diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..9869585 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,24 @@ +unused_args = false +allow_defined_top = true + +globals = { + "radioactive_gas" +} + +read_globals = { + -- Stdlib + string = {fields = {"split"}}, + table = {fields = {"copy", "getn"}}, + + -- Minetest + "minetest", + "vector", "ItemStack", + "dump", "VoxelArea", + + -- Deps + "unified_inventory", "default", + "vacuum", + + -- optional mods + "planetoidgen" +} diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..6e2f582 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +default? +vacuum? diff --git a/gas.lua b/gas.lua new file mode 100644 index 0000000..bff925a --- /dev/null +++ b/gas.lua @@ -0,0 +1,54 @@ +-- radioactive outgasing of ores in vacuum + +-- gas definition, drowns and is slightly radioactive +minetest.register_node("radioactive_gas:gas", { + description = "Moon gas", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + drawtype = "glasslike", + drowning = 1, + post_effect_color = {a = 20, r = 20, g = 250, b = 20}, + tiles = {"planet_moon_gas.png^[colorize:#E0F0E033"}, + alpha = 0.1, + groups = { + not_in_creative_inventory = 1, + not_blocking_trains = 1, + cools_lava = 1, + radioactive = 3 + }, + drop = {}, + sunlight_propagates = true +}) + +-- ores gas out in vacuum +minetest.register_abm({ + label = "moon ore outgasing", + nodenames = {"vacuum:vacuum"}, + neighbors = { + "default:stone_with_diamond", + "default:stone_with_mese", + "default:stone_with_gold", + "default:stone_with_iron", + "default:stone_with_coal", + "default:mineral_uranium" + }, + interval = 5, + chance = 10, + action = function(pos) + minetest.set_node(pos, {name = "radioactive_gas:gas"}) + end +}) + +-- radioactive gas removal if near air +minetest.register_abm({ + label = "radioactive gas removal", + nodenames = {"radioactive_gas:gas"}, + neighbors = {"air"}, + interval = 5, + chance = 5, + action = function(pos) + minetest.set_node(pos, {name = "air"}) + end +}) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..14a7d9c --- /dev/null +++ b/init.lua @@ -0,0 +1,5 @@ +local MP = minetest.get_modpath("radioactive_gas") +dofile(MP.."/gas.lua") + + +print("[OK] Radioactive gas") diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..62ac5c6 --- /dev/null +++ b/readme.md @@ -0,0 +1,10 @@ + +# Radioactive gas mod for minetest + +Spawns radioactive gas around ore and vacuum nodes +The gas disappears again if in contact with air + +## Dependencies + +* default? +* vacuum?