From 388f1c285335548cd8f25c16ab47d14d33524297 Mon Sep 17 00:00:00 2001 From: David Leal Date: Wed, 4 Nov 2020 10:17:45 -0600 Subject: [PATCH] Various changes and improvements (#1) * Use mod.conf for (soft) dependencies and description. * Deletes deprecated `depends.txt` and `description.txt`. * Add GitHub workflow to LuaCheck the code * Fix minor LuaCheck warnings --- .github/workflows/build.yml | 16 ++++++++++++++++ .luacheckrc | 2 +- depends.txt | 3 --- description.txt | 1 - init.lua | 11 ++++++++--- mod.conf | 3 +++ 6 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 depends.txt delete mode 100644 description.txt create mode 100644 mod.conf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1f0ae32 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,16 @@ +name: build +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - 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 index 88349af..bd1e744 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,4 +1,4 @@ - +allow_defined_top = true unused_args = false globals = { diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 9ccefed..0000000 --- a/depends.txt +++ /dev/null @@ -1,3 +0,0 @@ -3d_armor -technic_worldgen? -moreores? diff --git a/description.txt b/description.txt deleted file mode 100644 index 5738c4f..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds tin, silver and technic materials to 3d_armor. diff --git a/init.lua b/init.lua index 04c4ad5..8dfa0a2 100644 --- a/init.lua +++ b/init.lua @@ -11,7 +11,8 @@ local stats = { brass = { name=S("Brass"), material="technic:brass_ingot", armor=1.8, heal=0, use=650, radiation=43 }, cast = { name=S("Cast Iron"), material="technic:cast_iron_ingot", armor=2.5, heal=8, use=200, radiation=40 }, carbon = { name=S("Carbon Steel"), material="technic:carbon_steel_ingot", armor=2.7, heal=10, use=100, radiation=40 }, - stainless = { name=S("Stainless Steel"), material="technic:stainless_steel_ingot", armor=2.7, heal=10, use=75, radiation=40 }, + stainless = { name=S("Stainless Steel"), material="technic:" .. + "stainless_steel_ingot", armor=2.7, heal=10, use=75, radiation=40 }, } if minetest.get_modpath("moreores") then stats.tin = { name=S("Tin"), material="moreores:tin_ingot", armor=1.6, heal=0, use=750, radiation=37 } @@ -51,10 +52,14 @@ for key, armor in pairs(stats) do for partkey, part in pairs(parts) do local partname = "technic_armor:"..partkey.."_"..key minetest.register_tool(partname, { - -- Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string) + -- Translators: @1 stands for material and @2 for part of the armor + -- so that you could use a conjunction if in your language part name + -- comes first then material (e.g. in french 'Silver Boots' + -- is translated in 'Bottes en argent' by using '@2 en @1' as translated string) description = S("@1 @2", armor.name, part.name), inventory_image = "technic_armor_inv_"..partkey.."_"..key..".png", - groups = {["armor_"..part.place]=math.floor(part.level*armor.armor), armor_heal=armor.heal, armor_use=armor.use, armor_radiation=math.floor(part.radlevel*armor.radiation)}, + groups = {["armor_"..part.place]=math.floor(part.level*armor.armor), armor_heal=armor.heal, + armor_use=armor.use, armor_radiation=math.floor(part.radlevel*armor.radiation)}, wear = 0, }) minetest.register_craft({ diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..4320287 --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = technic_armor +depends = 3d_armor +optional_depends = moreores, technic_worldgen