renamed yl_speak_up.on_rightclick to yl_speak_up.mobs_on_rightclick to show that this is a function for mobs_redo

This commit is contained in:
Sokomine 2023-07-08 02:45:34 +02:00
parent 16a97ee6b4
commit 27e4da4a03
2 changed files with 14 additions and 7 deletions

View File

@ -4,12 +4,19 @@
-- Mob functions
--###
-- TODO: mob_table is currently unused
function yl_speak_up.init_mob_table()
return false
end
function yl_speak_up.on_rightclick(self, clicker)
-- React to right-clicking a mobs_redo mob:
-- * capture the mob with a lasso or net (if appropriate)
-- * protect the mob with a protector
-- * if none of the above applies: actually talk to the mob
-- This is so often needed (but also mobs_redo specific!) that we provide
-- an extra easy-to-call function here.
function yl_speak_up.mobs_on_rightclick(self, clicker)
--local item = clicker:get_wielded_item()
local name = clicker:get_player_name()

View File

@ -46,7 +46,7 @@ mobs:register_mob("yl_speak_up:human", {
punch_end = 219,
},
on_rightclick = yl_speak_up.on_rightclick,
on_rightclick = yl_speak_up.mobs_on_rightclick,
on_spawn = yl_speak_up.on_spawn,
after_activate = yl_speak_up.after_activate
})
@ -101,7 +101,7 @@ mobs:register_mob("yl_speak_up:elf", {
punch_end = 219,
},
on_rightclick = yl_speak_up.on_rightclick,
on_rightclick = yl_speak_up.mobs_on_rightclick,
on_spawn = yl_speak_up.on_spawn,
after_activate = yl_speak_up.after_activate
})
@ -156,7 +156,7 @@ mobs:register_mob("yl_speak_up:dwarf", {
punch_end = 219,
},
on_rightclick = yl_speak_up.on_rightclick,
on_rightclick = yl_speak_up.mobs_on_rightclick,
on_spawn = yl_speak_up.on_spawn,
after_activate = yl_speak_up.after_activate
})
@ -211,7 +211,7 @@ mobs:register_mob("yl_speak_up:goblin", {
punch_end = 219,
},
on_rightclick = yl_speak_up.on_rightclick,
on_rightclick = yl_speak_up.mobs_on_rightclick,
on_spawn = yl_speak_up.on_spawn,
after_activate = yl_speak_up.after_activate
})
@ -266,7 +266,7 @@ mobs:register_mob("yl_speak_up:orc", {
punch_end = 219,
},
on_rightclick = yl_speak_up.on_rightclick,
on_rightclick = yl_speak_up.mobs_on_rightclick,
on_spawn = yl_speak_up.on_spawn,
after_activate = yl_speak_up.after_activate
})
@ -325,7 +325,7 @@ mobs:register_mob("yl_speak_up:npc", {
punch_end = 219,
},
on_rightclick = yl_speak_up.on_rightclick,
on_rightclick = yl_speak_up.mobs_on_rightclick,
on_spawn = yl_speak_up.on_spawn,
after_activate = yl_speak_up.after_activate
})