diff --git a/docs/0.9.5/.buildinfo b/docs/0.9.5/.buildinfo index 995fa84411..6e728d38a6 100644 --- a/docs/0.9.5/.buildinfo +++ b/docs/0.9.5/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 4ca5726806a25c6c1d72261c24239678 +config: d9dce5655627bbc3b289deb13b5ed2ba tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/0.9.5/Default-Commands.html b/docs/0.9.5/Default-Commands.html index 51527f427a..86c07404cc 100644 --- a/docs/0.9.5/Default-Commands.html +++ b/docs/0.9.5/Default-Commands.html @@ -53,31 +53,31 @@ with Batch-Processor’s interactive mode.

diff --git a/docs/1.0-dev/Concepts/Change-Messages-Per-Receiver.html b/docs/1.0-dev/Concepts/Change-Messages-Per-Receiver.html new file mode 100644 index 0000000000..2ad0d4518c --- /dev/null +++ b/docs/1.0-dev/Concepts/Change-Messages-Per-Receiver.html @@ -0,0 +1,473 @@ + + + + + + + + + Sending different messages depending on viewpoint and receiver — Evennia 1.0-dev documentation + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Sending different messages depending on viewpoint and receiver

+

Sending messages to everyong in a location is handled by the +msg_contents method on +all Objects. It’s most commonly called on rooms.

+
room.msg_contents("Anna walks into the room.")
+
+
+

You can also embed references in the string:

+

+room.msg_contents("{anna} walks into the room.", 
+                  from_obj=caller, 
+                  mapping={'anna': anna_object})
+
+
+

Use exclude=object_or_list_of_object to skip sending the message one or more targets.

+

The advantage of this is that anna_object.get_display_name(looker) will be called +for every onlooker; this allows the {anna} stanza to be different depending on who +sees the strings. How this is to work depends on the stance of your game.

+

The stance indicates how your game echoes its messages to the player. Knowing how you want to +handle the stance is important for a text game. There are two main stances that are usually considered, +Actor stance and Director stance.

+ + + + + + + + + + + + + + + + + +

Stance

You see

Others in the same location see

Actor stance

You pick up the stone

Anna picks up the stone

Director stance

Anna picks up the stone

Anna picks up the stone

+

It’s not unheard of to mix the two stances - with commands from the game being told +in Actor stance while Director stance is used for complex emoting and roleplaying. One should +usually try to be consistent however.

+
+

Director Stance

+

While not so common as Actor stance, director stance has the advantage of simplicity, particularly +in roleplaying MUDs where longer roleplaying emotes are used. It is also a pretty simple stance to +implement technically since everyone sees the same text, regardless of viewpoint.

+

Here’s an example of a flavorful text to show the room:

+
Tom picks up the gun, whistling to himself.
+
+
+

Everyone will see this string, both Tom and others. Here’s how to send it to everyone in +the room.

+
text = "Tom picks up the gun, whistling to himself."
+room.msg_contents(text)
+
+
+

One may want to expand on it by making the name Tom be seen differently by different people, +but the English grammar of the sentence does not change. Not only is this pretty easy to do +technically, it’s also easy to write for the player.

+
+
+

Actor Stance

+

This means that the game addresses “you” when it does things. In actor stance, whenever you perform +an action, you should get a different message than those observing you doing that action.

+
Tom picks up the gun, whistling to himself.
+
+
+

This is what others should see. The player themselves should see this:

+
You pick up the gun, whistling to yourself.
+
+
+

Not only do you need to map “Tom” to “You” above, there are also grammatical differences - +“Tom walks” vs “You walk” and “himself” vs “yourself”. This is a lot more complex to handle. For a +developer making simple “You/Tom pick/picks up the stone” messages, you could in principle hand-craft +the strings from every view point, but there’s a better way.

+

The msg_contents method helps by parsing the ingoing string with a +FuncParser functions with some very specific $inline-functions. The inline funcs +basically provides you with a mini-language for building one string that will change +appropriately depending on who sees it.

+
text = "$You() $conj(pick) up the gun, whistling to $pron(yourself)."
+room.msg_contents(text, from_obj=caller, mapping={"gun": gun_object})
+
+
+

These are the inline-functions available:

+
    +
  • $You()/$you() - this is a reference to ‘you’ in the text. It will be replaced with “You/you” for +the one sending the text and with the return from caller.get_display_name(looker) for everyone else.

  • +
  • $conj(verb) - this will conjugate the given verb depending on who sees the string (like pick +to picks). Enter the root form of the verb.

  • +
  • $pron(pronoun[,options]) - A pronoun is a word you want to use instead of a proper noun, like +him, herself, its, me, I, their and so on. The options is a space- or comma-separated +set of options to help the system map your pronoun from 1st/2nd person to 3rd person and vice versa. +See next section.

  • +
+
+

More on $pron()

+

The $pron() inline func maps between 1st/2nd person (I/you) to 3rd person (he/she etc). In short, +it translates between this table …

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Subject Pronoun

Object Pronoun

Possessive Adjective

Possessive Pronoun

Reflexive Pronoun

1st person

I

me

my

mine

myself

1st person plural

we

us

our

ours

ourselves

2nd person

you

you

your

yours

yourself

2nd person plural

you

you

your

yours

yourselves

+

… to this table (in both directions):

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Subject Pronoun

Object Pronoun

Possessive Adjective

Possessive Pronoun

Reflexive Pronoun

3rd person male

he

him

his

his

himself

3rd person female

she

her

her

hers

herself

3rd person neutral

it

it

its

theirs*

itself

3rd person plural

they

them

their

theirs

themselves

+
+

*) The neutral 3rd person possessive pronoun is not actually used in English. We set it to “theirs” +just to have something to show should someone accidentally ask for a neutral possessive pronoun.

+
+

Some mappings are easy. For example, if you write $pron(yourselves) then the 3rd-person +form is always themselves. But because English grammar is the way it is, not all mappings +are 1:1. For example, if you write +$pron(you), Evennia will not know which 3rd-persion equivalent this should map to - you need to +provide more info to help out. This can either be provided as a second space-separated option +to $pron or the system will try to figure it out on its own.

+
    +
  • pronoun_type - this is one of the columns in the table and can be set as a $pron option.

    +
      +
    • subject pronoun (aliases subject or sp)

    • +
    • object pronoun (aliases object or op)

    • +
    • possessive adjective (aliases adjective or pa)

    • +
    • possessive pronoun (aliases pronoun or pp).

    • +
    +

    (There is no need to specify reflexive pronouns since they +are all uniquely mapped 1:1). Speciying the pronoun-type is mainly needed when using you, +since the same ‘you’ is used to represent all sorts of things in English grammar. +If not specified and the mapping is not clear, a ‘subject pronoun’ (he/she/it/they) is assumed.

    +
  • +
  • gender - set in $pron option as

    +
      +
    • male, or m

    • +
    • female' or f

    • +
    • neutral, or n

    • +
    • plural, or p (yes plural is considered a ‘gender’ for this purpose).

    • +
    +

    If not set as an option the system will +look for a callable or property .gender on the current from_obj. A callable will be called +with no arguments and is expected to return a string ‘male/female/neutral/plural’. If none +is found, a neutral gender is assumed.

    +
  • +
  • viewpoint- set in $pron option as

    +
      +
    • 1st person (aliases 1st or 1)

    • +
    • 2nd person (aliases 2nd or 2)

    • +
    +

    This is only needed if you want to have 1st person perspective - if +not, 2nd person is assumed wherever the viewpoint is unclear.

    +
  • +
+

$pron() examples:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Input

you see

others see

note

$pron(I, male)

I

he

$pron(I, f)

I

she

$pron(my)

my

its

figures out it’s an possessive adjective, assumes neutral

$pron(you)

you

it

assumes neutral subject pronoun

$pron(you, f)

you

she

female specified, assumes subject pronoun

$pron(you,op f)

you

her

$pron(you,op p)

you

them

$pron(you, f op)

you

her

specified female and objective pronoun

$pron(yourself)

yourself

itself

$pron(its)

your

its

$Pron(its)

Your

Its

Using $Pron always capitalizes

$pron(her)

you

her

3rd person -> 2nd person

$pron(her, 1)

I

her

3rd person -> 1st person

$pron(its, 1st)

my

its

3rd person -> 1st person

+

Note the three last examples - instead of specifying the 2nd person form you +can also specify the 3rd-person and do a ‘reverse’ lookup - you will still see the proper 1st/2nd text. +So writing $pron(her) instead of $pron(you, op f) gives the same result.

+

The $pron inlinefunc api is found here

+
+
+
+
+

Referencing other objects

+

There is one more inlinefunc understood by msg_contents. This can be used natively to spruce up +your strings (for both director- and actor stance):

+
    +
  • $Obj(name)/$obj(name) references another entity, which must be supplied +in the mapping keyword argument to msg_contents. The object’s .get_display_name(looker) will be +called and inserted instead. This is essentially the same as using the {anna} marker we used +in the first example at the top of this page, but using $Obj/$obj allows you to easily +control capitalization.

  • +
+

This is used like so:

+
# director stance
+text = "Tom picks up the $obj(gun), whistling to himself"
+
+# actor stance 
+text = "$You() $conj(pick) up the $obj(gun), whistling to $pron(yourself)"
+
+room.msg_contents(text, from_obj=caller, mapping={"gun": gun_object})
+
+
+

Depending on your game, Tom may now see himself picking up A rusty old gun, whereas an onlooker +with a high gun smith skill may instead see him picking up A rare-make Smith & Wesson model 686  in poor condition" ...

+
+
+

Recog systems and roleplaying

+

The $funcparser inline functions are very powerful for the game developer, but they may +be a bit too much to write for the regular player.

+

The rpsystem contrib implements a full dynamic emote/pose and recognition +system with short-descriptions and disguises. It uses director stance with a custom markup +language, like /me /gun and /tall man to refer to players and objects in the location. It can be +worth checking out for inspiration.

