diff --git a/build_arrow.lua b/build_arrow.lua deleted file mode 100755 index 6c66828..0000000 --- a/build_arrow.lua +++ /dev/null @@ -1,117 +0,0 @@ -minetest.register_craftitem("throwing:arrow_build", { - description = "Build Arrow", - inventory_image = "throwing_arrow_build.png", -}) - -minetest.register_node("throwing:arrow_build_box", { - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - -- Shaft - {-6.5/17, -1.5/17, -1.5/17, 6.5/17, 1.5/17, 1.5/17}, - --Spitze - {-4.5/17, 2.5/17, 2.5/17, -3.5/17, -2.5/17, -2.5/17}, - {-8.5/17, 0.5/17, 0.5/17, -6.5/17, -0.5/17, -0.5/17}, - --Federn - {6.5/17, 1.5/17, 1.5/17, 7.5/17, 2.5/17, 2.5/17}, - {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, - {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, - {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - - {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, - {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, - {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, - {7.5/17, -2.5/17, -2.5/17, 8.5/17, -3.5/17, -3.5/17}, - } - }, - tiles = {"throwing_arrow_build.png", "throwing_arrow_build.png", "throwing_arrow_build_back.png", "throwing_arrow_build_front.png", "throwing_arrow_build_2.png", "throwing_arrow_build.png"}, - groups = {not_in_creative_inventory=1}, -}) - -local THROWING_ARROW_ENTITY={ - physical = false, - timer=0, - visual = "wielditem", - visual_size = {x=0.1, y=0.1}, - textures = {"throwing:arrow_build_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, - node = "", - player = "", - inventory = false, - stack = false, - bow_damage = 0, -} - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local newpos = self.object:getpos() - if self.lastpos.x ~= nil then - for _, pos in pairs(throwing_get_trajectoire(self, newpos)) do - local node = minetest.get_node(pos) - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1) - for k, obj in pairs(objs) do - if throwing_is_player(self.player, obj) or throwing_is_entity(obj) then - if self.inventory and self.stack and not minetest.setting_getbool("creative_mode") then - self.inventory:remove_item("main", {name=self.stack:get_name()}) - end - if self.stack then - minetest.add_item(pos, {name=self.stack:get_name()}) - end - local toughness = 0.95 - if math.random() < toughness then - minetest.add_item(pos, 'throwing:arrow_build') - else - minetest.add_item(pos, 'default:stick') - end - self.object:remove() - return - end - end - - if node.name ~= "air" - and not string.find(node.name, "water_") - and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) - and not (string.find(node.name, 'farming:') and not string.find(node.name, 'soil')) - and not string.find(node.name, 'flowers:') - and not string.find(node.name, 'fire:') then - if node.name ~= "ignore" and self.inventory and self.stack then - if not minetest.is_protected(self.lastpos, "") - and not string.find(node.name, "lava") - and not string.find(node.name, "torch") - and self.stack:get_definition().type == "node" - and self.stack:get_name() ~= "default:torch" then - minetest.place_node(self.lastpos, {name=self.stack:get_name()}) - else - minetest.add_item(self.lastpos, {name=self.stack:get_name()}) - end - if not minetest.setting_getbool("creative_mode") then - self.inventory:remove_item("main", {name=self.stack:get_name()}) - end - end - minetest.add_item(self.lastpos, 'default:shovel_steel') - self.object:remove() - return - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} - end - end - self.lastpos={x=newpos.x, y=newpos.y, z=newpos.z} -end - -minetest.register_entity("throwing:arrow_build_entity", THROWING_ARROW_ENTITY) - -minetest.register_craft({ - output = 'throwing:arrow_build', - recipe = { - {'default:stick', 'default:stick', 'default:shovel_steel'}, - } -}) - -minetest.register_craft({ - output = 'throwing:arrow_build', - recipe = { - {'default:shovel_steel', 'default:stick', 'default:stick'}, - } -}) diff --git a/defaults.conf b/defaults.conf deleted file mode 100755 index e44b769..0000000 --- a/defaults.conf +++ /dev/null @@ -1,34 +0,0 @@ - --- Bows -DISABLE_WOODEN_BOW = false -DISABLE_LONGBOW = false -DISABLE_COMPOSITE_BOW = false -DISABLE_STEEL_BOW = false -DISABLE_ROYAL_BOW = false - --- Crossbows -DISABLE_CROSSBOW = false -DISABLE_ARBALEST = false -DISABLE_AUTOMATED_ARBALEST = false - --- Special Arrows -DISABLE_TELEPORT_ARROW = false -DISABLE_DIG_ARROW = false -- Deactivated to prevent griefing -DISABLE_BUILD_ARROW = false -- Deactivated to prevent griefing -DISABLE_TNT_ARROW = false -- Deactivated to prevent griefing -DISABLE_FIRE_ARROW = false -- Deactivated to prevent griefing -DISABLE_TORCH_ARROW = false -DISABLE_SHELL_ARROW = false -- Deactivated until crash bug related to this arrow is resolved -DISABLE_ROPE_ARROW = false - --- Fireworks arrows -DISABLE_FIREWORKS_BLUE_ARROW = false -DISABLE_FIREWORKS_RED_ARROW = false - --- Normal arrows -DISABLE_STONE_ARROW = false -DISABLE_STEEL_ARROW = false -DISABLE_OBSIDIAN_ARROW = false -DISABLE_DIAMOND_ARROW = false --- lesser damages to better damages - diff --git a/defaults.lua b/defaults.lua index 90518fa..c03bae4 100755 --- a/defaults.lua +++ b/defaults.lua @@ -1,25 +1,32 @@ +-- Bows DISABLE_WOODEN_BOW = false DISABLE_LONGBOW = false DISABLE_COMPOSITE_BOW = false DISABLE_STEEL_BOW = false -DISABLE_ROYAL_BOW = false +DISABLE_COMPOUND_BOW = false + +-- Crossbows DISABLE_CROSSBOW = false +DISABLE_REPEATING_CROSSBOW = false DISABLE_ARBALEST = false DISABLE_AUTOMATED_ARBALEST = false -DISABLE_TELEPORT_ARROW = true -DISABLE_DIG_ARROW = true -DISABLE_BUILD_ARROW = true -DISABLE_TNT_ARROW = true -DISABLE_FIRE_ARROW = true +-- Special Arrows +DISABLE_TELEPORT_ARROW = false +DISABLE_DIG_ARROW = false +DISABLE_TNT_ARROW = false DISABLE_TORCH_ARROW = false -DISABLE_SHELL_ARROW = false +DISABLE_ROPE_ARROW = false +DISABLE_LIGHTNING_ARROW = false +-- Fireworks arrows DISABLE_FIREWORKS_BLUE_ARROW = false DISABLE_FIREWORKS_RED_ARROW = false +DISABLE_FIREWORKS_GREEN_ARROW = false +-- Normal arrows DISABLE_STONE_ARROW = false DISABLE_STEEL_ARROW = false -DISABLE_DIAMOND_ARROW = false DISABLE_OBSIDIAN_ARROW = false - +DISABLE_DIAMOND_ARROW = false +DISABLE_MITHRIL_ARROW = false diff --git a/depends.txt b/depends.txt index c1d3108..5bddd6f 100755 --- a/depends.txt +++ b/depends.txt @@ -1,7 +1,6 @@ default farming dye -bucket? fire? tnt? moreores? diff --git a/dig_arrow.lua b/dig_arrow.lua index 3cdd689..993901a 100755 --- a/dig_arrow.lua +++ b/dig_arrow.lua @@ -105,14 +105,14 @@ end minetest.register_entity("throwing:arrow_dig_entity", THROWING_ARROW_ENTITY) minetest.register_craft({ - output = 'throwing:arrow_dig', + output = 'throwing:arrow_dig 4', recipe = { {'default:stick', 'default:stick', 'default:pick_steel'}, } }) minetest.register_craft({ - output = 'throwing:arrow_dig', + output = 'throwing:arrow_dig 4', recipe = { {'default:pick_steel', 'default:stick', 'default:stick'}, } diff --git a/fire_arrow.lua b/fire_arrow.lua deleted file mode 100755 index bc40246..0000000 --- a/fire_arrow.lua +++ /dev/null @@ -1,142 +0,0 @@ -minetest.register_craftitem("throwing:arrow_fire", { - description = "Fire Arrow", - inventory_image = "throwing_arrow_fire.png", -}) - -minetest.register_node("throwing:arrow_fire_box", { - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - -- Shaft - {-6.5/17, -1.5/17, -1.5/17, 6.5/17, 1.5/17, 1.5/17}, - --Spitze - {-4.5/17, 2.5/17, 2.5/17, -3.5/17, -2.5/17, -2.5/17}, - {-8.5/17, 0.5/17, 0.5/17, -6.5/17, -0.5/17, -0.5/17}, - --Federn - {6.5/17, 1.5/17, 1.5/17, 7.5/17, 2.5/17, 2.5/17}, - {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, - {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, - {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - - {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, - {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, - {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, - {7.5/17, -2.5/17, -2.5/17, 8.5/17, -3.5/17, -3.5/17}, - } - }, - tiles = {"throwing_arrow_fire.png", "throwing_arrow_fire.png", "throwing_arrow_fire_back.png", "throwing_arrow_fire_front.png", "throwing_arrow_fire_2.png", "throwing_arrow_fire.png"}, - groups = {not_in_creative_inventory=1}, -}) - -local THROWING_ARROW_ENTITY={ - physical = false, - visual = "wielditem", - visual_size = {x=0.1, y=0.1}, - textures = {"throwing:arrow_fire_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, - player = "", -} - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - local newpos = self.object:getpos() - if self.lastpos.x ~= nil then - for _, pos in pairs(throwing_get_trajectoire(self, newpos)) do - local node = minetest.get_node(pos) - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) - for k, obj in pairs(objs) do - local objpos = obj:getpos() - if throwing_is_player(self.player, obj) or throwing_is_entity(obj) then - if throwing_touch(pos, objpos) then - local puncher = self.object - if self.player and minetest.get_player_by_name(self.player) then - puncher = minetest.get_player_by_name(self.player) - end - local speed = vector.length(self.object:getvelocity()) - local damage = ((speed + 15)^1.2)/10 - obj:punch(puncher, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=damage}, - }, nil) - if math.random(0,100) % 2 == 0 then -- 50% of chance to drop //MFF (Mg|07/27/15) - minetest.add_item(pos, 'default:stick') - end - self.object:remove() - return - end - end - end - - if node.name ~= "air" - and node.name ~= "throwing:light" - and node.name ~= "fire:basic_flame" - and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) - and not (string.find(node.name, 'farming:') and not string.find(node.name, 'soil')) - and not string.find(node.name, 'flowers:') - and not string.find(node.name, 'fire:') then - if node.name ~= "ignore" then - minetest.set_node(self.lastpos, {name="fire:basic_flame"}) - end - self.object:remove() - return - end - - if minetest.get_node(pos).name == "air" then - minetest.set_node(pos, {name="throwing:light"}) - end - if minetest.get_node(self.lastpos).name == "throwing:light" then - minetest.remove_node(self.lastpos) - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} - end - end - self.lastpos={x=newpos.x, y=newpos.y, z=newpos.z} -end - - -minetest.register_entity("throwing:arrow_fire_entity", THROWING_ARROW_ENTITY) - -minetest.register_node("throwing:light", { - drawtype = "airlike", - paramtype = "light", - sunlight_propagates = true, - tiles = {"throwing_empty.png"}, - light_source = default.LIGHT_MAX-4, - selection_box = { - type = "fixed", - fixed = { - {0,0,0,0,0,0} - } - }, - groups = {not_in_creative_inventory=1} -}) - -minetest.register_abm({ - nodenames = {"throwing:light"}, - interval = 10, - chance = 1, - action = function(pos, node) - minetest.remove_node(pos) - end -}) - -minetest.register_craft({ - output = 'throwing:arrow_fire 4', - recipe = { - {'default:stick', 'default:stick', 'bucket:bucket_lava'}, - }, - replacements = { - {"bucket:bucket_lava", "bucket:bucket_empty"} - } -}) - -minetest.register_craft({ - output = 'throwing:arrow_fire 4', - recipe = { - {'bucket:bucket_lava', 'default:stick', 'default:stick'}, - }, - replacements = { - {"bucket:bucket_lava", "bucket:bucket_empty"} - } -}) diff --git a/fireworks_arrows.lua b/fireworks_arrows.lua index 8efc2c1..0ad9b31 100755 --- a/fireworks_arrows.lua +++ b/fireworks_arrows.lua @@ -83,10 +83,6 @@ local function throwing_register_fireworks(color, color2, desc) local function boom(pos) minetest.sound_play("throwing_firework_boom", {pos=pos, gain=1, max_hear_distance=2*64}) - if minetest.get_node(pos).name == 'air' or minetest.get_node(pos).name == 'throwing:firework_trail' then - minetest.add_node(pos, {name="throwing:firework_boom"}) - minetest.get_node_timer(pos):start(0.2) - end add_effects(pos, radius) end @@ -136,15 +132,11 @@ local function throwing_register_fireworks(color, color2, desc) end end local node = minetest.get_node(newpos) - if self.timer > 2 or node.name ~= "air" and node.name ~= "throwing:firework_trail" then + if self.timer > 2 or node.name ~= "air" then boom(self.lastpos) self.object:remove() return end - if node.name == 'air' then - minetest.add_node(newpos, {name="throwing:firework_trail"}) - minetest.get_node_timer(newpos):start(0.1) - end end self.lastpos={x=newpos.x, y=newpos.y, z=newpos.z} end @@ -153,16 +145,16 @@ local function throwing_register_fireworks(color, color2, desc) minetest.register_entity("throwing:arrow_fireworks_" .. color .. "_entity", THROWING_ARROW_ENTITY) minetest.register_craft({ - output = 'throwing:arrow_fireworks_' .. color .. ' 8', + output = 'throwing:arrow_fireworks_' .. color .. , recipe = { - {'default:stick', 'tnt:gunpowder', 'dye:' .. color}, + {'default:stick', 'group:coal', 'dye:' .. color}, } }) minetest.register_craft({ - output = 'throwing:arrow_fireworks_' .. color .. ' 8', + output = 'throwing:arrow_fireworks_' .. color .. , recipe = { - {'dye:' .. color, 'tnt:gunpowder', 'default:stick'}, + {'dye:' .. color, 'group:coal', 'default:stick'}, } }) end @@ -181,42 +173,3 @@ if not DISABLE_FIREWORKS_GREEN_ARROW then throwing_register_fireworks('green', 'cyan', 'Green') end ---~ Nodes - -minetest.register_node("throwing:firework_trail", { - drawtype = "airlike", - light_source = 9, - walkable = false, - drop = "", - groups = {dig_immediate=3}, - on_timer = function(pos, elapsed) - minetest.remove_node(pos) - end, -}) - -minetest.register_node("throwing:firework_boom", { - drawtype = "plantlike", - tiles = {"throwing_sparkle.png"}, - light_source = default.LIGHT_MAX, - walkable = false, - drop = "", - groups = {dig_immediate=3}, - on_timer = function(pos, elapsed) - minetest.remove_node(pos) - end, - after_destruct = function(pos, oldnode) - minetest.set_node(pos, {name="throwing:firework_light"}) - minetest.get_node_timer(pos):start(3) - end, -}) - -minetest.register_node("throwing:firework_light", { - drawtype = "airlike", - light_source = default.LIGHT_MAX, - walkable = false, - drop = "", - groups = {dig_immediate=3}, - on_timer = function(pos, elapsed) - minetest.remove_node(pos) - end, -}) diff --git a/init.lua b/init.lua index fe07f41..048ec5b 100755 --- a/init.lua +++ b/init.lua @@ -4,10 +4,8 @@ throwing_arrows = { {"throwing:arrow_obsidian", "throwing:arrow_obsidian_entity"}, {"throwing:arrow_diamond", "throwing:arrow_diamond_entity"}, {"throwing:arrow_mithril", "throwing:arrow_mithril_entity"}, - {"throwing:arrow_fire", "throwing:arrow_fire_entity"}, {"throwing:arrow_teleport", "throwing:arrow_teleport_entity"}, {"throwing:arrow_dig", "throwing:arrow_dig_entity"}, - {"throwing:arrow_build", "throwing:arrow_build_entity"}, {"throwing:arrow_tnt", "throwing:arrow_tnt_entity"}, {"throwing:arrow_torch", "throwing:arrow_torch_entity"}, {"throwing:arrow_fireworks_red", "throwing:arrow_fireworks_red_entity"}, @@ -32,10 +30,6 @@ dofile(minetest.get_modpath("throwing").."/tools.lua") dofile(minetest.get_modpath("throwing").."/standard_arrows.lua") -if minetest.get_modpath('fire') and minetest.get_modpath('bucket') and 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 @@ -44,10 +38,6 @@ 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 minetest.get_modpath('tnt') and not DISABLE_TNT_ARROW then dofile(minetest.get_modpath("throwing").."/tnt_arrow.lua") end diff --git a/lightning_arrow.lua b/lightning_arrow.lua index 51f801d..d49b6c8 100755 --- a/lightning_arrow.lua +++ b/lightning_arrow.lua @@ -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 + 10)^1.2)/10 + local damage = ((speed + 20)^1.2)/10 obj:punch(puncher, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=damage}, @@ -157,13 +157,13 @@ minetest.register_entity("throwing:arrow_lightning_entity", THROWING_ARROW_ENTIT minetest.register_craft({ output = 'throwing:arrow_lightning', recipe = { - {'default:stick', 'default:stick', 'default:pick_steel'}, + {'default:stick', 'default:mese_crystal', 'default:obsidian_shard'}, } }) minetest.register_craft({ output = 'throwing:arrow_lightning', recipe = { - {'default:pick_steel', 'default:stick', 'default:stick'}, + {'default:obsidian_shard', 'default:mese_crystal', 'default:stick'}, } }) diff --git a/rope_arrow.lua b/rope_arrow.lua index 4bb10d2..a560e4d 100755 --- a/rope_arrow.lua +++ b/rope_arrow.lua @@ -127,15 +127,15 @@ end minetest.register_entity("throwing:arrow_rope_entity", THROWING_ARROW_ENTITY) minetest.register_craft({ - output = 'throwing:arrow_rope 4', + output = 'throwing:arrow_rope', recipe = { - {'default:stick', 'default:stick', 'group:coal'}, + {'default:stick', 'default:stick', 'vines:rope_block'}, } }) minetest.register_craft({ - output = 'throwing:arrow_rope 4', + output = 'throwing:arrow_rope', recipe = { - {'group:coal', 'default:stick', 'default:stick'}, + {'vines:rope_block', 'default:stick', 'default:stick'}, } }) diff --git a/standard_arrows.lua b/standard_arrows.lua index bc60c83..ea5d75d 100755 --- a/standard_arrows.lua +++ b/standard_arrows.lua @@ -120,14 +120,14 @@ end minetest.register_entity("throwing:arrow_" .. kind .. "_entity", THROWING_ARROW_ENTITY) minetest.register_craft({ - output = 'throwing:arrow_' .. kind .. ' 16', + output = 'throwing:arrow_' .. kind .. ' 4', recipe = { {'default:stick', 'default:stick', craft}, } }) minetest.register_craft({ - output = 'throwing:arrow_' .. kind .. ' 16', + output = 'throwing:arrow_' .. kind .. ' 4', recipe = { {craft, 'default:stick', 'default:stick'}, } diff --git a/textures/compound_bow.xcf b/textures/compound_bow.xcf deleted file mode 100755 index 0540c82..0000000 Binary files a/textures/compound_bow.xcf and /dev/null differ diff --git a/textures/compound_bow_unload.xcf b/textures/compound_bow_unload.xcf deleted file mode 100755 index 7ded188..0000000 Binary files a/textures/compound_bow_unload.xcf and /dev/null differ diff --git a/textures/repeater_crossbow.xcf b/textures/repeater_crossbow.xcf deleted file mode 100755 index 34d35bd..0000000 Binary files a/textures/repeater_crossbow.xcf and /dev/null differ diff --git a/textures/throwing_arrow_lightning.xcf b/textures/throwing_arrow_lightning.xcf deleted file mode 100755 index 8a239f3..0000000 Binary files a/textures/throwing_arrow_lightning.xcf and /dev/null differ diff --git a/textures/throwing_rope_arrow.xcf b/textures/throwing_rope_arrow.xcf deleted file mode 100755 index 1e40712..0000000 Binary files a/textures/throwing_rope_arrow.xcf and /dev/null differ diff --git a/throwing.conf b/throwing.conf.example similarity index 54% rename from throwing.conf rename to throwing.conf.example index e44b769..402357c 100755 --- a/throwing.conf +++ b/throwing.conf.example @@ -1,34 +1,33 @@ - -- Bows DISABLE_WOODEN_BOW = false DISABLE_LONGBOW = false DISABLE_COMPOSITE_BOW = false DISABLE_STEEL_BOW = false -DISABLE_ROYAL_BOW = false +DISABLE_COMPOUND_BOW = false -- Crossbows DISABLE_CROSSBOW = false +DISABLE_REPEATING_CROSSBOW = false DISABLE_ARBALEST = false DISABLE_AUTOMATED_ARBALEST = false -- Special Arrows DISABLE_TELEPORT_ARROW = false -DISABLE_DIG_ARROW = false -- Deactivated to prevent griefing -DISABLE_BUILD_ARROW = false -- Deactivated to prevent griefing -DISABLE_TNT_ARROW = false -- Deactivated to prevent griefing -DISABLE_FIRE_ARROW = false -- Deactivated to prevent griefing +DISABLE_DIG_ARROW = false +DISABLE_TNT_ARROW = false DISABLE_TORCH_ARROW = false -DISABLE_SHELL_ARROW = false -- Deactivated until crash bug related to this arrow is resolved DISABLE_ROPE_ARROW = false +DISABLE_LIGHTNING_ARROW = false -- Fireworks arrows DISABLE_FIREWORKS_BLUE_ARROW = false DISABLE_FIREWORKS_RED_ARROW = false +DISABLE_FIREWORKS_GREEN_ARROW = false -- Normal arrows DISABLE_STONE_ARROW = false DISABLE_STEEL_ARROW = false DISABLE_OBSIDIAN_ARROW = false DISABLE_DIAMOND_ARROW = false --- lesser damages to better damages +DISABLE_MITHRIL_ARROW = false diff --git a/tools.lua b/tools.lua index 92331b8..dd67769 100755 --- a/tools.lua +++ b/tools.lua @@ -1,5 +1,5 @@ if not DISABLE_WOODEN_BOW then - throwing_register_bow ('bow_wood', 'Wooden bow', {x=1, y=1, z=0.5}, 20, 1, 5, false, { + 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', ''}, @@ -7,7 +7,7 @@ if not DISABLE_WOODEN_BOW then end if not DISABLE_LONGBOW then - throwing_register_bow ('longbow', 'Longbow', {x=1, y=2.5, z=0.5}, 23, 2, 100, false, { + 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', ''}, @@ -15,7 +15,7 @@ if not DISABLE_LONGBOW then 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, 150, false, { + 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', ''}, @@ -23,7 +23,7 @@ if not DISABLE_COMPOSITE_BOW then end if not DISABLE_STEEL_BOW then - throwing_register_bow ('bow_steel', 'Steel bow', {x=1, y=1.4, z=0.5}, 30, 2, 250, false, { + 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', ''}, @@ -31,9 +31,9 @@ if not DISABLE_STEEL_BOW then end if not DISABLE_COMPOUND_BOW then - throwing_register_bow ('compound_bow', 'Compound bow', {x=1, y=1.5, z=0.5}, 35, 1, 750, false, { + 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:steel_block'}, + {'farming:string', '', 'default:steelblock'}, {'farming:string', 'default:steel_ingot', 'default:steel_ingot'}, }) end @@ -41,33 +41,33 @@ 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, 80, true, { + 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:steel_block'}, + {'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, 80, true, { + 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:steel_block'}, + {'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, 120, true, { + 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:steel_block', 'farming:string', 'default:steel_block'}, + {'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, 60, true, { - {'default:steel_ingot', 'farming:string', 'default:steel_block'}, - {'default:steel_block', 'farming:string', 'default:steel_block'}, - {'default:steel_ingot', 'farming:string', 'default:steel_block'}, + 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'}, }) end diff --git a/torch_arrow.lua b/torch_arrow.lua index b464086..8a55935 100755 --- a/torch_arrow.lua +++ b/torch_arrow.lua @@ -98,11 +98,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) end - if node.name == 'air' then - minetest.add_node(pos, {name="throwing:torch_trail"}) - minetest.get_node_timer(pos):start(0.1) - elseif node.name ~= "air" - and not string.find(node.name, "trail") + if node.name ~= "air" and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) and not (string.find(node.name, 'farming:') and not string.find(node.name, 'soil')) and not string.find(node.name, 'flowers:') @@ -114,7 +110,13 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) and not minetest.is_protected(self.lastpos, self.player) and node.diggable ~= false then local dir=vector.direction(self.lastpos, pos) local wall=minetest.dir_to_wallmounted(dir) - minetest.add_node(self.lastpos, {name="default:torch", param2 = wall}) + if wall == 0 then + minetest.add_node(self.lastpos, {name="default:torch_ceiling", param2 = wall}) + elseif wall == 1 then + minetest.add_node(self.lastpos, {name="default:torch", param2 = wall}) + else + minetest.add_node(self.lastpos, {name="default:torch_wall", param2 = wall}) + end add_effects(self.lastpos, node) else local toughness = 0.9 @@ -148,14 +150,3 @@ minetest.register_craft({ {'group:coal', 'default:stick', 'default:stick'}, } }) - -minetest.register_node("throwing:torch_trail", { - drawtype = "airlike", - light_source = default.LIGHT_MAX-1, - walkable = false, - drop = "", - groups = {dig_immediate=3}, - on_timer = function(pos, elapsed) - minetest.remove_node(pos) - end, -})