mirror of
https://github.com/minetest-mods/throwing.git
synced 2025-01-24 09:00:21 +01:00
Add a "uses" field, add a gold bow
This commit is contained in:
parent
ccd667f9b7
commit
541f102b15
@ -36,6 +36,7 @@ Definition: definition table, containing:
|
||||
* description (highly recommended): description of the bow.
|
||||
* texture (essential): texture of the bow, shown in inventory.
|
||||
* groups (optional): groups of the item.
|
||||
* uses: number of uses of the bow (default is 50).
|
||||
* allow_shot (optional): function(player, itemstack):
|
||||
- player: the player using the bow
|
||||
- itemstack: the itemstack of the bow
|
||||
|
4
init.lua
4
init.lua
@ -310,7 +310,7 @@ function throwing.register_bow(name, def)
|
||||
end
|
||||
if shoot_arrow(itemstack, user, def.throw_itself) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535/30)
|
||||
itemstack:add_wear(65535 / (def.uses or 50))
|
||||
end
|
||||
end
|
||||
if def.throw_itself then
|
||||
@ -326,7 +326,7 @@ function throwing.register_bow(name, def)
|
||||
|
||||
if def.itemcraft then
|
||||
minetest.register_craft({
|
||||
output = throwing.modname..":"..name,
|
||||
output = name,
|
||||
recipe = {
|
||||
{"farming:cotton", def.itemcraft, ""},
|
||||
{"farming:cotton", "", def.itemcraft},
|
||||
|
@ -1,32 +1,44 @@
|
||||
throwing.register_bow("bow_wood", {
|
||||
itemcraft = "default:wood",
|
||||
description = "Wooden Bow",
|
||||
texture = "throwing_bow_wood.png"
|
||||
texture = "throwing_bow_wood.png",
|
||||
uses = 50
|
||||
})
|
||||
throwing.register_bow("bow_stone", {
|
||||
itemcraft = "default:cobble",
|
||||
description = "Stone Bow",
|
||||
texture = "throwing_bow_stone.png"
|
||||
texture = "throwing_bow_stone.png",
|
||||
uses = 100
|
||||
})
|
||||
throwing.register_bow("bow_steel", {
|
||||
itemcraft = "default:steel_ingot",
|
||||
description = "Steel Bow",
|
||||
texture = "throwing_bow_steel.png"
|
||||
texture = "throwing_bow_steel.png",
|
||||
uses = 150
|
||||
})
|
||||
throwing.register_bow("bow_bronze", {
|
||||
itemcraft = "default:bronze_ingot",
|
||||
description = "Bronze Bow",
|
||||
texture = "throwing_bow_bronze.png"
|
||||
texture = "throwing_bow_bronze.png",
|
||||
uses = 200
|
||||
})
|
||||
throwing.register_bow("bow_gold", {
|
||||
itemcraft = "default:gold_ingot",
|
||||
description = "Gold Bow",
|
||||
texture = "throwing_bow_gold.png",
|
||||
uses = 250
|
||||
})
|
||||
throwing.register_bow("bow_mese", {
|
||||
itemcraft = "default:mese_crystal",
|
||||
description = "Mese Bow",
|
||||
texture = "throwing_bow_mese.png"
|
||||
texture = "throwing_bow_mese.png",
|
||||
uses = 300
|
||||
})
|
||||
throwing.register_bow("bow_diamond", {
|
||||
itemcraft = "default:diamond",
|
||||
description = "Diamond Bow",
|
||||
texture = "throwing_bow_diamond.png"
|
||||
texture = "throwing_bow_diamond.png",
|
||||
uses = 320
|
||||
})
|
||||
|
||||
local function get_setting(name)
|
||||
|
BIN
textures/throwing_bow_gold.png
Normal file
BIN
textures/throwing_bow_gold.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 466 B |
Loading…
Reference in New Issue
Block a user