From 8b7da799c570a0b3f3647b864bcdd34845d38854 Mon Sep 17 00:00:00 2001
From: Evennia docbuilder action Contribution - Griatch 2012, vincent-lg 2019 This extends the normal Adding the Contribution - Griatch 2012, vincent-lg 2019, Griatch 2023 This extends the normal Add the In more detail, in Then reload to make the new commands available. Note that they only work
on rooms with the typeclass To dig a new extended room: To make all new rooms ExtendedRooms without having to specify it, make your
+ This allows to change the full description text the room shows
-depending on larger time variations. Four seasons (spring, summer,
-autumn and winter) are used by default. The season is calculated
-on-demand (no Script or timer needed) and updates the full text block. There is also a general description which is used as fallback if
-one or more of the seasonal descriptions are not set when their
-time comes. An updated The room uses the By default, the normal For example These will be stored in Attributes For example There is one in-built, time-based state To set a seasonal description, just set it as normal, with Normally the season changes with the in-game time, you can also ‘force’ a given
+season by setting its state If you set the season manually like this, it won’t change automatically again
+until you unset it. You can get the stateful description from the room with Contribution - Griatch 2012, vincent-lg 2019 This extends the normal Contribution - Griatch 2012, vincent-lg 2019, Griatch 2023 This extends the normal Table of Contents
-
Extended Room¶
-Room typeclass to allow its description to change
-with time-of-day and/or season. It also adds ‘details’ for the player to look at
-in the room (without having to create a new in-game object for each). The room is
-supported by new look and desc commands.Installation/testing:¶
-ExtendedRoomCmdset to the default character cmdset will add all
+Room typeclass to allow its description to change with
+time-of-day and/or season as well as any other state (like flooded or dark).
+Embedding $state(burning, This place is on fire!) in the description will
+allow for changing the description based on room state. The room also supports
+details for the player to look at in the room (without having to create a new
+in-game object for each), as well as support for random echoes. The room
+comes with a set of alternate commands for look and @desc, as well as new
+commands detail, roomstate and time.Installation¶
+ExtendedRoomCmdset to the default character cmdset will add all
new commands for use.mygame/commands/default_cmdsets.py:...
@@ -138,52 +143,144 @@ new commands for use.
ExtendedRoom. Create new rooms with the right
typeclass or use the typeclass command to swap existing rooms. Note that since
-this contrib overrides the look command, you will need to add the
+this contrib overrides the look and @desc commands, you will need to add the
extended_room.ExtendedRoomCmdSet to the default character cmdset after
-super().at_cmdset_creation(), or it will be overridden by the default look.super().at_cmdset_creation(), or they will be overridden by the default look.
+dig myroom:evennia.contrib.grid.extended_room.ExtendedRoom = north,south
+
Room typeclass inherit from the ExtendedRoom and then reload:# in mygame/typeclasses/rooms.py
+
+from evennia.contrib.grid.extended_room import ExtendedRoom
+
+# ...
+
+class Room(ObjectParent, ExtendedRoom):
+ # ...
+
+
Features¶
-Time-changing description slots¶
-desc command allows for setting seasonal descriptions.evennia.utils.gametime.GameTime global script. This is
-started by default, but if you have deactivated it, you need to
-supply your own time keeping mechanism.State-dependent description slots¶
+room.db.desc description is used. You can however
+add new state-ful descriptions with room.add_desc(description, room_state=roomstate) or with the in-game command@desc/roomstate [<description>]
+
@desc/dark This room is pitch black.`.
+
+
desc_<roomstate>. To set the default,
+fallback description, just use @desc <description>.
+To activate a state on the room, use room.add/remove_state(*roomstate) or the in-game
+commandroomstate <state> (use it again to toggle the state off)
+
roomstate dark
+
season. By default these are ‘spring’,
+‘summer’, ‘autumn’ and ‘winter’. The room.get_season() method returns the
+current season based on the in-game time. By default they change with a 12-month
+in-game time schedule. You can control them withExtendedRoom.months_per_year # default 12
+ExtendedRoom.seasons_per year # a dict of {"season": (start, end), ...} where
+ # start/end are given in fractions of the whole year
+
room.add_desc or
+in-game with@desc/winter This room is filled with snow.
+@desc/autumn Red and yellow leaves cover the ground.
+
roomstate winter
+
room.get_stateful_desc().
-extended_room¶Room typeclass to allow its description to change
-with time-of-day and/or season. It also adds ‘details’ for the player to look at
-in the room (without having to create a new in-game object for each). The room is
-supported by new look and desc commands.Room typeclass to allow its description to change with
+time-of-day and/or season as well as any other state (like flooded or dark).
+Embedding $state(burning, This place is on fire!) in the description will
+allow for changing the description based on room state. The room also supports
+details for the player to look at in the room (without having to create a new
+in-game object for each), as well as support for random echoes. The room
+comes with a set of alternate commands for look and @desc, as well as new
+commands detail, roomstate and time.
aliases = ['l', 'ls']¶aliases = ['ls', 'l']¶
search_index_entry = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'no_prefix': ' l ls', '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': 'ls l', 'category': 'general', 'key': 'look', 'no_prefix': ' ls l', 'tags': '', 'text': '\n look while out-of-character\n\n Usage:\n look\n\n Look in the ooc state.\n '}¶
aliases = ['@typeclasses', '@parent', '@type', '@update', '@swap']¶aliases = ['@update', '@parent', '@swap', '@typeclasses', '@type']¶
search_index_entry = {'aliases': '@typeclasses @parent @type @update @swap', 'category': 'building', 'key': '@typeclass', 'no_prefix': 'typeclass typeclasses parent type update swap', '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. This will also\n reset cmdsets!\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': '@update @parent @swap @typeclasses @type', 'category': 'building', 'key': '@typeclass', 'no_prefix': 'typeclass update parent swap typeclasses type', '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. This will also\n reset cmdsets!\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 "}¶
aliases = ['@ex', '@exam']¶aliases = ['@exam', '@ex']¶
search_index_entry = {'aliases': '@ex @exam', 'category': 'building', 'key': '@examine', 'no_prefix': 'examine ex exam', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [<object>[/attrname]]\n examine [*<account>[/attrname]]\n\n Switch:\n account - examine an Account (same as adding *)\n object - examine an Object (useful when OOC)\n script - examine a Script\n channel - examine a Channel\n\n The examine command shows detailed game info about an\n object and optionally a specific attribute on it.\n If object is not specified, the current location is examined.\n\n Append a * before the search string to examine an account.\n\n '}¶search_index_entry = {'aliases': '@exam @ex', 'category': 'building', 'key': '@examine', 'no_prefix': 'examine exam ex', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [<object>[/attrname]]\n examine [*<account>[/attrname]]\n\n Switch:\n account - examine an Account (same as adding *)\n object - examine an Object (useful when OOC)\n script - examine a Script\n channel - examine a Channel\n\n The examine command shows detailed game info about an\n object and optionally a specific attribute on it.\n If object is not specified, the current location is examined.\n\n Append a * before the search string to examine an account.\n\n '}¶
aliases = ['@search', '@locate']¶aliases = ['@locate', '@search']¶
search_index_entry = {'aliases': '@search @locate', 'category': 'building', 'key': '@find', 'no_prefix': 'find search locate', 'tags': '', 'text': '\n search the database for objects\n\n Usage:\n find[/switches] <name or dbref or *account> [= dbrefmin[-dbrefmax]]\n locate - this is a shorthand for using the /loc switch.\n\n Switches:\n room - only look for rooms (location=None)\n exit - only look for exits (destination!=None)\n char - only look for characters (BASE_CHARACTER_TYPECLASS)\n exact - only exact matches are returned.\n loc - display object location if exists and match has one result\n startswith - search for names starting with the string, rather than containing\n\n Searches the database for an object of a particular name or exact #dbref.\n Use *accountname to search for an account. The switches allows for\n limiting object matches to certain game entities. Dbrefmin and dbrefmax\n limits matches to within the given dbrefs range, or above/below if only\n one is given.\n '}¶search_index_entry = {'aliases': '@locate @search', 'category': 'building', 'key': '@find', 'no_prefix': 'find locate search', 'tags': '', 'text': '\n search the database for objects\n\n Usage:\n find[/switches] <name or dbref or *account> [= dbrefmin[-dbrefmax]]\n locate - this is a shorthand for using the /loc switch.\n\n Switches:\n room - only look for rooms (location=None)\n exit - only look for exits (destination!=None)\n char - only look for characters (BASE_CHARACTER_TYPECLASS)\n exact - only exact matches are returned.\n loc - display object location if exists and match has one result\n startswith - search for names starting with the string, rather than containing\n\n Searches the database for an object of a particular name or exact #dbref.\n Use *accountname to search for an account. The switches allows for\n limiting object matches to certain game entities. Dbrefmin and dbrefmax\n limits matches to within the given dbrefs range, or above/below if only\n one is given.\n '}¶
aliases = ['l', 'ls']¶aliases = ['ls', 'l']¶
search_index_entry = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'no_prefix': ' l ls', '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': 'ls l', 'category': 'general', 'key': 'look', 'no_prefix': ' ls l', '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 '}¶
aliases = ['nickname', 'nicks']¶aliases = ['nicks', 'nickname']¶
search_index_entry = {'aliases': 'nickname nicks', 'category': 'general', 'key': 'nick', 'no_prefix': ' nickname nicks', 'tags': '', 'text': '\n define a personal alias/nick by defining a string to\n match and replace it with another on the fly\n\n Usage:\n nick[/switches] <string> [= [replacement_string]]\n nick[/switches] <template> = <replacement_template>\n nick/delete <string> or number\n nicks\n\n Switches:\n inputline - replace on the inputline (default)\n object - replace on object-lookup\n account - replace on account-lookup\n list - show all defined aliases (also "nicks" works)\n delete - remove nick by index in /list\n clearall - clear all nicks\n\n Examples:\n nick hi = say Hello, I\'m Sarah!\n nick/object tom = the tall man\n nick build $1 $2 = create/drop $1;$2\n nick tell $1 $2=page $1=$2\n nick tm?$1=page tallman=$1\n nick tm\\=$1=page tallman=$1\n\n A \'nick\' is a personal string replacement. Use $1, $2, ... to catch arguments.\n Put the last $-marker without an ending space to catch all remaining text. You\n can also use unix-glob matching for the left-hand side <string>:\n\n * - matches everything\n ? - matches 0 or 1 single characters\n [abcd] - matches these chars in any order\n [!abcd] - matches everything not among these chars\n \\= - escape literal \'=\' you want in your <string>\n\n Note that no objects are actually renamed or changed by this command - your nicks\n are only available to you. If you want to permanently add keywords to an object\n for everyone to use, you need build privileges and the alias command.\n\n '}¶search_index_entry = {'aliases': 'nicks nickname', 'category': 'general', 'key': 'nick', 'no_prefix': ' nicks nickname', 'tags': '', 'text': '\n define a personal alias/nick by defining a string to\n match and replace it with another on the fly\n\n Usage:\n nick[/switches] <string> [= [replacement_string]]\n nick[/switches] <template> = <replacement_template>\n nick/delete <string> or number\n nicks\n\n Switches:\n inputline - replace on the inputline (default)\n object - replace on object-lookup\n account - replace on account-lookup\n list - show all defined aliases (also "nicks" works)\n delete - remove nick by index in /list\n clearall - clear all nicks\n\n Examples:\n nick hi = say Hello, I\'m Sarah!\n nick/object tom = the tall man\n nick build $1 $2 = create/drop $1;$2\n nick tell $1 $2=page $1=$2\n nick tm?$1=page tallman=$1\n nick tm\\=$1=page tallman=$1\n\n A \'nick\' is a personal string replacement. Use $1, $2, ... to catch arguments.\n Put the last $-marker without an ending space to catch all remaining text. You\n can also use unix-glob matching for the left-hand side <string>:\n\n * - matches everything\n ? - matches 0 or 1 single characters\n [abcd] - matches these chars in any order\n [!abcd] - matches everything not among these chars\n \\= - escape literal \'=\' you want in your <string>\n\n Note that no objects are actually renamed or changed by this command - your nicks\n are only available to you. If you want to permanently add keywords to an object\n for everyone to use, you need build privileges and the alias command.\n\n '}¶
aliases = ['i', 'inv']¶aliases = ['inv', 'i']¶
search_index_entry = {'aliases': 'i inv', 'category': 'general', 'key': 'inventory', 'no_prefix': ' i inv', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}¶search_index_entry = {'aliases': 'inv i', 'category': 'general', 'key': 'inventory', 'no_prefix': ' inv i', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}¶
aliases = ['emote', ':']¶aliases = [':', 'emote']¶
search_index_entry = {'aliases': 'emote :', 'category': 'general', 'key': 'pose', 'no_prefix': ' emote :', 'tags': '', 'text': "\n strike a pose\n\n Usage:\n pose <pose text>\n pose's <pose text>\n\n Example:\n pose is standing by the wall, smiling.\n -> others will see:\n Tom is standing by the wall, smiling.\n\n Describe an action being taken. The pose text will\n automatically begin with your name.\n "}¶search_index_entry = {'aliases': ': emote', 'category': 'general', 'key': 'pose', 'no_prefix': ' : emote', 'tags': '', 'text': "\n strike a pose\n\n Usage:\n pose <pose text>\n pose's <pose text>\n\n Example:\n pose is standing by the wall, smiling.\n -> others will see:\n Tom is standing by the wall, smiling.\n\n Describe an action being taken. The pose text will\n automatically begin with your name.\n "}¶
aliases = ['@task', '@delays']¶aliases = ['@delays', '@task']¶
search_index_entry = {'aliases': '@task @delays', 'category': 'system', 'key': '@tasks', 'no_prefix': 'tasks task delays', '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': '@delays @task', 'category': 'system', 'key': '@tasks', 'no_prefix': 'tasks delays task', '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 "}¶
Test the batch processor.
red_button = <module 'evennia.contrib.tutorials.red_button.red_button' from '/tmp/tmpvyvah_8j/c18ff3898e533600321e94404e1a1a9ed4bd24a7/evennia/contrib/tutorials/red_button/red_button.py'>¶
aliases = ['cre', 'cr']¶aliases = ['cr', 'cre']¶
search_index_entry = {'aliases': 'cre cr', 'category': 'general', 'key': 'create', 'no_prefix': ' cre cr', 'tags': '', 'text': '\n create a new account account\n\n Usage (at login screen):\n create <accountname> <password>\n create "account name" "pass word"\n\n This creates a new account account.\n\n If you have spaces in your name, enclose it in double quotes.\n '}¶search_index_entry = {'aliases': 'cr cre', 'category': 'general', 'key': 'create', 'no_prefix': ' cr cre', 'tags': '', 'text': '\n create a new account account\n\n Usage (at login screen):\n create <accountname> <password>\n create "account name" "pass word"\n\n This creates a new account account.\n\n If you have spaces in your name, enclose it in double quotes.\n '}¶
aliases = ['qu', 'q']¶aliases = ['q', 'qu']¶
search_index_entry = {'aliases': 'qu q', 'category': 'general', 'key': 'quit', 'no_prefix': ' qu q', 'tags': '', 'text': '\n quit when in unlogged-in state\n\n Usage:\n quit\n\n We maintain a different version of the quit command\n here for unconnected accounts for the sake of simplicity. The logged in\n version is a bit more complicated.\n '}¶search_index_entry = {'aliases': 'q qu', 'category': 'general', 'key': 'quit', 'no_prefix': ' q qu', 'tags': '', 'text': '\n quit when in unlogged-in state\n\n Usage:\n quit\n\n We maintain a different version of the quit command\n here for unconnected accounts for the sake of simplicity. The logged in\n version is a bit more complicated.\n '}¶
aliases = ['look', 'l']¶aliases = ['l', 'look']¶
search_index_entry = {'aliases': 'look l', 'category': 'general', 'key': '__unloggedin_look_command', 'no_prefix': ' look l', 'tags': '', 'text': '\n look when in unlogged-in state\n\n Usage:\n look\n\n This is an unconnected version of the look command for simplicity.\n\n This is called by the server and kicks everything in gear.\n All it does is display the connect screen.\n '}¶search_index_entry = {'aliases': 'l look', 'category': 'general', 'key': '__unloggedin_look_command', 'no_prefix': ' l look', 'tags': '', 'text': '\n look when in unlogged-in state\n\n Usage:\n look\n\n This is an unconnected version of the look command for simplicity.\n\n This is called by the server and kicks everything in gear.\n All it does is display the connect screen.\n '}¶
aliases = ['?', 'h']¶aliases = ['h', '?']¶
search_index_entry = {'aliases': '? h', 'category': 'general', 'key': 'help', 'no_prefix': ' ? h', 'tags': '', 'text': '\n get help when in unconnected-in state\n\n Usage:\n help\n\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}¶search_index_entry = {'aliases': 'h ?', 'category': 'general', 'key': 'help', 'no_prefix': ' h ?', 'tags': '', 'text': '\n get help when in unconnected-in state\n\n Usage:\n help\n\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}¶
aliases = ['cre', 'cr']¶aliases = ['cr', 'cre']¶
search_index_entry = {'aliases': 'cre cr', 'category': 'general', 'key': 'create', 'no_prefix': ' cre cr', 'tags': '', 'text': '\n Create a new account.\n\n Usage (at login screen):\n create "accountname" <email> <password>\n\n This creates a new account account.\n\n '}¶search_index_entry = {'aliases': 'cr cre', 'category': 'general', 'key': 'create', 'no_prefix': ' cr cre', 'tags': '', 'text': '\n Create a new account.\n\n Usage (at login screen):\n create "accountname" <email> <password>\n\n This creates a new account account.\n\n '}¶
aliases = ['qu', 'q']¶aliases = ['q', 'qu']¶
search_index_entry = {'aliases': 'qu q', 'category': 'general', 'key': 'quit', 'no_prefix': ' qu q', 'tags': '', 'text': '\n We maintain a different version of the `quit` command\n here for unconnected accounts for the sake of simplicity. The logged in\n version is a bit more complicated.\n '}¶search_index_entry = {'aliases': 'q qu', 'category': 'general', 'key': 'quit', 'no_prefix': ' q qu', 'tags': '', 'text': '\n We maintain a different version of the `quit` command\n here for unconnected accounts for the sake of simplicity. The logged in\n version is a bit more complicated.\n '}¶
aliases = ['look', 'l']¶aliases = ['l', 'look']¶
search_index_entry = {'aliases': 'look l', 'category': 'general', 'key': '__unloggedin_look_command', 'no_prefix': ' look l', 'tags': '', 'text': '\n This is an unconnected version of the `look` command for simplicity.\n\n This is called by the server and kicks everything in gear.\n All it does is display the connect screen.\n '}¶search_index_entry = {'aliases': 'l look', 'category': 'general', 'key': '__unloggedin_look_command', 'no_prefix': ' l look', 'tags': '', 'text': '\n This is an unconnected version of the `look` command for simplicity.\n\n This is called by the server and kicks everything in gear.\n All it does is display the connect screen.\n '}¶
aliases = ['?', 'h']¶aliases = ['h', '?']¶
search_index_entry = {'aliases': '? h', 'category': 'general', 'key': 'help', 'no_prefix': ' ? h', 'tags': '', 'text': '\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}¶search_index_entry = {'aliases': 'h ?', 'category': 'general', 'key': 'help', 'no_prefix': ' h ?', 'tags': '', 'text': '\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}¶
aliases = ['@callbacks', '@callback', '@calls']¶aliases = ['@calls', '@callback', '@callbacks']¶
search_index_entry = {'aliases': '@callbacks @callback @calls', 'category': 'building', 'key': '@call', 'no_prefix': 'call callbacks callback calls', 'tags': '', 'text': '\n Command to edit callbacks.\n '}¶search_index_entry = {'aliases': '@calls @callback @callbacks', 'category': 'building', 'key': '@call', 'no_prefix': 'call calls callback callbacks', 'tags': '', 'text': '\n Command to edit callbacks.\n '}¶
aliases = ['delaliaschan', 'delchanalias']¶aliases = ['delchanalias', 'delaliaschan']¶
search_index_entry = {'aliases': 'delaliaschan delchanalias', 'category': 'comms', 'key': 'delcom', 'no_prefix': ' delaliaschan delchanalias', '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': 'delchanalias delaliaschan', 'category': 'comms', 'key': 'delcom', 'no_prefix': ' delchanalias delaliaschan', '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 "}¶
aliases = ['q', 'abort', 'quit', 'chicken out']¶aliases = ['quit', 'chicken out', 'q', 'abort']¶
search_index_entry = {'aliases': 'q abort quit chicken out', 'category': 'evscaperoom', 'key': 'give up', 'no_prefix': ' q abort quit chicken out', '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': 'quit chicken out q abort', 'category': 'evscaperoom', 'key': 'give up', 'no_prefix': ' quit chicken out q abort', '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 '}¶
aliases = ['l', 'ls']¶aliases = ['ls', 'l']¶
search_index_entry = {'aliases': 'l ls', 'category': 'evscaperoom', 'key': 'look', 'no_prefix': ' l ls', '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': 'ls l', 'category': 'evscaperoom', 'key': 'look', 'no_prefix': ' ls l', 'tags': '', 'text': '\n Look at the room, an object or the currently focused object\n\n Usage:\n look [obj]\n\n '}¶
aliases = ['examine', 'ex', 'unfocus', 'e']¶aliases = ['e', 'ex', 'unfocus', 'examine']¶
search_index_entry = {'aliases': 'examine ex unfocus e', 'category': 'evscaperoom', 'key': 'focus', 'no_prefix': ' examine ex unfocus e', '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', 'no_prefix': ' e ex unfocus examine', '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 '}¶
aliases = ['inventory', 'i', 'inv', 'give']¶aliases = ['inventory', 'inv', 'give', 'i']¶
search_index_entry = {'aliases': 'inventory i inv give', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' inventory i inv give', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}¶search_index_entry = {'aliases': 'inventory inv give i', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' inventory inv give i', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}¶
aliases = ['@dig', '@open']¶aliases = ['@open', '@dig']¶
search_index_entry = {'aliases': '@dig @open', 'category': 'general', 'key': 'open', 'no_prefix': ' dig open', 'tags': '', 'text': '\n Interact with an object in focus.\n\n Usage:\n <action> [arg]\n\n '}¶search_index_entry = {'aliases': '@open @dig', 'category': 'general', 'key': 'open', 'no_prefix': ' open dig', 'tags': '', 'text': '\n Interact with an object in focus.\n\n Usage:\n <action> [arg]\n\n '}¶
aliases = ['i', 'inv']¶aliases = ['inv', 'i']¶
search_index_entry = {'aliases': 'i inv', 'category': 'general', 'key': 'inventory', 'no_prefix': ' i inv', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}¶search_index_entry = {'aliases': 'inv i', 'category': 'general', 'key': 'inventory', 'no_prefix': ' inv i', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}¶
Extended Room
-Evennia Contribution - Griatch 2012, vincent-lg 2019
-This is an extended Room typeclass for Evennia. It is supported -by an extended Look command and an extended desc command, also -in this module.
-Features:
-Time-changing description slots
This allows to change the full description text the room shows -depending on larger time variations. Four seasons (spring, summer, -autumn and winter) are used by default. The season is calculated -on-demand (no Script or timer needed) and updates the full text block.
-There is also a general description which is used as fallback if -one or more of the seasonal descriptions are not set when their -time comes.
-An updated desc command allows for setting seasonal descriptions.
-The room uses the evennia.utils.gametime.GameTime global script. This is -started by default, but if you have deactivated it, you need to -supply your own time keeping mechanism.
-In-description changing tags
Within each seasonal (or general) description text, you can also embed -time-of-day dependent sections. Text inside such a tag will only show -during that particular time of day. The tags looks like <timeslot> … -</timeslot>. By default there are four timeslots per day - morning, -afternoon, evening and night.
-Details
The Extended Room can be “detailed” with special keywords. This makes -use of a special Look command. Details are “virtual” targets to look -at, without there having to be a database object created for it. The -Details are simply stored in a dictionary on the room and if the look -command cannot find an object match for a look <target> command it -will also look through the available details at the current location -if applicable. The detail command is used to change details.
-Extra commands
-+CmdExtendedRoomLook - look command supporting room details -CmdExtendedRoomDesc - desc command allowing to add seasonal descs, -CmdExtendedRoomDetail - command allowing to manipulate details in this room
---as well as listing them
--
-- CmdExtendedRoomGameTime - A simple time command, displaying the current
- -
time and season.
-
Evennia Contribution - Griatch 2012, vincent-lg 2019, Griatch 2023
+This is an extended Room typeclass for Evennia, supporting descriptions that vary +by season, time-of-day or arbitrary states (like burning). It has details, embedded +state tags, support for repeating random messages as well as a few extra commands.
+The room description can be set to change depending on the season or time of day.
Parts of the room description can be set to change depending on arbitrary states (like burning).
Details can be added to the room, which can be looked at like objects.
Alternative text sections can be added to the room description, which will only show if +the room is in a given state.
Random messages can be set to repeat at a given rate.
Installation/testing:
Adding the ExtendedRoomCmdset to the default character cmdset will add all new commands for use.
@@ -174,69 +134,340 @@ self.add(extended_room.ExtendedRoomCmdSet) # <—Then reload to make the bew commands available. Note that they only work on rooms with the typeclass ExtendedRoom. Create new rooms with the right typeclass or use the typeclass command to swap existing rooms.
+evennia.contrib.grid.extended_room.extended_room.func_state(roomstate, *args, looker=None, room=None, **kwargs)[source]¶Usage: $state(roomstate, text)
+Funcparser callable for ExtendedRoom. This is called by the FuncParser when it +returns the description of the room. Use ‘default’ for a default text when no +other states are set.
+roomstate (str) – A roomstate, like “morning”, “raining”. This is case insensitive.
*args – All these will be combined into one string separated by commas.
looker (Object) – The object looking at the room. Unused by default.
room (ExtendedRoom) – The room being looked at.
Example
+$state(morning, It is a beautiful morning!)
+Notes
+We try to merge all args into one text, since this function doesn’t require more than one +argument. That way, one may be able to get away without using quotes.
+evennia.contrib.grid.extended_room.extended_room.ExtendedRoom(*args, **kwargs)[source]¶Bases: evennia.objects.objects.DefaultRoom
This room implements a more advanced look functionality depending on -time. It also allows for “details”, together with a slightly modified -look command.
-at_object_creation()[source]¶Called when room is first created only.
-get_time_and_season()[source]¶Calculate the current time and season ids.
-replace_timeslots(raw_desc, curr_time)[source]¶Filter so that only time markers <timeslot>…</timeslot> of -the correct timeslot remains in the description.
-raw_desc (str) – The unmodified description.
curr_time (str) – A timeslot identifier.
An Extended Room
+A room state is set as a Tag with category “roomstate” and tagkey “on_fire” or “flooded” +etc).
description (str) – A possibly moified description.
+Alternative descriptions: +- Add an Attribute desc_<roomstate> to the room, where <roomstate> is the name of the
+++roomstate to use this for, like desc_on_fire or desc_flooded. If not given, seasonal +descriptions given in desc_spring/summer/autumn/winter will be used, and last the +regular desc Attribute.
+
Alternative text sections +- Used to add alternative text sections to the room description. These are embedded in the
+++description by adding $state(roomstate, txt). They will show only if the room is in the +given roomstate. These are managed via the add/remove/get_alt_text methods.
+
Details: +- This is set as an Attribute details (a dict) on the room, with the detail name as key.
+++When looking at this room, the detail name can be used as a target to look at without having +to add an actual database object for it. The detail command is used to add/remove details.
+
Room messages +- Set room_message_rate > 0 and add a list of room_messages. These will be randomly
+++echoed to the room at the given rate.
+
room_state_tag_category = 'room_state'¶months_per_year = 12¶hours_per_day = 24¶seasons_per_year = {'autumn': (0.75, 1.0), 'spring': (0.25, 0.5), 'summer': (0.5, 0.75), 'winter': (1.0, 0.25)}¶desc_spring¶AttributeProperty.
+desc_summer¶AttributeProperty.
+desc_autumn¶AttributeProperty.
+desc_winter¶AttributeProperty.
+times_of_day = {'afternoon': (0.5, 0.75), 'evening': (0.75, 0), 'morning': (0.25, 0.5), 'night': (0, 0.25)}¶desc¶AttributeProperty.
+details¶AttributeProperty.
+room_message_rate = 0¶room_messages¶AttributeProperty.
+at_init()[source]¶Evennia hook. Start up repeating function whenever object loads into memory.
+start_repeat_broadcast_messages()[source]¶Start repeating the broadcast messages. Only needs to be called if adding messages +and not having reloaded the server.
+repeat_broadcast_message_to_room()[source]¶Send a message to the room at room_message_rate. By default +we will randomize which one to send.
+get_time_of_day()[source]¶Get the current time of day.
+Override to customize.
+str – The time of day, such as ‘morning’, ‘afternoon’, ‘evening’ or ‘night’.
return_detail(key)[source]¶This will attempt to match a “detail” to look for in the room.
+get_season()[source]¶Get the current season.
+Override to customize.
+str – The season, such as ‘spring’, ‘summer’, ‘autumn’ or ‘winter’.
+room_states¶Get all room_states set on this room.
+add_room_state(*room_states)[source]¶Set a room-state or room-states to the room.
key (str) – A detail identifier.
-detail (str or None) – A detail matching the given key.
+*room_state (str) – A room state like ‘on_fire’ or ‘flooded’. This will affect +what desc_* and roomstate_* descriptions/inlines are used. You can add +more than one at a time.
Notes
-A detail is a way to offer more things to look at in a room -without having to add new objects. For this to work, we -require a custom look command that allows for look -<detail> - the look command should defer to this method on -the current location (if it exists) before giving up on -finding the target.
-Details are not season-sensitive, but are parsed for timeslot -markers.
+You can also set time-based room_states this way, like ‘morning’ or ‘spring’. This +can be useful to force a particular description, but while this state is +set this way, that state will be unaffected by the passage of time. Remove +the state to let the current game time determine this type of states.
set_detail(detailkey, description)[source]¶remove_room_state(*room_states)[source]¶Remove a roomstate from the room.
+*room_state (str) – A roomstate like ‘on_fire’ or ‘flooded’. If the
did not have this state (room) –
happens.You can remove more than one at a time. (nothing) –
clear_room_state()[source]¶Clear all room states.
+Note that fallback time-of-day and seasonal states are not affected by this, only +custom states added with .add_room_state().
+add_desc(desc, room_state=None)[source]¶Add a custom description, matching a particular room state.
+desc (str) – The description to use when this roomstate is active.
roomstate (str, None) – The roomstate to match, like ‘on_fire’, ‘flooded’, or “spring”. +If None, set the default desc fallback.
remove_desc(room_state)[source]¶Remove a custom description.
+room_state (str) – The room-state description to remove.
+all_desc()[source]¶Get all available descriptions.
+dict –
+base subscription (stored in the desc Attribute).
+get_stateful_desc()[source]¶Get the currently active room description based on the current roomstate.
+str – The current description.
+Note
+Only one description can be active at a time. Priority order is as follows:
+Priority order is as follows:
++++
+- +
Room-states set by add_roomstate() that are not seasons. +If multiple room_states are set, the first one is used, sorted alphabetically.
- +
Seasons set by add_room_state(). This allows to ‘pin’ a season.
- +
Time-based seasons based on the current in-game time.
- +
None, if no seasons are defined in .seasons_per_year.
If either of the above is found, but doesn’t have a matching desc_<roomstate> +description, we move on to the next priority. If no matches are found, the desc +Attribute is used.
+replace_legacy_time_of_day_markup(desc)[source]¶Filter description by legacy markup like <morning>…</morning>. Filter +out all such markings that does not match the current time. Supports +‘morning’, ‘afternoon’, ‘evening’ and ‘night’.
+desc (str) – The unmodified description.
+str – A possibly modified description.
+Notes
+This is legacy. Use the $state markup for new rooms instead.
+get_display_desc(looker, **kwargs)[source]¶Evennia standard hook. Dynamically get the ‘desc’ component of the object description. This +is called by the return_appearance method and in turn by the ‘look’ command.
+looker (Object) – Object doing the looking (unused by default).
**kwargs – Arbitrary data for use when overriding.
str – The desc display string.
+add_detail(key, description)[source]¶This sets a new detail, using an Attribute “details”.
description (str) – The text to return when looking -at the given detailkey.
del_detail(detailkey, description)[source]¶Delete a detail.
-The description is ignored.
+set_detail(key, description)¶This sets a new detail, using an Attribute “details”.
detailkey (str) – the detail to remove (case-insensitive).
description (str, ignored) – the description.
detailkey (str) – The detail identifier to add (for +aliases you need to add multiple keys to the +same description). Case-insensitive.
description (str) – The text to return when looking +at the given detailkey. This can contain funcparser directives.
remove_detail(key, *args)[source]¶Delete a detail.
+key (str) – the detail to remove (case-insensitive).
*args – Unused (backwards compatibility)
return_appearance(looker, **kwargs)[source]¶This is called when e.g. the look command wants to retrieve -the description of this object.
+del_detail(key, *args)¶Delete a detail.
looker (Object) – The object looking at us.
**kwargs (dict) – Arbitrary, optional arguments for users -overriding the call (unused by default).
key (str) – the detail to remove (case-insensitive).
*args – Unused (backwards compatibility)
description (str) – Our description.
-The description is only included for compliance but is completely +ignored. Note that this method doesn’t raise any exception if +the detail doesn’t exist in this room.
update_current_description()[source]¶This will update the description of the room if the time or season -has changed since last checked.
+get_detail(key, looker=None)[source]¶This will attempt to match a “detail” to look for in the room. +This will do a lower-case match followed by a startsby match. This +is called by the new look Command.
+key (str) – A detail identifier.
looker (Object, optional) – The one looking.
detail (str or None) – A detail matching the given key, or None if +it was not found.
+Notes
+A detail is a way to offer more things to look at in a room +without having to add new objects. For this to work, we +require a custom look command that allows for look <detail> +- the look command should defer to this method on +the current location (if it exists) before giving up on +finding the target.
+return_detail(key, looker=None)¶This will attempt to match a “detail” to look for in the room. +This will do a lower-case match followed by a startsby match. This +is called by the new look Command.
+key (str) – A detail identifier.
looker (Object, optional) – The one looking.
detail (str or None) – A detail matching the given key, or None if +it was not found.
+Notes
+A detail is a way to offer more things to look at in a room +without having to add new objects. For this to work, we +require a custom look command that allows for look <detail> +- the look command should defer to this method on +the current location (if it exists) before giving up on +finding the target.
Observes your location, details at your location or objects in your vicinity.
+look_detail()[source]¶Look for detail on room.
+func()[source]¶Handle the looking - add fallback to details.
+Handle the looking.
evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomDesc(**kwargs)[source]¶Bases: evennia.commands.default.building.CmdDesc
desc - describe an object or room.
-desc[/switch] [<obj> =] <description>
+describe an object or the current room.
+@desc[/switch] [<obj> =] <description>
spring - set description for <season> in current room. -summer -autumn -winter
+edit - Open up a line editor for more advanced editing. +del - Delete the description of an object. If another state is given, its description
+++will be deleted.
+
spring|summer|autumn|winter - room description to use in respective in-game season +<other> - room description to use with an arbitrary room state.
Sets the “desc” attribute on an object. If an object is not given, -describe the current room.
-You can also embed special time markers in your room description, like this:
---<night>In the darkness, the forest looks foreboding.</night>.
-
Text marked this way will only display when the server is truly at the given -timeslot. The available times are night, morning, afternoon and evening.
-Note that seasons and time-of-day slots only work on rooms in this -version of the desc command.
+Sets the description an object. If an object is not given, +describe the current room, potentially showing any additional stateful descriptions. The room +states only work with rooms.
+Examples
+@desc/winter A cold winter scene. +@desc/edit/summer +@desc/burning This room is burning! +@desc A normal room with no state. +@desc/del/burning
+Rooms will automatically change season as the in-game time changes. You can +set a specific room-state with the |wroomstate|n command.
aliases = ['describe']¶key = '@desc'¶switch_options = ()¶switch_options = None¶
reset_times(obj)[source]¶By deleteting the caches we force a re-load.
-func()[source]¶Define extended command
-locks = 'cmd:perm(desc) or perm(Builder)'¶help_category = 'building'¶parse()[source]¶This method is called by the cmdhandler once the command name +has been identified. It creates a new set of member variables +that can be later accessed from self.func() (see below)
+The following variables are available for our use when entering this +method (from the command definition, and assigned on the fly by the +cmdhandler):
+++self.key - the name of this command (‘look’) +self.aliases - the aliases of this cmd (‘l’) +self.permissions - permission string for this command +self.help_category - overall category of command
+self.caller - the object calling this command +self.cmdstring - the actual command name used to call this
++++
+- (this allows you to know which alias was used,
- +
for example)
+self.args - the raw input; everything following self.cmdstring. +self.cmdset - the cmdset from which this command was picked. Not
+++often used (useful for commands like ‘help’ or to +list all available commands etc)
++
+- self.obj - the object on which this command was defined. It is often
- +
the same as self.caller.
+
A MUX command has the following possible syntax:
+++name[ with several words][/switch[/switch..]] arg1[,arg2,…] [[=|,] arg[,..]]
+
The ‘name[ with several words]’ part is already dealt with by the +cmdhandler at this point, and stored in self.cmdname (we don’t use +it here). The rest of the command is stored in self.args, which can +start with the switch indicator /.
+command (without the /))
+to separate left/right hand sides. tuple form +gives priority split to first string delimiter.
+This parser breaks self.args into its constituents and stores them in the +following variables:
+++self.switches = [list of /switches (without the /)] +self.raw = This is the raw argument input, including switches +self.args = This is re-defined to be everything except the switches +self.lhs = Everything to the left of = (lhs:’left-hand side’). If
+++no = is found, this is identical to self.args.
++
+- self.rhs: Everything to the right of = (rhs:’right-hand side’).
- +
If no ‘=’ is found, this is None.
+self.lhslist - [self.lhs split into a list by comma] +self.rhslist - [list of self.rhs split into a list by comma] +self.arglist = [list of space-separated args (stripped, including ‘=’ if it exists)]
+All args and list members are stripped of excess whitespace around the +strings, but case is preserved.
+
edit_handler()[source]¶show_stateful_descriptions()[source]¶func()[source]¶Define command
+key = '@desc'¶aliases = []¶search_index_entry = {'aliases': 'describe', 'category': 'building', 'key': '@desc', 'no_prefix': 'desc describe', 'tags': '', 'text': '\n `desc` - describe an object or room.\n\n Usage:\n desc[/switch] [<obj> =] <description>\n\n Switches for `desc`:\n spring - set description for <season> in current room.\n summer\n autumn\n winter\n\n Sets the "desc" attribute on an object. If an object is not given,\n describe the current room.\n\n You can also embed special time markers in your room description, like this:\n\n ```\n <night>In the darkness, the forest looks foreboding.</night>.\n ```\n\n Text marked this way will only display when the server is truly at the given\n timeslot. The available times are night, morning, afternoon and evening.\n\n Note that seasons and time-of-day slots only work on rooms in this\n version of the `desc` command.\n\n '}¶search_index_entry = {'aliases': '', 'category': 'building', 'key': '@desc', 'no_prefix': 'desc ', 'tags': '', 'text': '\n describe an object or the current room.\n\n Usage:\n @desc[/switch] [<obj> =] <description>\n\n Switches:\n edit - Open up a line editor for more advanced editing.\n del - Delete the description of an object. If another state is given, its description\n will be deleted.\n spring|summer|autumn|winter - room description to use in respective in-game season\n <other> - room description to use with an arbitrary room state.\n\n Sets the description an object. If an object is not given,\n describe the current room, potentially showing any additional stateful descriptions. The room\n states only work with rooms.\n\n Examples:\n @desc/winter A cold winter scene.\n @desc/edit/summer\n @desc/burning This room is burning!\n @desc A normal room with no state.\n @desc/del/burning\n\n Rooms will automatically change season as the in-game time changes. You can\n set a specific room-state with the |wroomstate|n command.\n\n '}¶
evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomState(**kwargs)[source]¶Bases: evennia.commands.default.muxcommand.MuxCommand
Toggle and view room state for the current room.
+@roomstate [<roomstate>]
+Examples
+@roomstate spring +@roomstate burning +@roomstate burning (a second time toggles it off)
+If the roomstate was already set, it will be disabled. Use +without arguments to see the roomstates on the current room.
+key = '@roomstate'¶locks = 'cmd:perm(Builder)'¶help_category = 'building'¶parse()[source]¶This method is called by the cmdhandler once the command name +has been identified. It creates a new set of member variables +that can be later accessed from self.func() (see below)
+The following variables are available for our use when entering this +method (from the command definition, and assigned on the fly by the +cmdhandler):
+++self.key - the name of this command (‘look’) +self.aliases - the aliases of this cmd (‘l’) +self.permissions - permission string for this command +self.help_category - overall category of command
+self.caller - the object calling this command +self.cmdstring - the actual command name used to call this
++++
+- (this allows you to know which alias was used,
- +
for example)
+self.args - the raw input; everything following self.cmdstring. +self.cmdset - the cmdset from which this command was picked. Not
+++often used (useful for commands like ‘help’ or to +list all available commands etc)
++
+- self.obj - the object on which this command was defined. It is often
- +
the same as self.caller.
+
A MUX command has the following possible syntax:
+++name[ with several words][/switch[/switch..]] arg1[,arg2,…] [[=|,] arg[,..]]
+
The ‘name[ with several words]’ part is already dealt with by the +cmdhandler at this point, and stored in self.cmdname (we don’t use +it here). The rest of the command is stored in self.args, which can +start with the switch indicator /.
+command (without the /))
+to separate left/right hand sides. tuple form +gives priority split to first string delimiter.
+This parser breaks self.args into its constituents and stores them in the +following variables:
+++self.switches = [list of /switches (without the /)] +self.raw = This is the raw argument input, including switches +self.args = This is re-defined to be everything except the switches +self.lhs = Everything to the left of = (lhs:’left-hand side’). If
+++no = is found, this is identical to self.args.
++
+- self.rhs: Everything to the right of = (rhs:’right-hand side’).
- +
If no ‘=’ is found, this is None.
+self.lhslist - [self.lhs split into a list by comma] +self.rhslist - [list of self.rhs split into a list by comma] +self.arglist = [list of space-separated args (stripped, including ‘=’ if it exists)]
+All args and list members are stripped of excess whitespace around the +strings, but case is preserved.
+
func()[source]¶This is the hook function that actually does all the work. It is called +by the cmdhandler right after self.parser() finishes, and so has access +to all the variables defined therein.
+aliases = []¶lock_storage = 'cmd:perm(Builder)'¶search_index_entry = {'aliases': '', 'category': 'building', 'key': '@roomstate', 'no_prefix': 'roomstate ', 'tags': '', 'text': '\n Toggle and view room state for the current room.\n\n Usage:\n @roomstate [<roomstate>]\n\n Examples:\n @roomstate spring\n @roomstate burning\n @roomstate burning (a second time toggles it off)\n\n If the roomstate was already set, it will be disabled. Use\n without arguments to see the roomstates on the current room.\n\n '}¶evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomGameTime(**kwargs)[source]¶Bases: evennia.commands.default.muxcommand.MuxCommand
Check the game time
+Check the game time.
time
help_category = 'general'¶
parse()[source]¶This method is called by the cmdhandler once the command name +has been identified. It creates a new set of member variables +that can be later accessed from self.func() (see below)
+The following variables are available for our use when entering this +method (from the command definition, and assigned on the fly by the +cmdhandler):
+++self.key - the name of this command (‘look’) +self.aliases - the aliases of this cmd (‘l’) +self.permissions - permission string for this command +self.help_category - overall category of command
+self.caller - the object calling this command +self.cmdstring - the actual command name used to call this
++++
+- (this allows you to know which alias was used,
- +
for example)
+self.args - the raw input; everything following self.cmdstring. +self.cmdset - the cmdset from which this command was picked. Not
+++often used (useful for commands like ‘help’ or to +list all available commands etc)
++
+- self.obj - the object on which this command was defined. It is often
- +
the same as self.caller.
+
A MUX command has the following possible syntax:
+++name[ with several words][/switch[/switch..]] arg1[,arg2,…] [[=|,] arg[,..]]
+
The ‘name[ with several words]’ part is already dealt with by the +cmdhandler at this point, and stored in self.cmdname (we don’t use +it here). The rest of the command is stored in self.args, which can +start with the switch indicator /.
+command (without the /))
+to separate left/right hand sides. tuple form +gives priority split to first string delimiter.
+This parser breaks self.args into its constituents and stores them in the +following variables:
+++self.switches = [list of /switches (without the /)] +self.raw = This is the raw argument input, including switches +self.args = This is re-defined to be everything except the switches +self.lhs = Everything to the left of = (lhs:’left-hand side’). If
+++no = is found, this is identical to self.args.
++
+- self.rhs: Everything to the right of = (rhs:’right-hand side’).
- +
If no ‘=’ is found, this is None.
+self.lhslist - [self.lhs split into a list by comma] +self.rhslist - [list of self.rhs split into a list by comma] +self.arglist = [list of space-separated args (stripped, including ‘=’ if it exists)]
+All args and list members are stripped of excess whitespace around the +strings, but case is preserved.
+
func()[source]¶Reads time info from current room
+This is the hook function that actually does all the work. It is called +by the cmdhandler right after self.parser() finishes, and so has access +to all the variables defined therein.
search_index_entry = {'aliases': '', 'category': 'general', 'key': 'time', 'no_prefix': ' ', 'tags': '', 'text': '\n Check the game time\n\n Usage:\n time\n\n Shows the current in-game time and season.\n '}¶search_index_entry = {'aliases': '', 'category': 'general', 'key': 'time', 'no_prefix': ' ', 'tags': '', 'text': '\n Check the game time.\n\n Usage:\n time\n\n Shows the current in-game time and season.\n\n '}¶
Extended Room - Griatch 2012, vincent-lg 2019
+Extended Room - Griatch 2012, vincent-lg 2019, Griatch 2023
Testing of ExtendedRoom contrib
-evennia.contrib.grid.extended_room.tests.ForceUTCDatetime[source]¶Bases: datetime.datetime
Force UTC datetime.
- - -evennia.contrib.grid.extended_room.tests.TestExtendedRoom(methodName='runTest')[source]¶Bases: evennia.utils.test_resources.BaseEvenniaCommandTest
Bases: evennia.utils.test_resources.EvenniaTestCase
Test Extended Room typeclass.
room_typeclass¶alias of evennia.contrib.grid.extended_room.extended_room.ExtendedRoom
DETAIL_DESC = 'A test detail.'¶SPRING_DESC = 'A spring description.'¶test_room_description()[source]¶Test that the vanilla room description is returned as expected.
+test_seasonal_room_descriptions = None¶Test room with $ [with *args=(‘morning’, ‘Morning room description.’)]
+Test room with $ [with *args=(‘afternoon’, ‘Afternoon room description.’)]
+Test room with $ [with *args=(‘evening’, ‘Evening room description.’)]
+Test room with $ [with *args=(‘night’, ‘Night room description.’)]
+test_seasonal_room_descriptions_0_spring()¶Test that the room description changes with the season [with *args=(‘spring’, ‘Spring room description.’)].
+test_seasonal_room_descriptions_1_summer()¶Test that the room description changes with the season [with *args=(‘summer’, ‘Summer room description.’)].
+evennia.contrib.grid.extended_room.tests.TestExtendedRoomCommands(methodName='runTest')[source]¶Bases: evennia.utils.test_resources.BaseEvenniaCommandTest
Test the ExtendedRoom commands.
+base_room_desc = 'Base room description.'¶test_cmd_desc(mock_gametime)[source]¶Test new desc command
+test_cmd_detail()[source]¶Test adding details
+test_cmd_roomstate(mock_gametime)[source]¶Test the roomstate command
+test_cmd_roomtime(mock_gametime)[source]¶Test the time command
+test_cmd_look(mock_gametime)[source]¶Test the look command.
+search_index_entry = {'aliases': '@dice roll', 'category': 'general', 'key': 'dice', 'no_prefix': ' dice roll', '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': 'roll @dice', 'category': 'general', 'key': 'dice', 'no_prefix': ' roll 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': 'i inv', 'category': 'general', 'key': 'inventory', 'no_prefix': ' i inv', 'tags': '', 'text': '\n View your inventory\n\n Usage:\n inventory\n\n '}¶search_index_entry = {'aliases': 'inv i', 'category': 'general', 'key': 'inventory', 'no_prefix': ' inv i', 'tags': '', 'text': '\n View your inventory\n\n Usage:\n inventory\n\n '}¶
str – The desc display string..
+str – The desc display string.
aliases = ['press button', 'press', 'push']¶
search_index_entry = {'aliases': 'press button press push', 'category': 'general', 'key': 'push button', 'no_prefix': ' press button press push', 'tags': '', 'text': '\n Push the red button (lid closed)\n\n Usage:\n push button\n\n '}¶
aliases = ['smash', 'smash lid', 'break lid']¶
search_index_entry = {'aliases': 'smash smash lid break lid', 'category': 'general', 'key': 'smash glass', 'no_prefix': ' smash smash lid break lid', '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 '}¶
aliases = ['press button', 'press', 'push']¶
search_index_entry = {'aliases': 'press button press push', 'category': 'general', 'key': 'push button', 'no_prefix': ' press button press push', 'tags': '', 'text': '\n Push the red button\n\n Usage:\n push button\n\n '}¶
aliases = ['examine', 'feel', 'l', 'listen', 'ex', 'get']¶
search_index_entry = {'aliases': 'examine feel l listen ex get', 'category': 'general', 'key': 'look', 'no_prefix': ' examine feel l listen ex get', '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': 'push move shiftroot pull', 'category': 'tutorialworld', 'key': 'shift', 'no_prefix': ' push move shiftroot pull', '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': 'move pull shiftroot push', 'category': 'tutorialworld', 'key': 'shift', 'no_prefix': ' move pull shiftroot push', '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 '}¶
aliases = ['push button', 'press button', 'button']¶aliases = ['press button', 'button', 'push button']¶
search_index_entry = {'aliases': 'push button press button button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' push button press button button', 'tags': '', 'text': '\n Presses a button.\n '}¶search_index_entry = {'aliases': 'press button button push button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' press button button push button', 'tags': '', 'text': '\n Presses a button.\n '}¶
aliases = ['bash', 'stab', 'thrust', 'pierce', 'parry', 'fight', 'kill', 'defend', 'slash', 'hit', 'chop']¶aliases = ['defend', 'pierce', 'kill', 'hit', 'stab', 'parry', 'thrust', 'slash', 'bash', 'chop', 'fight']¶
search_index_entry = {'aliases': 'bash stab thrust pierce parry fight kill defend slash hit chop', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' bash stab thrust pierce parry fight kill defend slash hit chop', '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': 'defend pierce kill hit stab parry thrust slash bash chop fight', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' defend pierce kill hit stab parry thrust slash bash chop fight', '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': '? h', 'category': 'tutorial world', 'key': 'help', 'no_prefix': ' ? h', 'tags': '', 'text': '\n Overwritten help command while on the bridge.\n '}¶search_index_entry = {'aliases': 'h ?', 'category': 'tutorial world', 'key': 'help', 'no_prefix': ' h ?', 'tags': '', 'text': '\n Overwritten help command while on the bridge.\n '}¶
aliases = ['fiddle', 'feel', 'l', 'feel around', 'search']¶aliases = ['feel', 'l', 'fiddle', 'feel around', 'search']¶
search_index_entry = {'aliases': 'fiddle feel l feel around search', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' fiddle feel l feel around search', '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 l fiddle feel around search', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' feel l fiddle feel around search', '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 '}¶
directory = '/tmp/tmplu8guq3w/267796446c52c60ba3fffb674500c22a7e0d0041/evennia'¶directory = '/tmp/tmpvyvah_8j/c18ff3898e533600321e94404e1a1a9ed4bd24a7/evennia'¶
directory = '/tmp/tmplu8guq3w/267796446c52c60ba3fffb674500c22a7e0d0041/evennia/game_template'¶directory = '/tmp/tmpvyvah_8j/c18ff3898e533600321e94404e1a1a9ed4bd24a7/evennia/game_template'¶
evennia.EvMenu
evennia.EvMore
evennia.EvTable
evennia.FuncParser
evennia.GLOBAL_SCRIPTS
evennia.InterruptCommand
evennia.MONITOR_HANDLER
str – The desc display string..
+str – The desc display string.
aliases = [':=', ':u', ':DD', ':echo', ':>', ':::', ':I', ':j', ':uu', ':dd', ':x', ':s', ':fi', ':<', ':i', ':h', ':dw', ':y', ':fd', ':UU', ':wq', '::', ':p', ':f', ':S', ':q', ':w', ':', ':A', ':r', ':!', ':q!']¶aliases = [':dd', ':x', ':dw', '::', ':::', ':fd', ':p', ':u', ':<', ':s', ':f', ':=', ':echo', ':h', ':q', ':A', ':S', ':y', ':UU', ':DD', ':j', ':I', ':q!', ':uu', ':fi', ':r', ':w', ':i', ':>', ':wq', ':', ':!']¶
search_index_entry = {'aliases': ':= :u :DD :echo :> ::: :I :j :uu :dd :x :s :fi :< :i :h :dw :y :fd :UU :wq :: :p :f :S :q :w : :A :r :! :q!', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' := :u :DD :echo :> ::: :I :j :uu :dd :x :s :fi :< :i :h :dw :y :fd :UU :wq :: :p :f :S :q :w : :A :r :! :q!', 'tags': '', 'text': '\n Commands for the editor\n '}¶search_index_entry = {'aliases': ':dd :x :dw :: ::: :fd :p :u :< :s :f := :echo :h :q :A :S :y :UU :DD :j :I :q! :uu :fi :r :w :i :> :wq : :!', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' :dd :x :dw :: ::: :fd :p :u :< :s :f := :echo :h :q :A :S :y :UU :DD :j :I :q! :uu :fi :r :w :i :> :wq : :!', 'tags': '', 'text': '\n Commands for the editor\n '}¶
aliases = ['y', 'n', 'no', '__nomatch_command', 'abort', 'yes', 'a']¶
search_index_entry = {'aliases': 'y n no __nomatch_command abort yes a', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' y n no __nomatch_command abort yes a', 'tags': '', 'text': '\n Handle a prompt for yes or no. Press [return] for the default choice.\n\n '}¶
aliases = ['end', 'next', 'quit', 'previous', 'e', 'top', 'q', 'a', 'p', 'n', 't', 'abort']¶aliases = ['n', 'end', 'top', 't', 'previous', 'p', 'e', 'q', 'abort', 'quit', 'a', 'next']¶
search_index_entry = {'aliases': 'end next quit previous e top q a p n t abort', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' end next quit previous e top q a p n t abort', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}¶search_index_entry = {'aliases': 'n end top t previous p e q abort quit a next', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' n end top t previous p e q abort quit a next', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}¶
EZU|_
z?^X1by=n_6+jhI1K8p`dd0j8Px6FY}&OKjy;Cm3&W1;&1?*UZ(yI8#?S66m?g^b$(
zW>4?V+f9l L)Cd8#ZEh3HTSpeFCpkGvxQCDT^%KmHvwtW;_8vE?#ri
zzUT7IUD3)VM@hkvz3WO@G^O5uS^xPHlbxtpP75-XNveLk_b-HEAZ2M?b9!WdM^%w7
z89A)YQv!k$$yDg`uJeo)Fl5!|JqR1gNf5Rimp2nCS>Y%}gg`bj@@Esm-)hRqFgc
z$;_t~5Yr~+bdHJ;lp~^I6%#UN_VgavF>NVkFJ2E1E8%r{PwQ ^&6{@3OQqf~w`_PuP}I1;T<
z2kEcPKS@a7@M7xbz}`)BwUcH;*%jFD@e>GLy1`tDACsIjd@Pxo##16K!Vtodd7^GH
zTGx-m(qSfvxaUA|4y=h|(Bhrn+iCtJ6PNh7M&k!dDYEMm*Do6)7oRHZo1bnhfuV9q
zR;x;T0E@J6RRv^xorAQ{di{=4Z0@cZZT`WPRWRAnB3OgNIn;kgBqbrH&(TB>(8y3x
zV#;%5tVQSa{@GBnckqT^6i{}meGwY67};<^w&z<>nVGc<3)JmYNbMU3BjpP)SZCoI
z&KNRs|6RLe;2woI*}lW9LGf$V<_Ph6mS%<1NsRh#it(s(NgQl?2KGg*SmD~G0RP|t5cllIy0S)v56KK|Y$!*8q_m(&Oj9sX
zqa%m&w{Bt}2I9tu=P_W$8$P();9$^czup{l>fEBnlbDzeW}VGfs<);N$Gd*9x{OM_
zq9^pn3Aiylsxf(?3XT36Zn>UEZuxrcqvG}6)Ujya3!bc8Ml^Y8aC_!=G+2C?EZ>2k
z(^l$j=Eqm) ^B_DFUKuc|Q;cn|I>q^V)pgmAdy;3pmwAHh%EB>^i*)
zZ1%M328&13H@E`%;a%P7@4wCPW=eks-5u8BJVaO?AjcrWQnK3}42x}lMjb4EC)?lc
zC_z{zZinPqbLe=C&m|95S<}l+7G7X=lP@S7fBx0)RoN8Rb#Y5A#_1QRcyhQRLzdS?
zFA^!lc|LX<^ALGiAKZe-rKTP4ldaD$L1fghj6UlzQ7VLZ$dV2pd%q4$hVzhoKI^rJ
zD2Bc!aYd?bT}Rpl)N8`ixdP
wkusOW)lx8wabOs6-5_Wm1O#Hkrrn6K4|GGUI>I%|jhW
zfj#5Sd+zC+U~_D3<fa9;T@nD>@t8wdXaXp^bE(9P#B{d@Nva
z;y$erFm;!laOGWm!u#vKI~f4$+$4gKC6o!gl@wj?Vgd3sU1Z)#8o{?7y{mUj*KWNt
z(lVmldB>tSrJFIAa7WSw?w)|l540rvlWHLiA{O?cIqZ5%(RUi=%+byBnd;;FC)0z=
z=9yW8x_31+31{oDGNUwFLW?gI5)vaO5*fh+y}^i%mk?qj5<4+t;5m>X66!2`g{}af
zsoCLJ60;iPAI5knc}&vwXRkwf(5rh88dDYAaRPdAflRqDc`g8wdjV3^x*5^NnOwWo
zn?CY7vtjtmo~x^__m6+hx4W?iXPMhy!*5*6_?+-*Bp&q;Yj*&0i5-5XfC4*WGuR09
z9$?FD(25-ZM>LOg+<}iY6s})s_XxO0-TpHu5Kbu|q!3m>7YBr4#2#Ik=Xk)kWB<0V
z50$MnPsb?eFyBnszqJoWR&2IP#5NceEiguHa21Y>8V8mstN~L(kr5z|;z$<-;-Zrp
z9U_uv0x~-l1V1D(ktR}&hxpBYT;Df-vmeG;gNOLden>zq9^#-FU
yH0@eMHms9iC+gOAp|khF~dwCcBbH3?=Q~30=>#+{4pt$;
?Xl=smUmWRKn{%0ZZB|0e1@*K~L%Et~x#>klwf7Ge1QmXWSz
z-Fu?|NnYz3}~yY*+5z8R!25nkNXuRxQ#_hrH;j0*MoEJJ!+;W>YCTS)J^wDs#El
zjfh71o#@2yf5haOY*b{3=hfJk?;>t~Bvo065>TR