0.9.6 - configurable

This commit is contained in:
echoes91 2015-03-14 11:49:06 +01:00
parent a9b795b9f9
commit 3fc8db2ac0
5 changed files with 187 additions and 147 deletions

View File

@ -15,7 +15,7 @@ Every shoot will take 1 arrow from your inventory and wears out the bow.
License:
This mod was originally published by Jeija and reworked by PilzAdam
Sourcecode: WTFPL (see below)
Grahpics & sounds: WTFPL (see below)
Grahpics & sounds: CC-BY 3.0 (see http://creativecommons.org/licenses/by/3.0/legalcode)
See also:
http://minetest.net/
@ -33,3 +33,4 @@ http://minetest.net/
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -30,14 +30,16 @@ local throwing_shoot_arrow = function(itemstack, player)
return false
end
local function reloading ()
local function reloading (user)
minetest.after(reload, function()
bow_idle=true
--~ minetest.chat_send_player(user:get_player_name(), "Reloaded!")
end)
end
if not disable_wooden_bow then
minetest.register_tool("throwing:bow_wood", {
description = "Wood Bow",
description = "Wooden Bow",
inventory_image = "throwing_bow_wood.png",
wield_scale = {x=1, y=1, z=0.5},
stack_max = 1,
@ -45,7 +47,7 @@ minetest.register_tool("throwing:bow_wood", {
stiffness = 13
reload = 1.1
if throwing_shoot_arrow(itemstack, user, pointed_thing) then
reloading()
reloading(user)
if not minetest.setting_getbool("creative_mode") then
itemstack:add_wear(65535/80)
end
@ -71,14 +73,16 @@ minetest.register_craft({
{'', 'group:wood', 'farming:string'},
}
})
end
if not disable_steel_bow then
minetest.register_tool("throwing:bow_steel", {
description = "Steel Bow",
inventory_image = "throwing_bow_steel.png",
wield_scale = {x=1, y=1, z=0.5},
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
stiffness = 17
stiffness = 19
reload = 1.6
if throwing_shoot_arrow(itemstack, user, pointed_thing) then
reloading()
@ -107,14 +111,16 @@ minetest.register_craft({
{'', 'default:steel_ingot', 'farming:string'},
}
})
end
if not disable_composite_bow then
minetest.register_tool("throwing:bow_composite", {
description = "Composite Bow",
inventory_image = "throwing_bow_composite.png",
wield_scale = {x=1, y=1, z=0.5},
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
stiffness = 16
stiffness = 18
reload = 1.3
if throwing_shoot_arrow(itemstack, user, pointed_thing) then
reloading()
@ -143,7 +149,9 @@ minetest.register_craft({
{'', 'group:wood', 'farming:string'},
}
})
end
if not disable_golden_bow then
minetest.register_tool("throwing:bow_gold", {
description = "Golden Bow",
inventory_image = "throwing_bow_gold.png",
@ -179,3 +187,5 @@ minetest.register_craft({
{'', 'default:gold_ingot', 'farming:string'},
}
})
end

5
config.lua Normal file
View File

@ -0,0 +1,5 @@
--~ Write an (uncommented) line like these to disable any bow or arrow:
--~
--~ disable_tnt_arrow = true
--~
--~ disable_composite_bow = true

View File

@ -10,20 +10,44 @@ arrows = {
{"throwing:arrow_torch", "throwing:arrow_torch_entity"},
{"throwing:arrow_diamond", "throwing:arrow_diamond_entity"},
{"throwing:arrow_shell", "throwing:arrow_shell_entity"},
{"throwing:arrow_fireworks_blue", "throwing:arrow_fireworks_blue_entity"},
}
dofile(minetest.get_modpath("throwing").."/config.lua")
dofile(minetest.get_modpath("throwing").."/bows.lua")
if not disable_steel_arrow then
dofile(minetest.get_modpath("throwing").."/steel_arrow.lua")
end
if not disable_stone_arrow then
dofile(minetest.get_modpath("throwing").."/stone_arrow.lua")
end
if not disable_stone_arrow then
dofile(minetest.get_modpath("throwing").."/obsidian_arrow.lua")
end
if not disable_fire_arrow then
dofile(minetest.get_modpath("throwing").."/fire_arrow.lua")
end
if not disable_teleport_arrow then
dofile(minetest.get_modpath("throwing").."/teleport_arrow.lua")
end
if not disable_dig_arrow then
dofile(minetest.get_modpath("throwing").."/dig_arrow.lua")
end
if not disable_build_arrow then
dofile(minetest.get_modpath("throwing").."/build_arrow.lua")
end
if not disable_tnt_arrow then
dofile(minetest.get_modpath("throwing").."/tnt_arrow.lua")
end
if not disable_torch_arrow then
dofile(minetest.get_modpath("throwing").."/torch_arrow.lua")
end
if not disable_diamond_arrow then
dofile(minetest.get_modpath("throwing").."/diamond_arrow.lua")
end
if not disable_shell_arrow then
dofile(minetest.get_modpath("throwing").."/shell_arrow.lua")
end
if minetest.setting_get("log_mods") then