Compare commits

...

5 Commits

Author SHA1 Message Date
Wuzzy d10efa7dc4 Use TRUE emphemeral sounds 2020-04-06 00:43:25 +02:00
Wuzzy 5dd6dc0993 Move to new translation system 2020-04-06 00:06:02 +02:00
Wuzzy b01b2989a2 Use ephemeral sounds 2020-04-06 00:03:32 +02:00
Wuzzy 58177b1086 Add disable_repair group 2018-10-16 12:58:50 +02:00
Wuzzy 9170c29506 Update for 0.4.16 settings syntax 2017-06-20 16:54:45 +02:00
6 changed files with 43 additions and 47 deletions

View File

@ -19,7 +19,6 @@ the installed mods.
* `technic`: For electronic point teleporter
* `mana`: For magic point teleporter
* `default` and `technic`: For crafting recipe for electronic point teleporter
* `intllib`: For simple translation of item names
Also supported (but not through a direct dependency) is the `doc_items` mod from the Documentation System modpack; help texts for all tools are provided.

View File

@ -1,4 +1,3 @@
intllib?
technic?
default?
mana?

View File

@ -1,10 +1,6 @@
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
local S = minetest.get_translator("teletool")
local REACH = 20.0
teletool = {}
@ -13,15 +9,15 @@ teletool.settings = {}
teletool.settings.avoid_collisions = true
teletool.settings.adjust_head = true
teletool.settings.cost_mana = 20
local avoid_collisions = minetest.setting_getbool("teletool_avoid_collisions")
local avoid_collisions = minetest.settings:get_bool("teletool_avoid_collisions")
if avoid_collisions ~= nil then
teletool.settings.avoid_collision = avoid_collisions
end
local adjust_head = minetest.setting_getbool("teletool_adjust_head")
local adjust_head = minetest.settings:get_bool("teletool_adjust_head")
if adjust_head ~= nil then
teletool.settings.adjust_head = adjust_head
end
local cost_mana = tonumber(minetest.setting_get("teletool_cost_mana"))
local cost_mana = tonumber(minetest.settings:get("teletool_cost_mana"))
if cost_mana ~= nil then
teletool.settings.cost_mana = cost_mana
end
@ -64,7 +60,7 @@ function teletool.teleport(player, pointed_thing)
maxsize=1.25,
texture = "teletool_particle_departure.png",
})
minetest.sound_play( {name="teletool_teleport1", gain=1}, {pos=src, max_hear_distance=12})
minetest.sound_play( {name="teletool_teleport1", gain=1}, {pos=src, max_hear_distance=12}, true)
player:setpos(dest)
minetest.add_particlespawner({
@ -80,7 +76,7 @@ function teletool.teleport(player, pointed_thing)
maxsize=1.25,
texture = "teletool_particle_arrival.png",
})
minetest.after(0.5, function(dest) minetest.sound_play( {name="teletool_teleport2", gain=1}, {pos=dest, max_hear_distance=12}) end, dest)
minetest.after(0.5, function(dest) minetest.sound_play( {name="teletool_teleport2", gain=1}, {pos=dest, max_hear_distance=12}, true) end, dest)
return true
end
@ -96,7 +92,7 @@ minetest.register_tool("teletool:teletool_infinite", {
description = S("Infinite point teleporter"),
_doc_items_longdesc = desc_inf,
_doc_items_usagehelp = use_inf,
range = 20.0,
range = REACH,
tool_capabilities = {},
wield_image = "teletool_teletool_infinite.png",
inventory_image = "teletool_teletool_infinite.png",
@ -108,11 +104,11 @@ minetest.register_tool("teletool:teletool_infinite", {
failure = true
end
if failure then
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4})
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, true)
end
return itemstack
end,
groups = { teletool = 1 },
groups = { teletool = 1, disable_repair = 1 },
})
@ -128,7 +124,7 @@ if(minetest.get_modpath("technic")) then
description = S("Electronic point teleporter"),
_doc_items_longdesc = desc_technic,
_doc_items_usagehelp = use_technic,
range = 20.0,
range = REACH,
tool_capabilities = {},
wield_image = "teletool_teletool_technic.png",
inventory_image = "teletool_teletool_technic.png",
@ -152,11 +148,11 @@ if(minetest.get_modpath("technic")) then
failure = true
end
if failure then
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4})
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, true)
end
return itemstack
end,
groups = { teletool = 1 },
groups = { teletool = 1, disable_repair = 1 },
-- Technic data
wear_represents = "technic_RE_charge",
@ -174,7 +170,7 @@ if(minetest.get_modpath("mana") ~= nil) then
description = S("Magical point teleporter"),
_doc_items_longdesc = desc_mana,
_doc_items_usagehelp = use_mana,
range = 20.0,
range = REACH,
tool_capabilities = {},
wield_image = "teletool_teletool_mana.png",
inventory_image = "teletool_teletool_mana.png",
@ -193,11 +189,11 @@ if(minetest.get_modpath("mana") ~= nil) then
failure = true
end
if failure then
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4})
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, true)
end
return itemstack
end,
groups = { teletool = 1 },
groups = { teletool = 1, disable_repair = 1 },
})
end

View File

