Compare commits
10 Commits
89b63ce26d
...
534c441ab8
Author | SHA1 | Date | |
---|---|---|---|
|
534c441ab8 | ||
|
3f6bcb065c | ||
|
ebd18bf3df | ||
|
0795e964f0 | ||
|
1005c406b1 | ||
|
a3ff3f290e | ||
|
1d43fb5334 | ||
|
49a9f7debd | ||
|
3f568c0d5b | ||
|
31e522dcb2 |
2
.mailmap
Normal file
2
.mailmap
Normal file
@ -0,0 +1,2 @@
|
||||
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
|
||||
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>
|
17
README.md
17
README.md
@ -1,7 +1,9 @@
|
||||
# Point Teleporter [teletool]
|
||||
Version: 1.3
|
||||
|
||||
Version: 1.5
|
||||
|
||||
## Description
|
||||
|
||||
This mod adds a new tool: The point teleporter. It is a tool which allows for short-range teleportation.
|
||||
To use it, leftclick with it on any pointed node, you will be teleported next to surface of the node you have clicked.
|
||||
The point teleporter has a range of 20 node lengths, but you cannot dig or attack while holding it.
|
||||
@ -13,6 +15,7 @@ Point teleporters comes in three varieties, which only differ in how often you c
|
||||
* Electronic point teleporter: It has to be charged at a battery station first. A charged one grants you about 50 teleportations. This point teleporter can be crafted.
|
||||
|
||||
## Dependencies
|
||||
|
||||
All dependencies are optional. The infinite point teleporter is always available, the existance of the other point teleporters depends on
|
||||
the installed mods.
|
||||
|
||||
@ -21,11 +24,13 @@ the installed mods.
|
||||
* `default` and `technic`: For crafting recipe for electronic point teleporter
|
||||
|
||||
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.
|
||||
It also supports the `tt` mod for tooltip extensions.
|
||||
|
||||
## Configuration
|
||||
You probably do not need to configure the mod, and the settings are mostly only provided for testing and using the default
|
||||
configuration is recommended. But you can change it anyways, if you wish. Configuration is done via ordinary `minetest.conf` variables:
|
||||
|
||||
* `teletool_avoid_collisions`: Boolean. If `true`, it is not possible to teleport somewhere where you would collide with a node. Default: `true`.
|
||||
* `teletool_adjust_head`: Boolean. If `true`, you will be teleported one node lower if you clicked on the lower side of a node. Otherwise, your “head” will be initially “stuck” in the node. Default: `true`.
|
||||
* `teletool_cost_mana`: Number. Cost of mana for the magic point teleporter. Default: `20`.
|
||||
You probably do not need to configure the mod, and the settings are mostly only provided for testing and using the default
|
||||
configuration is recommended. But you can change it anyways, if you wish. Look up the settings in the Minetest settings menu.
|
||||
|
||||
## License
|
||||
|
||||
This mod (code, sound, graphics, texts) is released under the MIT License.
|
||||
|
28
init.lua
28
init.lua
@ -25,7 +25,7 @@ end
|
||||
|
||||
function teletool.teleport(player, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
local src = player:getpos()
|
||||
local src = player:get_pos()
|
||||
local dest = {x=pos.x, y=math.ceil(pos.y)-0.5, z=pos.z}
|
||||
local over = {x=dest.x, y=dest.y+1, z=dest.z}
|
||||
local destnode = minetest.get_node({x=dest.x, y=math.ceil(dest.y), z=dest.z})
|
||||
@ -62,7 +62,7 @@ function teletool.teleport(player, pointed_thing)
|
||||
})
|
||||
minetest.sound_play( {name="teletool_teleport1", gain=1}, {pos=src, max_hear_distance=12}, true)
|
||||
|
||||
player:setpos(dest)
|
||||
player:set_pos(dest)
|
||||
minetest.add_particlespawner({
|
||||
amount = 25,
|
||||
time = 0.1,
|
||||
@ -90,6 +90,8 @@ local use_inf = baseuse
|
||||
|
||||
minetest.register_tool("teletool:teletool_infinite", {
|
||||
description = S("Infinite point teleporter"),
|
||||
-- Special fields for [tt] and [doc_items] mods
|
||||
_tt_help = S("Punch location to teleport"),
|
||||
_doc_items_longdesc = desc_inf,
|
||||
_doc_items_usagehelp = use_inf,
|
||||
range = REACH,
|
||||
@ -104,7 +106,7 @@ 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}, true)
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:get_pos(), max_hear_distance=4}, true)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
@ -115,13 +117,15 @@ minetest.register_tool("teletool:teletool_infinite", {
|
||||
if(minetest.get_modpath("technic")) then
|
||||
technic.register_power_tool("teletool:teletool_technic", 50000)
|
||||
|
||||
local technic = S("Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.")
|
||||
local technichelp = S("Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.")
|
||||
local technicuse = S("To recharge this tool, place it in a powered battery box.")
|
||||
local desc_technic = base .. "\n" .. technic
|
||||
local desc_technic = base .. "\n" .. technichelp
|
||||
local use_technic = technicuse .. " " .. baseuse
|
||||
|
||||
minetest.register_tool("teletool:teletool_technic", {
|
||||
description = S("Electronic point teleporter"),
|
||||
-- Special fields for [tt] and [doc_items] mods
|
||||
_tt_help = S("Punch location to teleport").."\n"..S("Must be charged in a battery box"),
|
||||
_doc_items_longdesc = desc_technic,
|
||||
_doc_items_usagehelp = use_technic,
|
||||
range = REACH,
|
||||
@ -137,7 +141,7 @@ if(minetest.get_modpath("technic")) then
|
||||
elseif meta.charge >= 1000 then
|
||||
meta.charge = meta.charge - 1000
|
||||
failure = not teletool.teleport(user, pointed_thing)
|
||||
if not failure then
|
||||
if not failure and not technic.creative_mode then
|
||||
technic.set_RE_wear(itemstack, meta.charge, 50000)
|
||||
itemstack:set_metadata(minetest.serialize(meta))
|
||||
end
|
||||
@ -148,7 +152,7 @@ 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}, true)
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:get_pos(), max_hear_distance=4}, true)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
@ -156,18 +160,20 @@ if(minetest.get_modpath("technic")) then
|
||||
|
||||
-- Technic data
|
||||
wear_represents = "technic_RE_charge",
|
||||
on_refill = technic.refill_RE_charge
|
||||
on_refill = technic.refill_RE_charge,
|
||||
})
|
||||
end
|
||||
|
||||
if(minetest.get_modpath("mana") ~= nil) then
|
||||
local dmana = string.format(S("Magical point teleporters are fueled by mana and require %d mana per teleportation."), teletool.settings.cost_mana)
|
||||
local manause = string.format(S("First make sure you have at least %d mana."), teletool.settings.cost_mana)
|
||||
local dmana = S("Magical point teleporters are fueled by mana and require @1 mana per teleportation.", string.format("%d", teletool.settings.cost_mana))
|
||||
local manause = S("First make sure you have at least @1 mana.", string.format("%d", teletool.settings.cost_mana))
|
||||
local desc_mana = base .. "\n" .. dmana
|
||||
local use_mana = manause .. " " .. baseuse
|
||||
|
||||
minetest.register_tool("teletool:teletool_mana", {
|
||||
description = S("Magical point teleporter"),
|
||||
-- Special fields for [tt] and [doc_items] mods
|
||||
_tt_help = S("Punch location to teleport").."\n"..S("Mana cost: @1", teletool.settings.cost_mana),
|
||||
_doc_items_longdesc = desc_mana,
|
||||
_doc_items_usagehelp = use_mana,
|
||||
range = REACH,
|
||||
@ -189,7 +195,7 @@ 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}, true)
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:get_pos(), max_hear_distance=4}, true)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
|
@ -1,13 +1,16 @@
|
||||
# textdomain:teletool
|
||||
Electronic point teleporter=Elektronischer Zeigeteleporter
|
||||
Magical point teleporter=Magischer Zeigeteleporter
|
||||
Infinite point teleporter=Unendlicher Zeigeteleporter
|
||||
# textdomain: teletool
|
||||
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.
|
||||
Infinite point teleporter=Unendlicher Zeigeteleporter
|
||||
Punch location to teleport=Ziel hauen, um zu teleportieren
|
||||
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 recharge this tool, place it in a powered battery box.=Um dieses Werkzeug wiederaufzuladen, platzieren Sie es in einer mit Strom versorgten Batteriebox.
|
||||
Electronic point teleporter=Elektronischer Zeigeteleporter
|
||||
Must be charged in a battery box=Muss in einer Batteriebox aufgeladen 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.
|
||||
First make sure you have at least @1 mana.=Stellen Sie zunächst sicher, dass Sie mindestens @1 Mana haben.
|
||||
Magical point teleporter=Magischer Zeigeteleporter
|
||||
Mana cost: @1=Manakosten: @1
|
||||
What an awesome device!=Was für ein tolles Gerät!
|
||||
Craft an electronic point teleporter.=Fertigen Sie einen elektronischen Zeigeteleporter.
|
||||
|
@ -1,13 +1,16 @@
|
||||
# textdomain:teletool
|
||||
Infinite point teleporter=
|
||||
Electronic point teleporter=
|
||||
Magical point teleporter=
|
||||
# textdomain: teletool
|
||||
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.=
|
||||
Infinite point teleporter=
|
||||
Punch location to teleport=
|
||||
Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.=
|
||||
To recharge this tool, place it in a powered battery box.=
|
||||
Electronic point teleporter=
|
||||
Must be charged in a battery box=
|
||||
Magical point teleporters are fueled by mana and require @1 mana per teleportation.=
|
||||
First make sure you have at least @1 mana.=
|
||||
Magical point teleporter=
|
||||
Mana cost: @1=
|
||||
What an awesome device!=
|
||||
Craft an electronic point teleporter.=
|
||||
|
3
mod.conf
3
mod.conf
@ -1,3 +1,4 @@
|
||||
name = teletool
|
||||
title = Point Teleporter
|
||||
description = Adds a short-distance teleportation device which allows the user to instantly change the position in front of a pointed node.
|
||||
optional_depends = technic, default, mana, awards
|
||||
optional_depends = technic, default, mana, awards, doc_items, tt
|
||||
|
8
settingtypes.txt
Normal file
8
settingtypes.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# If true, it is not possible to teleport somewhere where you would collide with a node.
|
||||
teletool_avoid_collisions (Avoid collisions) bool true
|
||||
|
||||
# If true, you will be teleported one node lower if you clicked on the lower side of a node. Otherwise, your “head” will be initially “stuck” in the node.
|
||||
teletool_adjust_head (Adjust head position after teleport) bool true
|
||||
|
||||
# Cost of mana for the magic point teleporter. Only relevant if the mana mod is used.
|
||||
teletool_cost_mana (Magic point teleporter mana cost) int 20 0
|
Loading…
x
Reference in New Issue
Block a user