evennia.contrib.game_systems.gendersub.gendersub

Gendersub

Griatch 2015

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:
  • male (he/his)

  • female (her/hers)

  • neutral (it/its)

  • ambiguous (they/them/their/theirs)

Usage

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

For example,

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.

class evennia.contrib.game_systems.gendersub.gendersub.SetGender(**kwargs)[source]

Bases: evennia.commands.command.Command

Sets gender on yourself

Usage:

@gender male || female || neutral || ambiguous

key = 'gender'
aliases = ['sex']
locks = 'cmd:all();call:all()'
func()[source]

Implements the command.

help_category = 'general'
lock_storage = 'cmd:all();call:all()'
search_index_entry = {'aliases': 'sex', 'category': 'general', 'key': 'gender', 'no_prefix': ' sex', 'tags': '', 'text': '\n Sets gender on yourself\n\n Usage:\n @gender male || female || neutral || ambiguous\n\n '}
class evennia.contrib.game_systems.gendersub.gendersub.GenderCharacter(*args, **kwargs)[source]

Bases: evennia.objects.objects.DefaultCharacter

This is a Character class aware of gender.

at_object_creation()[source]

Called once when the object is created.

msg(text=None, from_obj=None, session=None, **kwargs)[source]

Emits something to a session attached to the object. Overloads the default msg() implementation to include gender-aware markers in output.

Parameters
  • 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.

Notes

at_msg_receive will be called on this Object. All extra kwargs will be passed on to the protocol.

exception DoesNotExist

Bases: evennia.objects.objects.DefaultCharacter.DoesNotExist

exception MultipleObjectsReturned

Bases: evennia.objects.objects.DefaultCharacter.MultipleObjectsReturned

path = 'evennia.contrib.game_systems.gendersub.gendersub.GenderCharacter'
typename = 'GenderCharacter'