@ -1,12 +0,0 @@
Electronic point teleporter = Elektronischer Zeigeteleporter
Magical point teleporter = Magischer Zeigeteleporter
Infinite point teleporter = Unendlicher Zeigeteleporter
Point teleporters are short-range teleportation devices which allow the user to teleport instantly towards a block they point at. = Zeigeteleporter sind Teleportationsgeräte für kurze Entfernungen, welche es ihren Benutzern ermöglichen, sich sofort zu einem Block, auf dem sie zeigen, zu teleportieren.
Infinite point teleporters are very powerful, they can be used without limits. = Unendliche Zeigeteleporter sind sehr mächtig, sie können unbegrenzt verwendet werden.
Magical point teleporters are fueled by mana and require %d mana per teleportation. = Magische Zeigeteleporter werden von Mana angetrieben und erfordern %d Mana pro Teleportation.
Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times. = Elektronische Zeigeteleporter werden von Elektrizität angetrieben und müssen zuerst aufgeladen werden. Voll aufgeladen können sie ca. 50 mal benutzt werden.
To use this tool, point to a face of a block and punch to teleport in front of it. The target location must have a minimum amount of space for you to stand in, otherwise, teleportation will fail. = Um dieses Werkzeug zu benutzen, zeigen Sie auf eine Seite eines Blockes, und schlagen Sie, um sich direkt davor zu teleportieren. Der Zielort muss genügend Platz haben, damit Sie darin stehen können, ansonsten wird die Teleportation fehlschlagen.
To recharge this tool, place it in a powered battery box. = Um dieses Werkzeug wiederaufzuladen, platzieren Sie es in einer mit Strom versorgten Batteriebox.
First make sure you have at least %d mana. = Stellen Sie zunächst sicher, dass Sie mindestens %d Mana haben.
What an awesome device! = Was für ein tolles Gerät!
Craft an electronic point teleporter. = Fertigen Sie einen elektronischen Zeigeteleporter.

13
locale/teletool.de.tr Normal file
View File

@ -0,0 +1,13 @@
# textdomain:teletool
Electronic point teleporter=Elektronischer Zeigeteleporter
Magical point teleporter=Magischer Zeigeteleporter
Infinite point teleporter=Unendlicher Zeigeteleporter
Point teleporters are short-range teleportation devices which allow the user to teleport instantly towards a block they point at.=Zeigeteleporter sind Teleportationsgeräte für kurze Entfernungen, welche es ihren Benutzern ermöglichen, sich sofort zu einem Block, auf dem sie zeigen, zu teleportieren.
Infinite point teleporters are very powerful, they can be used without limits.=Unendliche Zeigeteleporter sind sehr mächtig, sie können unbegrenzt verwendet werden.
Magical point teleporters are fueled by mana and require @1 mana per teleportation.=Magische Zeigeteleporter werden von Mana angetrieben und erfordern @1 Mana pro Teleportation.
Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.=Elektronische Zeigeteleporter werden von Elektrizität angetrieben und müssen zuerst aufgeladen werden. Voll aufgeladen können sie ca. 50 mal benutzt werden.
To use this tool, point to a face of a block and punch to teleport in front of it. The target location must have a minimum amount of space for you to stand in, otherwise, teleportation will fail.=Um dieses Werkzeug zu benutzen, zeigen Sie auf eine Seite eines Blockes, und schlagen Sie, um sich direkt davor zu teleportieren. Der Zielort muss genügend Platz haben, damit Sie darin stehen können, ansonsten wird die Teleportation fehlschlagen.
To recharge this tool, place it in a powered battery box.=Um dieses Werkzeug wiederaufzuladen, platzieren Sie es in einer mit Strom versorgten Batteriebox.
First make sure you have at least @1 mana.=Stellen Sie zunächst sicher, dass Sie mindestens @1 Mana haben.
What an awesome device!=Was für ein tolles Gerät!
Craft an electronic point teleporter.=Fertigen Sie einen elektronischen Zeigeteleporter.

View File

@ -1,12 +1,13 @@
Infinite point teleporter
Electronic point teleporter
Magical point teleporter
Point teleporters are short-range teleportation devices which allow the user to teleport instantly towards a block they point at.
Infinite point teleporters are very powerful, they can be used without limits.
Magical point teleporters are fueled by mana and require %d mana per teleportation.
Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.
To use this tool, point to a face of a block and punch to teleport in front of it. The target location must have a minimum amount of space for you to stand in, otherwise, teleportation will fail.
To recharge this tool, place it in a powered battery box.
First make sure you have at least %d mana.
What an awesome device!
Craft an electronic point teleporter.
# textdomain:teletool
Infinite point teleporter=
Electronic point teleporter=
Magical point teleporter=
Point teleporters are short-range teleportation devices which allow the user to teleport instantly towards a block they point at.=
Infinite point teleporters are very powerful, they can be used without limits.=
Magical point teleporters are fueled by mana and require @1 mana per teleportation.=
Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.=
To use this tool, point to a face of a block and punch to teleport in front of it. The target location must have a minimum amount of space for you to stand in, otherwise, teleportation will fail.=
To recharge this tool, place it in a powered battery box.=
First make sure you have at least @1 mana.=
What an awesome device!=
Craft an electronic point teleporter.=