This is a simple gender-aware Character class for allowing users to insert custom markers in their text to indicate gender-aware messaging. It relies on a modified msg() and is meant as an inspiration and starting point to how to do stuff like this.
- An object can have the following genders:
When in use, messages can contain special tags to indicate pronouns gendered based on the one being addressed. Capitalization will be retained.
|s, |S: Subjective form: he, she, it, He, She, It, They
|o, |O: Objective form: him, her, it, Him, Her, It, Them
|p, |P: Possessive form: his, her, its, His, Her, Its, Their
|a, |A: Absolute Possessive form: his, hers, its, His, Hers, Its, Theirs
char.msg(“%s falls on |p face with a thud.” % char.key) “Tom falls on his face with a thud”
The default gender is “ambiguous” (they/them/their/theirs).
To use, have DefaultCharacter inherit from this, or change setting.DEFAULT_CHARACTER to point to this class.
The @gender command is used to set the gender. It needs to be added to the default cmdset before it becomes available.
Sets gender on yourself
Implements the command.
This is a Character class aware of gender.
Called once when the object is created.
msg(text=None, from_obj=None, session=None, **kwargs)¶
Emits something to a session attached to the object. Overloads the default msg() implementation to include gender-aware markers in output.
text (str or tuple, optional) – The message to send. This is treated internally like any send-command, so its value can be a tuple if sending multiple arguments to the text oob command.
from_obj (obj, optional) – object that is sending. If given, at_msg_send will be called
session (Session or list, optional) – session or list of sessions to relay to, if any. If set, will force send regardless of MULTISESSION_MODE.
at_msg_receive will be called on this Object. All extra kwargs will be passed on to the protocol.