forked from VoxeLibre/VoxeLibre
Readjust pvp enchant knockback to make the running knockback difference more pronounced
This commit is contained in:
parent
a8c2d4534a
commit
96aaf89036
|
@ -278,7 +278,7 @@ function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool
|
||||||
end
|
end
|
||||||
if hitter and hitter:is_player() then
|
if hitter and hitter:is_player() then
|
||||||
local wielditem = hitter:get_wielded_item()
|
local wielditem = hitter:get_wielded_item()
|
||||||
knockback = knockback + 6 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
knockback = knockback + 5 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
||||||
-- add player velocity to knockback
|
-- add player velocity to knockback
|
||||||
local v = player:get_velocity()
|
local v = player:get_velocity()
|
||||||
local hv = hitter:get_velocity()
|
local hv = hitter:get_velocity()
|
||||||
|
@ -286,7 +286,7 @@ function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool
|
||||||
local hitter_mag = math.sqrt((hv.x * hv.x) + (hv.z * hv.z))
|
local hitter_mag = math.sqrt((hv.x * hv.x) + (hv.z * hv.z))
|
||||||
local player_mag = math.sqrt((v.x * v.x) + (v.z * v.z))
|
local player_mag = math.sqrt((v.x * v.x) + (v.z * v.z))
|
||||||
if dir_dot > 0 and player_mag <= hitter_mag * 0.625 then
|
if dir_dot > 0 and player_mag <= hitter_mag * 0.625 then
|
||||||
knockback = knockback + hitter_mag * 0.0625
|
knockback = knockback + hitter_mag * 0.375
|
||||||
end
|
end
|
||||||
elseif luaentity and luaentity._knockback then
|
elseif luaentity and luaentity._knockback then
|
||||||
local kb = knockback + luaentity._knockback / 4
|
local kb = knockback + luaentity._knockback / 4
|
||||||
|
|
Loading…
Reference in New Issue