mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-03-28 15:00:30 +01:00
if max_light_damage is 16 then use natural light value to damage mob
This commit is contained in:
parent
9c72f0559d
commit
14a3dc83e5
8
api.lua
8
api.lua
@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20230502",
|
version = "20230514",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -381,7 +381,7 @@ function mob_class:set_yaw(yaw, delay)
|
|||||||
yaw = 0
|
yaw = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
delay = mob_smooth_rotate and (delay or 0) or 0
|
delay = mob_smooth_rotate and delay or 0
|
||||||
|
|
||||||
-- simplified yaw clamp
|
-- simplified yaw clamp
|
||||||
if yaw > 6.283185 then
|
if yaw > 6.283185 then
|
||||||
@ -1161,8 +1161,8 @@ function mob_class:do_env_damage()
|
|||||||
|
|
||||||
local light
|
local light
|
||||||
|
|
||||||
-- if min and max light set to 15 then only kill with natural sunlight
|
-- if max set to 16 then only kill mob with natural sunlight
|
||||||
if self.light_damage_min == 15 and self.light_damage_max == 15 then
|
if self.light_damage_max == 16 then
|
||||||
light = minetest.get_natural_light(pos) or 0
|
light = minetest.get_natural_light(pos) or 0
|
||||||
else
|
else
|
||||||
light = minetest.get_node_light(pos) or 0
|
light = minetest.get_node_light(pos) or 0
|
||||||
|
2
api.txt
2
api.txt
@ -90,7 +90,7 @@ functions needed for the mob to work properly which contains the following:
|
|||||||
level is between the min and max values below
|
level is between the min and max values below
|
||||||
'light_damage_min' minimum light value when mob is affected (default: 14)
|
'light_damage_min' minimum light value when mob is affected (default: 14)
|
||||||
'light_damage_max' maximum light value when mob is affected (default: 15)
|
'light_damage_max' maximum light value when mob is affected (default: 15)
|
||||||
When both set to 15, only kill mob with natural light.
|
When set to 16 then only natural light will kill mob.
|
||||||
'suffocation' when > 0 mobs will suffocate inside solid blocks and will be
|
'suffocation' when > 0 mobs will suffocate inside solid blocks and will be
|
||||||
hurt by the value given every second (0 to disable).
|
hurt by the value given every second (0 to disable).
|
||||||
'floats' when set to 1 mob will float in water, 0 has them sink.
|
'floats' when set to 1 mob will float in water, 0 has them sink.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user