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
This commit is contained in:
David Leal 2020-11-04 10:17:45 -06:00 committed by GitHub
parent 513569cd42
commit 388f1c2853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 8 deletions

16
.github/workflows/build.yml vendored Normal file
View File

@ -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 ./

View File

@ -1,4 +1,4 @@
allow_defined_top = true
unused_args = false unused_args = false
globals = { globals = {

View File

@ -1,3 +0,0 @@
3d_armor
technic_worldgen?
moreores?

View File

@ -1 +0,0 @@
Adds tin, silver and technic materials to 3d_armor.

View File

@ -11,7 +11,8 @@ local stats = {
brass = { name=S("Brass"), material="technic:brass_ingot", armor=1.8, heal=0, use=650, radiation=43 }, 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 }, 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 }, 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 if minetest.get_modpath("moreores") then
stats.tin = { name=S("Tin"), material="moreores:tin_ingot", armor=1.6, heal=0, use=750, radiation=37 } 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 for partkey, part in pairs(parts) do
local partname = "technic_armor:"..partkey.."_"..key local partname = "technic_armor:"..partkey.."_"..key
minetest.register_tool(partname, { 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), description = S("@1 @2", armor.name, part.name),
inventory_image = "technic_armor_inv_"..partkey.."_"..key..".png", 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, wear = 0,
}) })
minetest.register_craft({ minetest.register_craft({

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = technic_armor
depends = 3d_armor
optional_depends = moreores, technic_worldgen