mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-24 20:03:45 +01:00
Kill snow golems in rain
This commit is contained in:
parent
69b3e19c1b
commit
d575cf07b7
@ -646,6 +646,17 @@ local do_env_damage = function(self)
|
|||||||
|
|
||||||
local nodef = minetest.registered_nodes[self.standing_in]
|
local nodef = minetest.registered_nodes[self.standing_in]
|
||||||
|
|
||||||
|
-- rain
|
||||||
|
if self.rain_damage and minetest.get_modpath("mcl_weather") then
|
||||||
|
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||||
|
|
||||||
|
self.health = self.health - self.rain_damage
|
||||||
|
|
||||||
|
if check_for_death(self, "rain", {type = "environment",
|
||||||
|
pos = pos, node = self.standing_in}) then return end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
pos.y = pos.y + 1 -- for particle effect position
|
pos.y = pos.y + 1 -- for particle effect position
|
||||||
|
|
||||||
-- water
|
-- water
|
||||||
@ -3097,6 +3108,7 @@ minetest.register_entity(name, {
|
|||||||
|
|
||||||
-- MCL2 extensions
|
-- MCL2 extensions
|
||||||
ignores_nametag = def.ignores_nametag or false,
|
ignores_nametag = def.ignores_nametag or false,
|
||||||
|
rain_damage = def.rain_damage or 0,
|
||||||
|
|
||||||
on_spawn = def.on_spawn,
|
on_spawn = def.on_spawn,
|
||||||
|
|
||||||
|
@ -208,6 +208,7 @@ functions needed for the mob to work properly which contains the following:
|
|||||||
MineClone 2 extensions:
|
MineClone 2 extensions:
|
||||||
|
|
||||||
'ignores_nametag' if true, mob cannot be named by nametag
|
'ignores_nametag' if true, mob cannot be named by nametag
|
||||||
|
'rain_damage' damage per second if mob is standing in rain (default: 0)
|
||||||
|
|
||||||
|
|
||||||
Node Replacement
|
Node Replacement
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
mcl_core
|
mcl_core
|
||||||
|
mcl_weather?
|
||||||
mcl_tnt?
|
mcl_tnt?
|
||||||
invisibility?
|
invisibility?
|
||||||
intllib?
|
intllib?
|
||||||
|
@ -101,6 +101,8 @@ mobs:register_mob("mobs_mc:snowman", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
rain_damage = 4,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- This is to be called when a pumpkin or jack'o lantern has been placed. Recommended: In the on_construct function
|
-- This is to be called when a pumpkin or jack'o lantern has been placed. Recommended: In the on_construct function
|
||||||
|
Loading…
Reference in New Issue
Block a user