mob
var/class = "Fighter"
mob/proc/SpecialName()
if(key)
return "[src.key] the [src.class]"
else
return "[src.name] the [src.class]"
mob/Move()
..()
if(client)
for(var/mob/M in view())
src.client.object_name[M] = M.SpecialName()
(Ignoring the fact that it would be much better to only update for newly-spotted mobs.)
Essentially, the object_name variable would be an associative list associated by references on the client's screen. When the client mouses over or attempts to use a verb, the object's name will be first checked from the object_name list. If no entry in that list is present, the client will take the object's name directly from its instance instead.
This would make it possible, for instance, to have generic people on your map called "person" and have people you actually know called "[Personname]".
Seconded. I've wanted to do this several times.