alignment

alignment <creature>

The moral alignment of a creature, as a word.

Alignment is stored as a number internally, but this built-in reports the band it falls into rather than the raw value.

Arguments

Returns

A string — one of good, evil, or neutral.

Examples

after command (say) {
  do "say Your alignment is [alignment $actor]."
}

When the actor is the mob Puff, [alignment $actor] evaluates to good, and the mob says "Your alignment is good."

Branch on the band with streqi:

before command (enter) {
  require [streqi [alignment $actor] "evil"]
  do "say The wards flare against your dark presence."
}

The require guard advances to the next matching handler unless the actor is evil; only an evil actor triggers the warning.

See also