Manual:DIL Manual/sex
Jump to navigation
Jump to search
Contents
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_NEUTRALandSEX_MALEgives 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.