1
0
Fork 0

Merge pull request 'Added conditional based on existing fire damage conditional that will apply fire damage to a' (#3405) from magma_damage_guy into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3405
hardcore_mode_test
ancientmarinerdev 2023-02-06 00:22:48 +00:00
commit 5fbec2f6b5
2 changed files with 14 additions and 1 deletions

View File

@ -644,6 +644,7 @@ function mob_class:do_env_damage()
end end
local nodef = minetest.registered_nodes[self.standing_in] local nodef = minetest.registered_nodes[self.standing_in]
local nodef2 = minetest.registered_nodes[self.standing_on]
-- rain -- rain
if self.rain_damage > 0 then if self.rain_damage > 0 then
@ -675,7 +676,19 @@ function mob_class:do_env_damage()
return true return true
end end
end end
-- magma damage
elseif self.fire_damage > 0
and (nodef2.groups.fire) then
if self.fire_damage ~= 0 then
self.health = self.health - self.fire_damage
if self:check_for_death("fire", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
end
end
-- lava damage -- lava damage
elseif self.lava_damage > 0 elseif self.lava_damage > 0
and (nodef.groups.lava) then and (nodef.groups.lava) then

View File

@ -130,7 +130,7 @@ minetest.register_node("mcl_nether:magma", {
is_ground_content = true, is_ground_content = true,
light_source = 3, light_source = 3,
sunlight_propagates = false, sunlight_propagates = false,
groups = {pickaxey=1, building_block=1, material_stone=1}, groups = {pickaxey=1, building_block=1, material_stone=1, fire=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
-- From walkover mod -- From walkover mod
on_walk_over = function(loc, nodeiamon, player) on_walk_over = function(loc, nodeiamon, player)