Manual:DIL Manual/sex

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:14, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

sex

Field (integer, read/write; units: characters).

ch.sex : integer

The character's sex: SEX_NEUTRAL (0), SEX_MALE (1) or SEX_FEMALE (2), from vme.h. A zone file sets it with sex in an NPC; a player chooses it when the character is made. The pronouns $1e, $1m and $1s in act() follow it (he, him, his; she, her, her; it, it, its).

Notes

  • On an object, a room or null it fails.
  • Stored as an 8-bit number; any value other than SEX_NEUTRAL and SEX_MALE gives the female pronouns. No access level is needed to assign it.
  • A player's height, weight and lifespan come from the race and sex (races.def); after changing a player's sex, reset_race() rolls them again.

Example

dilbegin string sir_or_madam(ch : unitptr);
code
{
   if (ch.sex == SEX_MALE)
      return ("sir");
   if (ch.sex == SEX_FEMALE)
      return ("madam");
   return ("friend");
}
dilend

Picks how a shopkeeper addresses a customer.

See also