mirror of
https://github.com/minetest-mods/airtanks.git
synced 2025-01-12 21:17:27 +01:00
add documentation, air test for compressor
This commit is contained in:
parent
d60761daf9
commit
2bc578505b
@ -1 +1,3 @@
|
||||
default
|
||||
doc?
|
||||
intllib?
|
30
init.lua
30
init.lua
@ -25,14 +25,38 @@ local function setting(stype, name, default, description)
|
||||
end
|
||||
end
|
||||
|
||||
local full_tank_desc = S("A tank containing compressed air.")
|
||||
local full_tank_help = S("If you're underwater and you're running out of breath, wield this item and use it to replenish 5 bubbles on your breath bar. When fully charged this tank has %i uses before it becomes empty.")
|
||||
|
||||
local empty_tank_desc = S("A compressed air tank, currently empty.")
|
||||
local empty_tank_help = S("This tank can be recharged with compressed air by using it on a compressor block. When fully charged this tank has %i uses before it becomes empty.")
|
||||
|
||||
local compressor_desc = S("A machine for filling air tanks with compressed air.")
|
||||
local compressor_help = S("Place this machine somewhere that it has access to air (one of its adjacent nodes needs to have air in it). When you click on it with an empty or partly-empty compressed air tank the tank will be refilled.")
|
||||
|
||||
setting("int", "steel_uses", 30, "Number of uses for a steel air tank")
|
||||
setting("int", "copper_uses", 10, "Number of uses for a copper air tank")
|
||||
setting("int", "bronze_uses", (config.steel_uses + config.copper_uses)/2, "Number of uses for a bronze air tank")
|
||||
|
||||
local cardinal_dirs = {{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},}
|
||||
|
||||
local recharge_airtank = function(itemstack, user, pointed_thing, full_item)
|
||||
if pointed_thing.type ~= "node" then return itemstack end
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
if minetest.get_item_group(node.name, "airtanks_compressor") > 0 then
|
||||
|
||||
local has_air = false
|
||||
for _, dir in pairs(cardinal_dirs) do
|
||||
if minetest.get_node(vector.add(pointed_thing.under, dir)).name == "air" then
|
||||
has_air = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not has_air then
|
||||
minetest.sound_play("airtanks_compressor_fail", {pos = pointed_thing.under, gain = 0.5})
|
||||
return itemstack
|
||||
end
|
||||
|
||||
if itemstack:get_name() == full_item then
|
||||
itemstack:set_wear(0)
|
||||
else
|
||||
@ -74,6 +98,8 @@ end
|
||||
local function register_air_tank(name, desc, color, uses, material)
|
||||
minetest.register_craftitem("airtanks:empty_"..name.."_tank", {
|
||||
description = S("Empty @1", desc),
|
||||
_doc_items_longdesc = empty_tank_desc,
|
||||
_doc_items_usagehelp = string.format(empty_tank_help, uses),
|
||||
inventory_image = "airtanks_airtank.png^[multiply:"..color.."^airtanks_empty.png",
|
||||
wield_image = "airtanks_airtank.png^[multiply:"..color.."^airtanks_empty.png",
|
||||
stack_max = 99,
|
||||
@ -89,6 +115,8 @@ local function register_air_tank(name, desc, color, uses, material)
|
||||
|
||||
minetest.register_tool("airtanks:"..name.."_tank", {
|
||||
description = desc,
|
||||
_doc_items_longdesc = full_tank_desc,
|
||||
_doc_items_usagehelp = string.format(full_tank_help, uses),
|
||||
groups = {not_repaired_by_anvil = 1},
|
||||
inventory_image = "airtanks_airtank.png^[multiply:"..color,
|
||||
wield_image = "airtanks_airtank.png^[multiply:"..color,
|
||||
@ -127,6 +155,8 @@ end
|
||||
|
||||
minetest.register_node("airtanks:compressor", {
|
||||
description = S("Air Compressor"),
|
||||
_doc_items_longdesc = compressor_desc,
|
||||
_doc_items_usagehelp = compressor_help,
|
||||
groups = {oddly_breakable_by_hand = 1, airtanks_compressor = 1},
|
||||
sounds = sounds,
|
||||
tiles = {
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-03-26 01:50-0600\n"
|
||||
"POT-Creation-Date: 2017-03-26 10:53-0600\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -17,22 +17,56 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:54
|
||||
msgid "Empty @1"
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:28
|
||||
msgid "A tank containing compressed air."
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:95
|
||||
msgid "Steel Air Tank"
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:29
|
||||
#, lua-format
|
||||
msgid ""
|
||||
"If you're underwater and you're running out of breath, wield this item and "
|
||||
"use it to replenish 5 bubbles on your breath bar. When fully charged this "
|
||||
"tank has %i uses before it becomes empty."
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:96
|
||||
msgid "Copper Air Tank"
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:31
|
||||
msgid "A compressed air tank, currently empty."
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:97
|
||||
msgid "Bronze Air Tank"
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:32
|
||||
#, lua-format
|
||||
msgid ""
|
||||
"This tank can be recharged with compressed air by using it on a compressor "
|
||||
"block. When fully charged this tank has %i uses before it becomes empty."
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:34
|
||||
msgid "A machine for filling air tanks with compressed air."
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:35
|
||||
msgid ""
|
||||
"Place this machine somewhere that it has access to air (one of its adjacent "
|
||||
"nodes needs to have air in it). When you click on it with an empty or partly-"
|
||||
"empty compressed air tank the tank will be refilled."
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:100
|
||||
msgid "Empty @1"
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:145
|
||||
msgid "Steel Air Tank"
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:146
|
||||
msgid "Copper Air Tank"
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:147
|
||||
msgid "Bronze Air Tank"
|
||||
msgstr ""
|
||||
|
||||
#: C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\airtanks\init.lua:157
|
||||
msgid "Air Compressor"
|
||||
msgstr ""
|
||||
|
BIN
sounds/airtanks_compressor_fail.ogg
Normal file
BIN
sounds/airtanks_compressor_fail.ogg
Normal file
Binary file not shown.
@ -1,2 +1,3 @@
|
||||
airtanks_hiss - from https://www.freesound.org/people/josepharaoh99/sounds/367125/ by josepharaoh99 under the public domain via CC 0
|
||||
airtanks_comressor - from https://www.freesound.org/people/Cell31_Sound_Productions/sounds/376927/ by Cell31_Sound_Productions under CC BY 3.0
|
||||
airtanks_compressor_fail - from https://www.freesound.org/people/Cell31_Sound_Productions/sounds/383020/ by Cell31_Sound_Productions under CC BY 3.0
|
Loading…
Reference in New Issue
Block a user