Add better compass help

master
Wuzzy 2022-05-03 10:43:05 +02:00
parent def9476177
commit e4034e88cb
4 changed files with 32 additions and 3 deletions

View File

@ -181,7 +181,21 @@ for _, npc_type_table in pairs(npc_types) do
say_random("happy", name)
end
elseif minetest.get_item_group(iname, "nav_compass") == 1 then
say(S("Try magnetizing it on a wrought iron block"), name)
local r = math.random(1,3)
if r == 1 then
say(S("Try magnetizing it on a wrought iron block"), name)
elseif r == 2 then
say(S("Try magnetizing it on a steel block"), name)
else
say(S("Try magnetizing it on a carbon steel block"), name)
end
elseif minetest.get_item_group(iname, "nav_compass") == 2 then
local r = math.random(1,3)
if r == 1 then
say(S("If you use it on a cotton bale, it will point to the North again"), name)
else
say(S("If you use it on wool, it will point to the North again"), name)
end
elseif iname == "rp_nav:map" then
say(S("We live in a lovely place, don't we?"), name)
elseif iname == "mobs:lasso" then

View File

@ -104,9 +104,9 @@ local wield_imgs_magno = {
}
local d = S("Compass")
local t = S("It points to the North")
local t = S("It points to the North") .. "\n" .. S("Can be magnetized at magnetic blocks")
local dm = S("Magno Compass")
local tm = S("It points to a position")
local tm = S("It points to a position") .. "\n" .. S("Can be demagnetized at unmagnetic blocks")
for c=0,7 do
local magnetize_on_place = function(itemstack, placer, pointed_thing)

12
mods/rp_tt/init.lua Normal file
View File

@ -0,0 +1,12 @@
local S = minetest.get_translator("rp_tt")
tt.register_snippet(function(itemstring)
local magnetic = minetest.get_item_group(itemstring, "magnetic") > 0
local unmagnetic = minetest.get_item_group(itemstring, "unmagnetic") > 0
local str = nil
if magnetic then
str = S("Magnetic")
elseif unmagnetic then
str = S("Unmagnetic")
end
return str
end)

3
mods/rp_tt/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = rp_tt
depends = tt
description = Tooltip extras for Repixture