Improve windballs
This commit is contained in:
parent
b294ba6197
commit
19d492ba3c
@ -17,6 +17,7 @@ Game Changes:
|
||||
- Added 3D model to players.
|
||||
- Added guns
|
||||
- Added Electrified Mithril
|
||||
- Improved Windballs
|
||||
|
||||
Bugfixes:
|
||||
|
||||
|
@ -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,
|
||||
})
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user