write("You bing at "+target->query_name()+".\n");
tell_object(target, this_player()->query_name()+" bings at you.\n");
tell_room(environment(this_player()), this_player()->query_name()+" bings at "+target->query_name()+".\n");
Compare that to the following:
this_player()->targetted_action("$N $vbing at $t.\n", target);
The message module will create the appropriate messages and send them to the correct places. targetted_action can be called in any object which has inherited the MESSAGES module.
for simple actions only involving the doer and optionally some objects (or strings, see below)
same as simple_action, but only sends messages to the room
only send messages to the doer
for simple actions involving the doer, a target, and possibly some objects or strings
Here are the variables that can be used in messages:
$n1 $v1kick $t11 and not $n1 $v1kick $t.
The second gives "Beek kicks him" instead of "himself" when $n0 is someone else.
"$N $vpuke on $t. $N1 $v1are covered with slime!"
A couple things to note: $V1 is the correct way to make $N1 the subject of the sentence. Also, "is" is given in the 2nd person form ("are"). This means you have to switch your perspective when switching subjects. The first half of the sentence is written from the perspective of the puker; the second half from the perspective of the pukee.
string* action( string* wholist, message [, mixed ob [, mixed ob2 ]] )
The wholist is a list of people participating in the action, i.e. ({ this_player(), target }), and corresponds to $N0, $N1, etc ... The message and objects are the same as above.
The routine returns an array of strings; one string containing a message for each person in the who list, and an extra one for anyone who isn't directly involved (the simple routines send that message to the room).
These messages can then be sent wherever you want, etc. A routine exists to send them, if you're doing something that is *almost* simple (maybe the messages have to be seen in more than one room, etc).
inform(wholist, msgs, other)
where wholist is the wholist from above, msgs was returned by action() and other is the object to send the extra message to via tell_room().