More death messages, more reliable

This commit is contained in:
Wuzzy 2019-03-08 20:22:01 +01:00
parent db8d7af245
commit 20576431e1
12 changed files with 148 additions and 128 deletions

View file

@ -2,6 +2,6 @@ mcl_core
mcl_sounds
mcl_util
walkover
mcl_death_messages
mcl_death_messages?
doc_items
doc?

View file

@ -1,5 +1,7 @@
local S = minetest.get_translator("mcl_nether")
local mod_death_messages = minetest.get_modpath("mcl_death_messages")
minetest.register_node("mcl_nether:glowstone", {
description = S("Glowstone"),
_doc_items_longdesc = S("Glowstone is a naturally-glowing block which is home to the Nether."),
@ -91,7 +93,9 @@ minetest.register_node("mcl_nether:magma", {
on_walk_over = function(loc, nodeiamon, player)
-- Hurt players standing on top of this block
if player:get_hp() > 0 then
mcl_death_messages.player_damage(player, string.format("%s stood too long on a magma block.", player:get_player_name()))
if mod_death_messages then
mcl_death_messages.player_damage(player, string.format("%s stood too long on a magma block.", player:get_player_name()))
end
player:set_hp(player:get_hp() - 1)
end
end,

View file

@ -1,6 +1,7 @@
mcl_throwing = {}
local S = minetest.get_translator("mcl_throwing")
local mod_death_messages = minetest.get_modpath("mcl_death_messages")
--
-- Snowballs and other throwable items
@ -267,6 +268,10 @@ local pearl_on_step = function(self, dtime)
local oldpos = player:get_pos()
-- Teleport and hurt player
player:set_pos(telepos)
if mod_death_messages then
mcl_death_messages.player_damage(player, S("@1 used the ender pearl too often.", player:get_player_name()))
end
-- TODO: Deal as fall damage
player:set_hp(player:get_hp() - 5)
-- 5% chance to spawn endermite at the player's origin