Help

JS-CARDINALITY

Many methods support a "cardinality" mode. All of these methods work similarly. They either take one argument which is the argument to match for or they take a "cardinality mode" and then a list of arguments to match on. The cardinality modes are:

any          At least one of the arguments must be present.
all          All of the arguments must be present.
one          One and only one of the arguments must be present.
none         None of the arguments must be present.

The following returns true if the actor has object #23122.

actor.has( 23122 )

This returns true if the actor has either #23122 or #23142.

actor.has( 'any', 23122, 23142 )

This returns true if the actor has #23122, #23142, AND #23144 equipped.

actor.hasEq( 'all', 23122, 23142, 23144 )

This returns true if the actor has either the Cleric or Mage class but NOT both.

actor.hasClass( 'one', 'cl', 'ma' )

This returns true if the room has neither the 'arena' or 'battlefield' flags.

self.hasFlag( 'none', 'arena', 'battlefield' )

Cardinalities also work with arrays. See JS-CARDINALITY-ARRAY for an example.