diff --git a/mods/ctf_treasure/init.lua b/mods/ctf_treasure/init.lua index 2f239eb..abaea3a 100644 --- a/mods/ctf_treasure/init.lua +++ b/mods/ctf_treasure/init.lua @@ -15,7 +15,7 @@ treasurer.register_treasure("shooter:shotgun",0.05,2,1) treasurer.register_treasure("shooter:machine_gun",0.01,2,1) treasurer.register_treasure("shooter:ammo",0.5,2,{1,10}) - +--[[ treasurer.register_treasure("throwing:arrow_steel",0.1,5,{1,12}) treasurer.register_treasure("throwing:arrow_stone",0.2,5,{1,12}) treasurer.register_treasure("throwing:arrow_obsidian",0.3,5,{1,8}) @@ -25,6 +25,7 @@ treasurer.register_treasure("throwing:arrow_steel",0.2,5,{1,12}) treasurer.register_treasure("throwing:bow_wood",0.9,5,{1,12}) treasurer.register_treasure("throwing:longbow",0.4,5,1) treasurer.register_treasure("throwing:bow_steel",0.1,5,1) +]] treasurer.register_treasure("default:pick_steel",0.3,5,{1,10}) treasurer.register_treasure("default:pick_mese",0.005,5,1) diff --git a/mods/throwing/README.txt b/mods/throwing/README.txt deleted file mode 100644 index 4d3cf61..0000000 --- a/mods/throwing/README.txt +++ /dev/null @@ -1,112 +0,0 @@ -=== THROWING ENHANCED for MINETEST === - -Inroduction: -This mod adds many bows and arrows to Minetest. -It began as a fork of PilzAdam's throwing mod with some enhancements from me. Enjoy! -Echoes91 - -How to install: -http://wiki.minetest.com/wiki/Installing_Mods - -How to use the mod: -Select a bow and place the arrows into the slot next to it; shoot with left mouse click. -Every shoot will take 1 arrow from your inventory and wears out the bow. -Select a spear and attack with left mouse click; it will be used as a melee weapon if pointing any target, otherwise it will be thrown. - -License: -This mod was originally published by Jeija and reworked by PilzAdam -Sourcecode: LGPLv2.1 (see http://www.gnu.org/licenses/lgpl-2.1.html) -Grahpics & sounds: CC-BY 3.0 (see http://creativecommons.org/licenses/by/3.0/legalcode) - - -Changelog: - -Update 1.4.1: -- Fixed spears not retaining wear -- Improved textures -- Torch arrows have light trail - -Update 1.4: -- Added spears, capable of melee and ranged attacks -- Improved arrows textures - -Update 1.3: -- Added automated arbalest, the ultimate weapon -- New arbalest texture coherent with steel color - -Update 1.2: -- Added arbalest -- Defaults initialized - -Update 1.1: -- Added crossbow -- Code shrink -- Offensive arrows go through flora's and farming's -- Small fixes - -Update 1.0: -- Definitive reload, unload and shot system based on tool metadata, new global functions, no more "throw" privilege -- New textures for loaded bows -- Fireworks arrows to celebrate! - -Update 1.0rc2: -- Fixed "compare nil with number" due to self.break not being retained -- Filled conf.example's list -- Added Royal bow - -Update 1.0rc1: -- Added longbow and removed golden bow, definitive bow set for stable release. Feature freeze -- Fixed torch arrow recipe, thanks to Excalibur Zero -- Removed config.lua, configuration now goes int throwing.config, see example - -Update 0.9.8: -- New damage calculation for offensive arrows based on arrow's speed and material. Beware that dependency is more than linear for both, so that differences between arrows will be enhanced if they're shot at higher speed. -- Fixed bug that blocked ability to shot after shooting with empty arrow stack. -- Removed annoying debug symbols - -Update 0.9.7: -- Added visual feedback for reload -- Fixed reload for players who die while reloading and for multiplayer -- Changed license for the code to LGPLv2 - -Update 0.9.6: -- Any bow and arrow is now deactivable under config.lua, which won't be overwritten -- Changed license for media to CC-BY - -Update 0.9.5: -- Added shell arrows -- Revised sounds and some textures -- General balancing of bow's statistics - -Update 0.9.4: -- New bow texture -- Made recipes coherent - -Update 0.9.3: -- Added symmetric recipes, fixed golden bow recipe -- Adjusted few parameters - -Update 0.9.2: -- Added a chance to break for many arrows, so they don't last forever and outclass any other tool -- Build and torch arrows won't build on fluids and torches any more, build arrows won't place torches -- TNT arrow digs instead if removing blocks, eventual indestructible nodes are safe -- Added golden bow with possible new bow style -- Changed the (bit OP) composite bow resistance and new recipe -- New teleport arrow recipe, cheaper but single use - -Update 0.9.1: -- Good improvement for torch arrows, now they always attach and are often turned to the right direction -- Git repository will make things nicer - -Update 0.9: -- Now bows have reload times! They depend on weight and quality, anyway no more machine-gun-style shell swarms -- Fixed build arrow behavior, now it placed and consumes the node from the slot [b]right next to the arrow[/b] or drops the item beside it if not a node; no more disappearing nor 'CONTENT_IGNORE' errors -- Code cleanup and rationalization - -Update 0.8.1: -- Fixed wrong texture reference which made some arrows get a bad color during flight. -- Now bows have different stiffness besides wear resistances, which means that they shot arrows at different initial speed and learning to hit the target will become even harder. - Get rid of the old .env: API - Added new bows and new offensive, utility and harmful arrows (these are just my categories, they're not present into the code at all). - Removed stone bow, at least as long as somebody discovers an elastic rock ;) - Non-exploding arrows won't disappear any more after hitting target. \ No newline at end of file diff --git a/mods/throwing/build_arrow.lua b/mods/throwing/build_arrow.lua deleted file mode 100644 index d0cb031..0000000 --- a/mods/throwing/build_arrow.lua +++ /dev/null @@ -1,107 +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 = "", -} - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - if not self.inventory or not self.stack then - self.object:remove() - end - - if self.timer>0.2 then - 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 obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_build_entity" and obj:get_luaentity().name ~= "__builtin:item" then - self.object:remove() - 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(self.lastpos, {name=self.stack:get_name()}) - end - local toughness = 0.95 - if math.random() < toughness then - minetest.add_item(self.lastpos, 'throwing:arrow_build') - else - minetest.add_item(self.lastpos, 'default:stick') - end - end - end - end - end - - if self.lastpos.x~=nil then - if node.name ~= "air" then - self.object:remove() - 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 - if not string.find(node.name, "water") 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 - end - minetest.add_item(self.lastpos, 'default:shovel_steel') - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.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/mods/throwing/defaults.lua b/mods/throwing/defaults.lua deleted file mode 100644 index ec803ed..0000000 --- a/mods/throwing/defaults.lua +++ /dev/null @@ -1,24 +0,0 @@ -DISABLE_WOODEN_BOW = false -DISABLE_LONGBOW = false -DISABLE_COMPOSITE_BOW = false -DISABLE_STEEL_BOW = false -DISABLE_ROYAL_BOW = false -DISABLE_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 -DISABLE_TORCH_ARROW = false -DISABLE_SHELL_ARROW = false - -DISABLE_FIREWORKS_BLUE_ARROW = false -DISABLE_FIREWORKS_RED_ARROW = false - -DISABLE_STONE_ARROW = false -DISABLE_STEEL_ARROW = false -DISABLE_DIAMOND_ARROW = false -DISABLE_OBSIDIAN_ARROW = false diff --git a/mods/throwing/depends.txt b/mods/throwing/depends.txt deleted file mode 100644 index 9f0fa34..0000000 --- a/mods/throwing/depends.txt +++ /dev/null @@ -1,6 +0,0 @@ -default -farming? -dye? -bucket? -fire? -tnt? diff --git a/mods/throwing/description.txt b/mods/throwing/description.txt deleted file mode 100644 index ee25fb4..0000000 --- a/mods/throwing/description.txt +++ /dev/null @@ -1 +0,0 @@ -This mod adds many bows and arrows to Minetest. diff --git a/mods/throwing/dig_arrow.lua b/mods/throwing/dig_arrow.lua deleted file mode 100644 index 4e7cf9b..0000000 --- a/mods/throwing/dig_arrow.lua +++ /dev/null @@ -1,100 +0,0 @@ -minetest.register_craftitem("throwing:arrow_dig", { - description = "Dig Arrow", - inventory_image = "throwing_arrow_dig.png", -}) - -minetest.register_node("throwing:arrow_dig_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_dig.png", "throwing_arrow_dig.png", "throwing_arrow_dig_back.png", "throwing_arrow_dig_front.png", "throwing_arrow_dig_2.png", "throwing_arrow_dig.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_dig_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, -} - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - - if self.timer>0.2 then - 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 obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_dig_entity" and obj:get_luaentity().name ~= "__builtin:item" then - local damage = 1.5 - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=damage}, - }, nil) - self.object:remove() - local toughness = 0.9 - if math.random() < toughness then - minetest.add_item(self.lastpos, 'throwing:arrow_dig') - else - minetest.add_item(self.lastpos, 'default:stick') - end - end - end - end - end - - if self.lastpos.x~=nil then - if node.name ~= "air" then - self.object:remove() - if node.diggable ~= false then - minetest.dig_node(pos) - end - local toughness = 0.65 - if math.random() < toughness then - minetest.add_item(self.lastpos, 'default:pick_steel') - else - minetest.add_item(self.lastpos, 'default:stick') - end - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} -end - -minetest.register_entity("throwing:arrow_dig_entity", THROWING_ARROW_ENTITY) - -minetest.register_craft({ - output = 'throwing:arrow_dig', - recipe = { - {'default:stick', 'default:stick', 'default:pick_steel'}, - } -}) - -minetest.register_craft({ - output = 'throwing:arrow_dig', - recipe = { - {'default:pick_steel', 'default:stick', 'default:stick'}, - } -}) diff --git a/mods/throwing/fire_arrow.lua b/mods/throwing/fire_arrow.lua deleted file mode 100644 index 9457a87..0000000 --- a/mods/throwing/fire_arrow.lua +++ /dev/null @@ -1,125 +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, - timer=0, - visual = "wielditem", - visual_size = {x=0.1, y=0.1}, - textures = {"throwing:arrow_fire_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, -} - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - - if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) - for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_fire_entity" and obj:get_luaentity().name ~= "__builtin:item" then - local damage = 4 - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=damage}, - }, nil) - self.object:remove() - minetest.add_item(self.lastpos, 'default:stick') - end - end - end - end - - if self.lastpos.x~=nil then - if node.name ~= "air" and node.name ~= "throwing:light" then - minetest.set_node(self.lastpos, {name="fire:basic_flame"}) - self.object:remove() - end - if math.floor(self.lastpos.x+0.5) ~= math.floor(pos.x+0.5) or math.floor(self.lastpos.y+0.5) ~= math.floor(pos.y+0.5) or math.floor(self.lastpos.z+0.5) ~= math.floor(pos.z+0.5) then - if minetest.get_node(self.lastpos).name == "throwing:light" then - minetest.remove_node(self.lastpos) - end - if minetest.get_node(pos).name == "air" then - minetest.set_node(pos, {name="throwing:light"}) - end - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.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 = 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/mods/throwing/fireworks_arrows.lua b/mods/throwing/fireworks_arrows.lua deleted file mode 100644 index 4dd38fe..0000000 --- a/mods/throwing/fireworks_arrows.lua +++ /dev/null @@ -1,195 +0,0 @@ -local function throwing_register_fireworks(color, desc) - minetest.register_craftitem("throwing:arrow_fireworks_" .. color, { - description = desc .. "fireworks arrow", - inventory_image = "throwing_arrow_fireworks_" .. color .. ".png", - }) - - minetest.register_node("throwing:arrow_fireworks_" .. color .. "_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_fireworks_" .. color .. ".png", "throwing_arrow_fireworks_" .. color .. ".png", "throwing_arrow_fireworks_" .. color .. "_back.png", "throwing_arrow_fireworks_" .. color .. "_front.png", "throwing_arrow_fireworks_" .. color .. "_2.png", "throwing_arrow_fireworks_" .. color .. ".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_fireworks_" .. color .. "_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, - } - - local radius = 0.5 - - local function add_effects(pos, radius) - minetest.add_particlespawner({ - amount = 256, - time = 0.2, - minpos = vector.subtract(pos, radius / 2), - maxpos = vector.add(pos, radius / 2), - minvel = {x=-5, y=-5, z=-5}, - maxvel = {x=5, y=5, z=5}, - minacc = {x=0, y=-8, z=0}, - --~ maxacc = {x=-20, y=-50, z=-50}, - minexptime = 2.5, - maxexptime = 3, - minsize = 1, - maxsize = 2.5, - texture = "throwing_sparkle_" .. color .. ".png", - }) - end - - - 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 - - -- Back to the arrow - - THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - if self.timer < 0.07 then - minetest.sound_play("throwing_firework_launch", {pos=pos, gain=0.8, max_hear_distance=2*64}) - end - minetest.add_particlespawner({ - amount = 16, - time = 0.1, - minpos = pos, - maxpos = pos, - minvel = {x=-5, y=-5, z=-5}, - maxvel = {x=5, y=5, z=5}, - minacc = vector.new(), - maxacc = vector.new(), - minexptime = 0.3, - maxexptime = 0.5, - minsize = 0.5, - maxsize = 1, - texture = "throwing_sparkle.png", - }) - if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) - for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_fireworks_" .. color .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then - local damage = 2 - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=damage}, - }, nil) - self.object:remove() - boom(pos) - end - end - end - end - if self.timer > 2 then - self.object:remove() - boom(self.lastpos) - end - if self.lastpos.x~=nil then - if node.name ~= "air" and node.name ~= "throwing:firework_trail" then - self.object:remove() - boom(self.lastpos) - end - end - if node.name == 'air' then - minetest.add_node(pos, {name="throwing:firework_trail"}) - minetest.get_node_timer(pos):start(0.1) - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} - end - - minetest.register_entity("throwing:arrow_fireworks_" .. color .. "_entity", THROWING_ARROW_ENTITY) - - minetest.register_craft({ - output = 'throwing:arrow_fireworks_' .. color .. ' 8', - recipe = { - {'default:stick', 'tnt:gunpowder', 'dye:' .. color}, - } - }) - - minetest.register_craft({ - output = 'throwing:arrow_fireworks_' .. color .. ' 8', - recipe = { - {'dye:' .. color, 'tnt:gunpowder', 'default:stick'}, - } - }) -end - ---~ Arrows - -if not DISABLE_FIREWORKS_BLUE_ARROW then - throwing_register_fireworks('blue', 'Blue') -end - -if not DISABLE_FIREWORKS_RED_ARROW then - throwing_register_fireworks('red', 'Red') -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/mods/throwing/functions.lua b/mods/throwing/functions.lua deleted file mode 100644 index fd72686..0000000 --- a/mods/throwing/functions.lua +++ /dev/null @@ -1,145 +0,0 @@ ---~ ---~ Shot and reload system ---~ - -local players = {} - -minetest.register_on_joinplayer(function(player) - local playerName = player:get_player_name() - players[playerName] = { - reloading=false, - } -end) - -minetest.register_on_leaveplayer(function(player) - local playerName = player:get_player_name() - players[playerName] = nil -end) - -function throwing_shoot_arrow (itemstack, player, stiffness, is_cross) - if not player then - return - end - local arrow = itemstack:get_metadata() - itemstack:set_metadata("") - player:set_wielded_item(itemstack) - local playerpos = player:getpos() - print(dump(minetest.luaentities)) - local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow) - if not obj then - minetest.chat_send_player(player:get_player_name(), "Error! Failed to create arrow.") - end - print(dump(minetest.luaentities)) - local dir = player:get_look_dir() - obj:setvelocity({x=dir.x*stiffness, y=dir.y*stiffness, z=dir.z*stiffness}) - obj:setacceleration({x=dir.x*-3, y=-8.5, z=dir.z*-3}) - obj:setyaw(player:get_look_yaw()+math.pi) - if is_cross then - minetest.sound_play("throwing_crossbow_sound", {pos=playerpos}) - else - minetest.sound_play("throwing_bow_sound", {pos=playerpos}) - end - local le = obj:get_luaentity() - if le then - le.player = player - le.inventory = player:get_inventory() - le.stack = player:get_inventory():get_stack("main", player:get_wield_index()-1) - print("le") - else - print("no le") - end - return true -end - -function throwing_unload (itemstack, player, unloaded, wear) - if itemstack:get_metadata() then - for _,arrow in ipairs(throwing_arrows) do - if itemstack:get_metadata() == arrow[2] then - if not minetest.setting_getbool("creative_mode") then - player:get_inventory():add_item("main", arrow[1]) - end - end - end - end - if wear >= 65535 then - player:set_wielded_item({}) - else - player:set_wielded_item({name=unloaded, wear=wear}) - end -end - -function throwing_reload (itemstack, player, pos, is_cross, loaded) - local playerName = player:get_player_name() - players[playerName]['reloading'] = false - if itemstack:get_name() == player:get_wielded_item():get_name() then - if (pos.x == player:getpos().x and pos.y == player:getpos().y and pos.z == player:getpos().z) or not is_cross then - local wear = itemstack:get_wear() - for _,arrow in ipairs(throwing_arrows) do - if player:get_inventory():get_stack("main", player:get_wield_index()+1):get_name() == arrow[1] then - if not minetest.setting_getbool("creative_mode") then - player:get_inventory():remove_item("main", arrow[1]) - end - local meta = arrow[2] - player:set_wielded_item({name=loaded, wear=wear, metadata=meta}) - end - end - end - end -end - --- Bows and crossbows - -function throwing_register_bow (name, desc, scale, stiffness, reload_time, toughness, is_cross, craft) - minetest.register_tool("throwing:" .. name, { - description = desc, - inventory_image = "throwing_" .. name .. ".png", - wield_scale = scale, - stack_max = 1, - on_use = function(itemstack, user, pointed_thing) - local pos = user:getpos() - local playerName = user:get_player_name() - if not players[playerName]['reloading'] then - players[playerName]['reloading'] = true - minetest.after(reload_time, throwing_reload, itemstack, user, pos, is_cross, "throwing:" .. name .. "_loaded") - end - return itemstack - end, - }) - - minetest.register_tool("throwing:" .. name .. "_loaded", { - description = desc, - inventory_image = "throwing_" .. name .. "_loaded.png", - wield_scale = scale, - stack_max = 1, - on_use = function(itemstack, user, pointed_thing) - local wear = itemstack:get_wear() - if not minetest.setting_getbool("creative_mode") then - wear = wear + (65535/toughness) - end - local unloaded = "throwing:" .. name - throwing_shoot_arrow(itemstack, user, stiffness, is_cross) - minetest.after(0, throwing_unload, itemstack, user, unloaded, wear) - return itemstack - end, - on_drop = function(itemstack, dropper, pointed_thing) - local wear = itemstack:get_wear() - local unloaded = "throwing:" .. name - minetest.after(0, throwing_unload, itemstack, dropper, unloaded, wear) - end, - groups = {not_in_creative_inventory=1}, - }) - - minetest.register_craft({ - output = 'throwing:' .. name, - recipe = craft - }) - - minetest.register_craft({ - output = 'throwing:' .. name, - recipe = { - {craft[1][3], craft[1][2], craft[1][1]}, - {craft[2][3], craft[2][2], craft[2][1]}, - {craft[3][3], craft[3][2], craft[3][1]}, - } - }) -end diff --git a/mods/throwing/init.lua b/mods/throwing/init.lua deleted file mode 100644 index be1d42a..0000000 --- a/mods/throwing/init.lua +++ /dev/null @@ -1,66 +0,0 @@ -throwing_arrows = { - {"throwing:arrow_steel", "throwing:arrow_steel_entity"}, - {"throwing:arrow_stone", "throwing:arrow_stone_entity"}, - {"throwing:arrow_obsidian", "throwing:arrow_obsidian_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_diamond", "throwing:arrow_diamond_entity"}, - {"throwing:arrow_shell", "throwing:arrow_shell_entity"}, - {"throwing:arrow_fireworks_blue", "throwing:arrow_fireworks_blue_entity"}, - {"throwing:arrow_fireworks_red", "throwing:arrow_fireworks_red_entity"}, -} - -dofile(minetest.get_modpath("throwing").."/defaults.lua") - -local input = io.open(minetest.get_modpath("throwing").."/throwing.conf", "r") -if input then - dofile(minetest.get_modpath("throwing").."/throwing.conf") - input:close() - input = nil -end - -dofile(minetest.get_modpath("throwing").."/functions.lua") - -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 - -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('fire') and minetest.get_modpath('tnt') and 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 minetest.get_modpath('tnt') and not DISABLE_SHELL_ARROW then - dofile(minetest.get_modpath("throwing").."/shell_arrow.lua") -end - -if minetest.get_modpath('tnt') then - dofile(minetest.get_modpath("throwing").."/fireworks_arrows.lua") -end - -if minetest.setting_get("log_mods") then - minetest.log("action", "throwing loaded") -end diff --git a/mods/throwing/screenshot.png b/mods/throwing/screenshot.png deleted file mode 100644 index 32a89d1..0000000 Binary files a/mods/throwing/screenshot.png and /dev/null differ diff --git a/mods/throwing/shell_arrow.lua b/mods/throwing/shell_arrow.lua deleted file mode 100644 index 5267cf9..0000000 --- a/mods/throwing/shell_arrow.lua +++ /dev/null @@ -1,118 +0,0 @@ -minetest.register_craftitem("throwing:arrow_shell", { - description = "Shell arrow", - inventory_image = "throwing_arrow_shell.png", -}) - -minetest.register_node("throwing:arrow_shell_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_shell.png", "throwing_arrow_shell.png", "throwing_arrow_shell_back.png", "throwing_arrow_shell_front.png", "throwing_arrow_shell_2.png", "throwing_arrow_shell.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_shell_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, -} - -local radius = 1 - -local function add_effects(pos, radius) - minetest.add_particlespawner({ - amount = 8, - time = 0.5, - minpos = vector.subtract(pos, radius / 2), - maxpos = vector.add(pos, radius / 2), - minvel = {x=-10, y=-10, z=-10}, - maxvel = {x=10, y=10, z=10}, - minacc = vector.new(), - maxacc = vector.new(), - minexptime = 0.5, - maxexptime = 1, - minsize = 0.5, - maxsize = 1, - texture = "tnt_smoke.png", - }) -end - - -local function boom(pos) - minetest.sound_play("shell_explode", {pos=pos, gain=1.5, max_hear_distance=2*64}) - minetest.set_node(pos, {name="tnt:boom"}) - minetest.get_node_timer(pos):start(0.1) - add_effects(pos, radius) -end - --- Back to the arrow - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - - if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) - for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_shell_entity" and obj:get_luaentity().name ~= "__builtin:item" then - local speed = vector.length(self.object:getvelocity()) - local damage = ((speed + 5)^1.2)/10 + 12 - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=damage}, - }, nil) - self.object:remove() - boom(pos) - end - end - end - end - - if self.lastpos.x~=nil then - if node.name ~= "air" and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') then - self.object:remove() - boom(self.lastpos) - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} -end - -minetest.register_entity("throwing:arrow_shell_entity", THROWING_ARROW_ENTITY) - -minetest.register_craft({ - output = 'throwing:arrow_shell 8', - recipe = { - {'default:stick', 'tnt:gunpowder', 'default:bronze_ingot'}, - } -}) - -minetest.register_craft({ - output = 'throwing:arrow_shell 8', - recipe = { - {'default:bronze_ingot', 'tnt:gunpowder', 'default:stick'}, - } -}) diff --git a/mods/throwing/sounds/throwing_bow_sound.ogg b/mods/throwing/sounds/throwing_bow_sound.ogg deleted file mode 100644 index 411598c..0000000 Binary files a/mods/throwing/sounds/throwing_bow_sound.ogg and /dev/null differ diff --git a/mods/throwing/sounds/throwing_crossbow_sound.ogg b/mods/throwing/sounds/throwing_crossbow_sound.ogg deleted file mode 100644 index e30b1e0..0000000 Binary files a/mods/throwing/sounds/throwing_crossbow_sound.ogg and /dev/null differ diff --git a/mods/throwing/sounds/throwing_firework_boom.ogg b/mods/throwing/sounds/throwing_firework_boom.ogg deleted file mode 100644 index c25b96a..0000000 Binary files a/mods/throwing/sounds/throwing_firework_boom.ogg and /dev/null differ diff --git a/mods/throwing/sounds/throwing_firework_launch.ogg b/mods/throwing/sounds/throwing_firework_launch.ogg deleted file mode 100644 index e6165a4..0000000 Binary files a/mods/throwing/sounds/throwing_firework_launch.ogg and /dev/null differ diff --git a/mods/throwing/sounds/throwing_shell_explode.ogg b/mods/throwing/sounds/throwing_shell_explode.ogg deleted file mode 100644 index ec827f8..0000000 Binary files a/mods/throwing/sounds/throwing_shell_explode.ogg and /dev/null differ diff --git a/mods/throwing/standard_arrows.lua b/mods/throwing/standard_arrows.lua deleted file mode 100644 index 60674e0..0000000 --- a/mods/throwing/standard_arrows.lua +++ /dev/null @@ -1,114 +0,0 @@ -function throwing_register_arrow_standard (kind, desc, eq, toughness, craft) - minetest.register_craftitem("throwing:arrow_" .. kind, { - description = desc .. " arrow", - inventory_image = "throwing_arrow_" .. kind .. ".png", - }) - - minetest.register_node("throwing:arrow_" .. kind .. "_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_" .. kind .. ".png", "throwing_arrow_" .. kind .. ".png", "throwing_arrow_" .. kind .. "_back.png", "throwing_arrow_" .. kind .. "_front.png", "throwing_arrow_" .. kind .. "_2.png", "throwing_arrow_" .. kind .. ".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_" .. kind .. "_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, - } - - THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - - if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) - for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then - local speed = vector.length(self.object:getvelocity()) - local damage = ((speed + eq)^1.2)/10 - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=damage}, - }, nil) - self.object:remove() - --if math.random() < toughness then - --minetest.add_item(self.lastpos, 'throwing:arrow_' .. kind) - --else - --minetest.add_item(self.lastpos, 'default:stick') - --end - end - end - end - end - - if self.lastpos.x~=nil then - if node.name ~= "air" and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') then - self.object:remove() - if math.random() < toughness then - minetest.add_item(self.lastpos, 'throwing:arrow_' .. kind) - else - minetest.add_item(self.lastpos, 'default:stick') - end - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} - end - - minetest.register_entity("throwing:arrow_" .. kind .. "_entity", THROWING_ARROW_ENTITY) - - minetest.register_craft({ - output = 'throwing:arrow_' .. kind .. ' 16', - recipe = { - {'default:stick', 'default:stick', craft}, - } - }) - - minetest.register_craft({ - output = 'throwing:arrow_' .. kind .. ' 16', - recipe = { - {craft, 'default:stick', 'default:stick'}, - } - }) -end - -if not DISABLE_STONE_ARROW then - throwing_register_arrow_standard ('stone', 'Stone', 0, 0.88, 'group:stone') -end - -if not DISABLE_STEEL_ARROW then - throwing_register_arrow_standard ('steel', 'Steel', 5, 0.94, 'default:steel_ingot') -end - -if not DISABLE_DIAMOND_ARROW then - throwing_register_arrow_standard ('diamond', 'Diamond', 10, 0.97, 'default:diamond') -end - -if not DISABLE_OBSIDIAN_ARROW then - throwing_register_arrow_standard ('obsidian', 'Obsidian', 15, 0.88, 'default:obsidian') -end diff --git a/mods/throwing/teleport_arrow.lua b/mods/throwing/teleport_arrow.lua deleted file mode 100644 index d495de3..0000000 --- a/mods/throwing/teleport_arrow.lua +++ /dev/null @@ -1,92 +0,0 @@ -minetest.register_craftitem("throwing:arrow_teleport", { - description = "Teleport Arrow", - inventory_image = "throwing_arrow_teleport.png", -}) - -minetest.register_node("throwing:arrow_teleport_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_teleport.png", "throwing_arrow_teleport.png", "throwing_arrow_teleport_back.png", "throwing_arrow_teleport_front.png", "throwing_arrow_teleport_2.png", "throwing_arrow_teleport.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_teleport_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, - player = "", -} - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - if not self.player then - self.object:remove() - end - - if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) - for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_teleport_entity" and obj:get_luaentity().name ~= "__builtin:item" then - self.object:remove() - if self.player ~= "" then - self.player:setpos(pos) - self.player:get_inventory():add_item("main", ItemStack("default:stick 2")) - end - end - end - end - end - - if self.lastpos.x~=nil then - if node.name ~= "air" then - self.object:remove() - if self.player ~= "" then - self.player:setpos(self.lastpos) - self.player:get_inventory():add_item("main", ItemStack("default:stick 2")) - end - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} -end - -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_fragment'} - } -}) - -minetest.register_craft({ - output = 'throwing:arrow_teleport', - recipe = { - {'default:mese_crystal_fragment', 'default:stick', 'default:stick'} - } -}) diff --git a/mods/throwing/textures/throwing_arbalest.png b/mods/throwing/textures/throwing_arbalest.png deleted file mode 100644 index f53e377..0000000 Binary files a/mods/throwing/textures/throwing_arbalest.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arbalest_auto.png b/mods/throwing/textures/throwing_arbalest_auto.png deleted file mode 100644 index c40cd92..0000000 Binary files a/mods/throwing/textures/throwing_arbalest_auto.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arbalest_auto_loaded.png b/mods/throwing/textures/throwing_arbalest_auto_loaded.png deleted file mode 100644 index f971b24..0000000 Binary files a/mods/throwing/textures/throwing_arbalest_auto_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arbalest_loaded.png b/mods/throwing/textures/throwing_arbalest_loaded.png deleted file mode 100644 index 09b2cc8..0000000 Binary files a/mods/throwing/textures/throwing_arbalest_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_build.png b/mods/throwing/textures/throwing_arrow_build.png deleted file mode 100644 index d9b4062..0000000 Binary files a/mods/throwing/textures/throwing_arrow_build.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_build_2.png b/mods/throwing/textures/throwing_arrow_build_2.png deleted file mode 100644 index 1e178e4..0000000 Binary files a/mods/throwing/textures/throwing_arrow_build_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_build_back.png b/mods/throwing/textures/throwing_arrow_build_back.png deleted file mode 100644 index 621f258..0000000 Binary files a/mods/throwing/textures/throwing_arrow_build_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_build_front.png b/mods/throwing/textures/throwing_arrow_build_front.png deleted file mode 100644 index 25d47ce..0000000 Binary files a/mods/throwing/textures/throwing_arrow_build_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_diamond.png b/mods/throwing/textures/throwing_arrow_diamond.png deleted file mode 100644 index a70038a..0000000 Binary files a/mods/throwing/textures/throwing_arrow_diamond.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_diamond_2.png b/mods/throwing/textures/throwing_arrow_diamond_2.png deleted file mode 100644 index 485b12f..0000000 Binary files a/mods/throwing/textures/throwing_arrow_diamond_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_diamond_back.png b/mods/throwing/textures/throwing_arrow_diamond_back.png deleted file mode 100644 index 0c92fba..0000000 Binary files a/mods/throwing/textures/throwing_arrow_diamond_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_diamond_front.png b/mods/throwing/textures/throwing_arrow_diamond_front.png deleted file mode 100644 index 6e545df..0000000 Binary files a/mods/throwing/textures/throwing_arrow_diamond_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_dig.png b/mods/throwing/textures/throwing_arrow_dig.png deleted file mode 100644 index 6a1d443..0000000 Binary files a/mods/throwing/textures/throwing_arrow_dig.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_dig_2.png b/mods/throwing/textures/throwing_arrow_dig_2.png deleted file mode 100644 index b6d9d1b..0000000 Binary files a/mods/throwing/textures/throwing_arrow_dig_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_dig_back.png b/mods/throwing/textures/throwing_arrow_dig_back.png deleted file mode 100644 index 3bc4a60..0000000 Binary files a/mods/throwing/textures/throwing_arrow_dig_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_dig_front.png b/mods/throwing/textures/throwing_arrow_dig_front.png deleted file mode 100644 index aa7ff2e..0000000 Binary files a/mods/throwing/textures/throwing_arrow_dig_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fire.png b/mods/throwing/textures/throwing_arrow_fire.png deleted file mode 100644 index fd3a9d5..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fire.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fire_2.png b/mods/throwing/textures/throwing_arrow_fire_2.png deleted file mode 100644 index f86579a..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fire_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fire_back.png b/mods/throwing/textures/throwing_arrow_fire_back.png deleted file mode 100644 index 8a7d993..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fire_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fire_front.png b/mods/throwing/textures/throwing_arrow_fire_front.png deleted file mode 100644 index 3994257..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fire_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_blue.png b/mods/throwing/textures/throwing_arrow_fireworks_blue.png deleted file mode 100644 index 71d4ec8..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_blue.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_blue_2.png b/mods/throwing/textures/throwing_arrow_fireworks_blue_2.png deleted file mode 100644 index 51b055c..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_blue_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_blue_back.png b/mods/throwing/textures/throwing_arrow_fireworks_blue_back.png deleted file mode 100644 index 85956a6..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_blue_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_blue_front.png b/mods/throwing/textures/throwing_arrow_fireworks_blue_front.png deleted file mode 100644 index 8674cc8..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_blue_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_red.png b/mods/throwing/textures/throwing_arrow_fireworks_red.png deleted file mode 100644 index 9b13fcd..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_red.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_red_2.png b/mods/throwing/textures/throwing_arrow_fireworks_red_2.png deleted file mode 100644 index edb0097..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_red_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_red_back.png b/mods/throwing/textures/throwing_arrow_fireworks_red_back.png deleted file mode 100644 index 8e90fc5..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_red_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_fireworks_red_front.png b/mods/throwing/textures/throwing_arrow_fireworks_red_front.png deleted file mode 100644 index 8d6a629..0000000 Binary files a/mods/throwing/textures/throwing_arrow_fireworks_red_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_obsidian.png b/mods/throwing/textures/throwing_arrow_obsidian.png deleted file mode 100644 index 2df7a08..0000000 Binary files a/mods/throwing/textures/throwing_arrow_obsidian.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_obsidian_2.png b/mods/throwing/textures/throwing_arrow_obsidian_2.png deleted file mode 100644 index abccbb3..0000000 Binary files a/mods/throwing/textures/throwing_arrow_obsidian_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_obsidian_back.png b/mods/throwing/textures/throwing_arrow_obsidian_back.png deleted file mode 100644 index bd1232f..0000000 Binary files a/mods/throwing/textures/throwing_arrow_obsidian_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_obsidian_front.png b/mods/throwing/textures/throwing_arrow_obsidian_front.png deleted file mode 100644 index 2cbed4c..0000000 Binary files a/mods/throwing/textures/throwing_arrow_obsidian_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_shell.png b/mods/throwing/textures/throwing_arrow_shell.png deleted file mode 100644 index d100424..0000000 Binary files a/mods/throwing/textures/throwing_arrow_shell.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_shell_2.png b/mods/throwing/textures/throwing_arrow_shell_2.png deleted file mode 100644 index 25f2b3e..0000000 Binary files a/mods/throwing/textures/throwing_arrow_shell_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_shell_back.png b/mods/throwing/textures/throwing_arrow_shell_back.png deleted file mode 100644 index 4b64eaf..0000000 Binary files a/mods/throwing/textures/throwing_arrow_shell_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_shell_front.png b/mods/throwing/textures/throwing_arrow_shell_front.png deleted file mode 100644 index f6d51c4..0000000 Binary files a/mods/throwing/textures/throwing_arrow_shell_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_steel.png b/mods/throwing/textures/throwing_arrow_steel.png deleted file mode 100644 index 9932590..0000000 Binary files a/mods/throwing/textures/throwing_arrow_steel.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_steel_2.png b/mods/throwing/textures/throwing_arrow_steel_2.png deleted file mode 100644 index c0401a6..0000000 Binary files a/mods/throwing/textures/throwing_arrow_steel_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_steel_back.png b/mods/throwing/textures/throwing_arrow_steel_back.png deleted file mode 100644 index c7edf56..0000000 Binary files a/mods/throwing/textures/throwing_arrow_steel_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_steel_front.png b/mods/throwing/textures/throwing_arrow_steel_front.png deleted file mode 100644 index ff22af0..0000000 Binary files a/mods/throwing/textures/throwing_arrow_steel_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_stone.png b/mods/throwing/textures/throwing_arrow_stone.png deleted file mode 100644 index b563af6..0000000 Binary files a/mods/throwing/textures/throwing_arrow_stone.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_stone_2.png b/mods/throwing/textures/throwing_arrow_stone_2.png deleted file mode 100644 index 20182bc..0000000 Binary files a/mods/throwing/textures/throwing_arrow_stone_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_stone_back.png b/mods/throwing/textures/throwing_arrow_stone_back.png deleted file mode 100644 index 293334e..0000000 Binary files a/mods/throwing/textures/throwing_arrow_stone_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_stone_front.png b/mods/throwing/textures/throwing_arrow_stone_front.png deleted file mode 100644 index 8b35047..0000000 Binary files a/mods/throwing/textures/throwing_arrow_stone_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_teleport.png b/mods/throwing/textures/throwing_arrow_teleport.png deleted file mode 100644 index 584735b..0000000 Binary files a/mods/throwing/textures/throwing_arrow_teleport.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_teleport_2.png b/mods/throwing/textures/throwing_arrow_teleport_2.png deleted file mode 100644 index 56192c8..0000000 Binary files a/mods/throwing/textures/throwing_arrow_teleport_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_teleport_back.png b/mods/throwing/textures/throwing_arrow_teleport_back.png deleted file mode 100644 index 325c203..0000000 Binary files a/mods/throwing/textures/throwing_arrow_teleport_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_teleport_front.png b/mods/throwing/textures/throwing_arrow_teleport_front.png deleted file mode 100644 index 138f1cf..0000000 Binary files a/mods/throwing/textures/throwing_arrow_teleport_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_tnt.png b/mods/throwing/textures/throwing_arrow_tnt.png deleted file mode 100644 index c7ee8f1..0000000 Binary files a/mods/throwing/textures/throwing_arrow_tnt.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_tnt_2.png b/mods/throwing/textures/throwing_arrow_tnt_2.png deleted file mode 100644 index 3b53ece..0000000 Binary files a/mods/throwing/textures/throwing_arrow_tnt_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_tnt_back.png b/mods/throwing/textures/throwing_arrow_tnt_back.png deleted file mode 100644 index 230bb18..0000000 Binary files a/mods/throwing/textures/throwing_arrow_tnt_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_tnt_front.png b/mods/throwing/textures/throwing_arrow_tnt_front.png deleted file mode 100644 index b7252ac..0000000 Binary files a/mods/throwing/textures/throwing_arrow_tnt_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_torch.png b/mods/throwing/textures/throwing_arrow_torch.png deleted file mode 100644 index 1c424e4..0000000 Binary files a/mods/throwing/textures/throwing_arrow_torch.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_torch_2.png b/mods/throwing/textures/throwing_arrow_torch_2.png deleted file mode 100644 index a5800ce..0000000 Binary files a/mods/throwing/textures/throwing_arrow_torch_2.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_torch_back.png b/mods/throwing/textures/throwing_arrow_torch_back.png deleted file mode 100644 index 3b9fd11..0000000 Binary files a/mods/throwing/textures/throwing_arrow_torch_back.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_arrow_torch_front.png b/mods/throwing/textures/throwing_arrow_torch_front.png deleted file mode 100644 index 764a263..0000000 Binary files a/mods/throwing/textures/throwing_arrow_torch_front.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_composite.png b/mods/throwing/textures/throwing_bow_composite.png deleted file mode 100644 index 630af5a..0000000 Binary files a/mods/throwing/textures/throwing_bow_composite.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_composite_loaded.png b/mods/throwing/textures/throwing_bow_composite_loaded.png deleted file mode 100644 index 67bf8e5..0000000 Binary files a/mods/throwing/textures/throwing_bow_composite_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_royal.png b/mods/throwing/textures/throwing_bow_royal.png deleted file mode 100644 index 43c20f8..0000000 Binary files a/mods/throwing/textures/throwing_bow_royal.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_royal_loaded.png b/mods/throwing/textures/throwing_bow_royal_loaded.png deleted file mode 100644 index 3416f2e..0000000 Binary files a/mods/throwing/textures/throwing_bow_royal_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_steel.png b/mods/throwing/textures/throwing_bow_steel.png deleted file mode 100644 index 0e1d3d1..0000000 Binary files a/mods/throwing/textures/throwing_bow_steel.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_steel_loaded.png b/mods/throwing/textures/throwing_bow_steel_loaded.png deleted file mode 100644 index 16150a6..0000000 Binary files a/mods/throwing/textures/throwing_bow_steel_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_wood.png b/mods/throwing/textures/throwing_bow_wood.png deleted file mode 100644 index 9a6c6da..0000000 Binary files a/mods/throwing/textures/throwing_bow_wood.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_bow_wood_loaded.png b/mods/throwing/textures/throwing_bow_wood_loaded.png deleted file mode 100644 index 251e643..0000000 Binary files a/mods/throwing/textures/throwing_bow_wood_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_crossbow.png b/mods/throwing/textures/throwing_crossbow.png deleted file mode 100644 index f8a400b..0000000 Binary files a/mods/throwing/textures/throwing_crossbow.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_crossbow_loaded.png b/mods/throwing/textures/throwing_crossbow_loaded.png deleted file mode 100644 index 5d2b0c7..0000000 Binary files a/mods/throwing/textures/throwing_crossbow_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_empty.png b/mods/throwing/textures/throwing_empty.png deleted file mode 100644 index 6bbd554..0000000 Binary files a/mods/throwing/textures/throwing_empty.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_longbow.png b/mods/throwing/textures/throwing_longbow.png deleted file mode 100644 index 7bdae2f..0000000 Binary files a/mods/throwing/textures/throwing_longbow.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_longbow_loaded.png b/mods/throwing/textures/throwing_longbow_loaded.png deleted file mode 100644 index e03299a..0000000 Binary files a/mods/throwing/textures/throwing_longbow_loaded.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_sparkle.png b/mods/throwing/textures/throwing_sparkle.png deleted file mode 100644 index 432786e..0000000 Binary files a/mods/throwing/textures/throwing_sparkle.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_sparkle_blue.png b/mods/throwing/textures/throwing_sparkle_blue.png deleted file mode 100644 index d4710a3..0000000 Binary files a/mods/throwing/textures/throwing_sparkle_blue.png and /dev/null differ diff --git a/mods/throwing/textures/throwing_sparkle_red.png b/mods/throwing/textures/throwing_sparkle_red.png deleted file mode 100644 index 59ec68c..0000000 Binary files a/mods/throwing/textures/throwing_sparkle_red.png and /dev/null differ diff --git a/mods/throwing/throwing.conf.example b/mods/throwing/throwing.conf.example deleted file mode 100644 index f0e1ba5..0000000 --- a/mods/throwing/throwing.conf.example +++ /dev/null @@ -1,52 +0,0 @@ -# You can disable or disable any bow and arrow by writing lines like these inside throwing.conf -# -# DISABLE_WOODEN_BOW = true -# -# -# DISABLE_LONGBOW = true -# -# -# DISABLE_COMPOSITE_BOW = true -# -# -# DISABLE_STEEL_BOW = true -# -# -# DISABLE_ROYAL_BOW = true -# -# -# DISABLE_CROSSBOW = true -# -# -# DISABLE_BUILD_ARROW = false -# -# -# DISABLE_DIG_ARROW = false -# -# -# DISABLE_DIAMOND_ARROW = true -# -# -# DISABLE_OBSIDIAN_ARROW = true -# -# -# DISABLE_SHELL_ARROW = true -# -# -# DISABLE_STEEL_ARROW = true -# -# -# DISABLE_STONE_ARROW = false -# -# -# DISABLE_TELEPORT_ARROW = false -# -# -# DISABLE_FIRE_ARROW = false -# -# -# DISABLE_TNT_ARROW = false -# -# -# DISABLE_TORCH_ARROW = true -# \ No newline at end of file diff --git a/mods/throwing/tnt_arrow.lua b/mods/throwing/tnt_arrow.lua deleted file mode 100644 index d0a4f7d..0000000 --- a/mods/throwing/tnt_arrow.lua +++ /dev/null @@ -1,286 +0,0 @@ -minetest.register_craftitem("throwing:arrow_tnt", { - description = "TNT arrow", - inventory_image = "throwing_arrow_tnt.png", -}) - -minetest.register_node("throwing:arrow_tnt_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_tnt.png", "throwing_arrow_tnt.png", "throwing_arrow_tnt_back.png", "throwing_arrow_tnt_front.png", "throwing_arrow_tnt_2.png", "throwing_arrow_tnt.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_tnt_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, -} - --- TNT functions copied, would be nice to directly call them through an API... - --- loss probabilities array (one in X will be lost) -local loss_prob = {} - -loss_prob["default:cobble"] = 3 -loss_prob["default:dirt"] = 4 - -local radius = tonumber(minetest.setting_get("tnt_radius") or 3) - --- Fill a list with data for content IDs, after all nodes are registered -local cid_data = {} -minetest.after(0, function() - for name, def in pairs(minetest.registered_nodes) do - cid_data[minetest.get_content_id(name)] = { - name = name, - drops = def.drops, - flammable = def.groups.flammable, - } - end -end) - -local function rand_pos(center, pos, radius) - pos.x = center.x + math.random(-radius, radius) - pos.z = center.z + math.random(-radius, radius) -end - -local function eject_drops(drops, pos, radius) - local drop_pos = vector.new(pos) - for _, item in pairs(drops) do - local count = item:get_count() - local max = item:get_stack_max() - if count > max then - item:set_count(max) - end - while count > 0 do - if count < max then - item:set_count(count) - end - rand_pos(pos, drop_pos, radius) - local obj = minetest.add_item(drop_pos, item) - if obj then - obj:get_luaentity().collect = true - obj:setacceleration({x=0, y=-10, z=0}) - obj:setvelocity({x=math.random(-3, 3), y=10, - z=math.random(-3, 3)}) - end - count = count - max - end - end -end - -local function add_drop(drops, item) - item = ItemStack(item) - local name = item:get_name() - if loss_prob[name] ~= nil and math.random(1, loss_prob[name]) == 1 then - return - end - - local drop = drops[name] - if drop == nil then - drops[name] = item - else - drop:set_count(drop:get_count() + item:get_count()) - end -end - -local fire_node = {name="fire:basic_flame"} - -local function destroy(drops, pos, cid) - if minetest.is_protected(pos, "") then - return - end - local def = cid_data[cid] - if def and def.flammable then - minetest.set_node(pos, fire_node) - else - minetest.dig_node(pos) - if def then - local node_drops = minetest.get_node_drops(def.name, "") - for _, item in ipairs(node_drops) do - add_drop(drops, item) - end - end - end -end - - -local function calc_velocity(pos1, pos2, old_vel, power) - local vel = vector.direction(pos1, pos2) - vel = vector.normalize(vel) - vel = vector.multiply(vel, power) - - -- Divide by distance - local dist = vector.distance(pos1, pos2) - dist = math.max(dist, 1) - vel = vector.divide(vel, dist) - - -- Add old velocity - vel = vector.add(vel, old_vel) - return vel -end - -local function entity_physics(pos, radius) - -- Make the damage radius larger than the destruction radius - radius = radius * 2 - local objs = minetest.get_objects_inside_radius(pos, radius) - for _, obj in pairs(objs) do - local obj_pos = obj:getpos() - local obj_vel = obj:getvelocity() - local dist = math.max(1, vector.distance(pos, obj_pos)) - - if obj_vel ~= nil then - obj:setvelocity(calc_velocity(pos, obj_pos, - obj_vel, radius * 10)) - end - - local damage = (5 / dist) * radius - obj:set_hp(obj:get_hp() - damage) - end -end - -local function add_effects(pos, radius) - minetest.add_particlespawner({ - amount = 128, - time = 1, - minpos = vector.subtract(pos, radius / 2), - maxpos = vector.add(pos, radius / 2), - minvel = {x=-20, y=-20, z=-20}, - maxvel = {x=20, y=20, z=20}, - minacc = vector.new(), - maxacc = vector.new(), - minexptime = 1, - maxexptime = 3, - minsize = 8, - maxsize = 16, - texture = "tnt_smoke.png", - }) -end - - -local function explode(pos, radius) - local pos = vector.round(pos) - local vm = VoxelManip() - local pr = PseudoRandom(os.time()) - local p1 = vector.subtract(pos, radius) - local p2 = vector.add(pos, radius) - local minp, maxp = vm:read_from_map(p1, p2) - local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) - local data = vm:get_data() - - local drops = {} - local p = {} - - local c_air = minetest.get_content_id("air") - local c_tnt = minetest.get_content_id("tnt:tnt") - local c_tnt_burning = minetest.get_content_id("tnt:tnt_burning") - local c_gunpowder = minetest.get_content_id("tnt:gunpowder") - local c_gunpowder_burning = minetest.get_content_id("tnt:gunpowder_burning") - local c_boom = minetest.get_content_id("tnt:boom") - local c_fire = minetest.get_content_id("fire:basic_flame") - - for z = -radius, radius do - for y = -radius, radius do - local vi = a:index(pos.x + (-radius), pos.y + y, pos.z + z) - for x = -radius, radius do - if (x * x) + (y * y) + (z * z) <= - (radius * radius) + pr:next(-radius, radius) then - local cid = data[vi] - p.x = pos.x + x - p.y = pos.y + y - p.z = pos.z + z - if cid == c_tnt or cid == c_gunpowder then - burn(p) - elseif cid ~= c_tnt_burning and - cid ~= c_gunpowder_burning and - cid ~= c_air and - cid ~= c_fire and - cid ~= c_boom then - destroy(drops, p, cid) - end - end - vi = vi + 1 - end - end - end - - return drops -end - - -local function boom(pos) - minetest.sound_play("tnt_explode", {pos=pos, gain=1.5, max_hear_distance=2*64}) - minetest.set_node(pos, {name="tnt:boom"}) - minetest.get_node_timer(pos):start(0.5) - - local drops = explode(pos, radius) - entity_physics(pos, radius) - eject_drops(drops, pos, radius) - add_effects(pos, radius) -end - --- Back to the arrow - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - - if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) - for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_tnt_entity" and obj:get_luaentity().name ~= "__builtin:item" then - self.object:remove() - boom(pos) - end - end - end - end - - if self.lastpos.x~=nil then - if node.name ~= "air" then - self.object:remove() - boom(self.lastpos) - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} -end - -minetest.register_entity("throwing:arrow_tnt_entity", THROWING_ARROW_ENTITY) - -minetest.register_craft({ - output = 'throwing:arrow_tnt', - recipe = { - {'default:stick', 'tnt:tnt', 'default:bronze_ingot'}, - } -}) - -minetest.register_craft({ - output = 'throwing:arrow_tnt', - recipe = { - {'default:bronze_ingot', 'tnt:tnt', 'default:stick'}, - } -}) diff --git a/mods/throwing/tools.lua b/mods/throwing/tools.lua deleted file mode 100644 index 57ef85c..0000000 --- a/mods/throwing/tools.lua +++ /dev/null @@ -1,63 +0,0 @@ -if not DISABLE_WOODEN_BOW then - throwing_register_bow ('bow_wood', 'Wooden bow', {x=1, y=1, z=0.5}, 11, 0.8, 50, false, { - {'', 'default:stick', ''}, - {'farming:string', '', 'default:stick'}, - {'', 'default:stick', ''}, - }) -end - -if not DISABLE_LONGBOW then - throwing_register_bow ('longbow', 'Longbow', {x=1, y=2.5, z=0.5}, 17, 1.8, 100, false, { - {'farming:string', 'group:wood', ''}, - {'farming:string', '', 'group:wood'}, - {'farming:string', 'group:wood', ''}, - }) -end - -if not DISABLE_COMPOSITE_BOW then - throwing_register_bow ('bow_composite', 'Composite bow', {x=1, y=1.4, z=0.5}, 17, 1, 150, false, { - {'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}, 20, 1.3, 250, false, { - {'farming:string', 'default:steel_ingot', ''}, - {'farming:string', '', 'default:steel_ingot'}, - {'farming:string', 'default:steel_ingot', ''}, - }) -end - -if not DISABLE_ROYAL_BOW then - throwing_register_bow ('bow_royal', 'Royal bow', {x=1, y=1.5, z=0.5}, 18, 1.4, 750, false, { - {'farming:string', 'group:wood', 'default:diamond'}, - {'farming:string', '', 'default:gold_ingot'}, - {'farming:string', 'group:wood', 'default:diamond'}, - }) -end - -if not DISABLE_CROSSBOW then - throwing_register_bow ('crossbow', 'Crossbow', {x=1, y=1.3, z=0.5}, 28, 5, 80, true, { - {'group:wood', 'farming:string', ''}, - {'default:steel_ingot', 'farming:string', 'group:wood'}, - {'group:wood', 'farming:string', ''}, - }) -end - -if not DISABLE_ARBALEST then - throwing_register_bow ('arbalest', 'Arbalest', {x=1, y=1.3, z=0.5}, 35, 7.5, 120, true, { - {'default:steel_ingot', 'farming:string', 'default:stick'}, - {'default:steel_ingot', 'farming:string', 'default:steel_ingot'}, - {'default:steel_ingot', 'farming:string', 'default:stick'}, - }) -end - -if not DISABLE_AUTOMATED_ARBALEST then - throwing_register_bow ('arbalest_auto', 'Automated arbalest', {x=1, y=1.3, z=0.5}, 40, 3.5, 60, true, { - {'default:steel_ingot', 'farming:string', 'default:mese_crystal'}, - {'default:steel_ingot', 'farming:string', 'default:steel_ingot'}, - {'default:steel_ingot', 'farming:string', 'default:mese_crystal'}, - }) -end diff --git a/mods/throwing/torch_arrow.lua b/mods/throwing/torch_arrow.lua deleted file mode 100644 index 0de170a..0000000 --- a/mods/throwing/torch_arrow.lua +++ /dev/null @@ -1,118 +0,0 @@ -minetest.register_craftitem("throwing:arrow_torch", { - description = "Torch Arrow", - inventory_image = "throwing_arrow_torch.png", -}) - -minetest.register_node("throwing:arrow_torch_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_torch.png", "throwing_arrow_torch.png", "throwing_arrow_torch_back.png", "throwing_arrow_torch_front.png", "throwing_arrow_torch_2.png", "throwing_arrow_torch.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_torch_box"}, - lastpos={}, - collisionbox = {0,0,0,0,0,0}, - node = "", -} - -THROWING_ARROW_ENTITY.on_step = function(self, dtime) - self.timer=self.timer+dtime - local pos = self.object:getpos() - local node = minetest.get_node(pos) - - if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 0.5) - for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then - if obj:get_luaentity().name ~= "throwing:arrow_torch_entity" and obj:get_luaentity().name ~= "__builtin:item" then - local damage = 0.5 - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=damage}, - }, nil) - self.object:remove() - local toughness = 0.9 - if math.random() < toughness then - minetest.add_item(self.lastpos, 'throwing:arrow_torch') - else - minetest.add_item(self.lastpos, 'default:stick') - end - end - end - end - end - - if self.lastpos.x~=nil then - 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") then - self.object:remove() - if not string.find(node.name, "water") and not string.find(node.name, "lava") and not string.find(node.name, "torch") 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}) - else - local toughness = 0.9 - if math.random() < toughness then - minetest.add_item(self.lastpos, 'throwing:arrow_torch') - else - minetest.add_item(self.lastpos, 'default:stick') - end - end - end - end - self.lastpos={x=pos.x, y=pos.y, z=pos.z} -end - -minetest.register_entity("throwing:arrow_torch_entity", THROWING_ARROW_ENTITY) - -minetest.register_craft({ - output = 'throwing:arrow_torch 4', - recipe = { - {'default:stick', 'default:stick', 'group:coal'}, - } -}) - -minetest.register_craft({ - output = 'throwing:arrow_torch 4', - recipe = { - {'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, -})