diff --git a/README.txt b/README.txt index 88e9094..85ff5c9 100644 --- a/README.txt +++ b/README.txt @@ -9,8 +9,9 @@ How to install: http://wiki.minetest.com/wiki/Installing_Mods How to use the mod: -Select the bow and place the arrows into the slot next to it; shoot with left mouse click. +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 @@ -20,6 +21,10 @@ Grahpics & sounds: CC-BY 3.0 (see http://creativecommons.org/licenses/by/3.0/leg Changelog: +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 diff --git a/defaults.lua b/defaults.lua index ba3876e..b6c246f 100644 --- a/defaults.lua +++ b/defaults.lua @@ -21,4 +21,9 @@ DISABLE_FIREWORKS_RED_ARROW = false DISABLE_STONE_ARROW = false DISABLE_STEEL_ARROW = false DISABLE_DIAMOND_ARROW = false -DISABLE_OBSIDIAN_ARROW = false \ No newline at end of file +DISABLE_OBSIDIAN_ARROW = false + +DISABLE_STONE_SPEAR = false +DISABLE_STEEL_SPEAR = false +DISABLE_DIAMOND_SPEAR = false +DISABLE_OBSIDIAN_SPEAR = false diff --git a/functions.lua b/functions.lua index 568ad6e..3947342 100644 --- a/functions.lua +++ b/functions.lua @@ -24,7 +24,7 @@ function throwing_shoot_arrow (itemstack, player, stiffness, is_cross) local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow) 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=-10, z=dir.z*-3}) + 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}) @@ -129,3 +129,17 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough } }) end + +-- Spears + +function throwing_shoot_spear (itemstack, player) + local spear = itemstack:get_name() .. '_entity' + local playerpos = player:getpos() + local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear) + local dir = player:get_look_dir() + obj:setvelocity({x=dir.x*14, y=dir.y*14, z=dir.z*14}) + obj:setacceleration({x=-dir.x*1, y=-9.8, z=-dir.z*1}) + obj:setyaw(player:get_look_yaw()+math.pi) + minetest.sound_play("throwing_bow_sound", {pos=playerpos}) + return true +end diff --git a/init.lua b/init.lua index be1d42a..7ad1419 100644 --- a/init.lua +++ b/init.lua @@ -29,6 +29,8 @@ dofile(minetest.get_modpath("throwing").."/tools.lua") dofile(minetest.get_modpath("throwing").."/standard_arrows.lua") +dofile(minetest.get_modpath("throwing").."/spears.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 diff --git a/textures/throwing_arrow_build.png b/textures/throwing_arrow_build.png index 09d01ec..9b34bba 100644 Binary files a/textures/throwing_arrow_build.png and b/textures/throwing_arrow_build.png differ diff --git a/textures/throwing_arrow_build_2.png b/textures/throwing_arrow_build_2.png index 4fdbd92..c54f9fc 100644 Binary files a/textures/throwing_arrow_build_2.png and b/textures/throwing_arrow_build_2.png differ diff --git a/textures/throwing_arrow_diamond.png b/textures/throwing_arrow_diamond.png index ae34eb0..77eaf59 100644 Binary files a/textures/throwing_arrow_diamond.png and b/textures/throwing_arrow_diamond.png differ diff --git a/textures/throwing_arrow_diamond_2.png b/textures/throwing_arrow_diamond_2.png index 9bc1219..11727f0 100644 Binary files a/textures/throwing_arrow_diamond_2.png and b/textures/throwing_arrow_diamond_2.png differ diff --git a/textures/throwing_arrow_dig.png b/textures/throwing_arrow_dig.png index f54a7ae..8eea6ea 100644 Binary files a/textures/throwing_arrow_dig.png and b/textures/throwing_arrow_dig.png differ diff --git a/textures/throwing_arrow_dig_2.png b/textures/throwing_arrow_dig_2.png index 3370387..714dc18 100644 Binary files a/textures/throwing_arrow_dig_2.png and b/textures/throwing_arrow_dig_2.png differ diff --git a/textures/throwing_arrow_fire.png b/textures/throwing_arrow_fire.png index 8f5075a..fd3a9d5 100644 Binary files a/textures/throwing_arrow_fire.png and b/textures/throwing_arrow_fire.png differ diff --git a/textures/throwing_arrow_fire_2.png b/textures/throwing_arrow_fire_2.png index ed0aa5f..f86579a 100644 Binary files a/textures/throwing_arrow_fire_2.png and b/textures/throwing_arrow_fire_2.png differ diff --git a/textures/throwing_arrow_fireworks_blue.png b/textures/throwing_arrow_fireworks_blue.png index 36c30bc..5c0e256 100644 Binary files a/textures/throwing_arrow_fireworks_blue.png and b/textures/throwing_arrow_fireworks_blue.png differ diff --git a/textures/throwing_arrow_fireworks_blue_2.png b/textures/throwing_arrow_fireworks_blue_2.png index 672805c..bf2f8ad 100644 Binary files a/textures/throwing_arrow_fireworks_blue_2.png and b/textures/throwing_arrow_fireworks_blue_2.png differ diff --git a/textures/throwing_arrow_fireworks_red.png b/textures/throwing_arrow_fireworks_red.png index fe0fd89..8498adb 100644 Binary files a/textures/throwing_arrow_fireworks_red.png and b/textures/throwing_arrow_fireworks_red.png differ diff --git a/textures/throwing_arrow_fireworks_red_2.png b/textures/throwing_arrow_fireworks_red_2.png index 566c5cb..b33125e 100644 Binary files a/textures/throwing_arrow_fireworks_red_2.png and b/textures/throwing_arrow_fireworks_red_2.png differ diff --git a/textures/throwing_arrow_obsidian.png b/textures/throwing_arrow_obsidian.png index 86e5ef2..c26f864 100644 Binary files a/textures/throwing_arrow_obsidian.png and b/textures/throwing_arrow_obsidian.png differ diff --git a/textures/throwing_arrow_obsidian_2.png b/textures/throwing_arrow_obsidian_2.png index fefcd91..90ef6d1 100644 Binary files a/textures/throwing_arrow_obsidian_2.png and b/textures/throwing_arrow_obsidian_2.png differ diff --git a/textures/throwing_arrow_shell.png b/textures/throwing_arrow_shell.png index a1204d0..01b84d5 100644 Binary files a/textures/throwing_arrow_shell.png and b/textures/throwing_arrow_shell.png differ diff --git a/textures/throwing_arrow_shell_2.png b/textures/throwing_arrow_shell_2.png index ad7bc43..a834ca4 100644 Binary files a/textures/throwing_arrow_shell_2.png and b/textures/throwing_arrow_shell_2.png differ diff --git a/textures/throwing_arrow_steel.png b/textures/throwing_arrow_steel.png index 3d70610..dd9f205 100644 Binary files a/textures/throwing_arrow_steel.png and b/textures/throwing_arrow_steel.png differ diff --git a/textures/throwing_arrow_steel_2.png b/textures/throwing_arrow_steel_2.png index b989983..2098089 100644 Binary files a/textures/throwing_arrow_steel_2.png and b/textures/throwing_arrow_steel_2.png differ diff --git a/textures/throwing_arrow_stone.png b/textures/throwing_arrow_stone.png index c7a14e9..5a818f3 100644 Binary files a/textures/throwing_arrow_stone.png and b/textures/throwing_arrow_stone.png differ diff --git a/textures/throwing_arrow_stone_2.png b/textures/throwing_arrow_stone_2.png index 23617ef..2fd65ac 100644 Binary files a/textures/throwing_arrow_stone_2.png and b/textures/throwing_arrow_stone_2.png differ diff --git a/textures/throwing_arrow_teleport.png b/textures/throwing_arrow_teleport.png index 235745a..7cd174c 100644 Binary files a/textures/throwing_arrow_teleport.png and b/textures/throwing_arrow_teleport.png differ diff --git a/textures/throwing_arrow_teleport_2.png b/textures/throwing_arrow_teleport_2.png index db786ca..86b3542 100644 Binary files a/textures/throwing_arrow_teleport_2.png and b/textures/throwing_arrow_teleport_2.png differ diff --git a/textures/throwing_arrow_tnt.png b/textures/throwing_arrow_tnt.png index 6625cb0..7934bb5 100644 Binary files a/textures/throwing_arrow_tnt.png and b/textures/throwing_arrow_tnt.png differ diff --git a/textures/throwing_arrow_tnt_2.png b/textures/throwing_arrow_tnt_2.png index 426ebff..b3560bf 100644 Binary files a/textures/throwing_arrow_tnt_2.png and b/textures/throwing_arrow_tnt_2.png differ diff --git a/textures/throwing_arrow_torch.png b/textures/throwing_arrow_torch.png index 0126df1..c564c27 100644 Binary files a/textures/throwing_arrow_torch.png and b/textures/throwing_arrow_torch.png differ diff --git a/textures/throwing_arrow_torch_2.png b/textures/throwing_arrow_torch_2.png index 6bf9e11..e2857ec 100644 Binary files a/textures/throwing_arrow_torch_2.png and b/textures/throwing_arrow_torch_2.png differ diff --git a/textures/throwing_arrow_torch_back.png b/textures/throwing_arrow_torch_back.png index 12754c7..3b9fd11 100644 Binary files a/textures/throwing_arrow_torch_back.png and b/textures/throwing_arrow_torch_back.png differ