Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev

This commit is contained in:
Sys Quatre 2020-06-14 21:18:55 +02:00
commit 8e8bf83689
10 changed files with 26 additions and 30 deletions

View File

@ -1,4 +0,0 @@
mana?
intllib?
doc?
doc_items?

View File

@ -1 +0,0 @@
Adds the “Mirror of Returning”, a magical item which teleports the user to a previously set location.

View File

@ -1,9 +1,4 @@
local S
if (minetest.get_modpath("intllib")) then
S = intllib.Getter()
else
S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
end
local S = minetest.get_translator("returnmirror")
local returnmirror = {}
returnmirror.cost_teleport = 200
@ -47,14 +42,14 @@ returnmirror.set_position_inactive = function(itemstack, user, pointed_thing)
end
end
local pos = user:getpos()
local pos = user:get_pos()
if returnmirror.mana_check(user, returnmirror.cost_set) then
local newitem = ItemStack("returnmirror:mirror_active")
newitem:set_metadata(minetest.pos_to_string(pos))
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12})
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}, true)
return newitem
else
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18})
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18}, true)
end
end
@ -72,10 +67,10 @@ returnmirror.set_position_active = function(itemstack, user, pointed_thing)
local pos = user:getpos()
if returnmirror.mana_check(user, returnmirror.cost_set) then
itemstack:set_metadata(minetest.pos_to_string(pos))
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12})
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}, true)
return itemstack
else
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18})
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18}, true)
end
end
@ -97,9 +92,10 @@ minetest.register_tool("returnmirror:mirror_inactive", {
inventory_image = "returnmirror_mirror_inactive.png",
wield_image = "returnmirror_mirror_inactive.png",
tool_capabilities = {},
groups = { disable_repair = 1 },
range = 2,
on_use = function(itemstack, user, pointed_thing)
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=user:getpos(), max_hear_distance=18})
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=user:getpos(), max_hear_distance=18}, true)
end,
on_place = returnmirror.set_position_inactive,
on_secondary_use = returnmirror.set_position_inactive,
@ -112,6 +108,7 @@ minetest.register_tool("returnmirror:mirror_active", {
inventory_image = "returnmirror_mirror_active.png",
wield_image = "returnmirror_mirror_active.png",
tool_capabilities = {},
groups = { disable_repair = 1 },
range = 2,
on_use = function(itemstack, user, pointed_thing)
local dest_string = itemstack:get_metadata()
@ -121,7 +118,7 @@ minetest.register_tool("returnmirror:mirror_active", {
if dest ~= nil then
if returnmirror.mana_check(user, returnmirror.cost_teleport) then
fail = false
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=src, max_hear_distance=30})
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=src, max_hear_distance=30}, true)
minetest.add_particlespawner({
amount = 50,
time = 0.1,
@ -136,7 +133,7 @@ minetest.register_tool("returnmirror:mirror_active", {
texture = "returnmirror_particle_departure.png",
})
user:setpos(dest)
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=dest, max_hear_distance=30})
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=dest, max_hear_distance=30}, true)
minetest.add_particlespawner({
amount = 100,
time = 0.1,
@ -153,7 +150,7 @@ minetest.register_tool("returnmirror:mirror_active", {
end
end
if fail then
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=src, max_hear_distance=18})
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=src, max_hear_distance=18}, true)
end
end,
on_place = returnmirror.set_position_active,

View File

@ -1,5 +0,0 @@
Mirror of Returning = Spiegel der Rückkehr
Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location. = Rechtsklicken, um die Teleportationsposition des Spiegels zu setzen. Linksklicken, um eine sofortige Teleportation zur Teleportationsposition des Spiegels vorzunehmen.
Setting the teleport location costs @1 mana, teleporting costs @2 mana. = Das Setzen der Teleportationsposition kostet @1 Mana. Das Teleportieren kostet @2 Mana.
This item allows to teleport its user back to a previously set location. = Dieser Gegenstand ermöglicht es seinem Benutzer, sich zu einer zuvor gesetzen Position zurück zu teleportieren.
This item allows to teleport the user back to a previously set location, at the cost of mana. = Dieser Gegenstand ermöglicht es dem Benutzer, sich auf Kosten von Mana zu einer zuvor gesetzten Position zurück zu teleportieren.

View File

@ -0,0 +1,6 @@
# textdomain:returnmirror
Mirror of Returning=Spiegel der Rückkehr
Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location.=Rechtsklicken, um die Teleportationsposition des Spiegels zu setzen. Linksklicken, um eine sofortige Teleportation zur Teleportationsposition des Spiegels vorzunehmen.
Setting the teleport location costs @1 mana, teleporting costs @2 mana.=Das Setzen der Teleportationsposition kostet @1 Mana. Das Teleportieren kostet @2 Mana.
This item allows to teleport its user back to a previously set location.=Dieser Gegenstand ermöglicht es seinem Benutzer, sich zu einer zuvor gesetzen Position zurück zu teleportieren.
This item allows to teleport the user back to a previously set location, at the cost of mana.=Dieser Gegenstand ermöglicht es dem Benutzer, sich auf Kosten von Mana zu einer zuvor gesetzten Position zurück zu teleportieren.

View File

@ -1,5 +1,6 @@
Mirror of Returning =
Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location. =
Setting the teleport location costs @1 mana, teleporting costs @2 mana. =
This item allows to teleport its user back to a previously set location. =
This item allows to teleport the user back to a previously set location, at the cost of mana. =
# textdomain:returnmirror
Mirror of Returning=
Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location.=
Setting the teleport location costs @1 mana, teleporting costs @2 mana.=
This item allows to teleport its user back to a previously set location.=
This item allows to teleport the user back to a previously set location, at the cost of mana.=

View File

@ -1 +1,3 @@
name = returnmirror
description = Adds the “Mirror of Returning”, a magical item which teleports the user to a previously set location.
optional_depends = mana, doc, doc_items

Binary file not shown.

Binary file not shown.

Binary file not shown.