add translation support
This commit is contained in:
parent
e382ece1f3
commit
22e02b5336
18
items.lua
18
items.lua
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
local S = minetest.get_translator("bows")
|
||||||
|
|
||||||
-- detect feather item to use
|
-- detect feather item to use
|
||||||
|
|
||||||
local feather = "default:leaves"
|
local feather = "default:leaves"
|
||||||
@ -26,7 +28,7 @@ minetest.register_craft({
|
|||||||
-- wooden bow
|
-- wooden bow
|
||||||
|
|
||||||
bows.register_bow("bow_wood",{
|
bows.register_bow("bow_wood",{
|
||||||
description = "Wooden bow",
|
description = S("Wooden bow"),
|
||||||
texture = "bows_bow.png",
|
texture = "bows_bow.png",
|
||||||
texture_loaded = "bows_bow_loaded.png",
|
texture_loaded = "bows_bow_loaded.png",
|
||||||
uses = 50,
|
uses = 50,
|
||||||
@ -47,7 +49,7 @@ minetest.register_craft({
|
|||||||
-- steel bow
|
-- steel bow
|
||||||
|
|
||||||
bows.register_bow("bow_steel",{
|
bows.register_bow("bow_steel",{
|
||||||
description = "Steel bow",
|
description = S("Steel bow"),
|
||||||
texture = "bows_bow_steel.png",
|
texture = "bows_bow_steel.png",
|
||||||
texture_loaded = "bows_bow_loaded_steel.png",
|
texture_loaded = "bows_bow_loaded_steel.png",
|
||||||
uses = 280,
|
uses = 280,
|
||||||
@ -62,7 +64,7 @@ bows.register_bow("bow_steel",{
|
|||||||
-- bronze bow
|
-- bronze bow
|
||||||
|
|
||||||
bows.register_bow("bow_bronze",{
|
bows.register_bow("bow_bronze",{
|
||||||
description = "Bronze bow",
|
description = S("Bronze bow"),
|
||||||
texture = "bows_bow_bronze.png",
|
texture = "bows_bow_bronze.png",
|
||||||
texture_loaded = "bows_bow_loaded_bronze.png",
|
texture_loaded = "bows_bow_loaded_bronze.png",
|
||||||
uses = 140,
|
uses = 140,
|
||||||
@ -77,7 +79,7 @@ bows.register_bow("bow_bronze",{
|
|||||||
-- special David BOWie (lucky block drop)
|
-- special David BOWie (lucky block drop)
|
||||||
|
|
||||||
bows.register_bow("bow_bowie",{
|
bows.register_bow("bow_bowie",{
|
||||||
description = "David BOWie",
|
description = S("David BOWie"),
|
||||||
texture = "bows_bow_bowie.png",
|
texture = "bows_bow_bowie.png",
|
||||||
texture_loaded = "bows_bow_loaded_bowie.png",
|
texture_loaded = "bows_bow_loaded_bowie.png",
|
||||||
uses = 500,
|
uses = 500,
|
||||||
@ -87,7 +89,7 @@ bows.register_bow("bow_bowie",{
|
|||||||
-- wooden arrow
|
-- wooden arrow
|
||||||
|
|
||||||
bows.register_arrow("arrow",{
|
bows.register_arrow("arrow",{
|
||||||
description = "Arrow",
|
description = S("Wooden arrow"),
|
||||||
texture = "bows_arrow_wood.png",
|
texture = "bows_arrow_wood.png",
|
||||||
damage = 2,
|
damage = 2,
|
||||||
craft_count = 4,
|
craft_count = 4,
|
||||||
@ -121,7 +123,7 @@ minetest.register_craft({
|
|||||||
-- steel arrow
|
-- steel arrow
|
||||||
|
|
||||||
bows.register_arrow("arrow_steel",{
|
bows.register_arrow("arrow_steel",{
|
||||||
description = "Steel arrow",
|
description = S("Steel arrow"),
|
||||||
texture = "bows_arrow_wood.png^[colorize:#FFFFFFcc",
|
texture = "bows_arrow_wood.png^[colorize:#FFFFFFcc",
|
||||||
damage = 6,
|
damage = 6,
|
||||||
craft_count = 4,
|
craft_count = 4,
|
||||||
@ -146,7 +148,7 @@ bows.register_arrow("arrow_steel",{
|
|||||||
-- mese arrow (enables node mesecons when hit)
|
-- mese arrow (enables node mesecons when hit)
|
||||||
|
|
||||||
bows.register_arrow("arrow_mese",{
|
bows.register_arrow("arrow_mese",{
|
||||||
description = "Mese arrow",
|
description = S("Mese arrow"),
|
||||||
texture = "bows_arrow_wood.png^[colorize:#e3ff00cc",
|
texture = "bows_arrow_wood.png^[colorize:#e3ff00cc",
|
||||||
damage = 7,
|
damage = 7,
|
||||||
craft_count = 4,
|
craft_count = 4,
|
||||||
@ -173,7 +175,7 @@ bows.register_arrow("arrow_mese",{
|
|||||||
-- diamond arrow (breaks glass node when hit)
|
-- diamond arrow (breaks glass node when hit)
|
||||||
|
|
||||||
bows.register_arrow("arrow_diamond",{
|
bows.register_arrow("arrow_diamond",{
|
||||||
description = "Diamond arrow",
|
description = S("Diamond arrow"),
|
||||||
texture = "bows_arrow_wood.png^[colorize:#15d7c2cc",
|
texture = "bows_arrow_wood.png^[colorize:#15d7c2cc",
|
||||||
damage = 8,
|
damage = 8,
|
||||||
craft_count = 4,
|
craft_count = 4,
|
||||||
|
11
locale/template.txt
Normal file
11
locale/template.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# textdomain: bows
|
||||||
|
|
||||||
|
Wooden bow=
|
||||||
|
Steel bow=
|
||||||
|
Bronze bow=
|
||||||
|
David BOWie=
|
||||||
|
Wooden arrow=
|
||||||
|
Steel arrow=
|
||||||
|
Mese arrow=
|
||||||
|
Diamond arrow=
|
||||||
|
You took an arrow to the knee!
|
@ -1,7 +1,30 @@
|
|||||||
|
|
||||||
|
local S = minetest.get_translator("bows")
|
||||||
|
|
||||||
|
-- custom lb function
|
||||||
|
|
||||||
|
local function arrow_to_knee(pos, player)
|
||||||
|
|
||||||
|
local ppos = player:get_pos()
|
||||||
|
|
||||||
|
player:punch(player, 1.0, {
|
||||||
|
full_punch_interval = 1.0,
|
||||||
|
damage_groups = {fleshy = 6}
|
||||||
|
}, nil)
|
||||||
|
|
||||||
|
minetest.sound_play("player_damage",
|
||||||
|
{pos = ppos, gain = 1.0, max_hear_distance = 10}, true)
|
||||||
|
|
||||||
|
minetest.chat_send_player(player:get_player_name(),
|
||||||
|
lucky_block.green .. S("You took an arrow to the knee!"))
|
||||||
|
|
||||||
|
minetest.add_item(ppos, "bows:arrow_steel")
|
||||||
|
end
|
||||||
|
|
||||||
-- add lucky blocks
|
-- add lucky blocks
|
||||||
|
|
||||||
lucky_block:add_blocks({
|
lucky_block:add_blocks({
|
||||||
|
{"cus", arrow_to_knee},
|
||||||
{"dro", {"bows:bow_wood"}},
|
{"dro", {"bows:bow_wood"}},
|
||||||
{"dro", {"bows:bow_steel"}},
|
{"dro", {"bows:bow_steel"}},
|
||||||
{"dro", {"bows:bow_bronze"}},
|
{"dro", {"bows:bow_bronze"}},
|
||||||
@ -17,6 +40,6 @@ lucky_block:add_blocks({
|
|||||||
{name = "default:mese_crystal_fragment", max = 5},
|
{name = "default:mese_crystal_fragment", max = 5},
|
||||||
{name = "farming:string", max = 5},
|
{name = "farming:string", max = 5},
|
||||||
{name = bows.feather, max = 5},
|
{name = bows.feather, max = 5},
|
||||||
{name = "bows:bow_bowie", max = 1, chance = 4}
|
{name = "bows:bow_bowie", max = 1, chance = 5}
|
||||||
}},
|
}}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user