diff --git a/CHANGELOG.md b/CHANGELOG.md index b0d2783..b7fe01a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Game Changes: - Added 3D model to players. - Added guns - Added Electrified Mithril +- Improved Windballs Bugfixes: diff --git a/mods/ITEMS/pyutest_guns/api.lua b/mods/ITEMS/pyutest_guns/api.lua index 63b80f3..b4dc115 100644 --- a/mods/ITEMS/pyutest_guns/api.lua +++ b/mods/ITEMS/pyutest_guns/api.lua @@ -1,4 +1,4 @@ -PyuTest.make_gun = function(name, desc, texture, cooldown, damage) +PyuTest.make_gun = function(name, desc, texture, cooldown, damage, extra) local bullet_id = name .. "_bullet" local cd = cooldown or 1 @@ -7,13 +7,17 @@ PyuTest.make_gun = function(name, desc, texture, cooldown, damage) gun = 1, }, texture, { stack_max = 1, - + on_use = function(itemstack, user, pointed_thing) PyuTest.shoot_projectile_from_object(bullet_id, user, 35) core.sound_play("pyutest_shoot", { pos = user:get_pos() }) + if extra ~= nil then + extra(itemstack, user, pointed_thing) + end + return itemstack end, }) diff --git a/mods/ITEMS/pyutest_magic/tools.lua b/mods/ITEMS/pyutest_magic/tools.lua index 24c3b7b..d68287f 100644 --- a/mods/ITEMS/pyutest_magic/tools.lua +++ b/mods/ITEMS/pyutest_magic/tools.lua @@ -87,11 +87,14 @@ PyuTest.make_item("pyutest_magic:windball", "Windball", {}, "pyutest-windball.pn local vel = user:get_velocity() - user:add_velocity({ - x = vel.x * 2.5, - z = vel.z * 2.5, - y = math.random(11, 14) - }) + -- user:add_velocity({ + -- x = vel.x * 2.5, + -- z = vel.z * 2.5, + -- y = math.random(11, 14) + -- }) + + local dir = user:get_look_dir() + user:add_velocity(vector.multiply(-dir, 15)) local stack = user:get_wielded_item() stack:set_count(stack:get_count() - 1)