+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/1.0-dev/Concepts/Concepts-Overview.html b/docs/1.0-dev/Concepts/Concepts-Overview.html index c0c8048e6c..9104302be0 100644 --- a/docs/1.0-dev/Concepts/Concepts-Overview.html +++ b/docs/1.0-dev/Concepts/Concepts-Overview.html @@ -81,6 +81,7 @@
  • Change the language of the server

  • Server text-encoding

  • Text tags

  • +
  • Change Messages Per receiver

  • diff --git a/docs/1.0-dev/_modules/evennia/commands/default/system.html b/docs/1.0-dev/_modules/evennia/commands/default/system.html index 541617c809..bad8fafbeb 100644 --- a/docs/1.0-dev/_modules/evennia/commands/default/system.html +++ b/docs/1.0-dev/_modules/evennia/commands/default/system.html @@ -706,8 +706,7 @@ |wCode|n https://github.com/evennia/evennia |wDemo|n https://demo.evennia.com |wGame listing|n https://games.evennia.com - |wIrc|n #evennia on irc.freenode.net:6667 - |wDiscord|n https://discord.gg/SVCkd4cY3q + |wChat|n https://discord.gg/AJJpcRUhtF |wForum|n https://github.com/evennia/evennia/discussions |wLicence|n https://opensource.org/licenses/BSD-3-Clause |wMaintainer|n (2010-) Griatch (griatch AT gmail DOT com) diff --git a/docs/1.0-dev/_modules/evennia/objects/objects.html b/docs/1.0-dev/_modules/evennia/objects/objects.html index 3daa67762b..ce04e11aea 100644 --- a/docs/1.0-dev/_modules/evennia/objects/objects.html +++ b/docs/1.0-dev/_modules/evennia/objects/objects.html @@ -82,13 +82,8 @@ # the sessid_max is based on the length of the db_sessid csv field (excluding commas) _SESSID_MAX = 16 if _MULTISESSION_MODE in (1, 3) else 1 -_MSG_CONTENTS_PARSER = funcparser.FuncParser( - { - "you": funcparser.funcparser_callable_you, - "You": funcparser.funcparser_callable_You, - "conj": funcparser.funcparser_callable_conjugate - } -) +# init the actor-stance funcparser for msg_contents +_MSG_CONTENTS_PARSER = funcparser.FuncParser(funcparser.ACTOR_STANCE_CALLABLES)
    [docs]class ObjectSessionHandler: @@ -773,8 +768,9 @@ on the valid OOB outmessage form `(message, {kwargs})`, where kwargs are optional data passed to the `text` outputfunc. The message will be parsed for `{key}` formatting and - `$You/$you()/$You(key)` and `$conj(verb)` inline function callables. - The `key` is taken from the `mapping` kwarg {"key": object, ...}`. + `$You/$you()/$You()`, `$obj(name)`, `$conj(verb)` and `$pron(pronoun, option)` + inline function callables. + The `name` is taken from the `mapping` kwarg {"name": object, ...}`. The `mapping[key].get_display_name(looker=recipient)` will be called for that key for every recipient of the string. exclude (list, optional): A list of objects not to send to. diff --git a/docs/1.0-dev/_modules/evennia/server/evennia_launcher.html b/docs/1.0-dev/_modules/evennia/server/evennia_launcher.html index b3fe54260f..d35d055a17 100644 --- a/docs/1.0-dev/_modules/evennia/server/evennia_launcher.html +++ b/docs/1.0-dev/_modules/evennia/server/evennia_launcher.html @@ -331,7 +331,7 @@ Licence: BSD 3-Clause Licence Web: http://www.evennia.com - Irc: #evennia on FreeNode + Chat: https://discord.gg/AJJpcRUhtF Forum: http://www.evennia.com/discussions Maintainer (2006-10): Greg Taylor Maintainer (2010-): Griatch (griatch AT gmail DOT com) diff --git a/docs/1.0-dev/_modules/evennia/utils/funcparser.html b/docs/1.0-dev/_modules/evennia/utils/funcparser.html index f9aec1ad8b..82a32a82bc 100644 --- a/docs/1.0-dev/_modules/evennia/utils/funcparser.html +++ b/docs/1.0-dev/_modules/evennia/utils/funcparser.html @@ -97,6 +97,7 @@ safe_convert_to_types) from evennia.utils import search from evennia.utils.verb_conjugation.conjugate import verb_actor_stance_components +from evennia.utils.verb_conjugation.pronouns import pronoun_to_viewpoints # setup @@ -1126,8 +1127,8 @@ if hasattr(caller, "get_display_name") else str(caller))
    -
    [docs]def funcparser_callable_You(*args, you=None, receiver=None, mapping=None, capitalize=True, - **kwargs): +
    [docs]def funcparser_callable_you_capitalize( + *args, you=None, receiver=None, mapping=None, capitalize=True, **kwargs): """ Usage: $You() - capitalizes the 'you' output. @@ -1138,6 +1139,8 @@
    [docs]def funcparser_callable_conjugate(*args, caller=None, receiver=None, **kwargs): """ + Usage: $conj(word, [options]) + Conjugate a verb according to if it should be 2nd or third person. Keyword Args: @@ -1174,6 +1177,146 @@ return second_person_str if caller == receiver else third_person_str
    +
    [docs]def funcparser_callable_pronoun(*args, caller=None, receiver=None, capitalize=False, **kwargs): + """ + + Usage: $prop(word, [options]) + + Adjust pronouns to the expected form. Pronouns are words you use instead of a + proper name, such as 'him', 'herself', 'theirs' etc. These look different + depending on who sees the outgoing string. + + The parser maps between this table ... + + ==================== ======= ======= ========== ========== =========== + 1st/2nd person Subject Object Possessive Possessive Reflexive + Pronoun Pronoun Adjective Pronoun Pronoun + ==================== ======= ======= ========== ========== =========== + 1st person I me my mine myself + 1st person plural we us our ours ourselves + 2nd person you you your yours yourself + 2nd person plural you you your yours yourselves + ==================== ======= ======= ========== ========== =========== + + ... and this table (and vice versa). + + ==================== ======= ======= ========== ========== =========== + 3rd person Subject Object Possessive Possessive Reflexive + Pronoun Pronoun Adjective Pronoun Pronoun + ==================== ======= ======= ========== ========== =========== + 3rd person male he him his his himself + 3rd person female she her her hers herself + 3rd person neutral it it its itself + 3rd person plural they them their theirs themselves + ==================== ======= ======= ========== ========== =========== + + This system will examine `caller` for either a property or a callable `.gender` to + get a default gender fallback (if not specified in the call). If a callable, + `.gender` will be called without arguments and should return a string + `male`/`female`/`neutral`/`plural` (plural is considered a gender for this purpose). + If no `gender` property/callable is found, `neutral` is used as a fallback. + + The pronoun-type default (if not spefified in call) is `subject pronoun`. + + Args: + pronoun (str): Input argument to parsed call. This can be any of the pronouns + in the table above. If given in 1st/second form, they will be mappped to + 3rd-person form for others viewing the message (but will need extra input + via the `gender`, see below). If given on 3rd person form, this will be + mapped to 2nd person form for `caller` unless `viewpoint` is specified + in options. + options (str, optional): A space- or comma-separated string detailing `pronoun_type`, + `gender`/`plural` and/or `viewpoint` to help the mapper differentiate between + non-unique cases (such as if `you` should become `him` or `they`). + Allowed values are: + + - `subject pronoun`/`subject`/`sp` (I, you, he, they) + - `object pronoun`/`object/`/`op` (me, you, him, them) + - `possessive adjective`/`adjective`/`pa` (my, your, his, their) + - `possessive pronoun`/`pronoun`/`pp` (mine, yours, his, theirs) + - `male`/`m` + - `female`/`f` + - `neutral`/`n` + - `plural`/`p` + - `1st person`/`1st`/`1` + - `2nd person`/`2nd`/`2` + - `3rd person`/`3rd`/`3` + + Keyword Args: + + caller (Object): The object creating the string. If this has a property 'gender', + it will be checked for a string 'male/female/neutral' to determine + the 3rd person gender (but if `pronoun_type` contains a gender + component, that takes precedence). Provided automatically to the + funcparser. + receiver (Object): The recipient of the string. This being the same as + `caller` or not helps determine 2nd vs 3rd-person forms. This is + provided automatically by the funcparser. + capitalize (bool): The input retains its capitalization. If this is set the output is + always capitalized. + + Examples: + + ====================== ============= =========== + Input caller sees others see + ====================== ============= =========== + $pron(I, m) I he + $pron(you,fo) you her + $pron(yourself) yourself itself + $pron(its) your its + $pron(you,op,p) you them + ====================== ============= =========== + + Notes: + There is no option to specify reflexive pronouns since they are all unique + and the mapping can always be auto-detected. + + """ + if not args: + return '' + + pronoun, *options = args + # options is either multiple args or a space-separated string + if len(options) == 1: + options = options[0] + + # default differentiators + default_pronoun_type = "subject pronoun" + default_gender = "neutral" + default_viewpoint = "2nd person" + + if hasattr(caller, "gender"): + if callable(caller, gender): + default_gender = caller.gender() + else: + default_gender = caller.gender + + if "viewpoint" in kwargs: + # passed into FuncParser initialization + default_viewpoint = kwargs["viewpoint"] + + pronoun_1st_or_2nd_person, pronoun_3rd_person = pronoun_to_viewpoints( + pronoun, options, + pronoun_type=default_pronoun_type, gender=default_gender, viewpoint=default_viewpoint) + + if capitalize: + pronoun_1st_or_2nd_person = pronoun_1st_or_2nd_person.capitalize() + pronoun_3rd_person = pronoun_3rd_person.capitalize() + + return pronoun_1st_or_2nd_person if caller == receiver else pronoun_3rd_person
    + + +
    [docs]def funcparser_callable_pronoun_capitalize( + *args, caller=None, receiver=None, capitalize=True, **kwargs): + """ + Usage: $Pron(word) - always maps to a capitalized word. + + """ + return funcparser_callable_pronoun( + *args, caller=caller, receiver=receiver, capitalize=capitalize, **kwargs)
    + + + # these are made available as callables by adding 'evennia.utils.funcparser' as # a callable-path when initializing the FuncParser. @@ -1220,8 +1363,12 @@ ACTOR_STANCE_CALLABLES = { # requires `you`, `receiver` and `mapping` to be passed into parser "you": funcparser_callable_you, - "You": funcparser_callable_You, + "You": funcparser_callable_you_capitalize, + "obj": funcparser_callable_you, + "Obj": funcparser_callable_you_capitalize, "conj": funcparser_callable_conjugate, + "pron": funcparser_callable_pronoun, + "Pron": funcparser_callable_pronoun_capitalize, }
    diff --git a/docs/1.0-dev/_modules/evennia/utils/gametime.html b/docs/1.0-dev/_modules/evennia/utils/gametime.html index 36518f9b80..15e3befb96 100644 --- a/docs/1.0-dev/_modules/evennia/utils/gametime.html +++ b/docs/1.0-dev/_modules/evennia/utils/gametime.html @@ -48,6 +48,7 @@ It also supplies some useful methods to convert between in-mud time and real-world time as well allows to get the total runtime of the server and the current uptime. + """ import time @@ -288,8 +289,11 @@ script (Script): The created Script handling the sceduling. Examples: - schedule(func, min=5, sec=0) # Will call 5 minutes past the next (in-game) hour. - schedule(func, hour=2, min=30, sec=0) # Will call the next (in-game) day at 02:30. + :: + + schedule(func, min=5, sec=0) # Will call 5 minutes past the next (in-game) hour. + schedule(func, hour=2, min=30, sec=0) # Will call the next (in-game) day at 02:30. + """ seconds = real_seconds_until(sec=sec, min=min, hour=hour, day=day, month=month, year=year) script = create_script( diff --git a/docs/1.0-dev/_modules/evennia/utils/utils.html b/docs/1.0-dev/_modules/evennia/utils/utils.html index a49dcb5607..fcdc60b6f4 100644 --- a/docs/1.0-dev/_modules/evennia/utils/utils.html +++ b/docs/1.0-dev/_modules/evennia/utils/utils.html @@ -2672,6 +2672,43 @@ txt = strip_tags(txt) txt = _STRIP_UNSAFE_TOKENS(txt) return txt
    + + +
    [docs]def copy_word_case(base_word, new_word): + """ + Converts a word to use the same capitalization as a first word. + + Args: + base_word (str): A word to get the capitalization from. + new_word (str): A new word to capitalize in the same way as `base_word`. + + Returns: + str: The `new_word` with capitalization matching the first word. + + Notes: + This is meant for words. Longer sentences may get unexpected results. + + If the two words have a mix of capital/lower letters _and_ `new_word` + is longer than `base_word`, the excess will retain its original case. + + """ + + # Word + if base_word.istitle(): + return new_word.title() + # word + elif base_word.islower(): + return new_word.lower() + # WORD + elif base_word.isupper(): + return new_word.upper() + else: + # WorD - a mix. Handle each character + maxlen = len(base_word) + shared, excess = new_word[:maxlen], new_word[maxlen - 1:] + return "".join(char.upper() if base_word[ic].isupper() else char.lower() + for ic, char in enumerate(new_word)) + excess
    +
    diff --git a/docs/1.0-dev/_modules/evennia/utils/verb_conjugation/pronouns.html b/docs/1.0-dev/_modules/evennia/utils/verb_conjugation/pronouns.html new file mode 100644 index 0000000000..8d9b0545ca --- /dev/null +++ b/docs/1.0-dev/_modules/evennia/utils/verb_conjugation/pronouns.html @@ -0,0 +1,667 @@ + + + + + + + + evennia.utils.verb_conjugation.pronouns — Evennia 1.0-dev documentation + + + + + + + + + + + + + + + +
    +
    +
    +
    + +

    Source code for evennia.utils.verb_conjugation.pronouns

    +"""
    +English pronoun mapping between 1st/2nd person and 3rd person perspective (and vice-versa).
    +
    +This file is released under the Evennia regular BSD License.
    +(Griatch 2021)
    +
    +Pronouns are words you use instead of a proper name, such as 'him', 'herself', 'theirs' etc. These
    +look different depending on who sees the outgoing string. This mapping maps between 1st/2nd case and
    +the 3rd person case and back. In some cases, the mapping is not unique; it is assumed the system can
    +differentiate between the options in some other way.
    +
    +
    +====================  =======  ========  ==========  ==========  ===========
    +viewpoint/pronouns    Subject  Object    Possessive  Possessive  Reflexive
    +                      Pronoun  Pronoun   Adjective   Pronoun     Pronoun
    +====================  =======  ========  ==========  ==========  ===========
    +1st person              I        me        my         mine       myself
    +1st person plural       we       us        our        ours       ourselves
    +2nd person              you      you       your       yours      yourself
    +2nd person plural       you      you       your       yours      yourselves
    +
    +3rd person male         he       him       his        his        himself
    +3rd person female       she      her       her        hers       herself
    +3rd person neutral      it       it        its        theirs*    itself
    +3rd person plural       they     them      their      theirs     themselves
    +====================  =======  ========  ==========  ==========  ===========
    +
    +> `*`) Not formally used, we use `theirs` here as a filler.
    +
    +"""
    +from evennia.utils.utils import copy_word_case
    +
    +DEFAULT_PRONOUN_TYPE = "object_pronoun"
    +DEFAULT_VIEWPOINT = "2nd person"
    +DEFAULT_GENDER = "neutral"
    +
    +PRONOUN_MAPPING = {
    +    # 1st/2nd person -> 3rd person mappings
    +    "I": {
    +        "subject pronoun": {
    +            "3rd person": {
    +                "male": "he",
    +                "female": "she",
    +                "neutral": "it"
    +            }
    +        }
    +    },
    +    "me": {
    +        "object pronoun": {
    +            "3rd person": {
    +                "male": "him",
    +                "female": "her",
    +                "neutral": "it"
    +            }
    +        }
    +    },
    +    "my": {
    +        "possessive adjective": {
    +            "3rd person": {
    +                "male": "his",
    +                "female": "her",
    +                "neutral": "its"
    +            }
    +        }
    +    },
    +    "mine": {
    +        "possessive pronoun": {
    +            "3rd person": {
    +                "male": "his",
    +                "female": "hers",
    +                "neutral": "theirs",  # colloqial,
    +            }
    +        }
    +    },
    +    "myself": {
    +        "reflexive_pronoun": {
    +            "3rd person": {
    +                "male": "himself",
    +                "female": "herself",
    +                "neutral": "itself",
    +                "plural": "themselves",
    +            }
    +        }
    +    },
    +    "you": {
    +        "subject pronoun": {
    +            "3rd person": {
    +                "male": "he",
    +                "female": "she",
    +                "neutral": "it",
    +                "plural": "they",
    +            }
    +        },
    +        "object pronoun": {
    +            "3rd person": {
    +                "male": "him",
    +                "female": "her",
    +                "neutral": "it",
    +                "plural": "them",
    +            }
    +        }
    +    },
    +    "your": {
    +        "possessive adjective": {
    +            "3rd person": {
    +                "male": "his",
    +                "female": "her",
    +                "neutral": "its",
    +                "plural": "their",
    +            }
    +        }
    +    },
    +    "yours": {
    +        "possessive pronoun": {
    +            "3rd person": {
    +                "male": "his",
    +                "female": "hers",
    +                "neutral": "theirs",  # colloqial
    +                "plural": "theirs"
    +            }
    +        }
    +    },
    +    "yourself": {
    +        "reflexive_pronoun": {
    +            "3rd person": {
    +                "male": "himself",
    +                "female": "herself",
    +                "neutral": "itself",
    +            }
    +        }
    +    },
    +    "we": {
    +        "subject pronoun": {
    +            "3rd person": {
    +                "plural": "they"
    +            }
    +        }
    +    },
    +    "us": {
    +        "object pronoun": {
    +            "3rd person": {
    +                "plural": "them"
    +            }
    +        }
    +    },
    +    "our": {
    +        "possessive adjective": {
    +            "3rd person": {
    +                "plural": "their"
    +            }
    +        }
    +    },
    +    "ours": {
    +        "possessive pronoun": {
    +            "3rd person": {
    +                "plural": "theirs"
    +            }
    +        }
    +    },
    +    "ourselves": {
    +        "reflexive pronoun": {
    +            "3rd person": {
    +                "plural": "themselves"
    +            }
    +        }
    +    },
    +    "ours": {
    +        "possessive pronoun": {
    +            "3rd person": {
    +                "plural": "theirs"
    +            }
    +        }
    +    },
    +    "ourselves": {
    +        "reflexive pronoun": {
    +            "3rd person": {
    +                "plural": "themselves"
    +            }
    +        }
    +    },
    +    "yourselves": {
    +        "reflexive_pronoun": {
    +            "3rd person": {
    +                "plural": "themselves"
    +            }
    +        }
    +    },
    +    # 3rd person to 1st/second person mappings
    +    "he": {
    +        "subject pronoun": {
    +            "1st person": {
    +                "neutral": "I",
    +                "plural": "we"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "you",
    +                "plural": "you"  # pluralis majestatis
    +            }
    +        }
    +    },
    +    "him": {
    +        "object pronoun": {
    +            "1st person": {
    +                "neutral": "me",
    +                "plural": "us"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "you",
    +                "plural": "you"  # pluralis majestatis
    +            },
    +        }
    +    },
    +    "his": {
    +        "possessive adjective": {
    +            "1st person": {
    +                "neutral": "my",
    +                "plural": "our"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "your",
    +                "plural": "your"  # pluralis majestatis
    +            }
    +        },
    +        "possessive pronoun": {
    +            "1st person": {
    +                "neutral": "mine",
    +                "plural": "ours"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "yours",
    +                "plural": "yours"  # pluralis majestatis
    +            }
    +        }
    +    },
    +    "himself": {
    +        "reflexive pronoun": {
    +            "1st person": {
    +                "neutral": "myself",
    +                "plural": "ourselves"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "yours",
    +                "plural": "yours"  # pluralis majestatis
    +            }
    +        },
    +    },
    +    "she": {
    +        "subject pronoun": {
    +            "1st person": {
    +                "neutral": "I",
    +                "plural": "you"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "you",
    +                "plural": "we"  # pluralis majestatis
    +            }
    +        }
    +    },
    +    "her": {
    +        "object pronoun": {
    +            "1st person": {
    +                "neutral": "me",
    +                "plural": "us"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "you",
    +                "plural": "you"  # pluralis majestatis
    +            }
    +        },
    +        "possessive adjective": {
    +            "1st person": {
    +                "neutral": "my",
    +                "plural": "our"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "your",
    +                "plural": "your"  # pluralis majestatis
    +            }
    +        },
    +    },
    +    "hers": {
    +        "possessive pronoun": {
    +            "1st person": {
    +                "neutral": "mine",
    +                "plural": "ours"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "yours",
    +                "plural": "yours"  # pluralis majestatis
    +            }
    +        }
    +    },
    +    "herself": {
    +        "reflexive pronoun": {
    +            "1st person": {
    +                "neutral": "myself",
    +                "plural": "ourselves"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "yourself",
    +                "plural": "yourselves"  # pluralis majestatis
    +            }
    +        },
    +    },
    +    "it": {
    +        "subject pronoun": {
    +            "1st person": {
    +                "neutral": "I",
    +                "plural": "we"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "you",
    +                "plural": "you"  # pluralis majestatis
    +            }
    +        },
    +        "object pronoun": {
    +            "1st person": {
    +                "neutral": "me",
    +                "plural": "us"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "you",
    +                "plural": "you"  # pluralis majestatis
    +            }
    +        }
    +    },
    +    "its": {
    +        "possessive adjective": {
    +            "1st person": {
    +                "neutral": "my",
    +                "plural": "our"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "your",
    +                "plural": "your"  # pluralis majestatis
    +            }
    +        }
    +    },
    +    "theirs": {
    +        "possessive pronoun": {
    +            "1st person": {
    +                "neutral": "mine",
    +                "plural": "ours"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "yours",
    +                "plural": "yours"  # pluralis majestatis
    +            }
    +        }
    +    },
    +    "itself": {
    +        "reflexive pronoun": {
    +            "1st person": {
    +                "neutral": "myself",
    +                "plural": "ourselves"  # pluralis majestatis
    +            },
    +            "2nd person": {
    +                "neutral": "yourself",
    +                "plural": "yourselves"  # pluralis majestatis
    +            }
    +        },
    +    },
    +    "they": {
    +        "subject pronoun": {
    +            "1st person": {
    +                "plural": "we",
    +            },
    +            "2nd person": {
    +                "plural": "you",
    +            }
    +        }
    +    },
    +    "them": {
    +        "object pronoun": {
    +            "1st person": {
    +                "plural": "us",
    +            },
    +            "2nd person": {
    +                "plural": "you",
    +            }
    +        }
    +    },
    +    "their": {
    +        "possessive adjective": {
    +            "1st person": {
    +                "plural": "our",
    +            },
    +            "2nd person": {
    +                "plural": "your",
    +            }
    +        }
    +    },
    +    "themselves": {
    +        "reflexive pronoun": {
    +            "1st person": {
    +                "plural": "ourselves",
    +            },
    +            "2nd person": {
    +                "plural": "yourselves",
    +            }
    +        }
    +    }
    +}
    +
    +
    +ALIASES = {
    +    "m": "male",
    +    "f": "female",
    +    "n": "neutral",
    +    "p": "plural",
    +    "1st": "1st person",
    +    "2nd": "2nd person",
    +    "3rd": "3rd person",
    +    "1": "1st person",
    +    "2": "2nd person",
    +    "3": "3rd person",
    +    "s": "subject pronoun",
    +    "sp": "subject pronoun",
    +    "subject": "subject pronoun",
    +    "op": "object pronoun",
    +    "object": "object pronoun",
    +    "pa": "possessive adjective",
    +    "pp": "possessive pronoun",
    +}
    +
    +PRONOUN_TYPES = ["subject pronoun", "object pronoun", "possessive adjective",
    +                 "possessive pronoun", "reflexive pronoun"]
    +VIEWPOINTS = ["1st person", "2nd person", "3rd person"]
    +GENDERS = ["male", "female", "neutral", "plural"]  # including plural as a gender for simplicity
    +
    +
    +
    [docs]def pronoun_to_viewpoints(pronoun, + options=None, pronoun_type="object_pronoun", + gender="neutral", viewpoint="2nd person"): + """ + Access function for determining the forms of a pronount from different viewpoints. + + Args: + pronoun (str): A valid English pronoun, such as 'you', 'his', 'themselves' etc. + options (str or list, optional): A list or space-separated string of options to help + the engine when there is no unique mapping to use. This could for example + be "2nd female" (alias 'f') or "possessive adjective" (alias 'pa' or 'a'). + pronoun_type (str, optional): An explicit object pronoun to separate cases where + there is no unique mapping. Pronoun types defined in `options` take precedence. + Values are + + - `subject pronoun`/`subject`/`sp` (I, you, he, they) + - `object pronoun`/`object/`/`op` (me, you, him, them) + - `possessive adjective`/`adjective`/`pa` (my, your, his, their) + - `possessive pronoun`/`pronoun`/`pp` (mine, yours, his, theirs) + + gender (str, optional): Specific gender to use (plural counts a gender for this purpose). + A gender specified in `options` takes precedence. Values and aliases are: + + - `male`/`m` + - `female`/`f` + - `neutral`/`n` + - `plural`/`p` + + viewpoint (str, optional): A specified viewpoint of the one talking, to use + when there is no unique mapping. A viewpoint given in `options` take + precedence. Values and aliases are: + + - `1st person`/`1st`/`1` + - `2nd person`/`2nd`/`2` + - `3rd person`/`3rd`/`3` + + Returns: + tuple: A tuple `(1st/2nd_person_pronoun, 3rd_person_pronoun)` to show to the one sending the + string and others respectively. If pronoun is invalid, the word is returned verbatim. + + Note: + The capitalization of the original word will be retained. + + """ + if not pronoun: + return pronoun + + pronoun_lower = "I" if pronoun == "I" else pronoun.lower() + + if pronoun_lower not in PRONOUN_MAPPING: + return pronoun + + # differentiators + + if pronoun_type not in PRONOUN_TYPES: + pronoun_type = DEFAULT_PRONOUN_TYPE + if viewpoint not in VIEWPOINTS: + viewpoint = DEFAULT_VIEWPOINT + if gender not in GENDERS: + gender = DEFAULT_GENDER + + if options: + # option string/list will override the kwargs differentiators given + if isinstance(options, str): + options = options.split() + options = [str(part).strip().lower() for part in options] + options = [ALIASES.get(opt, opt) for opt in options] + + for opt in options: + if opt in PRONOUN_TYPES: + pronoun_type = opt + elif opt in VIEWPOINTS: + viewpoint = opt + elif opt in GENDERS: + gender = opt + + # step down into the mapping, using differentiators as needed + pronoun_types = PRONOUN_MAPPING[pronoun_lower] + # this has one or more pronoun-types + if len(pronoun_types) == 1: + pronoun_type, viewpoints = next(iter(pronoun_types.items())) + elif pronoun_type in pronoun_types: + viewpoints = pronoun_types[pronoun_type] + elif DEFAULT_PRONOUN_TYPE in pronoun_types: + pronoun_type = DEFAULT_PRONOUN_TYPE + viewpoints = pronoun_types[pronoun_type] + else: + # not enough info - grab the first of the mappings + pronoun_type, viewpoints = next(iter(pronoun_types.items())) + + # we have one or more viewpoints at this point + if len(viewpoints) == 1: + viewpoint, genders = next(iter(viewpoints.items())) + elif viewpoint in viewpoints: + genders = viewpoints[viewpoint] + elif DEFAULT_VIEWPOINT in viewpoints: + viewpoint = DEFAULT_VIEWPOINT + genders = viewpoints[viewpoint] + else: + # not enough info - grab first of mappings + viewpoint, genders = next(iter(viewpoints.items())) + + # we have one or more possible genders (including plural forms) + if len(genders) == 1: + gender, mapped_pronoun = next(iter(genders.items())) + elif gender in genders: + mapped_pronoun = genders[gender] + elif DEFAULT_GENDER in genders: + gender = DEFAULT_GENDER + mapped_pronoun = genders[gender] + else: + # not enough info - grab first mapping + gender, mapped_pronoun = next(iter(genders.items())) + + # keep the same capitalization as the original + if pronoun != "I": + # don't remap I, since this is always capitalized. + mapped_pronoun = copy_word_case(pronoun, mapped_pronoun) + if mapped_pronoun == "i": + mapped_pronoun = mapped_pronoun.upper() + + if viewpoint == "3rd person": + # the remapped viewpoing is in 3rd person, meaning the ingoing viewpoing + # must have been 1st or 2nd person. + return pronoun, mapped_pronoun + else: + # the remapped viewpoint is 1st or 2nd person, so ingoing must have been + # in 3rd person form. + return mapped_pronoun, pronoun
    +
    + +
    +
    +
    +
    + +
    +
    + + + + \ No newline at end of file diff --git a/docs/1.0-dev/_modules/evennia/utils/verb_conjugation/tests.html b/docs/1.0-dev/_modules/evennia/utils/verb_conjugation/tests.html index 5e3824caa8..0f11ae8760 100644 --- a/docs/1.0-dev/_modules/evennia/utils/verb_conjugation/tests.html +++ b/docs/1.0-dev/_modules/evennia/utils/verb_conjugation/tests.html @@ -49,7 +49,7 @@ from parameterized import parameterized from django.test import TestCase -from . import conjugate +from . import conjugate, pronouns
    [docs]class TestVerbConjugate(TestCase): @@ -283,6 +283,52 @@ """ self.assertEqual(expected, conjugate.verb_actor_stance_components(verb))
    + + +
    [docs]class TestPronounMapping(TestCase): + """ + Test pronoun viewpoint mapping + + """ + + @parameterized.expand([ + ("you", "m", "you", "he"), + ("you", "f op", "you", "her"), + ("I", "", "I", "it"), + ("I", "p", "I", "it"), # plural is invalid + ("I", "m", "I", "he"), + ("Me", "n", "Me", "It"), + ("your", "p", "your", "their"), + ("ours", "", "ours", "theirs"), + ("yourself", "", "yourself", "itself"), + ("yourself", "m", "yourself", "himself"), + ("yourself", "f", "yourself", "herself"), + ("yourself", "p", "yourself", "itself"), # plural is invalid + ("yourselves", "", "yourselves", "themselves"), + ("he", "", "you", "he"), # assume 2nd person + ("he", "1", "I", "he"), + ("he", "1 p", "we", "he"), + ("her", "p", "you", "her"), + ("her", "pa", "your", "her"), + ("their", "pa", "your", "their"), + ("their", "pa", "your", "their"), + ("itself", "", "yourself", "itself"), + ("themselves", "", "yourselves", "themselves"), + ("herself", "", "yourself", "herself"), + ]) + def test_mapping_with_options(self, pronoun, options, + expected_1st_or_2nd_person, + expected_3rd_person): + """ + Test the pronoun mapper. + + """ + received_1st_or_2nd_person, received_3rd_person = ( + pronouns.pronoun_to_viewpoints(pronoun, options) + ) + + self.assertEqual(expected_1st_or_2nd_person, received_1st_or_2nd_person) + self.assertEqual(expected_3rd_person, received_3rd_person)
    diff --git a/docs/1.0-dev/_modules/index.html b/docs/1.0-dev/_modules/index.html index ae6c38ff23..2a0d8870a1 100644 --- a/docs/1.0-dev/_modules/index.html +++ b/docs/1.0-dev/_modules/index.html @@ -237,6 +237,7 @@
  • evennia.utils.utils
  • evennia.utils.validatorfuncs
  • evennia.utils.verb_conjugation.conjugate
  • +
  • evennia.utils.verb_conjugation.pronouns
  • evennia.utils.verb_conjugation.tests
  • evennia.web.admin.accounts
  • evennia.web.admin.attributes
  • diff --git a/docs/1.0-dev/_sources/Components/Default-Commands.md.txt b/docs/1.0-dev/_sources/Components/Default-Commands.md.txt index b0a62e8938..f6ed23fa9c 100644 --- a/docs/1.0-dev/_sources/Components/Default-Commands.md.txt +++ b/docs/1.0-dev/_sources/Components/Default-Commands.md.txt @@ -22,7 +22,7 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using - [**alias** [setobjalias]](evennia.commands.default.building.CmdSetObjAlias) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**allcom**](evennia.commands.default.comms.CmdAllCom) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) - [**batchcode** [batchcodes]](evennia.commands.default.batchprocess.CmdBatchCode) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) -- [**batchcommands** [batchcmd, batchcommand]](evennia.commands.default.batchprocess.CmdBatchCommands) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) +- [**batchcommands** [batchcommand, batchcmd]](evennia.commands.default.batchprocess.CmdBatchCommands) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**cboot**](evennia.commands.default.comms.CmdCBoot) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) - [**ccreate** [channelcreate]](evennia.commands.default.comms.CmdChannelCreate) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) - [**cdesc**](evennia.commands.default.comms.CmdCdesc) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) @@ -33,13 +33,13 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using - [**clock**](evennia.commands.default.comms.CmdClock) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) - [**cmdsets** [listcmsets]](evennia.commands.default.building.CmdListCmdSets) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**color**](evennia.commands.default.account.CmdColorTest) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) -- [**connect** [conn, con, co]](evennia.commands.default.unloggedin.CmdUnconnectedConnect) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_) +- [**connect** [con, conn, co]](evennia.commands.default.unloggedin.CmdUnconnectedConnect) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_) - [**copy**](evennia.commands.default.building.CmdCopy) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**cpattr**](evennia.commands.default.building.CmdCpAttr) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**create**](evennia.commands.default.building.CmdCreate) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**create** [cr, cre]](evennia.commands.default.unloggedin.CmdUnconnectedCreate) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_) - [**cwho**](evennia.commands.default.comms.CmdCWho) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) -- [**delcom** [delchanalias, delaliaschan]](evennia.commands.default.comms.CmdDelCom) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) +- [**delcom** [delaliaschan, delchanalias]](evennia.commands.default.comms.CmdDelCom) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) - [**desc** [describe]](evennia.commands.default.building.CmdDesc) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**destroy** [delete, del]](evennia.commands.default.building.CmdDestroy) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**dig**](evennia.commands.default.building.CmdDig) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) @@ -55,17 +55,17 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using - [**home**](evennia.commands.default.general.CmdHome) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_) - [**ic** [puppet]](evennia.commands.default.account.CmdIC) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) - [**info**](evennia.commands.default.unloggedin.CmdUnconnectedInfo) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_) -- [**inventory** [inv, i]](evennia.commands.default.general.CmdInventory) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_) +- [**inventory** [i, inv]](evennia.commands.default.general.CmdInventory) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_) - [**irc2chan**](evennia.commands.default.comms.CmdIRC2Chan) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) - [**ircstatus**](evennia.commands.default.comms.CmdIRCStatus) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_) - [**link**](evennia.commands.default.building.CmdLink) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**lock** [locks]](evennia.commands.default.building.CmdLock) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) -- [**look** [ls, l]](evennia.commands.default.account.CmdOOCLook) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) -- [**look** [ls, l]](evennia.commands.default.general.CmdLook) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_) +- [**look** [l, ls]](evennia.commands.default.account.CmdOOCLook) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) +- [**look** [l, ls]](evennia.commands.default.general.CmdLook) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_) - [**mvattr**](evennia.commands.default.building.CmdMvAttr) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**name** [rename]](evennia.commands.default.building.CmdName) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**nick** [nicks, nickname]](evennia.commands.default.general.CmdNick) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) -- [**objects** [listobjects, listobjs, stats, db]](evennia.commands.default.building.CmdObjects) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_) +- [**objects** [listobjects, stats, db, listobjs]](evennia.commands.default.building.CmdObjects) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_) - [**ooc** [unpuppet]](evennia.commands.default.account.CmdOOC) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) - [**open**](evennia.commands.default.building.CmdOpen) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**option** [options]](evennia.commands.default.account.CmdOption) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) @@ -93,12 +93,12 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using - [**spawn** [olc]](evennia.commands.default.building.CmdSpawn) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**style**](evennia.commands.default.account.CmdStyle) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) - [**tag** [tags]](evennia.commands.default.building.CmdTag) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) -- [**tasks** [delays, task]](evennia.commands.default.system.CmdTasks) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_) +- [**tasks** [task, delays]](evennia.commands.default.system.CmdTasks) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_) - [**tel** [teleport]](evennia.commands.default.building.CmdTeleport) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**tickers**](evennia.commands.default.system.CmdTickers) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_) - [**time** [uptime]](evennia.commands.default.system.CmdTime) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_) - [**tunnel** [tun]](evennia.commands.default.building.CmdTunnel) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) -- [**typeclass** [type, parent, swap, update, typeclasses]](evennia.commands.default.building.CmdTypeclass) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) +- [**typeclass** [swap, typeclasses, update, type, parent]](evennia.commands.default.building.CmdTypeclass) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**unlink**](evennia.commands.default.building.CmdUnLink) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_) - [**whisper**](evennia.commands.default.general.CmdWhisper) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_) - [**who** [doing]](evennia.commands.default.account.CmdWho) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_) diff --git a/docs/1.0-dev/_sources/Components/FuncParser.md.txt b/docs/1.0-dev/_sources/Components/FuncParser.md.txt index 38167f3ac0..cb51d80c6b 100644 --- a/docs/1.0-dev/_sources/Components/FuncParser.md.txt +++ b/docs/1.0-dev/_sources/Components/FuncParser.md.txt @@ -319,9 +319,11 @@ The `caller` is required, it's the the object to do the access-check for. The `a These are used to implement actor-stance emoting. They are used by the [DefaultObject.msg_contents](evennia.objects.objects.DefaultObject.msg_contents) method -by default. +by default. You can read a lot more about this on the page +[Change messages per receiver](../Concepts/Change-Messages-Per-Receiver.md). -These all require extra kwargs be passed into the parser: +On the parser side, all these inline functions require extra kwargs be passed into the parser +(done by `msg_contents` by default): ```python parser.parse(string, caller=, receiver=, mapping={'key': , ...}) @@ -337,10 +339,13 @@ references to other objects accessible via these callables. result of `you_obj.get_display_name(looker=receiver)`. This allows for a single string to echo differently depending on who sees it, and also to reference other people in the same way. - `$You([key])` - same as `$you` but always capitalized. -- `$conj(verb)` ([code](evennia.utils.funcparser.funcparser_callable_conjugate)) -- conjugates a verb between 4nd person presens to 3rd person presence depending on who +- `$conj(verb)` ([code](evennia.utils.funcparser.funcparser_callable_conjugate)) - conjugates a verb + between 2nd person presens to 3rd person presence depending on who sees the string. For example `"$You() $conj(smiles)".` will show as "You smile." and "Tom smiles." depending on who sees it. This makes use of the tools in [evennia.utils.verb_conjugation](evennia.utils.verb_conjugation) to do this, and only works for English verbs. +- `$pron(pronoun [,options])` ([code](evennia.utils.funcparser.funcparser_callable_pronoun)) - Dynamically + map pronouns (like his, herself, you, its etc) between 1st/2nd person to 3rd person. ### Example diff --git a/docs/1.0-dev/_sources/Concepts/Change-Messages-Per-Receiver.md.txt b/docs/1.0-dev/_sources/Concepts/Change-Messages-Per-Receiver.md.txt new file mode 100644 index 0000000000..ca452f9f52 --- /dev/null +++ b/docs/1.0-dev/_sources/Concepts/Change-Messages-Per-Receiver.md.txt @@ -0,0 +1,220 @@ +# Sending different messages depending on viewpoint and receiver + +Sending messages to everyong in a location is handled by the +[msg_contents](evennia.objects.objects.DefaultObject.msg_contents) method on +all [Objects](../Components/Objects.md). It's most commonly called on rooms. + +```python +room.msg_contents("Anna walks into the room.") +``` + +You can also embed references in the string: + +```python + +room.msg_contents("{anna} walks into the room.", + from_obj=caller, + mapping={'anna': anna_object}) +``` + +Use `exclude=object_or_list_of_object` to skip sending the message one or more targets. + +The advantage of this is that `anna_object.get_display_name(looker)` will be called +for every onlooker; this allows the `{anna}` stanza to be different depending on who +sees the strings. How this is to work depends on the _stance_ of your game. + +The stance indicates how your game echoes its messages to the player. Knowing how you want to +handle the stance is important for a text game. There are two main stances that are usually considered, +_Actor stance_ and _Director stance_. + +| Stance | You see | Others in the same location see | +| --- | --- | --- | +| Actor stance | You pick up the stone | Anna picks up the stone | +|Director stance | Anna picks up the stone | Anna picks up the stone | + +It's not unheard of to mix the two stances - with commands from the game being told +in Actor stance while Director stance is used for complex emoting and roleplaying. One should +usually try to be consistent however. + +## Director Stance + +While not so common as Actor stance, director stance has the advantage of simplicity, particularly +in roleplaying MUDs where longer roleplaying emotes are used. It is also a pretty simple stance to +implement technically since everyone sees the same text, regardless of viewpoint. + +Here's an example of a flavorful text to show the room: + + Tom picks up the gun, whistling to himself. + +Everyone will see this string, both Tom and others. Here's how to send it to everyone in +the room. + +```python +text = "Tom picks up the gun, whistling to himself." +room.msg_contents(text) +``` + +One may want to expand on it by making the name `Tom` be seen differently by different people, +but the English grammar of the sentence does not change. Not only is this pretty easy to do +technically, it's also easy to write for the player. + +## Actor Stance + +This means that the game addresses "you" when it does things. In actor stance, whenever you perform +an action, you should get a different message than those _observing_ you doing that action. + + Tom picks up the gun, whistling to himself. + +This is what _others_ should see. The player themselves should see this: + + You pick up the gun, whistling to yourself. + +Not only do you need to map "Tom" to "You" above, there are also grammatical differences - +"Tom walks" vs "You walk" and "himself" vs "yourself". This is a lot more complex to handle. For a +developer making simple "You/Tom pick/picks up the stone" messages, you could in principle hand-craft +the strings from every view point, but there's a better way. + +The `msg_contents` method helps by parsing the ingoing string with a +[FuncParser functions](../Components/FuncParser.md) with some very specific `$inline-functions`. The inline funcs +basically provides you with a mini-language for building _one_ string that will change +appropriately depending on who sees it. + + +```python +text = "$You() $conj(pick) up the gun, whistling to $pron(yourself)." +room.msg_contents(text, from_obj=caller, mapping={"gun": gun_object}) +``` + +These are the inline-functions available: + +- `$You()/$you()` - this is a reference to 'you' in the text. It will be replaced with "You/you" for + the one sending the text and with the return from `caller.get_display_name(looker)` for everyone else. +- `$conj(verb)` - this will conjugate the given verb depending on who sees the string (like `pick` + to `picks`). Enter the root form of the verb. +- `$pron(pronoun[,options])` - A pronoun is a word you want to use instead of a proper noun, like + _him_, _herself_, _its_, _me_, _I_, _their_ and so on. The `options` is a space- or comma-separated + set of options to help the system map your pronoun from 1st/2nd person to 3rd person and vice versa. + See next section. + +### More on $pron() + +The `$pron()` inline func maps between 1st/2nd person (I/you) to 3rd person (he/she etc). In short, +it translates between this table ... + +| | Subject Pronoun | Object Pronoun | Possessive Adjective | Possessive Pronoun | Reflexive Pronoun | +| --- | --- | --- | --- | --- | --- | +| **1st person** | I | me | my | mine | myself | +| **1st person plural** | we | us | our | ours | ourselves | +| **2nd person** | you | you | your | yours | yourself | +| **2nd person plural** | you | you | your | yours | yourselves | + +... to this table (in both directions): + +| | Subject Pronoun | Object Pronoun | Possessive Adjective | Possessive Pronoun | Reflexive Pronoun | +| --- | --- | --- | --- | --- | --- | +| **3rd person male** | he | him | his | his | himself | +| **3rd person female** | she | her | her | hers | herself | +| **3rd person neutral** | it | it | its | theirs* | itself | +| **3rd person plural** | they | them | their | theirs | themselves | + +> *) The neutral 3rd person possessive pronoun is not actually used in English. We set it to "theirs" +> just to have something to show should someone accidentally ask for a neutral possessive pronoun. + +Some mappings are easy. For example, if you write `$pron(yourselves)` then the 3rd-person +form is always `themselves`. But because English grammar is the way it is, not all mappings +are 1:1. For example, if you write +`$pron(you)`, Evennia will not know which 3rd-persion equivalent this should map to - you need to +provide more info to help out. This can either be provided as a second space-separated option +to `$pron` or the system will try to figure it out on its own. + +- `pronoun_type` - this is one of the columns in the table and can be set as a `$pron` option. + + - `subject pronoun` (aliases `subject` or `sp`) + - `object pronoun` (aliases `object` or `op`) + - `possessive adjective` (aliases `adjective` or `pa`) + - `possessive pronoun` (aliases `pronoun` or `pp`). + + (There is no need to specify reflexive pronouns since they + are all uniquely mapped 1:1). Speciying the pronoun-type is mainly needed when using `you`, + since the same 'you' is used to represent all sorts of things in English grammar. + If not specified and the mapping is not clear, a 'subject pronoun' (he/she/it/they) is assumed. +- `gender` - set in `$pron` option as + + - `male`, or `m` + - `female'` or `f` + - `neutral`, or `n` + - `plural`, or `p` (yes plural is considered a 'gender' for this purpose). + + If not set as an option the system will + look for a callable or property `.gender` on the current `from_obj`. A callable will be called + with no arguments and is expected to return a string 'male/female/neutral/plural'. If none + is found, a neutral gender is assumed. +- `viewpoint`- set in `$pron` option as + + - `1st person` (aliases `1st` or `1`) + - `2nd person` (aliases `2nd` or `2`) + + This is only needed if you want to have 1st person perspective - if + not, 2nd person is assumed wherever the viewpoint is unclear. + +`$pron()` examples: + +| Input | you see | others see | note | +| --- | --- | ---| --- | +| `$pron(I, male)` | I | he | | +| `$pron(I, f)` | I | she | | +| `$pron(my)` | my | its | figures out it's an possessive adjective, assumes neutral | +| `$pron(you)` | you | it | assumes neutral subject pronoun | +| `$pron(you, f)` | you | she | female specified, assumes subject pronoun | +| `$pron(you,op f)` | you | her | | +| `$pron(you,op p)` | you | them | | +| `$pron(you, f op)` | you | her | specified female and objective pronoun| +| `$pron(yourself)` | yourself | itself | | +| `$pron(its)` | your | its | | +| `$Pron(its)` | Your | Its | Using $Pron always capitalizes | +| `$pron(her)` | you | her | 3rd person -> 2nd person | +| `$pron(her, 1)` | I | her | 3rd person -> 1st person | +| `$pron(its, 1st)` | my | its | 3rd person -> 1st person | + + +Note the three last examples - instead of specifying the 2nd person form you +can also specify the 3rd-person and do a 'reverse' lookup - you will still see the proper 1st/2nd text. +So writing `$pron(her)` instead of `$pron(you, op f)` gives the same result. + +The [$pron inlinefunc api is found here](evennia.utils.funcparser.funcparser_callable_pronoun) + +# Referencing other objects + +There is one more inlinefunc understood by `msg_contents`. This can be used natively to spruce up +your strings (for both director- and actor stance): + +- `$Obj(name)/$obj(name)` references another entity, which must be supplied + in the `mapping` keyword argument to `msg_contents`. The object's `.get_display_name(looker)` will be + called and inserted instead. This is essentially the same as using the `{anna}` marker we used + in the first example at the top of this page, but using `$Obj/$obj` allows you to easily + control capitalization. + +This is used like so: + +```python +# director stance +text = "Tom picks up the $obj(gun), whistling to himself" + +# actor stance +text = "$You() $conj(pick) up the $obj(gun), whistling to $pron(yourself)" + +room.msg_contents(text, from_obj=caller, mapping={"gun": gun_object}) +``` +Depending on your game, Tom may now see himself picking up `A rusty old gun`, whereas an onlooker +with a high gun smith skill may instead see him picking up `A rare-make Smith & Wesson model 686 +in poor condition" ...` + +# Recog systems and roleplaying + +The `$funcparser` inline functions are very powerful for the game developer, but they may +be a bit too much to write for the regular player. + +The [rpsystem contrib](evennia.contribs.rpsystem) implements a full dynamic emote/pose and recognition +system with short-descriptions and disguises. It uses director stance with a custom markup +language, like `/me` `/gun` and `/tall man` to refer to players and objects in the location. It can be +worth checking out for inspiration. \ No newline at end of file diff --git a/docs/1.0-dev/_sources/Concepts/Concepts-Overview.md.txt b/docs/1.0-dev/_sources/Concepts/Concepts-Overview.md.txt index eaba407c09..11da8aed43 100644 --- a/docs/1.0-dev/_sources/Concepts/Concepts-Overview.md.txt +++ b/docs/1.0-dev/_sources/Concepts/Concepts-Overview.md.txt @@ -24,6 +24,7 @@ This documentation cover more over-arching concepts of Evennia, often involving - [Change the language of the server](./Internationalization.md) - [Server text-encoding](./Text-Encodings.md) - [Text tags](./TextTags.md) +- [Change Messages Per receiver](./Change-Messages-Per-Receiver.md) ## Web features diff --git a/docs/1.0-dev/_sources/api/evennia.server.md.txt b/docs/1.0-dev/_sources/api/evennia.server.md.txt index 5a8fc21fb4..e80c01b070 100644 --- a/docs/1.0-dev/_sources/api/evennia.server.md.txt +++ b/docs/1.0-dev/_sources/api/evennia.server.md.txt @@ -19,6 +19,7 @@ evennia.server evennia.server.initial_setup evennia.server.inputfuncs evennia.server.manager + evennia.server.markup evennia.server.models evennia.server.server evennia.server.serversession diff --git a/docs/1.0-dev/_sources/api/evennia.utils.verb_conjugation.md.txt b/docs/1.0-dev/_sources/api/evennia.utils.verb_conjugation.md.txt index a3359e1408..e2fb6e5fe0 100644 --- a/docs/1.0-dev/_sources/api/evennia.utils.verb_conjugation.md.txt +++ b/docs/1.0-dev/_sources/api/evennia.utils.verb_conjugation.md.txt @@ -13,6 +13,7 @@ evennia.utils.verb\_conjugation :maxdepth: 6 evennia.utils.verb_conjugation.conjugate + evennia.utils.verb_conjugation.pronouns evennia.utils.verb_conjugation.tests ``` \ No newline at end of file diff --git a/docs/1.0-dev/_sources/api/evennia.utils.verb_conjugation.pronouns.md.txt b/docs/1.0-dev/_sources/api/evennia.utils.verb_conjugation.pronouns.md.txt new file mode 100644 index 0000000000..1456e857ea --- /dev/null +++ b/docs/1.0-dev/_sources/api/evennia.utils.verb_conjugation.pronouns.md.txt @@ -0,0 +1,10 @@ +```{eval-rst} +evennia.utils.verb\_conjugation.pronouns +=============================================== + +.. automodule:: evennia.utils.verb_conjugation.pronouns + :members: + :undoc-members: + :show-inheritance: + +``` \ No newline at end of file diff --git a/docs/1.0-dev/_sources/toc.md.txt b/docs/1.0-dev/_sources/toc.md.txt index b7ccdaf8d2..2dc81b8ec6 100644 --- a/docs/1.0-dev/_sources/toc.md.txt +++ b/docs/1.0-dev/_sources/toc.md.txt @@ -58,6 +58,7 @@ Concepts/Async-Process Concepts/Banning Concepts/Bootstrap-&-Evennia Concepts/Building-Permissions +Concepts/Change-Messages-Per-Receiver Concepts/Clickable-Links Concepts/Colors Concepts/Concepts-Overview @@ -393,6 +394,7 @@ api/evennia.utils.utils api/evennia.utils.validatorfuncs api/evennia.utils.verb_conjugation api/evennia.utils.verb_conjugation.conjugate +api/evennia.utils.verb_conjugation.pronouns api/evennia.utils.verb_conjugation.tests api/evennia.web api/evennia.web.admin diff --git a/docs/1.0-dev/api/evennia-api.html b/docs/1.0-dev/api/evennia-api.html index 57d0699659..09ceafa243 100644 --- a/docs/1.0-dev/api/evennia-api.html +++ b/docs/1.0-dev/api/evennia-api.html @@ -380,6 +380,7 @@
  • evennia.utils.verb_conjugation
  • diff --git a/docs/1.0-dev/api/evennia.commands.default.account.html b/docs/1.0-dev/api/evennia.commands.default.account.html index 377982b4f2..10876a582f 100644 --- a/docs/1.0-dev/api/evennia.commands.default.account.html +++ b/docs/1.0-dev/api/evennia.commands.default.account.html @@ -73,7 +73,7 @@ method. Otherwise all text will be returned to all connected sessions.

    -aliases = ['ls', 'l']
    +aliases = ['l', 'ls']
    @@ -104,7 +104,7 @@ method. Otherwise all text will be returned to all connected sessions.

    -search_index_entry = {'aliases': 'ls l', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n look while out-of-character\n\n Usage:\n look\n\n Look in the ooc state.\n '}
    +search_index_entry = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n look while out-of-character\n\n Usage:\n look\n\n Look in the ooc state.\n '}
    diff --git a/docs/1.0-dev/api/evennia.commands.default.batchprocess.html b/docs/1.0-dev/api/evennia.commands.default.batchprocess.html index b2b331300f..18dbb610ba 100644 --- a/docs/1.0-dev/api/evennia.commands.default.batchprocess.html +++ b/docs/1.0-dev/api/evennia.commands.default.batchprocess.html @@ -78,7 +78,7 @@ skipping, reloading etc.

    -aliases = ['batchcmd', 'batchcommand']
    +aliases = ['batchcommand', 'batchcmd']
    @@ -109,7 +109,7 @@ skipping, reloading etc.

    -search_index_entry = {'aliases': 'batchcmd batchcommand', 'category': 'building', 'key': 'batchcommands', 'tags': '', 'text': '\n build from batch-command file\n\n Usage:\n batchcommands[/interactive] <python.path.to.file>\n\n Switch:\n interactive - this mode will offer more control when\n executing the batch file, like stepping,\n skipping, reloading etc.\n\n Runs batches of commands from a batch-cmd text file (*.ev).\n\n '}
    +search_index_entry = {'aliases': 'batchcommand batchcmd', 'category': 'building', 'key': 'batchcommands', 'tags': '', 'text': '\n build from batch-command file\n\n Usage:\n batchcommands[/interactive] <python.path.to.file>\n\n Switch:\n interactive - this mode will offer more control when\n executing the batch file, like stepping,\n skipping, reloading etc.\n\n Runs batches of commands from a batch-cmd text file (*.ev).\n\n '}
    diff --git a/docs/1.0-dev/api/evennia.commands.default.building.html b/docs/1.0-dev/api/evennia.commands.default.building.html index 9d3ca38c59..b1613334d8 100644 --- a/docs/1.0-dev/api/evennia.commands.default.building.html +++ b/docs/1.0-dev/api/evennia.commands.default.building.html @@ -1277,7 +1277,7 @@ server settings.

    -aliases = ['type', 'parent', 'swap', 'update', 'typeclasses']
    +aliases = ['swap', 'typeclasses', 'update', 'type', 'parent']
    @@ -1308,7 +1308,7 @@ server settings.

    -search_index_entry = {'aliases': 'type parent swap update typeclasses', 'category': 'building', 'key': 'typeclass', 'tags': '', 'text': "\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] <object> [= typeclass.path]\n typeclass/prototype <object> = prototype_key\n\n typeclasses or typeclass/list/show [typeclass.path]\n swap - this is a shorthand for using /force/reset flags.\n update - this is a shorthand for using the /force/reload flag.\n\n Switch:\n show, examine - display the current typeclass of object (default) or, if\n given a typeclass path, show the docstring of that typeclass.\n update - *only* re-run at_object_creation on this object\n meaning locks or other properties set later may remain.\n reset - clean out *all* the attributes and properties on the\n object - basically making this a new clean object.\n force - change to the typeclass also if the object\n already has a typeclass of the same name.\n list - show available typeclasses. Only typeclasses in modules actually\n imported or used from somewhere in the code will show up here\n (those typeclasses are still available if you know the path)\n prototype - clean and overwrite the object with the specified\n prototype key - effectively making a whole new object.\n\n Example:\n type button = examples.red_button.RedButton\n type/prototype button=a red button\n\n If the typeclass_path is not given, the current object's typeclass is\n assumed.\n\n View or set an object's typeclass. If setting, the creation hooks of the\n new typeclass will be run on the object. If you have clashing properties on\n the old class, use /reset. By default you are protected from changing to a\n typeclass of the same name as the one you already have - use /force to\n override this protection.\n\n The given typeclass must be identified by its location using python\n dot-notation pointing to the correct module and class. If no typeclass is\n given (or a wrong typeclass is given). Errors in the path or new typeclass\n will lead to the old typeclass being kept. The location of the typeclass\n module is searched from the default typeclass directory, as defined in the\n server settings.\n\n "}
    +search_index_entry = {'aliases': 'swap typeclasses update type parent', 'category': 'building', 'key': 'typeclass', 'tags': '', 'text': "\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] <object> [= typeclass.path]\n typeclass/prototype <object> = prototype_key\n\n typeclasses or typeclass/list/show [typeclass.path]\n swap - this is a shorthand for using /force/reset flags.\n update - this is a shorthand for using the /force/reload flag.\n\n Switch:\n show, examine - display the current typeclass of object (default) or, if\n given a typeclass path, show the docstring of that typeclass.\n update - *only* re-run at_object_creation on this object\n meaning locks or other properties set later may remain.\n reset - clean out *all* the attributes and properties on the\n object - basically making this a new clean object.\n force - change to the typeclass also if the object\n already has a typeclass of the same name.\n list - show available typeclasses. Only typeclasses in modules actually\n imported or used from somewhere in the code will show up here\n (those typeclasses are still available if you know the path)\n prototype - clean and overwrite the object with the specified\n prototype key - effectively making a whole new object.\n\n Example:\n type button = examples.red_button.RedButton\n type/prototype button=a red button\n\n If the typeclass_path is not given, the current object's typeclass is\n assumed.\n\n View or set an object's typeclass. If setting, the creation hooks of the\n new typeclass will be run on the object. If you have clashing properties on\n the old class, use /reset. By default you are protected from changing to a\n typeclass of the same name as the one you already have - use /force to\n override this protection.\n\n The given typeclass must be identified by its location using python\n dot-notation pointing to the correct module and class. If no typeclass is\n given (or a wrong typeclass is given). Errors in the path or new typeclass\n will lead to the old typeclass being kept. The location of the typeclass\n module is searched from the default typeclass directory, as defined in the\n server settings.\n\n "}
    @@ -1819,7 +1819,7 @@ given, <nr> defaults to 10.

    -aliases = ['listobjects', 'listobjs', 'stats', 'db']
    +aliases = ['listobjects', 'stats', 'db', 'listobjs']
    @@ -1845,7 +1845,7 @@ given, <nr> defaults to 10.

    -search_index_entry = {'aliases': 'listobjects listobjs stats db', 'category': 'system', 'key': 'objects', 'tags': '', 'text': '\n statistics on objects in the database\n\n Usage:\n objects [<nr>]\n\n Gives statictics on objects in database as well as\n a list of <nr> latest objects in database. If not\n given, <nr> defaults to 10.\n '}
    +search_index_entry = {'aliases': 'listobjects stats db listobjs', 'category': 'system', 'key': 'objects', 'tags': '', 'text': '\n statistics on objects in the database\n\n Usage:\n objects [<nr>]\n\n Gives statictics on objects in database as well as\n a list of <nr> latest objects in database. If not\n given, <nr> defaults to 10.\n '}
    diff --git a/docs/1.0-dev/api/evennia.commands.default.comms.html b/docs/1.0-dev/api/evennia.commands.default.comms.html index 20ac38ee42..e646ca1605 100644 --- a/docs/1.0-dev/api/evennia.commands.default.comms.html +++ b/docs/1.0-dev/api/evennia.commands.default.comms.html @@ -977,7 +977,7 @@ for that channel.

    -aliases = ['delchanalias', 'delaliaschan']
    +aliases = ['delaliaschan', 'delchanalias']
    @@ -1008,7 +1008,7 @@ for that channel.

    -search_index_entry = {'aliases': 'delchanalias delaliaschan', 'category': 'comms', 'key': 'delcom', 'tags': '', 'text': "\n remove a channel alias and/or unsubscribe from channel\n\n Usage:\n delcom <alias or channel>\n delcom/all <channel>\n\n If the full channel name is given, unsubscribe from the\n channel. If an alias is given, remove the alias but don't\n unsubscribe. If the 'all' switch is used, remove all aliases\n for that channel.\n "}
    +search_index_entry = {'aliases': 'delaliaschan delchanalias', 'category': 'comms', 'key': 'delcom', 'tags': '', 'text': "\n remove a channel alias and/or unsubscribe from channel\n\n Usage:\n delcom <alias or channel>\n delcom/all <channel>\n\n If the full channel name is given, unsubscribe from the\n channel. If an alias is given, remove the alias but don't\n unsubscribe. If the 'all' switch is used, remove all aliases\n for that channel.\n "}
    diff --git a/docs/1.0-dev/api/evennia.commands.default.general.html b/docs/1.0-dev/api/evennia.commands.default.general.html index cccb471ae6..271f5c3472 100644 --- a/docs/1.0-dev/api/evennia.commands.default.general.html +++ b/docs/1.0-dev/api/evennia.commands.default.general.html @@ -115,7 +115,7 @@ look *<account&g
    -aliases = ['ls', 'l']
    +aliases = ['l', 'ls']
    @@ -146,7 +146,7 @@ look *<account&g
    -search_index_entry = {'aliases': 'ls l', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n look at location or object\n\n Usage:\n look\n look <obj>\n look *<account>\n\n Observes your location or objects in your vicinity.\n '}
    +search_index_entry = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n look at location or object\n\n Usage:\n look\n look <obj>\n look *<account>\n\n Observes your location or objects in your vicinity.\n '}
    @@ -263,7 +263,7 @@ inv

    -aliases = ['inv', 'i']
    +aliases = ['i', 'inv']
    @@ -294,7 +294,7 @@ inv

    -search_index_entry = {'aliases': 'inv i', 'category': 'general', 'key': 'inventory', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}
    +search_index_entry = {'aliases': 'i inv', 'category': 'general', 'key': 'inventory', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}
    diff --git a/docs/1.0-dev/api/evennia.commands.default.system.html b/docs/1.0-dev/api/evennia.commands.default.system.html index 7e55d6b9fe..7ff6d08249 100644 --- a/docs/1.0-dev/api/evennia.commands.default.system.html +++ b/docs/1.0-dev/api/evennia.commands.default.system.html @@ -618,7 +618,7 @@ See |luhttps://ww
    -aliases = ['delays', 'task']
    +aliases = ['task', 'delays']
    @@ -664,7 +664,7 @@ to all the variables defined therein.

    -search_index_entry = {'aliases': 'delays task', 'category': 'system', 'key': 'tasks', 'tags': '', 'text': "\n Display or terminate active tasks (delays).\n\n Usage:\n tasks[/switch] [task_id or function_name]\n\n Switches:\n pause - Pause the callback of a task.\n unpause - Process all callbacks made since pause() was called.\n do_task - Execute the task (call its callback).\n call - Call the callback of this task.\n remove - Remove a task without executing it.\n cancel - Stop a task from automatically executing.\n\n Notes:\n A task is a single use method of delaying the call of a function. Calls are created\n in code, using `evennia.utils.delay`.\n See |luhttps://www.evennia.com/docs/latest/Command-Duration.html|ltthe docs|le for help.\n\n By default, tasks that are canceled and never called are cleaned up after one minute.\n\n Examples:\n - `tasks/cancel move_callback` - Cancels all movement delays from the slow_exit contrib.\n In this example slow exits creates it's tasks with\n `utils.delay(move_delay, move_callback)`\n - `tasks/cancel 2` - Cancel task id 2.\n\n "}
    +search_index_entry = {'aliases': 'task delays', 'category': 'system', 'key': 'tasks', 'tags': '', 'text': "\n Display or terminate active tasks (delays).\n\n Usage:\n tasks[/switch] [task_id or function_name]\n\n Switches:\n pause - Pause the callback of a task.\n unpause - Process all callbacks made since pause() was called.\n do_task - Execute the task (call its callback).\n call - Call the callback of this task.\n remove - Remove a task without executing it.\n cancel - Stop a task from automatically executing.\n\n Notes:\n A task is a single use method of delaying the call of a function. Calls are created\n in code, using `evennia.utils.delay`.\n See |luhttps://www.evennia.com/docs/latest/Command-Duration.html|ltthe docs|le for help.\n\n By default, tasks that are canceled and never called are cleaned up after one minute.\n\n Examples:\n - `tasks/cancel move_callback` - Cancels all movement delays from the slow_exit contrib.\n In this example slow exits creates it's tasks with\n `utils.delay(move_delay, move_callback)`\n - `tasks/cancel 2` - Cancel task id 2.\n\n "}
    diff --git a/docs/1.0-dev/api/evennia.commands.default.unloggedin.html b/docs/1.0-dev/api/evennia.commands.default.unloggedin.html index 600093ceef..549f5be0a6 100644 --- a/docs/1.0-dev/api/evennia.commands.default.unloggedin.html +++ b/docs/1.0-dev/api/evennia.commands.default.unloggedin.html @@ -62,7 +62,7 @@ connect “account name” “pass word”

    -aliases = ['conn', 'con', 'co']
    +aliases = ['con', 'conn', 'co']
    @@ -97,7 +97,7 @@ there is no object yet before the account has logged in)

    -search_index_entry = {'aliases': 'conn con co', 'category': 'general', 'key': 'connect', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect "account name" "pass word"\n\n Use the create command to first create an account before logging in.\n\n If you have spaces in your name, enclose it in double quotes.\n '}
    +search_index_entry = {'aliases': 'con conn co', 'category': 'general', 'key': 'connect', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect "account name" "pass word"\n\n Use the create command to first create an account before logging in.\n\n If you have spaces in your name, enclose it in double quotes.\n '}
    diff --git a/docs/1.0-dev/api/evennia.contrib.chargen.html b/docs/1.0-dev/api/evennia.contrib.chargen.html index 570a1a5d88..2f9ce1d17a 100644 --- a/docs/1.0-dev/api/evennia.contrib.chargen.html +++ b/docs/1.0-dev/api/evennia.contrib.chargen.html @@ -80,7 +80,7 @@ at them with this command.

    -aliases = ['ls', 'l']
    +aliases = ['l', 'ls']
    @@ -112,7 +112,7 @@ that is checked by the @ic command directly.

    -search_index_entry = {'aliases': 'ls l', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n ooc look\n\n Usage:\n look\n look <character>\n\n This is an OOC version of the look command. Since an Account doesn\'t\n have an in-game existence, there is no concept of location or\n "self".\n\n If any characters are available for you to control, you may look\n at them with this command.\n '}
    +search_index_entry = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n ooc look\n\n Usage:\n look\n look <character>\n\n This is an OOC version of the look command. Since an Account doesn\'t\n have an in-game existence, there is no concept of location or\n "self".\n\n If any characters are available for you to control, you may look\n at them with this command.\n '}
    diff --git a/docs/1.0-dev/api/evennia.contrib.clothing.html b/docs/1.0-dev/api/evennia.contrib.clothing.html index 4756c281eb..7f1d30a484 100644 --- a/docs/1.0-dev/api/evennia.contrib.clothing.html +++ b/docs/1.0-dev/api/evennia.contrib.clothing.html @@ -631,7 +631,7 @@ inv

    -aliases = ['inv', 'i']
    +aliases = ['i', 'inv']
    @@ -662,7 +662,7 @@ inv

    -search_index_entry = {'aliases': 'inv i', 'category': 'general', 'key': 'inventory', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}
    +search_index_entry = {'aliases': 'i inv', 'category': 'general', 'key': 'inventory', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}
    diff --git a/docs/1.0-dev/api/evennia.contrib.dice.html b/docs/1.0-dev/api/evennia.contrib.dice.html index 3a54340a8c..a0adc15e6f 100644 --- a/docs/1.0-dev/api/evennia.contrib.dice.html +++ b/docs/1.0-dev/api/evennia.contrib.dice.html @@ -152,7 +152,7 @@ everyone but the person rolling.

    -aliases = ['roll', '@dice']
    +aliases = ['@dice', 'roll']
    @@ -178,7 +178,7 @@ everyone but the person rolling.

    -search_index_entry = {'aliases': 'roll @dice', 'category': 'general', 'key': 'dice', 'tags': '', 'text': "\n roll dice\n\n Usage:\n dice[/switch] <nr>d<sides> [modifier] [success condition]\n\n Switch:\n hidden - tell the room the roll is being done, but don't show the result\n secret - don't inform the room about neither roll nor result\n\n Examples:\n dice 3d6 + 4\n dice 1d100 - 2 < 50\n\n This will roll the given number of dice with given sides and modifiers.\n So e.g. 2d6 + 3 means to 'roll a 6-sided die 2 times and add the result,\n then add 3 to the total'.\n Accepted modifiers are +, -, * and /.\n A success condition is given as normal Python conditionals\n (<,>,<=,>=,==,!=). So e.g. 2d6 + 3 > 10 means that the roll will succeed\n only if the final result is above 8. If a success condition is given, the\n outcome (pass/fail) will be echoed along with how much it succeeded/failed\n with. The hidden/secret switches will hide all or parts of the roll from\n everyone but the person rolling.\n "}
    +search_index_entry = {'aliases': '@dice roll', 'category': 'general', 'key': 'dice', 'tags': '', 'text': "\n roll dice\n\n Usage:\n dice[/switch] <nr>d<sides> [modifier] [success condition]\n\n Switch:\n hidden - tell the room the roll is being done, but don't show the result\n secret - don't inform the room about neither roll nor result\n\n Examples:\n dice 3d6 + 4\n dice 1d100 - 2 < 50\n\n This will roll the given number of dice with given sides and modifiers.\n So e.g. 2d6 + 3 means to 'roll a 6-sided die 2 times and add the result,\n then add 3 to the total'.\n Accepted modifiers are +, -, * and /.\n A success condition is given as normal Python conditionals\n (<,>,<=,>=,==,!=). So e.g. 2d6 + 3 > 10 means that the roll will succeed\n only if the final result is above 8. If a success condition is given, the\n outcome (pass/fail) will be echoed along with how much it succeeded/failed\n with. The hidden/secret switches will hide all or parts of the roll from\n everyone but the person rolling.\n "}
    diff --git a/docs/1.0-dev/api/evennia.contrib.email_login.html b/docs/1.0-dev/api/evennia.contrib.email_login.html index 081bde1083..972f10c6db 100644 --- a/docs/1.0-dev/api/evennia.contrib.email_login.html +++ b/docs/1.0-dev/api/evennia.contrib.email_login.html @@ -77,7 +77,7 @@ the module given by settings.CONNECTION_SCREEN_MODULE.

    -aliases = ['conn', 'con', 'co']
    +aliases = ['con', 'conn', 'co']
    @@ -107,7 +107,7 @@ there is no object yet before the account has logged in)

    -search_index_entry = {'aliases': 'conn con co', 'category': 'general', 'key': 'connect', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect <email> <password>\n\n Use the create command to first create an account before logging in.\n '}
    +search_index_entry = {'aliases': 'con conn co', 'category': 'general', 'key': 'connect', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect <email> <password>\n\n Use the create command to first create an account before logging in.\n '}
    diff --git a/docs/1.0-dev/api/evennia.contrib.evscaperoom.commands.html b/docs/1.0-dev/api/evennia.contrib.evscaperoom.commands.html index 1ab92fbec1..629674796f 100644 --- a/docs/1.0-dev/api/evennia.contrib.evscaperoom.commands.html +++ b/docs/1.0-dev/api/evennia.contrib.evscaperoom.commands.html @@ -150,7 +150,7 @@ the operation will be general or on the room.

    -aliases = ['q', 'abort', 'quit', 'chicken out']
    +aliases = ['chicken out', 'q', 'abort', 'quit']
    @@ -174,7 +174,7 @@ set in self.parse())

    -search_index_entry = {'aliases': 'q abort quit chicken out', 'category': 'evscaperoom', 'key': 'give up', 'tags': '', 'text': '\n Give up\n\n Usage:\n give up\n\n Abandons your attempts at escaping and of ever winning the pie-eating contest.\n\n '}
    +search_index_entry = {'aliases': 'chicken out q abort quit', 'category': 'evscaperoom', 'key': 'give up', 'tags': '', 'text': '\n Give up\n\n Usage:\n give up\n\n Abandons your attempts at escaping and of ever winning the pie-eating contest.\n\n '}
    @@ -195,7 +195,7 @@ set in self.parse())

    -aliases = ['ls', 'l']
    +aliases = ['l', 'ls']
    @@ -229,7 +229,7 @@ set in self.parse())

    -search_index_entry = {'aliases': 'ls l', 'category': 'evscaperoom', 'key': 'look', 'tags': '', 'text': '\n Look at the room, an object or the currently focused object\n\n Usage:\n look [obj]\n\n '}
    +search_index_entry = {'aliases': 'l ls', 'category': 'evscaperoom', 'key': 'look', 'tags': '', 'text': '\n Look at the room, an object or the currently focused object\n\n Usage:\n look [obj]\n\n '}
    @@ -310,7 +310,7 @@ shout

    -aliases = [';', 'shout', 'whisper']
    +aliases = ['shout', 'whisper', ';']
    @@ -339,7 +339,7 @@ set in self.parse())

    -search_index_entry = {'aliases': '; shout whisper', 'category': 'general', 'key': 'say', 'tags': '', 'text': '\n Perform an communication action.\n\n Usage:\n say <text>\n whisper\n shout\n\n '}
    +search_index_entry = {'aliases': 'shout whisper ;', 'category': 'general', 'key': 'say', 'tags': '', 'text': '\n Perform an communication action.\n\n Usage:\n say <text>\n whisper\n shout\n\n '}
    @@ -429,7 +429,7 @@ looks and what actions is available.

    -aliases = ['ex', 'examine', 'e', 'unfocus']
    +aliases = ['e', 'ex', 'unfocus', 'examine']
    @@ -458,7 +458,7 @@ set in self.parse())

    -search_index_entry = {'aliases': 'ex examine e unfocus', 'category': 'evscaperoom', 'key': 'focus', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus <obj>\n\n Once focusing on an object, use look to get more information about how it\n looks and what actions is available.\n\n '}
    +search_index_entry = {'aliases': 'e ex unfocus examine', 'category': 'evscaperoom', 'key': 'focus', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus <obj>\n\n Once focusing on an object, use look to get more information about how it\n looks and what actions is available.\n\n '}
    @@ -520,7 +520,7 @@ set in self.parse())

    -aliases = ['inv', 'i', 'give', 'inventory']
    +aliases = ['i', 'give', 'inventory', 'inv']
    @@ -544,7 +544,7 @@ set in self.parse())

    -search_index_entry = {'aliases': 'inv i give inventory', 'category': 'evscaperoom', 'key': 'get', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}
    +search_index_entry = {'aliases': 'i give inventory inv', 'category': 'evscaperoom', 'key': 'get', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}
    @@ -565,7 +565,7 @@ set in self.parse())

    -aliases = ['@open', '@dig']
    +aliases = ['@dig', '@open']
    @@ -588,7 +588,7 @@ to all the variables defined therein.

    -search_index_entry = {'aliases': '@open @dig', 'category': 'general', 'key': 'open', 'tags': '', 'text': '\n Interact with an object in focus.\n\n Usage:\n <action> [arg]\n\n '}
    +search_index_entry = {'aliases': '@dig @open', 'category': 'general', 'key': 'open', 'tags': '', 'text': '\n Interact with an object in focus.\n\n Usage:\n <action> [arg]\n\n '}
    diff --git a/docs/1.0-dev/api/evennia.contrib.rpsystem.html b/docs/1.0-dev/api/evennia.contrib.rpsystem.html index f3e7bf37a1..12e4a93804 100644 --- a/docs/1.0-dev/api/evennia.contrib.rpsystem.html +++ b/docs/1.0-dev/api/evennia.contrib.rpsystem.html @@ -827,7 +827,7 @@ Using the command without arguments will list all current recogs.

    -aliases = ['recognize', 'forget']
    +aliases = ['forget', 'recognize']
    @@ -854,7 +854,7 @@ Using the command without arguments will list all current recogs.

    -search_index_entry = {'aliases': 'recognize forget', 'category': 'general', 'key': 'recog', 'tags': '', 'text': '\n Recognize another person in the same room.\n\n Usage:\n recog\n recog sdesc as alias\n forget alias\n\n Example:\n recog tall man as Griatch\n forget griatch\n\n This will assign a personal alias for a person, or forget said alias.\n Using the command without arguments will list all current recogs.\n\n '}
    +search_index_entry = {'aliases': 'forget recognize', 'category': 'general', 'key': 'recog', 'tags': '', 'text': '\n Recognize another person in the same room.\n\n Usage:\n recog\n recog sdesc as alias\n forget alias\n\n Example:\n recog tall man as Griatch\n forget griatch\n\n This will assign a personal alias for a person, or forget said alias.\n Using the command without arguments will list all current recogs.\n\n '}
    diff --git a/docs/1.0-dev/api/evennia.contrib.tutorial_examples.red_button.html b/docs/1.0-dev/api/evennia.contrib.tutorial_examples.red_button.html index 80070b3104..0e5bc3b421 100644 --- a/docs/1.0-dev/api/evennia.contrib.tutorial_examples.red_button.html +++ b/docs/1.0-dev/api/evennia.contrib.tutorial_examples.red_button.html @@ -82,7 +82,7 @@ such as when closing the lid and un-blinding a character.

    -aliases = ['press', 'push', 'press button']
    +aliases = ['press button', 'press', 'push']
    @@ -111,7 +111,7 @@ check if the lid is open or closed.

    -search_index_entry = {'aliases': 'press push press button', 'category': 'general', 'key': 'push button', 'tags': '', 'text': '\n Push the red button (lid closed)\n\n Usage:\n push button\n\n '}
    +search_index_entry = {'aliases': 'press button press push', 'category': 'general', 'key': 'push button', 'tags': '', 'text': '\n Push the red button (lid closed)\n\n Usage:\n push button\n\n '}
    @@ -181,7 +181,7 @@ check if the lid is open or closed.

    -aliases = ['smash', 'break lid', 'smash lid']
    +aliases = ['break lid', 'smash', 'smash lid']
    @@ -208,7 +208,7 @@ break.

    -search_index_entry = {'aliases': 'smash break lid smash lid', 'category': 'general', 'key': 'smash glass', 'tags': '', 'text': '\n Smash the protective glass.\n\n Usage:\n smash glass\n\n Try to smash the glass of the button.\n\n '}
    +search_index_entry = {'aliases': 'break lid smash smash lid', 'category': 'general', 'key': 'smash glass', 'tags': '', 'text': '\n Smash the protective glass.\n\n Usage:\n smash glass\n\n Try to smash the glass of the button.\n\n '}
    @@ -308,7 +308,7 @@ be mutually exclusive.

    -aliases = ['press', 'push', 'press button']
    +aliases = ['press button', 'press', 'push']
    @@ -337,7 +337,7 @@ set in self.parse())

    -search_index_entry = {'aliases': 'press push press button', 'category': 'general', 'key': 'push button', 'tags': '', 'text': '\n Push the red button\n\n Usage:\n push button\n\n '}
    +search_index_entry = {'aliases': 'press button press push', 'category': 'general', 'key': 'push button', 'tags': '', 'text': '\n Push the red button\n\n Usage:\n push button\n\n '}
    @@ -435,7 +435,7 @@ be mutually exclusive.

    -aliases = ['listen', 'get', 'feel', 'ex', 'l', 'examine']
    +aliases = ['listen', 'get', 'ex', 'l', 'examine', 'feel']
    @@ -461,7 +461,7 @@ be mutually exclusive.

    -search_index_entry = {'aliases': 'listen get feel ex l examine', 'category': 'general', 'key': 'look', 'tags': '', 'text': "\n Looking around in darkness\n\n Usage:\n look <obj>\n\n ... not that there's much to see in the dark.\n\n "}
    +search_index_entry = {'aliases': 'listen get ex l examine feel', 'category': 'general', 'key': 'look', 'tags': '', 'text': "\n Looking around in darkness\n\n Usage:\n look <obj>\n\n ... not that there's much to see in the dark.\n\n "}
    diff --git a/docs/1.0-dev/api/evennia.contrib.tutorial_world.objects.html b/docs/1.0-dev/api/evennia.contrib.tutorial_world.objects.html index 875eb319f3..e3e7d4b948 100644 --- a/docs/1.0-dev/api/evennia.contrib.tutorial_world.objects.html +++ b/docs/1.0-dev/api/evennia.contrib.tutorial_world.objects.html @@ -364,7 +364,7 @@ of the object. We overload it with our own version.

    -aliases = ['burn', 'light']
    +aliases = ['light', 'burn']
    @@ -391,7 +391,7 @@ to sit on a “lightable” object, we operate only on self.obj.

    -search_index_entry = {'aliases': 'burn light', 'category': 'tutorialworld', 'key': 'on', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}
    +search_index_entry = {'aliases': 'light burn', 'category': 'tutorialworld', 'key': 'on', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}
    @@ -495,7 +495,7 @@ shift green root up/down

    -aliases = ['shiftroot', 'push', 'pull', 'move']
    +aliases = ['pull', 'move', 'push', 'shiftroot']
    @@ -531,7 +531,7 @@ yellow/green - horizontal roots

    -search_index_entry = {'aliases': 'shiftroot push pull move', 'category': 'tutorialworld', 'key': 'shift', 'tags': '', 'text': '\n Shifts roots around.\n\n Usage:\n shift blue root left/right\n shift red root left/right\n shift yellow root up/down\n shift green root up/down\n\n '}
    +search_index_entry = {'aliases': 'pull move push shiftroot', 'category': 'tutorialworld', 'key': 'shift', 'tags': '', 'text': '\n Shifts roots around.\n\n Usage:\n shift blue root left/right\n shift red root left/right\n shift yellow root up/down\n shift green root up/down\n\n '}
    @@ -548,7 +548,7 @@ yellow/green - horizontal roots

    -aliases = ['button', 'press button', 'push button']
    +aliases = ['push button', 'press button', 'button']
    @@ -574,7 +574,7 @@ yellow/green - horizontal roots

    -search_index_entry = {'aliases': 'button press button push button', 'category': 'tutorialworld', 'key': 'press', 'tags': '', 'text': '\n Presses a button.\n '}
    +search_index_entry = {'aliases': 'push button press button button', 'category': 'tutorialworld', 'key': 'press', 'tags': '', 'text': '\n Presses a button.\n '}
    @@ -718,7 +718,7 @@ parry - forgoes your attack but will make you harder to hit on next

    -aliases = ['bash', 'defend', 'pierce', 'chop', 'fight', 'hit', 'kill', 'stab', 'slash', 'parry', 'thrust']
    +aliases = ['slash', 'stab', 'bash', 'thrust', 'kill', 'pierce', 'chop', 'fight', 'defend', 'hit', 'parry']
    @@ -744,7 +744,7 @@ parry - forgoes your attack but will make you harder to hit on next

    -search_index_entry = {'aliases': 'bash defend pierce chop fight hit kill stab slash parry thrust', 'category': 'tutorialworld', 'key': 'attack', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab <enemy>\n slash <enemy>\n parry\n\n stab - (thrust) makes a lot of damage but is harder to hit with.\n slash - is easier to land, but does not make as much damage.\n parry - forgoes your attack but will make you harder to hit on next\n enemy attack.\n\n '}
    +search_index_entry = {'aliases': 'slash stab bash thrust kill pierce chop fight defend hit parry', 'category': 'tutorialworld', 'key': 'attack', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab <enemy>\n slash <enemy>\n parry\n\n stab - (thrust) makes a lot of damage but is harder to hit with.\n slash - is easier to land, but does not make as much damage.\n parry - forgoes your attack but will make you harder to hit on next\n enemy attack.\n\n '}
    diff --git a/docs/1.0-dev/api/evennia.contrib.tutorial_world.rooms.html b/docs/1.0-dev/api/evennia.contrib.tutorial_world.rooms.html index 815d5f6e0c..556c09a629 100644 --- a/docs/1.0-dev/api/evennia.contrib.tutorial_world.rooms.html +++ b/docs/1.0-dev/api/evennia.contrib.tutorial_world.rooms.html @@ -868,7 +868,7 @@ to find something.

    -aliases = ['search', 'feel', 'l', 'fiddle', 'feel around']
    +aliases = ['feel around', 'l', 'search', 'fiddle', 'feel']
    @@ -896,7 +896,7 @@ random chance of eventually finding a light source.

    -search_index_entry = {'aliases': 'search feel l fiddle feel around', 'category': 'tutorialworld', 'key': 'look', 'tags': '', 'text': '\n Look around in darkness\n\n Usage:\n look\n\n Look around in the darkness, trying\n to find something.\n '}
    +search_index_entry = {'aliases': 'feel around l search fiddle feel', 'category': 'tutorialworld', 'key': 'look', 'tags': '', 'text': '\n Look around in darkness\n\n Usage:\n look\n\n Look around in the darkness, trying\n to find something.\n '}
    diff --git a/docs/1.0-dev/api/evennia.html b/docs/1.0-dev/api/evennia.html index 3f5990667d..9dc15f6f9f 100644 --- a/docs/1.0-dev/api/evennia.html +++ b/docs/1.0-dev/api/evennia.html @@ -476,6 +476,7 @@ with ‘q’, remove the break line and restart server when finished.

  • evennia.utils.verb_conjugation
  • diff --git a/docs/1.0-dev/api/evennia.objects.objects.html b/docs/1.0-dev/api/evennia.objects.objects.html index 51d0e255d4..0ebfaabfe7 100644 --- a/docs/1.0-dev/api/evennia.objects.objects.html +++ b/docs/1.0-dev/api/evennia.objects.objects.html @@ -547,8 +547,9 @@ function on.

    on the valid OOB outmessage form (message, {kwargs}), where kwargs are optional data passed to the text outputfunc. The message will be parsed for {key} formatting and -$You/$you()/$You(key) and $conj(verb) inline function callables. -The key is taken from the mapping kwarg {“key”: object, …}**. +$You/$you()/$You(), $obj(name), $conj(verb) and $pron(pronoun, option) +inline function callables. +The name is taken from the mapping kwarg {“name”: object, …}**. The mapping[key].get_display_name(looker=recipient) will be called for that key for every recipient of the string.

  • exclude (list, optional) – A list of objects not to send to.

  • diff --git a/docs/1.0-dev/api/evennia.utils.eveditor.html b/docs/1.0-dev/api/evennia.utils.eveditor.html index 5a5538f5cd..0a16e33ff4 100644 --- a/docs/1.0-dev/api/evennia.utils.eveditor.html +++ b/docs/1.0-dev/api/evennia.utils.eveditor.html @@ -277,7 +277,7 @@ indentation.

    -aliases = [':x', ':=', ':<', ':q!', ':', '::', ':uu', ':fi', ':dw', ':::', ':s', ':S', ':y', ':u', ':echo', ':i', ':wq', ':j', ':A', ':DD', ':>', ':r', ':!', ':q', ':UU', ':w', ':h', ':f', ':p', ':I', ':fd', ':dd']
    +aliases = [':dd', ':h', ':echo', ':f', ':', ':fi', ':q', ':s', ':fd', ':i', ':::', ':=', ':j', ':x', ':q!', ':wq', ':!', ':r', ':w', ':A', ':p', ':dw', ':uu', ':UU', ':<', ':I', '::', ':S', ':>', ':u', ':DD', ':y']
    @@ -305,7 +305,7 @@ efficient presentation.

    -search_index_entry = {'aliases': ':x := :< :q! : :: :uu :fi :dw ::: :s :S :y :u :echo :i :wq :j :A :DD :> :r :! :q :UU :w :h :f :p :I :fd :dd', 'category': 'general', 'key': ':editor_command_group', 'tags': '', 'text': '\n Commands for the editor\n '}
    +search_index_entry = {'aliases': ':dd :h :echo :f : :fi :q :s :fd :i ::: := :j :x :q! :wq :! :r :w :A :p :dw :uu :UU :< :I :: :S :> :u :DD :y', 'category': 'general', 'key': ':editor_command_group', 'tags': '', 'text': '\n Commands for the editor\n '}
    diff --git a/docs/1.0-dev/api/evennia.utils.evmenu.html b/docs/1.0-dev/api/evennia.utils.evmenu.html index 8d73402956..12b64025c3 100644 --- a/docs/1.0-dev/api/evennia.utils.evmenu.html +++ b/docs/1.0-dev/api/evennia.utils.evmenu.html @@ -943,7 +943,7 @@ single question.

    -aliases = ['yes', 'abort', '__nomatch_command', 'y', 'a', 'n', 'no']
    +aliases = ['y', 'no', 'abort', 'yes', 'n', 'a', '__nomatch_command']
    @@ -969,7 +969,7 @@ single question.

    -search_index_entry = {'aliases': 'yes abort __nomatch_command y a n no', 'category': 'general', 'key': '__noinput_command', 'tags': '', 'text': '\n Handle a prompt for yes or no. Press [return] for the default choice.\n\n '}
    +search_index_entry = {'aliases': 'y no abort yes n a __nomatch_command', 'category': 'general', 'key': '__noinput_command', 'tags': '', 'text': '\n Handle a prompt for yes or no. Press [return] for the default choice.\n\n '}
    diff --git a/docs/1.0-dev/api/evennia.utils.evmore.html b/docs/1.0-dev/api/evennia.utils.evmore.html index 1bb9d04562..db489c0b61 100644 --- a/docs/1.0-dev/api/evennia.utils.evmore.html +++ b/docs/1.0-dev/api/evennia.utils.evmore.html @@ -78,7 +78,7 @@ the caller.msg() construct every time the page is updated.

    -aliases = ['end', 'next', 't', 'abort', 'top', 'e', 'previous', 'quit', 'a', 'p', 'n', 'q']
    +aliases = ['quit', 't', 'abort', 'previous', 'end', 'n', 'p', 'a', 'e', 'next', 'q', 'top']
    @@ -104,7 +104,7 @@ the caller.msg() construct every time the page is updated.

    -search_index_entry = {'aliases': 'end next t abort top e previous quit a p n q', 'category': 'general', 'key': '__noinput_command', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}
    +search_index_entry = {'aliases': 'quit t abort previous end n p a e next q top', 'category': 'general', 'key': '__noinput_command', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}
    diff --git a/docs/1.0-dev/api/evennia.utils.funcparser.html b/docs/1.0-dev/api/evennia.utils.funcparser.html index 8527b305dc..834d6b5e9e 100644 --- a/docs/1.0-dev/api/evennia.utils.funcparser.html +++ b/docs/1.0-dev/api/evennia.utils.funcparser.html @@ -612,15 +612,16 @@ Others will see “With a grin, CharName jumps at Tommy.”

    -
    -evennia.utils.funcparser.funcparser_callable_You(*args, you=None, receiver=None, mapping=None, capitalize=True, **kwargs)[source]
    +
    +evennia.utils.funcparser.funcparser_callable_you_capitalize(*args, you=None, receiver=None, mapping=None, capitalize=True, **kwargs)[source]

    Usage: $You() - capitalizes the ‘you’ output.

    evennia.utils.funcparser.funcparser_callable_conjugate(*args, caller=None, receiver=None, **kwargs)[source]
    -

    Conjugate a verb according to if it should be 2nd or third person.

    +

    Usage: $conj(word, [options])

    +

    Conjugate a verb according to if it should be 2nd or third person.

    Keyword Arguments
      @@ -649,6 +650,220 @@ than ‘you’. The caller/receiver must be passed to the parser directly.

      Others will see “With a grin, CharName jumps.”

    +
    +
    +evennia.utils.funcparser.funcparser_callable_pronoun(*args, caller=None, receiver=None, capitalize=False, **kwargs)[source]
    +

    Usage: $prop(word, [options])

    +

    Adjust pronouns to the expected form. Pronouns are words you use instead of a +proper name, such as ‘him’, ‘herself’, ‘theirs’ etc. These look different +depending on who sees the outgoing string.

    +

    The parser maps between this table …

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    1st/2nd person

    Subject +Pronoun

    Object +Pronoun

    Possessive +Adjective

    Possessive +Pronoun

    Reflexive +Pronoun

    1st person

    I

    me

    my

    mine

    myself

    1st person plural

    we

    us

    our

    ours

    ourselves

    2nd person

    you

    you

    your

    yours

    yourself

    2nd person plural

    you

    you

    your

    yours

    yourselves

    +

    … and this table (and vice versa).

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    3rd person

    Subject +Pronoun

    Object +Pronoun

    Possessive +Adjective

    Possessive +Pronoun

    Reflexive +Pronoun

    3rd person male

    he

    him

    his

    his

    himself

    3rd person female

    she

    her

    her

    hers

    herself

    3rd person neutral

    it

    it

    its

    itself

    3rd person plural

    they

    them

    their

    theirs

    themselves

    +

    This system will examine caller for either a property or a callable .gender to +get a default gender fallback (if not specified in the call). If a callable, +.gender will be called without arguments and should return a string +male/female/neutral/plural (plural is considered a gender for this purpose). +If no gender property/callable is found, neutral is used as a fallback.

    +

    The pronoun-type default (if not spefified in call) is subject pronoun.

    +
    +
    Parameters
    +
      +
    • pronoun (str) – Input argument to parsed call. This can be any of the pronouns +in the table above. If given in 1st/second form, they will be mappped to +3rd-person form for others viewing the message (but will need extra input +via the gender, see below). If given on 3rd person form, this will be +mapped to 2nd person form for caller unless viewpoint is specified +in options.

    • +
    • options (str, optional) –

      A space- or comma-separated string detailing pronoun_type, +gender/plural and/or viewpoint to help the mapper differentiate between +non-unique cases (such as if you should become him or they). +Allowed values are:

      +
        +
      • subject pronoun/subject/sp (I, you, he, they)

      • +
      • object pronoun/object//op (me, you, him, them)

      • +
      • possessive adjective/adjective/pa (my, your, his, their)

      • +
      • possessive pronoun/pronoun/pp (mine, yours, his, theirs)

      • +
      • male/m

      • +
      • female/f

      • +
      • neutral/n

      • +
      • plural/p

      • +
      • 1st person/1st/1

      • +
      • 2nd person/2nd/2

      • +
      • 3rd person/3rd/3

      • +
      +

    • +
    +
    +
    Keyword Arguments
    +
      +
    • caller (Object) – The object creating the string. If this has a property ‘gender’, +it will be checked for a string ‘male/female/neutral’ to determine +the 3rd person gender (but if pronoun_type contains a gender +component, that takes precedence). Provided automatically to the +funcparser.

    • +
    • receiver (Object) – The recipient of the string. This being the same as +caller or not helps determine 2nd vs 3rd-person forms. This is +provided automatically by the funcparser.

    • +
    • capitalize (bool) – The input retains its capitalization. If this is set the output is +always capitalized.

    • +
    +
    +
    +

    Examples

    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Input

    caller sees

    others see

    $pron(I, m)

    I

    he

    $pron(you,fo)

    you

    her

    $pron(yourself)

    yourself

    itself

    $pron(its)

    your

    its

    $pron(you,op,p)

    you

    them

    +

    Notes

    +

    There is no option to specify reflexive pronouns since they are all unique +and the mapping can always be auto-detected.

    +
    + +
    +
    +evennia.utils.funcparser.funcparser_callable_pronoun_capitalize(*args, caller=None, receiver=None, capitalize=True, **kwargs)[source]
    +

    Usage: $Pron(word) - always maps to a capitalized word.

    +
    +
    diff --git a/docs/1.0-dev/api/evennia.utils.gametime.html b/docs/1.0-dev/api/evennia.utils.gametime.html index 44c6dffd78..51e845208d 100644 --- a/docs/1.0-dev/api/evennia.utils.gametime.html +++ b/docs/1.0-dev/api/evennia.utils.gametime.html @@ -226,8 +226,10 @@ to store in Attributes on the generated scheduling Script.

    Examples

    -

    schedule(func, min=5, sec=0) # Will call 5 minutes past the next (in-game) hour. -schedule(func, hour=2, min=30, sec=0) # Will call the next (in-game) day at 02:30.

    +
    schedule(func, min=5, sec=0)  # Will call 5 minutes past the next (in-game) hour.
    +schedule(func, hour=2, min=30, sec=0)  # Will call the next (in-game) day at 02:30.
    +
    +
    diff --git a/docs/1.0-dev/api/evennia.utils.html b/docs/1.0-dev/api/evennia.utils.html index 268849ea17..fbc15bd7b7 100644 --- a/docs/1.0-dev/api/evennia.utils.html +++ b/docs/1.0-dev/api/evennia.utils.html @@ -96,6 +96,7 @@ functionality.

  • evennia.utils.verb_conjugation
  • diff --git a/docs/1.0-dev/api/evennia.utils.utils.html b/docs/1.0-dev/api/evennia.utils.utils.html index 3591599324..ba6a483cde 100644 --- a/docs/1.0-dev/api/evennia.utils.utils.html +++ b/docs/1.0-dev/api/evennia.utils.utils.html @@ -1656,6 +1656,27 @@ to check for bypassing the strip. If not given, use permissions are required to bypass this strip.

    +
    +
    +evennia.utils.utils.copy_word_case(base_word, new_word)[source]
    +

    Converts a word to use the same capitalization as a first word.

    +
    +
    Parameters
    +
      +
    • base_word (str) – A word to get the capitalization from.

    • +
    • new_word (str) – A new word to capitalize in the same way as base_word.

    • +
    +
    +
    Returns
    +

    str – The new_word with capitalization matching the first word.

    +
    +
    +

    Notes

    +

    This is meant for words. Longer sentences may get unexpected results.

    +

    If the two words have a mix of capital/lower letters _and_ new_word +is longer than base_word, the excess will retain its original case.

    +
    + diff --git a/docs/1.0-dev/api/evennia.utils.verb_conjugation.html b/docs/1.0-dev/api/evennia.utils.verb_conjugation.html index 7c4d5275ed..816ce37eeb 100644 --- a/docs/1.0-dev/api/evennia.utils.verb_conjugation.html +++ b/docs/1.0-dev/api/evennia.utils.verb_conjugation.html @@ -45,6 +45,7 @@ diff --git a/docs/1.0-dev/api/evennia.utils.verb_conjugation.pronouns.html b/docs/1.0-dev/api/evennia.utils.verb_conjugation.pronouns.html new file mode 100644 index 0000000000..2b81f29f5d --- /dev/null +++ b/docs/1.0-dev/api/evennia.utils.verb_conjugation.pronouns.html @@ -0,0 +1,255 @@ + + + + + + + + + evennia.utils.verb_conjugation.pronouns — Evennia 1.0-dev documentation + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +

    evennia.utils.verb_conjugation.pronouns

    +

    English pronoun mapping between 1st/2nd person and 3rd person perspective (and vice-versa).

    +

    This file is released under the Evennia regular BSD License. +(Griatch 2021)

    +

    Pronouns are words you use instead of a proper name, such as ‘him’, ‘herself’, ‘theirs’ etc. These +look different depending on who sees the outgoing string. This mapping maps between 1st/2nd case and +the 3rd person case and back. In some cases, the mapping is not unique; it is assumed the system can +differentiate between the options in some other way.

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    viewpoint/pronouns

    Subject +Pronoun

    Object +Pronoun

    Possessive +Adjective

    Possessive +Pronoun

    Reflexive +Pronoun

    1st person

    I

    me

    my

    mine

    myself

    1st person plural

    we

    us

    our

    ours

    ourselves

    2nd person

    you

    you

    your

    yours

    yourself

    2nd person plural

    you

    you

    your

    yours

    yourselves

    3rd person male

    he

    him

    his

    his

    himself

    3rd person female

    she

    her

    her

    hers

    herself

    3rd person neutral

    it

    it

    its

    theirs*

    itself

    3rd person plural

    they

    them

    their

    theirs

    themselves

    +

    > *) Not formally used, we use theirs here as a filler.

    +
    +
    +evennia.utils.verb_conjugation.pronouns.pronoun_to_viewpoints(pronoun, options=None, pronoun_type='object_pronoun', gender='neutral', viewpoint='2nd person')[source]
    +

    Access function for determining the forms of a pronount from different viewpoints.

    +
    +
    Parameters
    +
      +
    • pronoun (str) – A valid English pronoun, such as ‘you’, ‘his’, ‘themselves’ etc.

    • +
    • options (str or list, optional) – A list or space-separated string of options to help +the engine when there is no unique mapping to use. This could for example +be “2nd female” (alias ‘f’) or “possessive adjective” (alias ‘pa’ or ‘a’).

    • +
    • pronoun_type (str, optional) –

      An explicit object pronoun to separate cases where +there is no unique mapping. Pronoun types defined in options take precedence. +Values are

      +
        +
      • subject pronoun/subject/sp (I, you, he, they)

      • +
      • object pronoun/object//op (me, you, him, them)

      • +
      • possessive adjective/adjective/pa (my, your, his, their)

      • +
      • possessive pronoun/pronoun/pp (mine, yours, his, theirs)

      • +
      +

    • +
    • gender (str, optional) –

      Specific gender to use (plural counts a gender for this purpose). +A gender specified in options takes precedence. Values and aliases are:

      +
        +
      • male/m

      • +
      • female/f

      • +
      • neutral/n

      • +
      • plural/p

      • +
      +

    • +
    • viewpoint (str, optional) –

      A specified viewpoint of the one talking, to use +when there is no unique mapping. A viewpoint given in options take +precedence. Values and aliases are:

      +
        +
      • 1st person/1st/1

      • +
      • 2nd person/2nd/2

      • +
      • 3rd person/3rd/3

      • +
      +

    • +
    +
    +
    Returns
    +

    tuple – A tuple (1st/2nd_person_pronoun, 3rd_person_pronoun) to show to the one sending the +string and others respectively. If pronoun is invalid, the word is returned verbatim.

    +
    +
    +
    +

    Note

    +

    The capitalization of the original word will be retained.

    +
    +
    + +
    + + +
    +
    +
    +
    + +
    +
    + + + + \ No newline at end of file diff --git a/docs/1.0-dev/api/evennia.utils.verb_conjugation.tests.html b/docs/1.0-dev/api/evennia.utils.verb_conjugation.tests.html index f791ebbc22..f75bcd347c 100644 --- a/docs/1.0-dev/api/evennia.utils.verb_conjugation.tests.html +++ b/docs/1.0-dev/api/evennia.utils.verb_conjugation.tests.html @@ -745,6 +745,156 @@ +
    +
    +class evennia.utils.verb_conjugation.tests.TestPronounMapping(methodName='runTest')[source]
    +

    Bases: django.test.testcases.TestCase

    +

    Test pronoun viewpoint mapping

    +
    +
    +test_mapping_with_options = None
    +
    + +
    +
    +test_mapping_with_options_00_you()
    +

    Test the pronoun mapper [with pronoun=’you’, options=’m’, expected_1st_or_2nd_person=’you’, expected_3rd_person=’he’].

    +
    + +
    +
    +test_mapping_with_options_01_you()
    +

    Test the pronoun mapper [with pronoun=’you’, options=’f op’, expected_1st_or_2nd_person=’you’, expected_3rd_person=’her’].

    +
    + +
    +
    +test_mapping_with_options_02_I()
    +

    Test the pronoun mapper [with pronoun=’I’, options=’’, expected_1st_or_2nd_person=’I’, expected_3rd_person=’it’].

    +
    + +
    +
    +test_mapping_with_options_03_I()
    +

    Test the pronoun mapper [with pronoun=’I’, options=’p’, expected_1st_or_2nd_person=’I’, expected_3rd_person=’it’].

    +
    + +
    +
    +test_mapping_with_options_04_I()
    +

    Test the pronoun mapper [with pronoun=’I’, options=’m’, expected_1st_or_2nd_person=’I’, expected_3rd_person=’he’].

    +
    + +
    +
    +test_mapping_with_options_05_Me()
    +

    Test the pronoun mapper [with pronoun=’Me’, options=’n’, expected_1st_or_2nd_person=’Me’, expected_3rd_person=’It’].

    +
    + +
    +
    +test_mapping_with_options_06_your()
    +

    Test the pronoun mapper [with pronoun=’your’, options=’p’, expected_1st_or_2nd_person=’your’, expected_3rd_person=’their’].

    +
    + +
    +
    +test_mapping_with_options_07_ours()
    +

    Test the pronoun mapper [with pronoun=’ours’, options=’’, expected_1st_or_2nd_person=’ours’, expected_3rd_person=’theirs’].

    +
    + +
    +
    +test_mapping_with_options_08_yourself()
    +

    Test the pronoun mapper [with pronoun=’yourself’, options=’’, expected_1st_or_2nd_person=’yourself’, expected_3rd_person=’itself’].

    +
    + +
    +
    +test_mapping_with_options_09_yourself()
    +

    Test the pronoun mapper [with pronoun=’yourself’, options=’m’, expected_1st_or_2nd_person=’yourself’, expected_3rd_person=’himself’].

    +
    + +
    +
    +test_mapping_with_options_10_yourself()
    +

    Test the pronoun mapper [with pronoun=’yourself’, options=’f’, expected_1st_or_2nd_person=’yourself’, expected_3rd_person=’herself’].

    +
    + +
    +
    +test_mapping_with_options_11_yourself()
    +

    Test the pronoun mapper [with pronoun=’yourself’, options=’p’, expected_1st_or_2nd_person=’yourself’, expected_3rd_person=’itself’].

    +
    + +
    +
    +test_mapping_with_options_12_yourselves()
    +

    Test the pronoun mapper [with pronoun=’yourselves’, options=’’, expected_1st_or_2nd_person=’yourselves’, expected_3rd_person=’themselves’].

    +
    + +
    +
    +test_mapping_with_options_13_he()
    +

    Test the pronoun mapper [with pronoun=’he’, options=’’, expected_1st_or_2nd_person=’you’, expected_3rd_person=’he’].

    +
    + +
    +
    +test_mapping_with_options_14_he()
    +

    Test the pronoun mapper [with pronoun=’he’, options=’1’, expected_1st_or_2nd_person=’I’, expected_3rd_person=’he’].

    +
    + +
    +
    +test_mapping_with_options_15_he()
    +

    Test the pronoun mapper [with pronoun=’he’, options=’1 p’, expected_1st_or_2nd_person=’we’, expected_3rd_person=’he’].

    +
    + +
    +
    +test_mapping_with_options_16_her()
    +

    Test the pronoun mapper [with pronoun=’her’, options=’p’, expected_1st_or_2nd_person=’you’, expected_3rd_person=’her’].

    +
    + +
    +
    +test_mapping_with_options_17_her()
    +

    Test the pronoun mapper [with pronoun=’her’, options=’pa’, expected_1st_or_2nd_person=’your’, expected_3rd_person=’her’].

    +
    + +
    +
    +test_mapping_with_options_18_their()
    +

    Test the pronoun mapper [with pronoun=’their’, options=’pa’, expected_1st_or_2nd_person=’your’, expected_3rd_person=’their’].

    +
    + +
    +
    +test_mapping_with_options_19_their()
    +

    Test the pronoun mapper [with pronoun=’their’, options=’pa’, expected_1st_or_2nd_person=’your’, expected_3rd_person=’their’].

    +
    + +
    +
    +test_mapping_with_options_20_itself()
    +

    Test the pronoun mapper [with pronoun=’itself’, options=’’, expected_1st_or_2nd_person=’yourself’, expected_3rd_person=’itself’].

    +
    + +
    +
    +test_mapping_with_options_21_themselves()
    +

    Test the pronoun mapper [with pronoun=’themselves’, options=’’, expected_1st_or_2nd_person=’yourselves’, expected_3rd_person=’themselves’].

    +
    + +
    +
    +test_mapping_with_options_22_herself()
    +

    Test the pronoun mapper [with pronoun=’herself’, options=’’, expected_1st_or_2nd_person=’yourself’, expected_3rd_person=’herself’].

    +
    + +
    + diff --git a/docs/1.0-dev/genindex.html b/docs/1.0-dev/genindex.html index d38bb5112b..2a11da5b3e 100644 --- a/docs/1.0-dev/genindex.html +++ b/docs/1.0-dev/genindex.html @@ -3309,10 +3309,10 @@
  • CmdLookBridge (class in evennia.contrib.tutorial_world.rooms)
  • - - + - - + + +
  • test_mapping_with_options (evennia.utils.verb_conjugation.tests.TestPronounMapping attribute) +
  • +
  • test_mapping_with_options_00_you() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_01_you() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_02_I() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_03_I() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_04_I() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_05_Me() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_06_your() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_07_ours() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_08_yourself() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_09_yourself() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_10_yourself() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_11_yourself() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_12_yourselves() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_13_he() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_14_he() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_15_he() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_16_her() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_17_her() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_18_their() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_19_their() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_20_itself() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_21_themselves() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • +
  • test_mapping_with_options_22_herself() (evennia.utils.verb_conjugation.tests.TestPronounMapping method) +
  • test_mask() (evennia.contrib.security.auditing.tests.AuditingTest method)
  • test_memplot() (evennia.server.profiling.tests.TestMemPlot method) @@ -17669,6 +17734,8 @@
  • (evennia.contrib.xyzgrid.tests.TestMap9 method)
  • + + -