forked from VoxeLibre/VoxeLibre
Compare commits
9 Commits
master
...
player_vs_
Author | SHA1 | Date |
---|---|---|
|
00165959af | |
|
4cd2962a87 | |
|
be2fcc925a | |
|
5ebe9f549b | |
|
107fb0b082 | |
|
91a3f11689 | |
|
72768d9191 | |
|
98a61ec0be | |
|
b2da2b2f63 |
|
@ -532,6 +532,13 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
return
|
||||
end
|
||||
|
||||
local time_now = minetest.get_us_time()
|
||||
|
||||
-- check for invulnerability time in microseconds (0.5 second)
|
||||
if time_now - self.last_invul_time <= 500000 then
|
||||
return
|
||||
end
|
||||
|
||||
local is_player = hitter:is_player()
|
||||
|
||||
if is_player then
|
||||
|
@ -657,6 +664,9 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
-- do damage
|
||||
self.health = self.health - damage
|
||||
|
||||
-- give invulnerability
|
||||
self.last_invul_time = time_now
|
||||
|
||||
-- skip future functions if dead, except alerting others
|
||||
if self:check_for_death( "hit", {type = "punch", puncher = hitter}) then
|
||||
die = true
|
||||
|
@ -672,7 +682,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
if not v then return end
|
||||
local r = 1.4 - math.min(punch_interval, 1.4)
|
||||
local kb = r * (math.abs(v.x)+math.abs(v.z))
|
||||
local up = 2
|
||||
local up = 2.5
|
||||
|
||||
if die==true then
|
||||
kb=kb*2
|
||||
|
@ -689,7 +699,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
if tool_capabilities.damage_groups["knockback"] then
|
||||
kb = tool_capabilities.damage_groups["knockback"]
|
||||
else
|
||||
kb = kb * 1.5
|
||||
kb = kb * 2.5
|
||||
end
|
||||
|
||||
|
||||
|
@ -699,7 +709,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
end
|
||||
if hitter and is_player then
|
||||
local wielditem = hitter:get_wielded_item()
|
||||
kb = kb + 3 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
||||
kb = kb + 10 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
||||
elseif luaentity and luaentity._knockback then
|
||||
kb = kb + luaentity._knockback
|
||||
end
|
||||
|
|
|
@ -220,6 +220,7 @@ function mcl_mobs.register_mob(name, def)
|
|||
replace_delay = def.replace_delay or 0,
|
||||
timer = 0,
|
||||
env_damage_timer = 0,
|
||||
last_invul_time = 0,
|
||||
tamed = false,
|
||||
pause_timer = 0,
|
||||
horny = false,
|
||||
|
|
|
@ -173,7 +173,7 @@ minetest.register_globalstep(function(dtime)
|
|||
end
|
||||
end
|
||||
|
||||
elseif food_tick_timer > 0.5 and food_level == 20 and food_saturation_level > 0 then -- fast regeneration
|
||||
elseif food_tick_timer > 4 and food_level == 20 and food_saturation_level > 0 then -- fast regeneration
|
||||
if player_health > 0 and player_health < 20 then
|
||||
food_tick_timer = 0
|
||||
player:set_hp(player_health+1)
|
||||
|
|
|
@ -39,7 +39,7 @@ local node_def = {
|
|||
shearsy_wool = { speed = 1, level = 0, uses = 0 },
|
||||
shearsy_cobweb = { speed = 1, level = 0, uses = 0 },
|
||||
},
|
||||
range = tonumber(minetest.settings:get("mcl_hand_range")) or 4.5
|
||||
range = tonumber(minetest.settings:get("mcl_hand_range")) or 3.5
|
||||
}
|
||||
|
||||
-- This is for _mcl_autogroup to know about the survival hand tool capabilites
|
||||
|
|
|
@ -82,8 +82,8 @@ mcl_craftguide_progressive_mode (Learn crafting recipes progressively) bool true
|
|||
mcl_enable_skin_customization (Enable player skin customization) bool true
|
||||
|
||||
# How far the player hand can reach
|
||||
# Default:4.5
|
||||
mcl_hand_range (Hand range) float 4.5 1 128
|
||||
# Default:3.5
|
||||
mcl_hand_range (Hand range) float 3.5 1 128
|
||||
|
||||
# How far the player hand can reach in creative mode
|
||||
# Default:10
|
||||
|
|
Loading…
Reference in New Issue