summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helptexts.lua16
-rw-r--r--init.lua216
2 files changed, 217 insertions, 15 deletions
diff --git a/helptexts.lua b/helptexts.lua
index aac9f70..8667d6e 100644
--- a/helptexts.lua
+++ b/helptexts.lua
@@ -63,6 +63,9 @@ help.longdesc = {
["default:nyancat"] = "A pop-tart cat in a block. Just for fun.",
["default:nyancat_rainbow"] = "A rainbow in a block. Just for fun.",
["default:grass_1"] = "Some grass. On a dirt with grass block, it will slowly spread.",
+ ["default:bucket_empty"] = "A bucket, liquids can be collected with it.",
+ ["default:bucket_water"] = "A bucket which is filled with water.",
+ ["default:bucket_lava"] = "A bucket which is filled with lava.",
["bones:bones"] = "These are the remains of a deceased player. It contains the player's inventory.",
@@ -72,7 +75,7 @@ help.longdesc = {
["farming:desert_sand_soil"] = "Dry soil, this is where you can grow crops on. Dry soil will become wet if a water source is near.",
["farming:desert_sand_soil_wet"] = "Wet soil, this is where you can grow crops on.",
- ["tnt:tnt"] = "An explosive device which is capable of damaging living beings and destroys blocks around it, shortly after it has been ignited. With a small chance, blocks may drop as an item. TNT can be ignited by explosions and fire.",
+ ["tnt:tnt"] = "An explosive device. When it explodes, it will hurt living beings, destroy blocks around it, and set flammable blocks on fire. With a small chance, blocks may drop as an item rather than being destroyed. TNT can be ignited by explosions and fire.",
["tnt:gunpowder"] = "Gunpowder is used to craft TNT and to create gunpowder trails which can be ignited.",
["fire:basic_flame"] = "Fire is a damaging and destructive but short-lived kind of block. It will destroy and spread towards near flammable blocks, but fire will disappear if there is nothing to burn left. Fire will be extinguished faster if water is near it (no matter from which direction). A single fire block can be destroyed safely by punching it, but it is hurtful if you stand directly in fire.",
@@ -80,6 +83,10 @@ help.longdesc = {
["bedrock2:bedrock"] = "If you have found this block then you have reached the bottom of the world. Bedrock cannot be moved, altered or destroyed by any means.",
["doors:trapdoor"] = "A trapdoor covers a hole in the floor and can be opened manually to access the area below it. An opened trapdoor can be climbed like a ladder.",
+
+ ["screwdriver:screwdriver"] = "A screwdriver can be used to rotate blocks. It can be used 200 times.",
+
+ ["boats:boat"] = "A simple boat which allows you to float on the surface of large water bodies. Travelling by boat is slightly faster than swimming.",
}
help.usagehelp = {
@@ -91,6 +98,9 @@ help.usagehelp = {
["default:sign_wall"] = "Rightclick the sign to edit the text.",
["default:bookshelf"] = "Rightclick to open the bookshelf. You can store one book per inventory slot. To collect the bookshelf, you must make sure it does not contain any books.",
+ ["default:bucket_empty"] = "Rightclick on a liquid source while holding the bucket to collect the liquid. Rightclick again somewhere to empty the bucket, this will create a liquid source at the position you've clicked at.",
+ ["default:bucket_water"] = "Rightclick while holding this bucket on any block to empty it.",
+ ["default:bucket_lava"] = "Rightclick while holding this bucket on any block to empty it. Be careful by doing so, lava is dangerous!",
["bones:bones"] = "Rightclick to access the inventory, dig it to obtain all items immediately. If these are not your bones, you have to wait 10 minutes before you can do this. It is only possible to take from this inventory, nothing can be stored into it.",
@@ -98,4 +108,8 @@ help.usagehelp = {
["tnt:tnt"] = "Place the TNT on the ground and punch it with a torch to light it and quickly get in a safe distance before it explodes. A burning gunpowder trail will also light the TNT.",
["doors:trapdoor"] = "Rightclick the trapdoor to open or close it. When the trapdoor is open, use the sneak or use key (depends on your configuration) to climb down, and the jump key to climb up.",
+
+ ["screwdriver:screwdriver"] = "Leftclick on a block to rotate it around its current axis. Rightclick on a block to rotate its axis.",
+
+ ["boats:boat"] = "Place the boat on an even water surface to set it up. Rightclick the boat to enter it. When you are on the boat, use the forward key to speed up, the backward key to slow down and the left and right keys to turn the boat. Rightclick on the boat again to leave it. Leftclick the placed boat to collect it.",
}
diff --git a/init.lua b/init.lua
index 874f51f..21b37b3 100644
--- a/init.lua
+++ b/init.lua
@@ -9,6 +9,10 @@ local forced_nodes = {
"farming:desert_sand_soil_wet",
}
+local item_name_overrides = {
+ ["screwdriver:screwdriver"] = "Screwdriver",
+}
+
local groups_to_string = function(grouptable)
local gstring = ""
if #grouptable == 0 then
@@ -26,11 +30,19 @@ doc.new_category("nodes", {
name = "Blocks",
build_formspec = function(data)
if data then
- local longdesc = data.longdesc or "N/A"
- local usagehelp = data.usagehelp or "N/A"
- local formstring = "item_image[11,0;1,1;"..data.itemstring.."]"
- formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..longdesc.."\n\n"
- formstring = formstring .. "Usage: "..usagehelp .. "\n\n"
+ local longdesc = data.longdesc
+ local usagehelp = data.usagehelp
+
+ local formstring = ""
+ if data.itemstring ~= "air" then
+ formstring = formstring .. "item_image[11,0;1,1;"..data.itemstring.."]"
+ end
+ if longdesc ~= nil then
+ formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..longdesc.."\n\n"
+ end
+ if usagehelp ~= nil then
+ formstring = formstring .. "Usage help: "..usagehelp .. "\n\n"
+ end
formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n"
local yesno = function(bool)
@@ -68,7 +80,7 @@ doc.new_category("nodes", {
elseif data.def.light_source > 5 then
formstring = formstring .. "This block is a source of light.\n"
elseif data.def.light_source > 0 then
- formstring = formstring .. "This block is a source of light and glow faintly.\n"
+ formstring = formstring .. "This block is a source of light and glows faintly.\n"
end
if data.def.climbable == true then
formstring = formstring .. "This block can be climbed.\n"
@@ -86,13 +98,24 @@ doc.new_category("nodes", {
formstring = formstring .. "You will slowly lose breath in this block.\n"
end
- if data.def.groups.immortal == 1 then
- formstring = formstring .. "This block can not be dug by ordinary digging tools.\n"
- end
- if data.def.groups.dig_immediate == 2 then
- formstring = formstring .. "This block can be dug by any tool in half a second.\n"
- elseif data.def.groups.dig_immediate == 3 then
- formstring = formstring .. "This block can be dug by any tool immediately.\n"
+ if data.def.drops == "" then
+ if data.def.groups.immortal == 1 then
+ formstring = formstring .. "This block can not be dug by ordinary digging tools.\n"
+ end
+ if data.def.groups.dig_immediate == 2 then
+ formstring = formstring .. "This block can be dug by any tool in half a second.\n"
+ elseif data.def.groups.dig_immediate == 3 then
+ formstring = formstring .. "This block can be dug by any tool immediately.\n"
+ end
+ else
+ if data.def.groups.immortal == 1 then
+ formstring = formstring .. "This block can not be destroyed by ordinary digging tools.\n"
+ end
+ if data.def.groups.dig_immediate == 2 then
+ formstring = formstring .. "This block can be destroyed by any tool in half a second.\n"
+ elseif data.def.groups.dig_immediate == 3 then
+ formstring = formstring .. "This block can be destroyed by any tool immediately.\n"
+ end
end
if data.def.groups.falling_node == 1 then
@@ -212,6 +235,118 @@ doc.new_category("nodes", {
end
})
+doc.new_category("tools", {
+ name = "Tools and weapons",
+ build_formspec = function(data)
+ if data then
+ local longdesc = data.longdesc or "N/A"
+ local usagehelp = data.usagehelp or "N/A"
+ local formstring = "item_image[11,0;1,1;"..data.itemstring.."]"
+ formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..longdesc.."\n\n"
+ formstring = formstring .. "Usage: "..usagehelp .. "\n\n"
+ formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n"
+
+ local yesno = function(bool)
+ if bool==true then return "Yes"
+ elseif bool==false then return "No"
+ else return "N/A" end
+ end
+
+ local range = 4.0
+ if data.def.range ~= nil then range = data.def.range end
+ formstring = formstring .. "Range: "..range.."\n"
+
+ formstring = formstring .. "\n"
+
+ if data.def.tool_capabilities ~= nil and data.def.tool_capabilities ~= {} then
+ formstring = formstring .. "Full punch interval: "..data.def.tool_capabilities.full_punch_interval.." s\n"
+ local groupcaps = data.def.tool_capabilities.groupcaps
+ formstring = formstring .. "Groupcaps:\n"
+ for k,v in pairs(groupcaps) do
+ formstring = formstring .. k .. ": blabla" .. "\n"
+ end
+
+ formstring = formstring .. "Damage groups:\n"
+ local damage_groups = data.def.tool_capabilities.damage_groups
+ for k,v in pairs(damage_groups) do
+ formstring = formstring .. k .. ": " .. v .. " HP\n"
+ end
+ end
+
+ formstring = formstring .. "\n"
+
+ -- Global factoids
+ if data.def.liquids_pointable == true then
+ formstring = formstring .. "This item will point to liquids rather than ignore them.\n"
+ end
+
+ formstring = formstring .. ";]"
+
+ return formstring
+ else
+ return "label[0,1;NO DATA AVALIABLE!"
+ end
+ end
+})
+
+
+doc.new_category("craftitems", {
+ name = "Misc. items",
+ build_formspec = function(data)
+ if data then
+ local longdesc = data.longdesc or "N/A"
+ local usagehelp = data.usagehelp or "N/A"
+ local formstring = "item_image[11,0;1,1;"..data.itemstring.."]"
+ formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..longdesc.."\n\n"
+ formstring = formstring .. "Usage: "..usagehelp .. "\n\n"
+ formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n"
+
+ local yesno = function(bool)
+ if bool==true then return "Yes"
+ elseif bool==false then return "No"
+ else return "N/A" end
+ end
+
+ local range = 4.0
+ if data.def.range ~= nil then range = data.def.range end
+ formstring = formstring .. "Range: "..range.."\n"
+
+ formstring = formstring .. "\n"
+
+ if data.def.tool_capabilities ~= nil and data.def.tool_capabilities ~= {} then
+ formstring = formstring .. "Full punch interval: "..data.def.tool_capabilities.full_punch_interval.." s\n"
+ local groupcaps = data.def.tool_capabilities.groupcaps
+ formstring = formstring .. "Groupcaps:\n"
+ for k,v in pairs(groupcaps) do
+ formstring = formstring .. k .. ": blabla" .. "\n"
+ end
+
+ formstring = formstring .. "Damage groups:\n"
+ local damage_groups = data.def.tool_capabilities.damage_groups
+ for k,v in pairs(damage_groups) do
+ formstring = formstring .. k .. ": " .. v .. " HP\n"
+ end
+ end
+
+ formstring = formstring .. "\n"
+
+ -- Global factoids
+ if data.def.liquids_pointable == true then
+ formstring = formstring .. "This tool will point to liquids rather than ignore them.\n"
+ end
+
+ formstring = formstring .. ";]"
+
+ return formstring
+ else
+ return "label[0,1;NO DATA AVALIABLE!"
+ end
+ end
+})
+
+
+
+
dofile(minetest.get_modpath("doc_minetest_game") .. "/helptexts.lua")
local function gather_descs()
@@ -246,7 +381,60 @@ local function gather_descs()
def = def,
}
}
- doc.new_entry("nodes", id, infotable)
+ doc.new_entry("nodes", id, infotable)
+ end
+ end
+
+
+ -- TODO: Add hand
+ for id, def in pairs(minetest.registered_tools) do
+ local name, ld, uh
+ if item_name_overrides[id] ~= nil then
+ name = item_name_overrides[id]
+ else
+ name = def.description
+ end
+ if not (name == nil or name == "" or def.groups.not_in_creative_inventory) then
+ if help.longdesc[id] ~= nil then
+ ld = help.longdesc[id]
+ end
+ if help.usagehelp[id] ~= nil then
+ uh = help.usagehelp[id]
+ end
+ local infotable = {
+ name = name,
+ data = {
+ longdesc = ld,
+ usagehelp = uh,
+ itemstring = id,
+ def = def,
+ }
+ }
+ doc.new_entry("tools", id, infotable)
+ end
+ end
+
+
+ for id, def in pairs(minetest.registered_craftitems) do
+ local name, ld, uh
+ name = def.description
+ if not (name == nil or name == "" or def.groups.not_in_creative_inventory) then
+ if help.longdesc[id] ~= nil then
+ ld = help.longdesc[id]
+ end
+ if help.usagehelp[id] ~= nil then
+ uh = help.usagehelp[id]
+ end
+ local infotable = {
+ name = name,
+ data = {
+ longdesc = ld,
+ usagehelp = uh,
+ itemstring = id,
+ def = def,
+ }
+ }
+ doc.new_entry("craftitems", id, infotable)
end
end
end