Kill snow golems in rain

This commit is contained in:
Wuzzy 2018-05-30 12:01:53 +02:00
parent 69b3e19c1b
commit d575cf07b7
4 changed files with 16 additions and 0 deletions

View File

@ -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,

View File

@ -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

View File

@ -1,4 +1,5 @@
mcl_core mcl_core
mcl_weather?
mcl_tnt? mcl_tnt?
invisibility? invisibility?
intllib? intllib?

View File

@ -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