Help

JS-ROOM-VISIT

Some of the room visit*() methods can also take a distance parameter. This specifies that not only should things in the current room be visited, but also things up to "distance" rooms away. For example:

function fly( o ) {
  o.msg( "A cool, magical breeze wafts lightly through the forest..." );
  o.addAura( 'fly', Mud.dice( 1, 8 ) );
}
function good( o ) {
  o.isGood();
}
inRoom.visitChars( 3, fly, good );

The previous example would add the fly aura to all good characters in the current room and any room that is up to 3 rooms away.

visitPlayers() works similarly but only affects players. When you only want to affect players, use visitPlayers() as it is far more efficient.