SLUDGE

hasFlag


Syntax:

hasFlag (thisObject, thisFlag);

Purpose:

Checks to see whether the object thisObject has the object flag thisFlag. Flags are specified when creating object types and cannot subsequently be changed by the game.

Return value:

TRUE if thisObject has the flag thisFlag set. FALSE if not.

Example:

objectType kevin () {
flag ALIVE;
}

objectType hilda () {
flags ALIVE, FEMALE;
}

objectType rock () {
}

sub failToLift (something) {
   if (hasFlag (something, ALIVE)) {
      if (hasFlag (something, FEMALE)) {
         say (ego, "I don't want to pick her up.");
      } else {
         say (ego, "I don't want to pick him up.");
      }
   } else {
      say (ego, "I don't want to pick that up.");
   }
}

See also:

fetchEvent