communication

lib
OBJECT
        /obj/lib/communication


LAST UPDATE
	Thragor, 19-Jun-95, 20:00 MET


SYNOPSIS
	inherit "/obj/lib/communication";


DESCRIPTION
	communication is used to do the communication in rooms. It may
	be used at other places, but this is the main idea. Actually
	it is used in /obj/healer to do the chats, e. g. when the
	healer healed someone.

	  string Name(void|int cap)
	    You have to define this function in your file using
	    /obj/lib/communication, to return e. g. the name of the
	    healer. If <cap> is not zero, the name should be returned
	    capitalized. The function defined in
	    /obj/lib/communication just returns "someone" as default.
	    Example:
	      public varargs string Name(int cap)
	      {
	        return cap?"The healer":"the healer";
	      }

	The following function are for use in the strings given to
	Say() and Emote(). Those strings will be parsed through
	process_string(). To give the argument 'cap' just append "|1"
	behind the function which shall be called:
	  "@@PlPronoun|1@@ smiles happily.\n"
	  "You are puzzle as you see @@PlObjective@@ laughing.\n"
	The argument to the function is just boolean, but has to be
	'string' because the argument in process_string is passed as
	string-value.

	  string PlName(string cap)
	    Returns the result of this_player()->QueryName().

	  string PlPronoun(string cap)
	    Returns the result of this_player()->QueryPronoun().

	  string PlPossessive(string cap)
	    Returns the result of this_player()->QueryPossessive().

	  string PlObjective(string cap)
	    Returns the result of this_player()->QueryObjective().

	  string PlGenitive(string cap)
	    Returns the result of add_gen(this_player()->QueryName()).

	The following functions do the communication in a room, i. e.
	emoting and speaking.
	
	  void Emote(string|string *|closure message)
	    Print a message with a leading: Name()+" ".
	    The message might be a simple string, which will be
	    displayed only to this_player() or an array of strings
	    where the size says what to do with its contents:
	      1: is handled as if it is just a simple string;
	      2: the first message is printed to the player and the
	         second one to her/his environment;
	      3: the first message is printed to the player, the
                 second one to all persons in the environment who can
	         see and the third one to all who can't;
	      4: the first message is printed to the player if (s)he
	         can see, the second one if (s)he can't, the third one
	         to the environment who can see and the last one to
	         the environment who can't.
	    If an array-content is 0, it will be ignored (not printed
	    at all).

	  void Say(string|closure message)
	    Print a message with a leading: Name()+" says: ".
	    If the message is a closure it will be evaluated. If the
	    result is a string it will be printed just like said
	    before, otherwise nothing will be done.


INHERITANCE TREE
        communication


SEE ALSO