mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 10:10:21 +01:00
knockback can also use 'knockback' value inside tool groups if found
This commit is contained in:
parent
f1a30679aa
commit
84672a07ce
13
api.lua
13
api.lua
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
-- Mobs Api (17th September 2017)
|
-- Mobs Api (20th September 2017)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20170917"
|
mobs.version = "20170920"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -2249,13 +2249,20 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
|||||||
-- direction error check
|
-- direction error check
|
||||||
dir = dir or {x = 0, y = 0, z = 0}
|
dir = dir or {x = 0, y = 0, z = 0}
|
||||||
|
|
||||||
|
-- check if tool already has specific knockback value
|
||||||
|
if tool_capabilities.damage_groups["knockback"] then
|
||||||
|
kb = tool_capabilities.damage_groups["knockback"]
|
||||||
|
else
|
||||||
|
kb = kb * 2
|
||||||
|
end
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:setvelocity({
|
||||||
x = dir.x * kb,
|
x = dir.x * kb,
|
||||||
y = up,
|
y = up,
|
||||||
z = dir.z * kb
|
z = dir.z * kb
|
||||||
})
|
})
|
||||||
|
|
||||||
self.pause_timer = r
|
self.pause_timer = 0.25 -- r
|
||||||
end
|
end
|
||||||
end -- END if damage
|
end -- END if damage
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user