Page 1 of 1

Display number of times monster killed in tooltip

Posted: Sun Oct 17, 2010 1:30 pm
by Shoob
New NPC.lua tooltip function

Code: Select all

function _M:tooltip(x, y, seen_by)
	local str = mod.class.Actor.tooltip(self, x, y, seen_by)
	if not str then return end
	local killed = (game.player.all_kills[self.name] or 0)

	return str..([[
Killed: %d

Target: %s
UID: %d]]):format(
	killed,
	self.ai_target.actor and self.ai_target.actor.name or "none",
	self.uid)
end

Re: Display number of times monster killed in tooltip

Posted: Sun Oct 17, 2010 1:37 pm
by darkgod
Good idea, done

Re: Display number of times monster killed in tooltip

Posted: Sun Oct 17, 2010 3:39 pm
by Final Master
I like this very much.

Re: Display number of times monster killed in tooltip

Posted: Sun Oct 17, 2010 9:10 pm
by yufra
There should be a newline character in front of the "Killed by you"... it currently is tacked onto the last effect.