Added functionality to register multiple bow recipes; added more recipes for low tier bows; improved overall balance, damages and durability; removed reversed crafting schematic for bows and arrows; improved dig arrow texture.
parent
90e875fe2c
commit
0730da8706
|
@ -33,3 +33,5 @@ DISABLE_MITHRIL_ARROW = minetest.settings:get("DISABLE_MITHRIL_ARROW") or false
|
|||
|
||||
-- Other
|
||||
THROWING_RECOVERY_CHANCE = minetest.settings:get("THROWING_RECOVERY_CHANCE") or 0.5
|
||||
DISABLE_MOREBLOCKS_CRAFT = minetest.settings:get("DISABLE_MOREBLOCKS_CRAFT") or false
|
||||
DISABLE_VINES_CRAFT = minetest.settings:get("DISABLE_VINES_CRAFT") or false
|
||||
|
|
|
@ -120,10 +120,3 @@ minetest.register_craft({
|
|||
{'default:stick', 'default:stick', 'default:pick_steel'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_dig 4',
|
||||
recipe = {
|
||||
{'default:pick_steel', 'default:stick', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -151,12 +151,6 @@ local function throwing_register_fireworks(color, color2, desc)
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_fireworks_' .. color,
|
||||
recipe = {
|
||||
{'dye:' .. color, 'group:coal', 'default:stick'},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
--~ Arrows
|
||||
|
|
|
@ -161,31 +161,24 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough
|
|||
end,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:' .. name,
|
||||
recipe = craft
|
||||
})
|
||||
|
||||
local craft_width = 1
|
||||
-- Since # isn't stable especially when there are nils in the table, count by hand
|
||||
for _,v in ipairs(craft) do
|
||||
for i,__ in ipairs(v) do
|
||||
if i > craft_width then
|
||||
craft_width = i
|
||||
end
|
||||
|
||||
for k,v in pairs(craft) do
|
||||
if v ~= nil then
|
||||
minetest.register_craft({
|
||||
output = 'throwing:' .. name,
|
||||
recipe = v
|
||||
})
|
||||
end
|
||||
end
|
||||
local rev_craft = {}
|
||||
for i,y in ipairs(craft) do
|
||||
rev_craft[i] = {}
|
||||
for j,x in ipairs(y) do
|
||||
rev_craft[i][craft_width-j+1] = x
|
||||
end
|
||||
end
|
||||
minetest.register_craft({
|
||||
output = 'throwing:' .. name,
|
||||
recipe = rev_craft
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
function retrieveCraft(schematic, modname)
|
||||
if modname ~= nil then
|
||||
if minetest.get_modpath(modname) then
|
||||
return schematic
|
||||
end
|
||||
else
|
||||
return schematic
|
||||
end
|
||||
end
|
||||
|
|
2
init.lua
2
init.lua
|
@ -51,6 +51,6 @@ if minetest.get_modpath('vines') and not DISABLE_ROPE_ARROW then
|
|||
dofile(minetest.get_modpath("throwing").."/rope_arrow.lua")
|
||||
end
|
||||
|
||||
if minetest.get_modpath('lightning') and not DISABLE_LIGHTNING_ARROW then
|
||||
if minetest.get_modpath('lightning') and minetest.get_modpath('lightning') and not DISABLE_LIGHTNING_ARROW then
|
||||
dofile(minetest.get_modpath("throwing").."/lightning_arrow.lua")
|
||||
end
|
||||
|
|
|
@ -125,7 +125,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
|||
puncher = minetest.get_player_by_name(self.player)
|
||||
end
|
||||
local speed = vector.length(self.object:getvelocity())
|
||||
local damage = ((speed + 20)^1.2)/10
|
||||
local damage = ((speed + 25)^1.2)/10
|
||||
obj:punch(puncher, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=damage},
|
||||
|
@ -161,9 +161,3 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_lightning',
|
||||
recipe = {
|
||||
{'default:obsidian_shard', 'default:mese_crystal', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -131,9 +131,3 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_rope',
|
||||
recipe = {
|
||||
{'vines:rope_block', 'default:stick', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -27,3 +27,7 @@ DISABLE_DIAMOND_ARROW (Disable Diamond Arrow) bool false
|
|||
DISABLE_MITHRIL_ARROW (Disable Mithril Arrow) bool false
|
||||
|
||||
THROWING_RECOVERY_CHANCE (Arrow Recovery Chance) float 0.3
|
||||
|
||||
DISABLE_MOREBLOCKS_CRAFT (Low level bow crafting with ropes from moreblocks) bool false
|
||||
|
||||
DISABLE_VINES_CRAFT (Low level bow crafting with vines from vines) bool false
|
||||
|
|
|
@ -123,13 +123,6 @@ end
|
|||
{'default:stick', 'default:stick', craft},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_' .. kind .. ' 4',
|
||||
recipe = {
|
||||
{craft, 'default:stick', 'default:stick'},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_STONE_ARROW then
|
||||
|
@ -137,15 +130,15 @@ if not DISABLE_STONE_ARROW then
|
|||
end
|
||||
|
||||
if not DISABLE_STEEL_ARROW then
|
||||
throwing_register_arrow_standard ('steel', 'Steel', 10, 'default:steel_ingot')
|
||||
throwing_register_arrow_standard ('steel', 'Steel', 12, 'default:steel_ingot')
|
||||
end
|
||||
|
||||
if not DISABLE_OBSIDIAN_ARROW then
|
||||
throwing_register_arrow_standard ('obsidian', 'Obsidian', 15, 'default:obsidian')
|
||||
throwing_register_arrow_standard ('obsidian', 'Obsidian', 18, 'default:obsidian')
|
||||
end
|
||||
|
||||
if not DISABLE_DIAMOND_ARROW then
|
||||
throwing_register_arrow_standard ('diamond', 'Diamond', 20, 'default:diamond')
|
||||
throwing_register_arrow_standard ('diamond', 'Diamond', 25, 'default:diamond')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('moreores') and not DISABLE_MITHRIL_ARROW then
|
||||
|
|
|
@ -121,13 +121,6 @@ minetest.register_entity("throwing:arrow_teleport_entity", THROWING_ARROW_ENTITY
|
|||
minetest.register_craft({
|
||||
output = 'throwing:arrow_teleport',
|
||||
recipe = {
|
||||
{'default:stick', 'default:stick', 'default:mese_crystal'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_teleport',
|
||||
recipe = {
|
||||
{'default:mese_crystal', 'default:stick', 'default:stick'}
|
||||
{'default:stick', 'default:copper_ingot', 'default:mese_crystal'}
|
||||
}
|
||||
})
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 241 B |
|
@ -180,9 +180,3 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_tnt',
|
||||
recipe = {
|
||||
{'default:bronze_ingot', 'group:coal', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
|
136
tools.lua
136
tools.lua
|
@ -1,73 +1,119 @@
|
|||
if not DISABLE_WOODEN_BOW then
|
||||
throwing_register_bow ('bow_wood', 'Wooden bow', {x=1, y=1, z=0.5}, 20, 1, 25, false, {
|
||||
{'', 'default:stick', ''},
|
||||
{'farming:string', '', 'default:stick'},
|
||||
{'', 'default:stick', ''},
|
||||
})
|
||||
throwing_register_bow ('bow_wood', 'Wooden bow', {x=1, y=1, z=0.5}, 18, 1, 50, false, {
|
||||
retrieveCraft({
|
||||
{'', 'default:stick', ''},
|
||||
{'default:junglegrass', '', 'default:stick'},
|
||||
{'', 'default:stick', ''},
|
||||
}),
|
||||
retrieveCraft({
|
||||
{'', 'default:stick', ''},
|
||||
{'farming:string', '', 'default:stick'},
|
||||
{'', 'default:stick', ''},
|
||||
}),
|
||||
retrieveCraft({
|
||||
{'', 'default:stick', ''},
|
||||
{'group:vines', '', 'default:stick'},
|
||||
{'', 'default:stick', ''},
|
||||
}, "vines"),
|
||||
retrieveCraft({
|
||||
{'', 'default:stick', ''},
|
||||
{'moreblocks:rope', '', 'default:stick'},
|
||||
{'', 'default:stick', ''},
|
||||
}, "moreblocks"),
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_LONGBOW then
|
||||
throwing_register_bow ('longbow', 'Longbow', {x=1, y=2.5, z=0.5}, 23, 2, 50, false, {
|
||||
{'farming:string', 'group:wood', ''},
|
||||
{'farming:string', '', 'group:wood'},
|
||||
{'farming:string', 'group:wood', ''},
|
||||
})
|
||||
throwing_register_bow ('longbow', 'Longbow', {x=1, y=2.5, z=0.5}, 21, 2, 75, false, {
|
||||
retrieveCraft({
|
||||
{'default:junglegrass', 'group:wood', ''},
|
||||
{'default:junglegrass', '', 'group:wood'},
|
||||
{'default:junglegrass', 'group:wood', ''},
|
||||
}),
|
||||
retrieveCraft({
|
||||
{'farming:string', 'group:wood', ''},
|
||||
{'farming:string', '', 'group:wood'},
|
||||
{'farming:string', 'group:wood', ''},
|
||||
}),
|
||||
retrieveCraft({
|
||||
{'group:vines', 'group:wood', ''},
|
||||
{'group:vines', '', 'group:wood'},
|
||||
{'group:vines', 'group:wood', ''},
|
||||
}, "vines"),
|
||||
retrieveCraft({
|
||||
{'moreblocks:rope', 'group:wood', ''},
|
||||
{'moreblocks:rope', '', 'group:wood'},
|
||||
{'moreblocks:rope', 'group:wood', ''},
|
||||
}, "moreblocks"),
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_COMPOSITE_BOW then
|
||||
throwing_register_bow ('bow_composite', 'Composite bow', {x=1, y=1.4, z=0.5}, 25, 1.5, 100, false, {
|
||||
{'farming:string', 'group:wood', ''},
|
||||
{'farming:string', '', 'default:steel_ingot'},
|
||||
{'farming:string', 'group:wood', ''},
|
||||
})
|
||||
throwing_register_bow ('bow_composite', 'Composite bow', {x=1, y=1.4, z=0.5}, 25, 1.5, 150, false, {
|
||||
retrieveCraft({
|
||||
{'farming:string', 'group:wood', ''},
|
||||
{'farming:string', '', 'default:steel_ingot'},
|
||||
{'farming:string', 'group:wood', ''},
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_STEEL_BOW then
|
||||
throwing_register_bow ('bow_steel', 'Steel bow', {x=1, y=1.4, z=0.5}, 30, 2, 200, false, {
|
||||
{'farming:string', 'default:steel_ingot', ''},
|
||||
{'farming:string', '', 'default:steel_ingot'},
|
||||
{'farming:string', 'default:steel_ingot', ''},
|
||||
})
|
||||
throwing_register_bow ('bow_steel', 'Steel bow', {x=1, y=1.4, z=0.5}, 30, 2, 300, false, {
|
||||
retrieveCraft({
|
||||
{'farming:string', 'default:steel_ingot', ''},
|
||||
{'farming:string', '', 'default:steel_ingot'},
|
||||
{'farming:string', 'default:steel_ingot', ''},
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_COMPOUND_BOW then
|
||||
throwing_register_bow ('compound_bow', 'Compound bow', {x=1, y=1.5, z=0.5}, 35, 1, 500, false, {
|
||||
{'farming:string', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'farming:string', '', 'default:steelblock'},
|
||||
{'farming:string', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
})
|
||||
retrieveCraft({
|
||||
{'farming:string', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'farming:string', '', 'default:steelblock'},
|
||||
{'farming:string', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
--function throwing_register_bow (name, desc, scale, stiffness, reload_time, toughness, is_cross, craft)
|
||||
|
||||
if not DISABLE_CROSSBOW then
|
||||
throwing_register_bow ('crossbow', 'Crossbow', {x=1, y=1.3, z=0.5}, 45, 3.5, 150, true, {
|
||||
{'default:steel_ingot', 'farming:string', ''},
|
||||
{'group:wood', 'farming:string', 'default:steelblock'},
|
||||
{'default:steel_ingot', 'farming:string', ''},
|
||||
})
|
||||
throwing_register_bow ('crossbow', 'Crossbow', {x=1, y=1.3, z=0.5}, 45, 3.5, 200, true, {
|
||||
retrieveCraft({
|
||||
{'default:steel_ingot', 'farming:string', ''},
|
||||
{'group:wood', 'farming:string', 'default:steelblock'},
|
||||
{'default:steel_ingot', 'farming:string', ''},
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_REPEATING_CROSSBOW then
|
||||
throwing_register_bow ('repeating_crossbow', 'Repeating crossbow', {x=1, y=1.3, z=0.5}, 25, 0.4, 100, true, {
|
||||
{'group:wood', 'farming:string', 'group:wood'},
|
||||
{'default:steel_ingot', 'farming:string', 'default:steelblock'},
|
||||
{'group:wood', 'farming:string', 'group:wood'},
|
||||
})
|
||||
retrieveCraft({
|
||||
{'group:wood', 'farming:string', 'group:wood'},
|
||||
{'default:steel_ingot', 'farming:string', 'default:steelblock'},
|
||||
{'group:wood', 'farming:string', 'group:wood'},
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_ARBALEST then
|
||||
throwing_register_bow ('arbalest', 'Arbalest', {x=1, y=1.3, z=0.5}, 60, 5, 200, true, {
|
||||
{'default:steel_ingot', 'farming:string', 'default:steel_ingot'},
|
||||
{'default:steelblock', 'farming:string', 'default:steelblock'},
|
||||
{'default:steel_ingot', 'farming:string', 'default:steel_ingot'},
|
||||
})
|
||||
throwing_register_bow ('arbalest', 'Arbalest', {x=1, y=1.3, z=0.5}, 60, 5, 500, true, {
|
||||
retrieveCraft({
|
||||
{'default:steel_ingot', 'farming:string', 'default:steel_ingot'},
|
||||
{'default:steelblock', 'farming:string', 'default:steelblock'},
|
||||
{'default:steel_ingot', 'farming:string', 'default:steel_ingot'},
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
if not DISABLE_AUTOMATED_ARBALEST then
|
||||
throwing_register_bow ('arbalest_auto', 'Automated arbalest', {x=1, y=1.3, z=0.5}, 60, 2, 200, true, {
|
||||
{'default:steel_ingot', 'farming:string', 'default:steelblock'},
|
||||
{'default:steelblock', 'farming:string', 'default:steelblock'},
|
||||
{'default:steel_ingot', 'farming:string', 'default:steelblock'},
|
||||
})
|
||||
throwing_register_bow ('arbalest_auto', 'Automated arbalest', {x=1, y=1.3, z=0.5}, 60, 2, 500, true, {
|
||||
retrieveCraft({
|
||||
{'default:steel_ingot', 'farming:string', 'default:steelblock'},
|
||||
{'default:steelblock', 'farming:string', 'default:steelblock'},
|
||||
{'default:steel_ingot', 'farming:string', 'default:steelblock'},
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
|
|
@ -141,9 +141,3 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_torch 4',
|
||||
recipe = {
|
||||
{'group:coal', 'default:stick', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue