Add infotext to parrot NPCs
This commit is contained in:
parent
af17b3a1d6
commit
172fbb6806
@ -285,6 +285,13 @@ local parrot_activate = function(self)
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
self._next_animation_at = math.random(PARROT_ANIMATION_DELAY_MIN, PARROT_ANIMATION_DELAY_MAX)
|
||||
end
|
||||
local parrot_activate_goldie = function(self)
|
||||
parrot_activate(self)
|
||||
self.object:set_properties({
|
||||
infotext = S(GOLDIE_NAME_SHORT)
|
||||
})
|
||||
end
|
||||
|
||||
local parrot_step_idle = function(self, dtime)
|
||||
if self._scorched then
|
||||
self._scorched_timer = self._scorched_timer + dtime
|
||||
@ -376,7 +383,7 @@ minetest.register_entity("lzr_parrot_npc:parrot", {
|
||||
_scorch = parrot_scorch,
|
||||
_base_textures = texture_repeat("lzr_parrot_npc_goldie.png"),
|
||||
|
||||
on_activate = parrot_activate,
|
||||
on_activate = parrot_activate_goldie,
|
||||
on_step = parrot_step_idle,
|
||||
on_rightclick = function(self, clicker)
|
||||
react(self, clicker)
|
||||
@ -568,9 +575,11 @@ minetest.register_entity("lzr_parrot_npc:hidden_parrot", {
|
||||
-- MUST be called right after spawning entity.
|
||||
_init = function(self, hidden_id)
|
||||
self._hidden_id = hidden_id
|
||||
local name = S(hidden_parrot_names_short[hidden_id])
|
||||
local textures = texture_repeat("lzr_parrot_npc_"..hidden_id..".png")
|
||||
self.object:set_properties({
|
||||
textures = textures,
|
||||
infotext = name,
|
||||
})
|
||||
self._base_textures = textures
|
||||
end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user