From 5dc5dfb7a8c093b5b80baf00f2ab29d62d3227ff Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 19 Dec 2021 17:04:26 +0100 Subject: [PATCH] Update links/paths to new contrib locations --- evennia/commands/default/tests.py | 2 +- evennia/contrib/base_systems/__init__.py | 0 .../contrib/base_systems/awsstorage/tests.py | 2 +- .../base_systems/building_menu/README.md | 5 +- .../building_menu/building_menu.py | 2 +- .../base_systems/building_menu/tests.py | 2 +- .../base_systems/color_markups/README.md | 2 +- .../custom_gametime/custom_gametime.py | 2 +- .../base_systems/ingame_python/README.md | 29 +++---- .../base_systems/ingame_python/scripts.py | 4 +- .../base_systems/ingame_python/tests.py | 38 ++++----- .../base_systems/ingame_python/utils.py | 2 +- .../base_systems/menu_login/menu_login.py | 4 +- evennia/contrib/full_systems/__init__.py | 0 .../full_systems/evscaperoom/README.md | 6 +- .../contrib/full_systems/evscaperoom/state.py | 2 +- .../full_systems/evscaperoom/states/README.md | 2 +- .../evscaperoom/states/state_001_start.py | 4 +- .../contrib/full_systems/evscaperoom/tests.py | 2 +- evennia/contrib/game_systems/__init__.py | 0 evennia/contrib/game_systems/barter/] | 83 ------------------- .../contrib/game_systems/clothing/README.md | 2 +- .../contrib/game_systems/clothing/clothing.py | 12 +-- .../contrib/game_systems/cooldowns/tests.py | 2 +- .../contrib/game_systems/crafting/crafting.py | 13 +-- .../contrib/game_systems/crafting/tests.py | 6 +- .../contrib/game_systems/gendersub/tests.py | 2 +- .../game_systems/multidescer/README.md | 2 +- .../game_systems/multidescer/multidescer.py | 2 +- evennia/contrib/game_systems/puzzles/tests.py | 2 +- .../game_systems/turnbattle/tb_basic.py | 6 +- .../game_systems/turnbattle/tb_equip.py | 14 ++-- .../game_systems/turnbattle/tb_items.py | 6 +- .../game_systems/turnbattle/tb_magic.py | 6 +- .../game_systems/turnbattle/tb_range.py | 8 +- .../contrib/game_systems/turnbattle/tests.py | 2 +- evennia/contrib/grid/mapbuilder/README.md | 6 +- evennia/contrib/grid/mapbuilder/mapbuilder.py | 10 +-- evennia/contrib/grid/mapbuilder/tests.py | 6 +- evennia/contrib/grid/wilderness/__init__.py | 2 - evennia/contrib/grid/wilderness/wilderness.py | 4 +- evennia/contrib/grid/xyzgrid/README.md | 6 +- evennia/contrib/grid/xyzgrid/tests.py | 7 +- evennia/contrib/rpg/__init__.py | 0 evennia/contrib/rpg/rpsystem/rpsystem.py | 12 +-- evennia/contrib/rpg/traits/README.md | 8 +- evennia/contrib/rpg/traits/tests.py | 24 +++--- evennia/contrib/rpg/traits/traits.py | 18 ++-- evennia/contrib/tutorials/__init__.py | 4 + .../contrib/tutorials/bodyfunctions/tests.py | 2 +- .../tutorials/talking_npc/talking_npc.py | 2 +- .../contrib/tutorials/tutorial_world/mob.py | 2 +- .../tutorials/tutorial_world/objects.py | 2 +- .../contrib/tutorials/tutorial_world/rooms.py | 4 +- .../contrib/tutorials/tutorial_world/tests.py | 7 +- evennia/contrib/utils/__init__.py | 0 evennia/contrib/utils/auditing/tests.py | 3 +- evennia/contrib/utils/fieldfill/fieldfill.py | 2 +- .../utils/random_string_generator/README.md | 2 +- .../random_string_generator.py | 6 +- .../contrib/utils/tree_select/tree_select.py | 2 +- 61 files changed, 171 insertions(+), 248 deletions(-) create mode 100644 evennia/contrib/base_systems/__init__.py create mode 100644 evennia/contrib/full_systems/__init__.py create mode 100644 evennia/contrib/game_systems/__init__.py delete mode 100644 evennia/contrib/game_systems/barter/] create mode 100644 evennia/contrib/rpg/__init__.py create mode 100644 evennia/contrib/tutorials/__init__.py create mode 100644 evennia/contrib/utils/__init__.py diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 1f3f17ba5e..c0e80cdfc0 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -2186,7 +2186,7 @@ class TestBatchProcess(CommandTest): self.call( batchprocess.CmdBatchCommands(), "batchprocessor.example_batch_cmds", - "Running Batch-command processor - Automatic mode for example_batch_cmds", + "Running Batch-command processor - Automatic mode for batchprocessor.example_batch_cmds", ) # we make sure to delete the button again here to stop the running reactor confirm = building.CmdDestroy.confirm diff --git a/evennia/contrib/base_systems/__init__.py b/evennia/contrib/base_systems/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/evennia/contrib/base_systems/awsstorage/tests.py b/evennia/contrib/base_systems/awsstorage/tests.py index 6e20a8243f..a9d180d461 100644 --- a/evennia/contrib/base_systems/awsstorage/tests.py +++ b/evennia/contrib/base_systems/awsstorage/tests.py @@ -11,7 +11,7 @@ import datetime, gzip, pickle, threading _SKIP = False try: from botocore.exceptions import ClientError - from evennia.contrib.awsstorage import aws_s3_cdn as s3boto3 + from .awsstorage import aws_s3_cdn as s3boto3 except ImportError: _SKIP = True diff --git a/evennia/contrib/base_systems/building_menu/README.md b/evennia/contrib/base_systems/building_menu/README.md index 7fc7710d69..037c5ea2c1 100644 --- a/evennia/contrib/base_systems/building_menu/README.md +++ b/evennia/contrib/base_systems/building_menu/README.md @@ -13,10 +13,11 @@ that will edit any default object offering to change its key and description. ## Install -1. Import the `GenericBuildingCmd` class from this contrib in your `mygame/commands/default_cmdset.py` file: +1. Import the `GenericBuildingCmd` class from this contrib in your + `mygame/commands/default_cmdset.py` file: ```python - from evennia.base_systems.contrib.building_menu import GenericBuildingCmd + from evennia.contrib.base_systems.building_menu import GenericBuildingCmd ``` 2. Below, add the command in the `CharacterCmdSet`: diff --git a/evennia/contrib/base_systems/building_menu/building_menu.py b/evennia/contrib/base_systems/building_menu/building_menu.py index 32834d7712..c1711f5086 100644 --- a/evennia/contrib/base_systems/building_menu/building_menu.py +++ b/evennia/contrib/base_systems/building_menu/building_menu.py @@ -60,7 +60,7 @@ The first thing to do is to create a new module and place a class inheriting from `BuildingMenu` in it. ```python -from evennia.contrib.building_menu.building_menu import BuildingMenu +from evennia.contrib.base_systems.building_menu.building_menu import BuildingMenu class RoomBuildingMenu(BuildingMenu): # ... diff --git a/evennia/contrib/base_systems/building_menu/tests.py b/evennia/contrib/base_systems/building_menu/tests.py index 63bf9ab6f2..aafcd3fe32 100644 --- a/evennia/contrib/base_systems/building_menu/tests.py +++ b/evennia/contrib/base_systems/building_menu/tests.py @@ -160,7 +160,7 @@ class TestBuildingMenu(CommandTest): """Test to add sub-menus.""" def open_exit(menu): - menu.open_submenu("evennia.contrib.tests.Submenu", self.exit) + menu.open_submenu("evennia.contrib.base_systems.building_menu.tests.Submenu", self.exit) return False self.menu.add_choice("exit", key="x", on_enter=open_exit) diff --git a/evennia/contrib/base_systems/color_markups/README.md b/evennia/contrib/base_systems/color_markups/README.md index ef116e996c..17fd5c2377 100644 --- a/evennia/contrib/base_systems/color_markups/README.md +++ b/evennia/contrib/base_systems/color_markups/README.md @@ -47,7 +47,7 @@ To add the `%c-` "mux/mush" style, add the following to your settings file, then reboot both Server and Portal: ```python -from evennia.contrib import color_markups +from evennia.contrib.base_systems import color_markups COLOR_ANSI_EXTRA_MAP = color_markups.MUX_COLOR_ANSI_EXTRA_MAP COLOR_XTERM256_EXTRA_FG = color_markups.MUX_COLOR_XTERM256_EXTRA_FG COLOR_XTERM256_EXTRA_BG = color_markups.MUX_COLOR_XTERM256_EXTRA_BG diff --git a/evennia/contrib/base_systems/custom_gametime/custom_gametime.py b/evennia/contrib/base_systems/custom_gametime/custom_gametime.py index 76f72cd750..619985ceb7 100644 --- a/evennia/contrib/base_systems/custom_gametime/custom_gametime.py +++ b/evennia/contrib/base_systems/custom_gametime/custom_gametime.py @@ -291,7 +291,7 @@ def schedule(callback, repeat=False, **kwargs): """ seconds = real_seconds_until(**kwargs) script = create_script( - "evennia.contrib.custom_gametime.GametimeScript", + "evennia.contrib.base_systems.custom_gametime.GametimeScript", key="GametimeScript", desc="A timegame-sensitive script", interval=seconds, diff --git a/evennia/contrib/base_systems/ingame_python/README.md b/evennia/contrib/base_systems/ingame_python/README.md index 60d581dd74..9a734fc3ed 100644 --- a/evennia/contrib/base_systems/ingame_python/README.md +++ b/evennia/contrib/base_systems/ingame_python/README.md @@ -84,10 +84,10 @@ This is the quick summary. Scroll down for more detailed help on each step. default to `None`). 3. Add the `call` command. 4. Inherit from the custom typeclasses of the in-game Python system. - - `evennia.contrib.ingame_python.typeclasses.EventCharacter`: to replace `DefaultCharacter`. - - `evennia.contrib.ingame_python.typeclasses.EventExit`: to replace `DefaultExit`. - - `evennia.contrib.ingame_python.typeclasses.EventObject`: to replace `DefaultObject`. - - `evennia.contrib.ingame_python.typeclasses.EventRoom`: to replace `DefaultRoom`. + - `evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter`: to replace `DefaultCharacter`. + - `evennia.contrib.base_systems.ingame_python.typeclasses.EventExit`: to replace `DefaultExit`. + - `evennia.contrib.base_systems.ingame_python.typeclasses.EventObject`: to replace `DefaultObject`. + - `evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom`: to replace `DefaultRoom`. The following sections describe in details each step of the installation. @@ -181,7 +181,7 @@ this: ```python from evennia import default_cmds -from evennia.contrib.ingame_python.commands import CmdCallback +from evennia.contrib.base_systems.ingame_python.commands import CmdCallback class CharacterCmdSet(default_cmds.CharacterCmdSet): """ @@ -679,8 +679,8 @@ Here, we want to add a "push" event on objects. In your `typeclasses/objects.py write something like: ```python -from evennia.contrib.ingame_python.utils import register_events -from evennia.contrib.ingame_python.typeclasses import EventObject +from evennia.contrib.base_systems.ingame_python.utils import register_events +from evennia.contrib.base_systems.ingame_python.typeclasses import EventObject EVENT_PUSH = """ A character push the object. @@ -806,14 +806,15 @@ see a message about a "beautiful ant-hill". ### Adding new eventfuncs -Eventfuncs, like `deny()`, are defined in `contrib/events/eventfuncs.py`. You can add your own -eventfuncs by creating a file named `eventfuncs.py` in your `world` directory. The functions -defined in this file will be added as helpers. +Eventfuncs, like `deny()`, are defined in +`contrib/base_systesm/ingame_python/eventfuncs.py`. You can add your own +eventfuncs by creating a file named `eventfuncs.py` in your `world` directory. +The functions defined in this file will be added as helpers. -You can also decide to create your eventfuncs in another location, or even in several locations. To -do so, edit the `EVENTFUNCS_LOCATION` setting in your `server/conf/settings.py` file, specifying -either a python path or a list of Python paths in which your helper functions are defined. For -instance: +You can also decide to create your eventfuncs in another location, or even in +several locations. To do so, edit the `EVENTFUNCS_LOCATION` setting in your +`server/conf/settings.py` file, specifying either a python path or a list of +Python paths in which your helper functions are defined. For instance: ```python EVENTFUNCS_LOCATIONS = [ diff --git a/evennia/contrib/base_systems/ingame_python/scripts.py b/evennia/contrib/base_systems/ingame_python/scripts.py index cee407c2ae..dff3abcbbb 100644 --- a/evennia/contrib/base_systems/ingame_python/scripts.py +++ b/evennia/contrib/base_systems/ingame_python/scripts.py @@ -70,7 +70,7 @@ class EventHandler(DefaultScript): # Generate locals self.ndb.current_locals = {} self.ndb.fresh_locals = {} - addresses = ["evennia.contrib.ingame_python.eventfuncs"] + addresses = ["evennia.contrib.base_systems.ingame_python.eventfuncs"] addresses.extend(getattr(settings, "EVENTFUNCS_LOCATIONS", ["world.eventfuncs"])) for address in addresses: if pypath_to_realpath(address): @@ -87,7 +87,7 @@ class EventHandler(DefaultScript): delay(seconds, complete_task, task_id) # Place the script in the CallbackHandler - from evennia.contrib.ingame_python import typeclasses + from evennia.contrib.base_systems.ingame_python import typeclasses CallbackHandler.script = self DefaultObject.callbacks = typeclasses.EventObject.callbacks diff --git a/evennia/contrib/base_systems/ingame_python/tests.py b/evennia/contrib/base_systems/ingame_python/tests.py index c321f2da3f..93472467f5 100644 --- a/evennia/contrib/base_systems/ingame_python/tests.py +++ b/evennia/contrib/base_systems/ingame_python/tests.py @@ -31,18 +31,18 @@ class TestEventHandler(EvenniaTest): def setUp(self): """Create the event handler.""" super().setUp() - self.handler = create_script("evennia.contrib.ingame_python.scripts.EventHandler") + self.handler = create_script("evennia.contrib.base_systems.ingame_python.scripts.EventHandler") # Copy old events if necessary if OLD_EVENTS: self.handler.ndb.events = dict(OLD_EVENTS) # Alter typeclasses - self.char1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter") - self.char2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter") - self.room1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom") - self.room2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom") - self.exit.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventExit") + self.char1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter") + self.char2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter") + self.room1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom") + self.room2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom") + self.exit.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventExit") def tearDown(self): """Stop the event handler.""" @@ -253,18 +253,18 @@ class TestCmdCallback(CommandTest): def setUp(self): """Create the callback handler.""" super().setUp() - self.handler = create_script("evennia.contrib.ingame_python.scripts.EventHandler") + self.handler = create_script("evennia.contrib.base_systems.ingame_python.scripts.EventHandler") # Copy old events if necessary if OLD_EVENTS: self.handler.ndb.events = dict(OLD_EVENTS) # Alter typeclasses - self.char1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter") - self.char2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter") - self.room1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom") - self.room2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom") - self.exit.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventExit") + self.char1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter") + self.char2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter") + self.room1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom") + self.room2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom") + self.exit.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventExit") def tearDown(self): """Stop the callback handler.""" @@ -272,7 +272,7 @@ class TestCmdCallback(CommandTest): OLD_EVENTS.update(self.handler.ndb.events) self.handler.delete() for script in ScriptDB.objects.filter( - db_typeclass_path="evennia.contrib.ingame_python.scripts.TimeEventScript" + db_typeclass_path="evennia.contrib.base_systems.ingame_python.scripts.TimeEventScript" ): script.delete() @@ -432,18 +432,18 @@ class TestDefaultCallbacks(CommandTest): def setUp(self): """Create the callback handler.""" super().setUp() - self.handler = create_script("evennia.contrib.ingame_python.scripts.EventHandler") + self.handler = create_script("evennia.contrib.base_systems.ingame_python.scripts.EventHandler") # Copy old events if necessary if OLD_EVENTS: self.handler.ndb.events = dict(OLD_EVENTS) # Alter typeclasses - self.char1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter") - self.char2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter") - self.room1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom") - self.room2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom") - self.exit.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventExit") + self.char1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter") + self.char2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter") + self.room1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom") + self.room2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom") + self.exit.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventExit") def tearDown(self): """Stop the callback handler.""" diff --git a/evennia/contrib/base_systems/ingame_python/utils.py b/evennia/contrib/base_systems/ingame_python/utils.py index d4ff77dcb6..4860625736 100644 --- a/evennia/contrib/base_systems/ingame_python/utils.py +++ b/evennia/contrib/base_systems/ingame_python/utils.py @@ -173,7 +173,7 @@ def time_event(obj, event_name, number, parameters): """ seconds, usual, key = get_next_wait(parameters) script = create_script( - "evennia.contrib.ingame_python.scripts.TimeEventScript", interval=seconds, obj=obj + "evennia.contrib.base_systems.ingame_python.scripts.TimeEventScript", interval=seconds, obj=obj ) script.key = key script.desc = "event on {}".format(key) diff --git a/evennia/contrib/base_systems/menu_login/menu_login.py b/evennia/contrib/base_systems/menu_login/menu_login.py index 3d50641387..4353f71bd7 100644 --- a/evennia/contrib/base_systems/menu_login/menu_login.py +++ b/evennia/contrib/base_systems/menu_login/menu_login.py @@ -8,7 +8,7 @@ sequence instead of requiring you to enter both at once. To install, add this line to the settings file (`mygame/server/conf/settings.py`): - CMDSET_UNLOGGEDIN = "evennia.base_systems.contrib.menu_login.UnloggedinCmdSet" + CMDSET_UNLOGGEDIN = "evennia.contrib.base_systems.menu_login.UnloggedinCmdSet" Reload the server and the new connection method will be active. Note that you must independently change the connection screen to match this login style, by editing @@ -244,7 +244,7 @@ class CmdUnloggedinLook(Command): """ EvMenu( self.caller, - "evennia.contrib.menu_login", + "evennia.contrib.base_systems.menu_login", startnode="node_enter_username", auto_look=False, auto_quit=False, diff --git a/evennia/contrib/full_systems/__init__.py b/evennia/contrib/full_systems/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/evennia/contrib/full_systems/evscaperoom/README.md b/evennia/contrib/full_systems/evscaperoom/README.md index 0c799b3560..ebd5d3ed02 100644 --- a/evennia/contrib/full_systems/evscaperoom/README.md +++ b/evennia/contrib/full_systems/evscaperoom/README.md @@ -29,7 +29,7 @@ In `mygame/commands/default_cmdsets.py`: ```python -from evennia.contrib.evscaperoom.commands import CmdEvscapeRoomStart +from evennia.contrib.full_systems.evscaperoom.commands import CmdEvscapeRoomStart class CharacterCmdSet(...): @@ -47,7 +47,7 @@ comes with a small (very small) escape room as an example. To do this, you need to make your own states. First make sure you can play the simple example room installed above. -Copy `evennia/contrib/evscaperoom/states` to somewhere in your game folder (let's +Copy `evennia/contrib/full_systems/evscaperoom/states` to somewhere in your game folder (let's assume you put it under `mygame/world/`). Next you need to re-point Evennia to look for states in this new location. Add @@ -70,7 +70,7 @@ There are a few other settings that may be useful: want some other naming scheme. - `HELP_SUMMARY_TEXT` - this is the help blurb shown when entering `help` in the room without an argument. The original is found at the top of - `evennia/contrib/evscaperoom/commands.py`. + `evennia/contrib/full_systems/evscaperoom/commands.py`. # Playing the game diff --git a/evennia/contrib/full_systems/evscaperoom/state.py b/evennia/contrib/full_systems/evscaperoom/state.py index abe492f398..e8741cff27 100644 --- a/evennia/contrib/full_systems/evscaperoom/state.py +++ b/evennia/contrib/full_systems/evscaperoom/state.py @@ -24,7 +24,7 @@ from .utils import create_evscaperoom_object, msg_cinematic, parse_for_things if hasattr(settings, "EVSCAPEROOM_STATE_PACKAGE"): _ROOMSTATE_PACKAGE = settings.EVSCAPEROOM_STATE_PACKAGE else: - _ROOMSTATE_PACKAGE = "evennia.contrib.evscaperoom.states" + _ROOMSTATE_PACKAGE = "evennia.contrib.full_systems.evscaperoom.states" if hasattr(settings, "EVSCAPEROOM_START_STATE"): _FIRST_STATE = settings.EVSCAPEROOM_START_STATE else: diff --git a/evennia/contrib/full_systems/evscaperoom/states/README.md b/evennia/contrib/full_systems/evscaperoom/states/README.md index ac2c75bdcd..2b7186b414 100644 --- a/evennia/contrib/full_systems/evscaperoom/states/README.md +++ b/evennia/contrib/full_systems/evscaperoom/states/README.md @@ -15,7 +15,7 @@ system but they don't necessarily need to follow each other in the exact sequence. Each state module must make a class `State` available in the global scope. This -should be a child of `evennia.contrib.evscaperoom.state.BaseState`. The +should be a child of `evennia.contrib.full_systems/evscaperoom.state.BaseState`. The methods on this class will be called to initialize the state and clean up etc. There are no other restrictions on the module. diff --git a/evennia/contrib/full_systems/evscaperoom/states/state_001_start.py b/evennia/contrib/full_systems/evscaperoom/states/state_001_start.py index 66dfbae8d4..8cf3d4d71b 100644 --- a/evennia/contrib/full_systems/evscaperoom/states/state_001_start.py +++ b/evennia/contrib/full_systems/evscaperoom/states/state_001_start.py @@ -8,8 +8,8 @@ teleported back to the evscaperoom menu. """ -from evennia.contrib.evscaperoom.state import BaseState -from evennia.contrib.evscaperoom import objects +from evennia.contrib.full_systems.evscaperoom.state import BaseState +from evennia.contrib.full_systems.evscaperoom import objects GREETING = """ This is the situation, {name}: diff --git a/evennia/contrib/full_systems/evscaperoom/tests.py b/evennia/contrib/full_systems/evscaperoom/tests.py index 2c839ae1ba..0b37c98d0f 100644 --- a/evennia/contrib/full_systems/evscaperoom/tests.py +++ b/evennia/contrib/full_systems/evscaperoom/tests.py @@ -271,7 +271,7 @@ class TestStates(EvenniaTest): dirname = path.join(path.dirname(__file__), "states") states = [] for imp, module, ispackage in pkgutil.walk_packages( - path=[dirname], prefix="evennia.contrib.evscaperoom.states." + path=[dirname], prefix="evennia.contrib.full_systems.evscaperoom.states." ): mod = mod_import(module) states.append(mod) diff --git a/evennia/contrib/game_systems/__init__.py b/evennia/contrib/game_systems/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/evennia/contrib/game_systems/barter/] b/evennia/contrib/game_systems/barter/] deleted file mode 100644 index 72d1cbe47a..0000000000 --- a/evennia/contrib/game_systems/barter/] +++ /dev/null @@ -1,83 +0,0 @@ -# Clothing - -Evennia contribution - Tim Ashley Jenkins 2017 - -Provides a typeclass and commands for wearable clothing, -which is appended to a character's description when worn. - -Clothing items, when worn, are added to the character's description -in a list. For example, if wearing the following clothing items: - - a thin and delicate necklace - a pair of regular ol' shoes - one nice hat - a very pretty dress - -## Installation - -To install, import this module and have your default character -inherit from ClothedCharacter in your game's characters.py file: - -```python - -from evennia.contrib.game_systems.clothing import ClothedCharacter - -class Character(ClothedCharacter): - -``` - -And then add `ClothedCharacterCmdSet` in your character set in -`mygame/commands/default_cmdsets.py`: - -```python - -from evennia.contrib.game_systems.clothing import ClothedCharacterCmdSet <-- - -class CharacterCmdSet(default_cmds.CharacterCmdSet): - ... - at_cmdset_creation(self): - - super().at_cmdset_creation() - ... - self.add(ClothedCharacterCmdSet) # <-- - -``` - -From here, you can use the default builder commands to create clothes -with which to test the system: - - create a pretty shirt : evennia.contrib.clothing.Clothing - set shirt/clothing_type = 'top' - wear shirt - -A character's description may look like this: - - Superuser(#1) - This is User #1. - - Superuser is wearing one nice hat, a thin and delicate necklace, - a very pretty dress and a pair of regular ol' shoes. - -Characters can also specify the style of wear for their clothing - I.E. -to wear a scarf 'tied into a tight knot around the neck' or 'draped -loosely across the shoulders' - to add an easy avenue of customization. -For example, after entering: - - wear scarf draped loosely across the shoulders - -The garment appears like so in the description: - - Superuser(#1) - This is User #1. - - Superuser is wearing a fanciful-looking scarf draped loosely - across the shoulders. - -Items of clothing can be used to cover other items, and many options -are provided to define your own clothing types and their limits and -behaviors. For example, to have undergarments automatically covered -by outerwear, or to put a limit on the number of each type of item -that can be worn. The system as-is is fairly freeform - you -can cover any garment with almost any other, for example - but it -can easily be made more restrictive, and can even be tied into a -system for armor or other equipment. diff --git a/evennia/contrib/game_systems/clothing/README.md b/evennia/contrib/game_systems/clothing/README.md index 0c07ef8dd2..7b84b3fa09 100644 --- a/evennia/contrib/game_systems/clothing/README.md +++ b/evennia/contrib/game_systems/clothing/README.md @@ -46,7 +46,7 @@ class CharacterCmdSet(default_cmds.CharacterCmdSet): From here, you can use the default builder commands to create clothes with which to test the system: - create a pretty shirt : evennia.contrib.clothing.Clothing + create a pretty shirt : evennia.contrib.game_systems.clothing.Clothing set shirt/clothing_type = 'top' wear shirt diff --git a/evennia/contrib/game_systems/clothing/clothing.py b/evennia/contrib/game_systems/clothing/clothing.py index 14e018be42..18272b604c 100644 --- a/evennia/contrib/game_systems/clothing/clothing.py +++ b/evennia/contrib/game_systems/clothing/clothing.py @@ -47,14 +47,14 @@ system for armor or other equipment. To install, import this module and have your default character inherit from ClothedCharacter in your game's characters.py file: - from evennia.contrib.clothing import ClothedCharacter + from evennia.contrib.game_systems.clothing import ClothedCharacter class Character(ClothedCharacter): And then add ClothedCharacterCmdSet in your character set in your game's commands/default_cmdsets.py: - from evennia.contrib.clothing import ClothedCharacterCmdSet + from evennia.contrib.game_systems.clothing import ClothedCharacterCmdSet class CharacterCmdSet(default_cmds.CharacterCmdSet): ... @@ -67,7 +67,7 @@ game's commands/default_cmdsets.py: From here, you can use the default builder commands to create clothes with which to test the system: - @create a pretty shirt : evennia.contrib.clothing.Clothing + @create a pretty shirt : evennia.contrib.game_systems.clothing.Clothing @set shirt/clothing_type = 'top' wear shirt @@ -389,7 +389,7 @@ class CmdWear(MuxCommand): if not clothing: self.caller.msg("Thing to wear must be in your inventory.") return - if not clothing.is_typeclass("evennia.contrib.clothing.Clothing", exact=False): + if not clothing.is_typeclass("evennia.contrib.game_systems.clothing.Clothing", exact=False): self.caller.msg("That's not clothes!") return @@ -492,10 +492,10 @@ class CmdCover(MuxCommand): cover_with = self.caller.search(self.arglist[1], candidates=self.caller.contents) if not to_cover or not cover_with: return - if not to_cover.is_typeclass("evennia.contrib.clothing.Clothing", exact=False): + if not to_cover.is_typeclass("evennia.contrib.game_systems.clothing.Clothing", exact=False): self.caller.msg("%s isn't clothes!" % to_cover.name) return - if not cover_with.is_typeclass("evennia.contrib.clothing.Clothing", exact=False): + if not cover_with.is_typeclass("evennia.contrib.game_systems.clothing.Clothing", exact=False): self.caller.msg("%s isn't clothes!" % cover_with.name) return if cover_with.db.clothing_type: diff --git a/evennia/contrib/game_systems/cooldowns/tests.py b/evennia/contrib/game_systems/cooldowns/tests.py index ab701959a9..eea54ef103 100644 --- a/evennia/contrib/game_systems/cooldowns/tests.py +++ b/evennia/contrib/game_systems/cooldowns/tests.py @@ -8,7 +8,7 @@ from evennia.utils.test_resources import EvenniaTest from . import cooldowns -@patch("evennia.contrib.cooldowns.time.time", return_value=0.0) +@patch("evennia.contrib.game_systems.cooldowns.time.time", return_value=0.0) class TestCooldowns(EvenniaTest): def setUp(self): super().setUp() diff --git a/evennia/contrib/game_systems/crafting/crafting.py b/evennia/contrib/game_systems/crafting/crafting.py index 2911230fe2..2b31121273 100644 --- a/evennia/contrib/game_systems/crafting/crafting.py +++ b/evennia/contrib/game_systems/crafting/crafting.py @@ -51,7 +51,7 @@ tools will be identified before consumables). ```python - from evennia.contrib.crafting import crafting + from evennia.contrib.game_systems.crafting import crafting spiked_club = crafting.craft(crafter, "spiked club", club, nails) @@ -87,7 +87,7 @@ substantially this way. ```python - from evennia.contrib.crafting.crafting import CraftingRecipe + from evennia.contrib.game_systems.crafting.crafting import CraftingRecipe class PigIronRecipe(CraftingRecipe): # Pig iron is a high-carbon result of melting iron in a blast furnace. @@ -112,7 +112,7 @@ substantially this way. If the above class was added to a module in `CRAFT_RECIPE_MODULES`, it could be called using its `.name` property, as "pig iron". -The [example_recipies](api:evennia.contrib.crafting.example_recipes) module has +The [example_recipies](api:evennia.contrib.game_systems.crafting.example_recipes) module has a full example of the components for creating a sword from base components. ---- @@ -139,7 +139,7 @@ def _load_recipes(): global _RECIPE_CLASSES if not _RECIPE_CLASSES: - paths = ["evennia.contrib.crafting.example_recipes"] + paths = ["evennia.contrib.game_systems.crafting.example_recipes"] if hasattr(settings, "CRAFT_RECIPE_MODULES"): paths += make_iter(settings.CRAFT_RECIPE_MODULES) for path in paths: @@ -462,7 +462,7 @@ class CraftingRecipe(CraftingRecipeBase): this deletes consumables. Use `.msg` to conveniently send messages to the crafter. Raise - `evennia.contrib.crafting.crafting.CraftingError` exception to abort + `evennia.contrib.game_systems.crafting.crafting.CraftingError` exception to abort crafting at any time in the sequence. If raising with a text, this will be shown to the crafter automatically @@ -909,7 +909,8 @@ def craft(crafter, recipe_name, *inputs, raise_exception=False, **kwargs): Notes: If no recipe_module is given, will look for a list `settings.CRAFT_RECIPE_MODULES` and - lastly fall back to the example module `"evennia.contrib."` + lastly fall back to the example module + `"evennia.contrib.game_systems.crafting.example_recipes"` """ # delayed loading/caching of recipes diff --git a/evennia/contrib/game_systems/crafting/tests.py b/evennia/contrib/game_systems/crafting/tests.py index 0d24c0c0ec..0e74946d98 100644 --- a/evennia/contrib/game_systems/crafting/tests.py +++ b/evennia/contrib/game_systems/crafting/tests.py @@ -485,7 +485,7 @@ class TestCraftSword(TestCase): self.crafter.msg = mock.MagicMock() @override_settings(CRAFT_RECIPE_MODULES=[], DEFAULT_HOME="#999999") - @mock.patch("evennia.contrib.crafting.example_recipes.random") + @mock.patch("evennia.contrib.game_systems.crafting.example_recipes.random") def test_craft_sword(self, mockrandom): """ Craft example sword. For the test, every crafting works. @@ -652,8 +652,8 @@ class TestCraftSword(TestCase): self.assertIsNotNone(cauldron) -@mock.patch("evennia.contrib.crafting.crafting._load_recipes", new=mock.MagicMock()) -@mock.patch("evennia.contrib.crafting.crafting._RECIPE_CLASSES", new={"testrecipe": _MockRecipe}) +@mock.patch("evennia.contrib.game_systems.crafting.crafting._load_recipes", new=mock.MagicMock()) +@mock.patch("evennia.contrib.game_systems.crafting.crafting._RECIPE_CLASSES", new={"testrecipe": _MockRecipe}) @override_settings(CRAFT_RECIPE_MODULES=[], DEFAULT_HOME="#999999") class TestCraftCommand(CommandTest): """Test the crafting command""" diff --git a/evennia/contrib/game_systems/gendersub/tests.py b/evennia/contrib/game_systems/gendersub/tests.py index f25b54abf7..bf14aef1e0 100644 --- a/evennia/contrib/game_systems/gendersub/tests.py +++ b/evennia/contrib/game_systems/gendersub/tests.py @@ -22,7 +22,7 @@ class TestGenderSub(CommandTest): self.assertEqual( gendersub._RE_GENDER_PRONOUN.sub(char._get_pronoun, txt), "Test their gender" ) - with patch("evennia.contrib.gendersub.DefaultCharacter.msg") as mock_msg: + with patch("evennia.contrib.game_systems.gendersub.DefaultCharacter.msg") as mock_msg: char.db.gender = "female" char.msg("Test |p gender") mock_msg.assert_called_with("Test her gender", from_obj=None, session=None) diff --git a/evennia/contrib/game_systems/multidescer/README.md b/evennia/contrib/game_systems/multidescer/README.md index e3805d5b45..3068dda1e5 100644 --- a/evennia/contrib/game_systems/multidescer/README.md +++ b/evennia/contrib/game_systems/multidescer/README.md @@ -14,7 +14,7 @@ also adds the short descriptions and the `sdesc` command). ## Installation Edit `mygame/commands/default_cmdsets.py` and add -`from evennia.contrib.multidescer import CmdMultiDesc` to the top. +`from evennia.contrib.game_systems.multidescer import CmdMultiDesc` to the top. Next, look up the `at_cmdset_create` method of the `CharacterCmdSet` class and add a line `self.add(CmdMultiDesc())` to the end diff --git a/evennia/contrib/game_systems/multidescer/multidescer.py b/evennia/contrib/game_systems/multidescer/multidescer.py index fb5fc61b62..57245c2eca 100644 --- a/evennia/contrib/game_systems/multidescer/multidescer.py +++ b/evennia/contrib/game_systems/multidescer/multidescer.py @@ -15,7 +15,7 @@ also adds the short descriptions and the `sdesc` command). Installation: Edit `mygame/commands/default_cmdsets.py` and add -`from evennia.contrib.game_system.multidescer import CmdMultiDesc` to the top. +`from evennia.contrib.game_systems.multidescer import CmdMultiDesc` to the top. Next, look up the `at_cmdset_create` method of the `CharacterCmdSet` class and add a line `self.add(CmdMultiDesc())` to the end diff --git a/evennia/contrib/game_systems/puzzles/tests.py b/evennia/contrib/game_systems/puzzles/tests.py index 94f91baf3d..c494947b2a 100644 --- a/evennia/contrib/game_systems/puzzles/tests.py +++ b/evennia/contrib/game_systems/puzzles/tests.py @@ -101,7 +101,7 @@ class TestPuzzles(CommandTest): self._assert_msg_matched(msg, regexs, re_flags=re.MULTILINE | re.DOTALL) def test_cmdset_puzzle(self): - self.char1.cmdset.add("evennia.contrib.puzzles.PuzzleSystemCmdSet") + self.char1.cmdset.add("evennia.contrib.game_systems.puzzles.PuzzleSystemCmdSet") # FIXME: testing nothing, this is just to bump up coverage def test_cmd_puzzle(self): diff --git a/evennia/contrib/game_systems/turnbattle/tb_basic.py b/evennia/contrib/game_systems/turnbattle/tb_basic.py index 8dd1894c55..8b385b2943 100644 --- a/evennia/contrib/game_systems/turnbattle/tb_basic.py +++ b/evennia/contrib/game_systems/turnbattle/tb_basic.py @@ -19,7 +19,7 @@ own battle system. To install and test, import this module's TBBasicCharacter object into your game's character.py module: - from evennia.contrib.turnbattle.tb_basic import TBBasicCharacter + from evennia.contrib.game_systems.turnbattle.tb_basic import TBBasicCharacter And change your game's character typeclass to inherit from TBBasicCharacter instead of the default: @@ -28,7 +28,7 @@ instead of the default: Next, import this module into your default_cmdsets.py module: - from evennia.contrib.turnbattle import tb_basic + from evennia.contrib.game_systems.turnbattle import tb_basic And add the battle command set to your default command set: @@ -585,7 +585,7 @@ class CmdFight(Command): return here.msg_contents("%s starts a fight!" % self.caller) # Add a turn handler script to the room, which starts combat. - here.scripts.add("contrib.turnbattle.tb_basic.TBBasicTurnHandler") + here.scripts.add("contrib.game_systems.turnbattle.tb_basic.TBBasicTurnHandler") # Remember you'll have to change the path to the script if you copy this code to your own modules! diff --git a/evennia/contrib/game_systems/turnbattle/tb_equip.py b/evennia/contrib/game_systems/turnbattle/tb_equip.py index 37b3fb8f74..20c1c066bf 100644 --- a/evennia/contrib/game_systems/turnbattle/tb_equip.py +++ b/evennia/contrib/game_systems/turnbattle/tb_equip.py @@ -31,7 +31,7 @@ the rules of your preferred system or the needs of your own game. To install and test, import this module's TBEquipCharacter object into your game's character.py module: - from evennia.contrib.turnbattle.tb_equip import TBEquipCharacter + from evennia.contrib.game_systems.turnbattle.tb_equip import TBEquipCharacter And change your game's character typeclass to inherit from TBEquipCharacter instead of the default: @@ -40,7 +40,7 @@ instead of the default: Next, import this module into your default_cmdsets.py module: - from evennia.contrib.turnbattle import tb_equip + from evennia.contrib.game_systems.turnbattle import tb_equip And add the battle command set to your default command set: @@ -722,7 +722,7 @@ class CmdFight(Command): return here.msg_contents("%s starts a fight!" % self.caller) # Add a turn handler script to the room, which starts combat. - here.scripts.add("contrib.turnbattle.tb_equip.TBEquipTurnHandler") + here.scripts.add("contrib.game_systems.turnbattle.tb_equip.TBEquipTurnHandler") # Remember you'll have to change the path to the script if you copy this code to your own modules! @@ -933,7 +933,7 @@ class CmdWield(Command): weapon = self.caller.search(self.args, candidates=self.caller.contents) if not weapon: return - if not weapon.is_typeclass("evennia.contrib.turnbattle.tb_equip.TBEWeapon", exact=True): + if not weapon.is_typeclass("evennia.contrib.game_systems.turnbattle.tb_equip.TBEWeapon", exact=True): self.caller.msg("That's not a weapon!") # Remember to update the path to the weapon typeclass if you move this module! return @@ -1012,7 +1012,7 @@ class CmdDon(Command): armor = self.caller.search(self.args, candidates=self.caller.contents) if not armor: return - if not armor.is_typeclass("evennia.contrib.turnbattle.tb_equip.TBEArmor", exact=True): + if not armor.is_typeclass("evennia.contrib.game_systems.turnbattle.tb_equip.TBEArmor", exact=True): self.caller.msg("That's not armor!") # Remember to update the path to the armor typeclass if you move this module! return @@ -1088,9 +1088,9 @@ PROTOTYPES START HERE ---------------------------------------------------------------------------- """ -BASEWEAPON = {"typeclass": "evennia.contrib.turnbattle.tb_equip.TBEWeapon"} +BASEWEAPON = {"typeclass": "evennia.contrib.game_systems.turnbattle.tb_equip.TBEWeapon"} -BASEARMOR = {"typeclass": "evennia.contrib.turnbattle.tb_equip.TBEArmor"} +BASEARMOR = {"typeclass": "evennia.contrib.game_systems.turnbattle.tb_equip.TBEArmor"} DAGGER = { "prototype": "BASEWEAPON", diff --git a/evennia/contrib/game_systems/turnbattle/tb_items.py b/evennia/contrib/game_systems/turnbattle/tb_items.py index c069e42521..65ed24c8f5 100644 --- a/evennia/contrib/game_systems/turnbattle/tb_items.py +++ b/evennia/contrib/game_systems/turnbattle/tb_items.py @@ -43,7 +43,7 @@ can be specified on the item as well, but they are optional. To install and test, import this module's TBItemsCharacter object into your game's character.py module: - from evennia.contrib.turnbattle.tb_items import TBItemsCharacter + from evennia.contrib.game_systems.turnbattle.tb_items import TBItemsCharacter And change your game's character typeclass to inherit from TBItemsCharacter instead of the default: @@ -52,7 +52,7 @@ instead of the default: Next, import this module into your default_cmdsets.py module: - from evennia.contrib.turnbattle import tb_items + from evennia.contrib.game_systems.turnbattle import tb_items And add the battle command set to your default command set: @@ -866,7 +866,7 @@ class CmdFight(Command): return here.msg_contents("%s starts a fight!" % self.caller) # Add a turn handler script to the room, which starts combat. - here.scripts.add("contrib.turnbattle.tb_items.TBItemsTurnHandler") + here.scripts.add("contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler") # Remember you'll have to change the path to the script if you copy this code to your own modules! diff --git a/evennia/contrib/game_systems/turnbattle/tb_magic.py b/evennia/contrib/game_systems/turnbattle/tb_magic.py index 3db583f167..81e882e3cf 100644 --- a/evennia/contrib/game_systems/turnbattle/tb_magic.py +++ b/evennia/contrib/game_systems/turnbattle/tb_magic.py @@ -37,7 +37,7 @@ or whatever else your game requires. To install and test, import this module's TBMagicCharacter object into your game's character.py module: - from evennia.contrib.turnbattle.tb_magic import TBMagicCharacter + from evennia.contrib.game_systems.turnbattle.tb_magic import TBMagicCharacter And change your game's character typeclass to inherit from TBMagicCharacter instead of the default: @@ -52,7 +52,7 @@ on all existing Characters. Next, import this module into your default_cmdsets.py module: - from evennia.contrib.turnbattle import tb_magic + from evennia.contrib.game_systems.turnbattle import tb_magic And add the battle command set to your default command set: @@ -612,7 +612,7 @@ class CmdFight(Command): return here.msg_contents("%s starts a fight!" % self.caller) # Add a turn handler script to the room, which starts combat. - here.scripts.add("contrib.turnbattle.tb_magic.TBMagicTurnHandler") + here.scripts.add("contrib.game_systems.turnbattle.tb_magic.TBMagicTurnHandler") # Remember you'll have to change the path to the script if you copy this code to your own modules! diff --git a/evennia/contrib/game_systems/turnbattle/tb_range.py b/evennia/contrib/game_systems/turnbattle/tb_range.py index b65a3cd79e..b1575f53e4 100644 --- a/evennia/contrib/game_systems/turnbattle/tb_range.py +++ b/evennia/contrib/game_systems/turnbattle/tb_range.py @@ -72,7 +72,7 @@ are objects placed in the range field like any other. To install and test, import this module's TBRangeCharacter object into your game's character.py module: - from evennia.contrib.turnbattle.tb_range import TBRangeCharacter + from evennia.contrib.game_systems.turnbattle.tb_range import TBRangeCharacter And change your game's character typeclass to inherit from TBRangeCharacter instead of the default: @@ -81,12 +81,12 @@ instead of the default: Do the same thing in your game's objects.py module for TBRangeObject: - from evennia.contrib.turnbattle.tb_range import TBRangeObject + from evennia.contrib.game_systems.turnbattle.tb_range import TBRangeObject class Object(TBRangeObject): Next, import this module into your default_cmdsets.py module: - from evennia.contrib.turnbattle import tb_range + from evennia.contrib.game_systems.turnbattle import tb_range And add the battle command set to your default command set: @@ -1031,7 +1031,7 @@ class CmdFight(Command): return here.msg_contents("%s starts a fight!" % self.caller) # Add a turn handler script to the room, which starts combat. - here.scripts.add("contrib.turnbattle.tb_range.TBRangeTurnHandler") + here.scripts.add("contrib.game_systems.turnbattle.tb_range.TBRangeTurnHandler") # Remember you'll have to change the path to the script if you copy this code to your own modules! diff --git a/evennia/contrib/game_systems/turnbattle/tests.py b/evennia/contrib/game_systems/turnbattle/tests.py index 8f11c74b5b..4d4d3405d7 100644 --- a/evennia/contrib/game_systems/turnbattle/tests.py +++ b/evennia/contrib/game_systems/turnbattle/tests.py @@ -388,7 +388,7 @@ class TestTurnBattleRangeFunc(EvenniaTest): class TestTurnBattleItemsFunc(EvenniaTest): - @patch("evennia.contrib.turnbattle.tb_items.tickerhandler", new=MagicMock()) + @patch("evennia.contrib.game_systems.turnbattle.tb_items.tickerhandler", new=MagicMock()) def setUp(self): super(TestTurnBattleItemsFunc, self).setUp() self.testroom = create_object(DefaultRoom, key="Test Room") diff --git a/evennia/contrib/grid/mapbuilder/README.md b/evennia/contrib/grid/mapbuilder/README.md index 3ddad7d8ab..4d42770ad1 100644 --- a/evennia/contrib/grid/mapbuilder/README.md +++ b/evennia/contrib/grid/mapbuilder/README.md @@ -79,7 +79,7 @@ For example: mapbuilder world.gamemap.MAP world.maplegend.MAP_LEGEND mapbuilder evennia.contrib.grid.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND - mapbuilder/two evennia.contrib.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND + mapbuilder/two evennia.contrib.grid.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND (Legend path defaults to map path) Below are two examples showcasing the use of automatic exit generation and @@ -93,7 +93,7 @@ convenience The below example code should be in mymap.py in mygame/world. from django.conf import settings from evennia.utils import utils -# mapbuilder evennia.contrib.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND +# mapbuilder evennia.contrib.grid.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND # -*- coding: utf-8 -*- @@ -193,7 +193,7 @@ EXAMPLE1_LEGEND = { ## Example Two ```python -# @mapbuilder/two evennia.contrib.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND +# @mapbuilder/two evennia.contrib.grid.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND # -*- coding: utf-8 -*- diff --git a/evennia/contrib/grid/mapbuilder/mapbuilder.py b/evennia/contrib/grid/mapbuilder/mapbuilder.py index 1776ba525f..33d778f5ca 100644 --- a/evennia/contrib/grid/mapbuilder/mapbuilder.py +++ b/evennia/contrib/grid/mapbuilder/mapbuilder.py @@ -81,7 +81,7 @@ For example: mapbuilder world.gamemap.MAP world.maplegend.MAP_LEGEND mapbuilder evennia.contrib.grid.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND - mapbuilder/two evennia.contrib.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND + mapbuilder/two evennia.contrib.grid.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND (Legend path defaults to map path) Below are two examples showcasing the use of automatic exit generation and @@ -91,7 +91,7 @@ convenience The below example code should be in mymap.py in mygame/world. # Example One: ```python -# @mapbuilder evennia.contrib.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND +# @mapbuilder evennia.contrib.grid.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND # -*- coding: utf-8 -*- @@ -191,7 +191,7 @@ EXAMPLE1_LEGEND = { # Example two ```python -# @mapbuilder/two evennia.contrib.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND +# @mapbuilder/two evennia.contrib.grid.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND # -*- coding: utf-8 -*- @@ -414,8 +414,8 @@ class CmdMapBuilder(COMMAND_DEFAULT_CLASS): Example: @mapbuilder world.gamemap.MAP world.maplegend.MAP_LEGEND - @mapbuilder evennia.contrib.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND - @mapbuilder/two evennia.contrib.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND + @mapbuilder evennia.contrib.grid.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND + @mapbuilder/two evennia.contrib.grid.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND (Legend path defaults to map path) This is a command which takes two inputs: diff --git a/evennia/contrib/grid/mapbuilder/tests.py b/evennia/contrib/grid/mapbuilder/tests.py index ae2011b619..9ebc465c94 100644 --- a/evennia/contrib/grid/mapbuilder/tests.py +++ b/evennia/contrib/grid/mapbuilder/tests.py @@ -18,7 +18,7 @@ import random # A map with a temple (▲) amongst mountains (n,∩) in a forest (♣,♠) on an # island surrounded by water (≈). By giving no instructions for the water # characters we effectively skip it and create no rooms for those squares. -EXAMPLE1_MAP = ''' +EXAMPLE1_MAP = '''\ ≈≈≈≈≈ ≈♣n♣≈ ≈∩▲∩≈ @@ -102,7 +102,7 @@ EXAMPLE1_LEGEND = { # Example two -# @mapbuilder/two evennia.contrib.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND +# @mapbuilder/two evennia.contrib.grid.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND # -*- coding: utf-8 -*- @@ -115,7 +115,7 @@ EXAMPLE1_LEGEND = { # This is the same layout as Example 1 but included are characters for exits. # We can use these characters to determine which rooms should be connected. -EXAMPLE2_MAP = ''' +EXAMPLE2_MAP = '''\ ≈ ≈ ≈ ≈ ≈ ≈ ♣-♣-♣ ≈ diff --git a/evennia/contrib/grid/wilderness/__init__.py b/evennia/contrib/grid/wilderness/__init__.py index 8e1c9490a1..ccb0877d88 100644 --- a/evennia/contrib/grid/wilderness/__init__.py +++ b/evennia/contrib/grid/wilderness/__init__.py @@ -10,5 +10,3 @@ from .wilderness import WildernessScript # noqa from .wilderness import WildernessExit # noqa from .wilderness import WildernessRoom # noqa from .wilderness import WildernessMapProvider # noqa -from .wilderness import Wilderness # noqa -from .wilderness import WildernessMap # noqa diff --git a/evennia/contrib/grid/wilderness/wilderness.py b/evennia/contrib/grid/wilderness/wilderness.py index 7d35d43986..7ad043240d 100644 --- a/evennia/contrib/grid/wilderness/wilderness.py +++ b/evennia/contrib/grid/wilderness/wilderness.py @@ -17,11 +17,11 @@ with their own name. If no name is provided, then a default one is used. Interna the wilderness is stored as a Script with the name you specify. If you don't specify the name, a script named "default" will be created and used. - @py from evennia.contrib.grid import wilderness; wilderness.create_wilderness() + py from evennia.contrib.grid import wilderness; wilderness.create_wilderness() Once created, it is possible to move into that wilderness map: - @py from evennia.contrib.grid import wilderness; wilderness.enter_wilderness(me) + py from evennia.contrib.grid import wilderness; wilderness.enter_wilderness(me) All coordinates used by the wilderness map are in the format of `(x, y)` tuples. x goes from left to right and y goes from bottom to top. So `(0, 0)` diff --git a/evennia/contrib/grid/xyzgrid/README.md b/evennia/contrib/grid/xyzgrid/README.md index 5822aee634..7a723579d1 100644 --- a/evennia/contrib/grid/xyzgrid/README.md +++ b/evennia/contrib/grid/xyzgrid/README.md @@ -29,13 +29,13 @@ in the docs. 1. If you haven't before, install the extra contrib requirements. You can do so by doing `pip install -r requirements_extra.txt` from the `evennia/` folder. -2. Import and add the `evennia.contrib.xyzgrid.commands.XYZGridCmdSet` to the +2. Import and add the `evennia.contrib.grid.xyzgrid.commands.XYZGridCmdSet` to the `CharacterCmdset` cmdset in `mygame/commands.default_cmds.py`. Reload the server. This makes the `map`, `goto/path` and modified `teleport` and `open` commands available in-game. 3. Edit `mygame/server/conf/settings.py` and set - EXTRA_LAUNCHER_COMMANDS['xyzgrid'] = 'evennia.contrib.xyzgrid.launchcmd.xyzcommand' + EXTRA_LAUNCHER_COMMANDS['xyzgrid'] = 'evennia.contrib.grid.xyzgrid.launchcmd.xyzcommand' 4. Run the new `evennia xyzgrid help` for instructions on how to spawn the grid. @@ -45,7 +45,7 @@ After installation, do the following (from your command line, where the `evennia` command is available) to install an example grid: evennia xyzgrid init - evennia xyzgrid add evennia.contrib.xyzgrid.example + evennia xyzgrid add evennia.contrib.grid.xyzgrid.example evennia xyzgrid list evennia xyzgrid show "the large tree" evennia xyzgrid show "the small cave" diff --git a/evennia/contrib/grid/xyzgrid/tests.py b/evennia/contrib/grid/xyzgrid/tests.py index 390595a18d..c8c9451537 100644 --- a/evennia/contrib/grid/xyzgrid/tests.py +++ b/evennia/contrib/grid/xyzgrid/tests.py @@ -851,9 +851,11 @@ class TestMap8(_MapTest): """ mapstr = self.map.get_visual_range(coord, dist=dist, mode='nodes', - target=target, target_path_style="", + target=target, target_path_style=".", character='@', max_size=max_size) + self.assertEqual(expected, mapstr.replace("||", "|")) + def test_spawn(self): """ Spawn the map into actual objects. @@ -1013,10 +1015,9 @@ class TestMap11(_MapTest): """ mapstr = self.map.get_visual_range(coord, dist=dist, mode='nodes', - target=target, target_path_style="", + target=target, target_path_style=".", character='@', max_size=max_size) - print(f"\n\n{coord}-{target}\n{expected}\n\n{mapstr}") self.assertEqual(expected, mapstr) diff --git a/evennia/contrib/rpg/__init__.py b/evennia/contrib/rpg/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/evennia/contrib/rpg/rpsystem/rpsystem.py b/evennia/contrib/rpg/rpsystem/rpsystem.py index 68b902a0a5..f96adad6b6 100644 --- a/evennia/contrib/rpg/rpsystem/rpsystem.py +++ b/evennia/contrib/rpg/rpsystem/rpsystem.py @@ -42,7 +42,7 @@ to a game, common to many RP-centric games: simple Attribute that modifies how the characters is viewed when in a room as sdesc + pose. - in-emote says, including seamless integration with language - obscuration routine (such as contrib/rplanguage.py) + obscuration routine (such as contrib/rpg/rplanguage.py) Installation: @@ -125,7 +125,7 @@ Extra Installation Instructions: 1. In typeclasses/character.py: Import the `ContribRPCharacter` class: - `from evennia.contrib.rpsystem import ContribRPCharacter` + `from evennia.contrib.rpg.rpsystem import ContribRPCharacter` Inherit ContribRPCharacter: Change "class Character(DefaultCharacter):" to `class Character(ContribRPCharacter):` @@ -133,13 +133,13 @@ Extra Installation Instructions: Add `super().at_object_creation()` as the top line. 2. In `typeclasses/rooms.py`: Import the `ContribRPRoom` class: - `from evennia.contrib.rpsystem import ContribRPRoom` + `from evennia.contrib.rpg.rpsystem import ContribRPRoom` Inherit `ContribRPRoom`: Change `class Room(DefaultRoom):` to `class Room(ContribRPRoom):` 3. In `typeclasses/objects.py` Import the `ContribRPObject` class: - `from evennia.contrib.rpsystem import ContribRPObject` + `from evennia.contrib.rpg.rpsystem import ContribRPObject` Inherit `ContribRPObject`: Change `class Object(DefaultObject):` to `class Object(ContribRPObject):` @@ -348,7 +348,7 @@ def parse_language(speaker, emote): the markers and a tuple (langname, saytext), where langname can be None. Raises: - evennia.contrib.rpsystem.LanguageError: If an invalid language was + evennia.contrib.rpg.rpsystem.LanguageError: If an invalid language was specified. Notes: @@ -1756,7 +1756,7 @@ class ContribRPCharacter(DefaultCharacter, ContribRPObject): Notes: This is designed to work together with a string obfuscator such as the `obfuscate_language` or `obfuscate_whisper` in - the evennia.contrib.rplanguage module. + the evennia.contrib.rpg.rplanguage module. """ return "%s|w%s|n" % ("|W(%s)" % language if language else "", text) diff --git a/evennia/contrib/rpg/traits/README.md b/evennia/contrib/rpg/traits/README.md index 2889633f12..944216c633 100644 --- a/evennia/contrib/rpg/traits/README.md +++ b/evennia/contrib/rpg/traits/README.md @@ -34,7 +34,7 @@ Here's an example for adding the TraitHandler to the Character class: from evennia import DefaultCharacter from evennia.utils import lazy_property -from evennia.contrib.traits import TraitHandler +from evennia.contrib.rpg.traits import TraitHandler # ... @@ -71,7 +71,7 @@ other properties/methods on your class. from evennia import DefaultObject from evennia.utils import lazy_property -from evennia.contrib.traits import TraitProperty +from evennia.contrib.rpg.traits import TraitProperty # ... @@ -394,13 +394,13 @@ like a glorified Attribute. ## Expanding with your own Traits -A Trait is a class inhering from `evennia.contrib.traits.Trait` (or from one of +A Trait is a class inhering from `evennia.contrib.rpg.traits.Trait` (or from one of the existing Trait classes). ```python # in a file, say, 'mygame/world/traits.py' -from evennia.contrib.traits import StaticTrait +from evennia.contrib.rpg.traits import StaticTrait class RageTrait(StaticTrait): diff --git a/evennia/contrib/rpg/traits/tests.py b/evennia/contrib/rpg/traits/tests.py index 8fe6975e62..1d3811f896 100644 --- a/evennia/contrib/rpg/traits/tests.py +++ b/evennia/contrib/rpg/traits/tests.py @@ -32,17 +32,17 @@ class _MockObj: # we want to test the base traits too _TEST_TRAIT_CLASS_PATHS = [ - "evennia.contrib.traits.Trait", - "evennia.contrib.traits.StaticTrait", - "evennia.contrib.traits.CounterTrait", - "evennia.contrib.traits.GaugeTrait", + "evennia.contrib.rpg.traits.Trait", + "evennia.contrib.rpg.traits.StaticTrait", + "evennia.contrib.rpg.traits.CounterTrait", + "evennia.contrib.rpg.traits.GaugeTrait", ] class _TraitHandlerBase(TestCase): "Base for trait tests" - @patch("evennia.contrib.traits._TRAIT_CLASS_PATHS", new=_TEST_TRAIT_CLASS_PATHS) + @patch("evennia.contrib.rpg.traits._TRAIT_CLASS_PATHS", new=_TEST_TRAIT_CLASS_PATHS) def setUp(self): self.obj = _MockObj() self.traithandler = traits.TraitHandler(self.obj) @@ -494,7 +494,7 @@ class TestTraitCounterTimed(_TraitHandlerBase): Test for trait with timer component """ - @patch("evennia.contrib.traits.time", new=MagicMock(return_value=1000)) + @patch("evennia.contrib.rpg.traits.time", new=MagicMock(return_value=1000)) def setUp(self): super().setUp() self.traithandler.add( @@ -522,7 +522,7 @@ class TestTraitCounterTimed(_TraitHandlerBase): self.trait.ratetarget, ) - @patch("evennia.contrib.traits.time") + @patch("evennia.contrib.rpg.traits.time") def test_timer_rate(self, mock_time): """Test time stepping""" mock_time.return_value = 1000 @@ -549,7 +549,7 @@ class TestTraitCounterTimed(_TraitHandlerBase): mock_time.return_value = 1218 self.assertEqual(self._get_timer_data(), (0, -2, -10, None, None)) - @patch("evennia.contrib.traits.time") + @patch("evennia.contrib.rpg.traits.time") def test_timer_ratetarget(self, mock_time): """test ratetarget""" mock_time.return_value = 1000 @@ -751,7 +751,7 @@ class TestTraitGaugeTimed(_TraitHandlerBase): Test for trait with timer component """ - @patch("evennia.contrib.traits.time", new=MagicMock(return_value=1000)) + @patch("evennia.contrib.rpg.traits.time", new=MagicMock(return_value=1000)) def setUp(self): super().setUp() self.traithandler.add( @@ -778,7 +778,7 @@ class TestTraitGaugeTimed(_TraitHandlerBase): self.trait.ratetarget, ) - @patch("evennia.contrib.traits.time") + @patch("evennia.contrib.rpg.traits.time") def test_timer_rate(self, mock_time): """Test time stepping""" mock_time.return_value = 1000 @@ -806,7 +806,7 @@ class TestTraitGaugeTimed(_TraitHandlerBase): mock_time.return_value = 1218 self.assertEqual(self._get_timer_data(), (0, 0, -10, None, None)) - @patch("evennia.contrib.traits.time") + @patch("evennia.contrib.rpg.traits.time") def test_timer_ratetarget(self, mock_time): """test ratetarget""" mock_time.return_value = 1000 @@ -915,7 +915,7 @@ class TestTraitFields(TestCase): """ - @patch("evennia.contrib.traits._TRAIT_CLASS_PATHS", new=_TEST_TRAIT_CLASS_PATHS) + @patch("evennia.contrib.rpg.traits._TRAIT_CLASS_PATHS", new=_TEST_TRAIT_CLASS_PATHS) def test_traitfields(self): obj = DummyCharacter() obj2 = DummyCharacter() diff --git a/evennia/contrib/rpg/traits/traits.py b/evennia/contrib/rpg/traits/traits.py index 140f00c535..f178c68e80 100644 --- a/evennia/contrib/rpg/traits/traits.py +++ b/evennia/contrib/rpg/traits/traits.py @@ -31,7 +31,7 @@ Here's an example for adding the TraitHandler to the Character class: from evennia import DefaultCharacter from evennia.utils import lazy_property -from evennia.contrib.traits import TraitHandler +from evennia.contrib.rpg.traits import TraitHandler # ... @@ -68,7 +68,7 @@ other properties/methods on your class. from evennia import DefaultObject from evennia.utils import lazy_property -from evennia.contrib.traits import TraitProperty +from evennia.contrib.rpg.traits import TraitProperty # ... @@ -392,13 +392,13 @@ like a glorified Attribute. ## Expanding with your own Traits -A Trait is a class inhering from `evennia.contrib.traits.Trait` (or from one of +A Trait is a class inhering from `evennia.contrib.rpg.traits.Trait` (or from one of the existing Trait classes). ```python # in a file, say, 'mygame/world/traits.py' -from evennia.contrib.traits import StaticTrait +from evennia.contrib.rpg.traits import StaticTrait class RageTrait(StaticTrait): @@ -461,10 +461,10 @@ from evennia.utils.utils import inherits_from, class_from_module, list_to_string # "counter" and "gauge". _TRAIT_CLASS_PATHS = [ - "evennia.contrib.traits.Trait", - "evennia.contrib.traits.StaticTrait", - "evennia.contrib.traits.CounterTrait", - "evennia.contrib.traits.GaugeTrait", + "evennia.contrib.rpg.traits.Trait", + "evennia.contrib.rpg.traits.StaticTrait", + "evennia.contrib.rpg.traits.CounterTrait", + "evennia.contrib.rpg.traits.GaugeTrait", ] if hasattr(settings, "TRAIT_CLASS_PATHS"): @@ -725,7 +725,7 @@ class TraitProperty: Example: :: from evennia.utils import lazy_property - from evennia.contrib.traits import TraitProperty + from evennia.contrib.rpg.traits import TraitProperty class Character(DefaultCharacter): diff --git a/evennia/contrib/tutorials/__init__.py b/evennia/contrib/tutorials/__init__.py new file mode 100644 index 0000000000..db77c60bae --- /dev/null +++ b/evennia/contrib/tutorials/__init__.py @@ -0,0 +1,4 @@ +""" +Contribs acting as tutorials, examples or supporting the documentation. + +""" diff --git a/evennia/contrib/tutorials/bodyfunctions/tests.py b/evennia/contrib/tutorials/bodyfunctions/tests.py index d140fea6db..e95f37a5cd 100644 --- a/evennia/contrib/tutorials/bodyfunctions/tests.py +++ b/evennia/contrib/tutorials/bodyfunctions/tests.py @@ -7,7 +7,7 @@ from evennia.utils.test_resources import EvenniaTest from .bodyfunctions import BodyFunctions -@patch("evennia.contrib.tutorial_examples.bodyfunctions.random") +@patch("evennia.contrib.tutorials.bodyfunctions.random") class TestBodyFunctions(EvenniaTest): script_typeclass = BodyFunctions diff --git a/evennia/contrib/tutorials/talking_npc/talking_npc.py b/evennia/contrib/tutorials/talking_npc/talking_npc.py index 1384514a47..e6a8aabb7d 100644 --- a/evennia/contrib/tutorials/talking_npc/talking_npc.py +++ b/evennia/contrib/tutorials/talking_npc/talking_npc.py @@ -112,7 +112,7 @@ class CmdTalk(default_cmds.MuxCommand): # Initiate the menu. Change this if you are putting this on # some other custom NPC class. - EvMenu(self.caller, "evennia.contrib.talking_npc", startnode="menu_start_node") + EvMenu(self.caller, "evennia.contrib.tutorials.talking_npc", startnode="menu_start_node") class TalkingCmdSet(CmdSet): diff --git a/evennia/contrib/tutorials/tutorial_world/mob.py b/evennia/contrib/tutorials/tutorial_world/mob.py index 04ffa475db..59a8382412 100644 --- a/evennia/contrib/tutorials/tutorial_world/mob.py +++ b/evennia/contrib/tutorials/tutorial_world/mob.py @@ -11,7 +11,7 @@ from evennia import TICKER_HANDLER from evennia import search_object from evennia import Command, CmdSet from evennia import logger -from evennia.contrib.tutorial_world import objects as tut_objects +from . import objects as tut_objects class CmdMobOnOff(Command): diff --git a/evennia/contrib/tutorials/tutorial_world/objects.py b/evennia/contrib/tutorials/tutorial_world/objects.py index c427ee48a4..8fce833bb0 100644 --- a/evennia/contrib/tutorials/tutorial_world/objects.py +++ b/evennia/contrib/tutorials/tutorial_world/objects.py @@ -982,7 +982,7 @@ class TutorialWeapon(TutorialObject): WEAPON_PROTOTYPES = { "weapon": { - "typeclass": "evennia.contrib.tutorial_world.objects.TutorialWeapon", + "typeclass": "evennia.contrib.tutorials.tutorial_world.objects.TutorialWeapon", "key": "Weapon", "hit": 0.2, "parry": 0.2, diff --git a/evennia/contrib/tutorials/tutorial_world/rooms.py b/evennia/contrib/tutorials/tutorial_world/rooms.py index 4e8f3514b7..aa6d61912c 100644 --- a/evennia/contrib/tutorials/tutorial_world/rooms.py +++ b/evennia/contrib/tutorials/tutorial_world/rooms.py @@ -15,7 +15,7 @@ from evennia import TICKER_HANDLER from evennia import CmdSet, Command, DefaultRoom from evennia import utils, create_object, search_object from evennia import syscmdkeys, default_cmds -from evennia.contrib.tutorial_world.objects import LightSource +from .objects import LightSource # the system error-handling module is defined in the settings. We load the # given setting here using utils.object_from_module. This way we can use @@ -1158,7 +1158,7 @@ class OutroRoom(TutorialRoom): del character.db.combat_parry_mode del character.db.tutorial_bridge_position for obj in character.contents: - if obj.typeclass_path.startswith("evennia.contrib.tutorial_world"): + if obj.typeclass_path.startswith("evennia.contrib.tutorials.tutorial_world"): obj.delete() character.tags.clear(category="tutorial_world") diff --git a/evennia/contrib/tutorials/tutorial_world/tests.py b/evennia/contrib/tutorials/tutorial_world/tests.py index 67defee2eb..75b209af6d 100644 --- a/evennia/contrib/tutorials/tutorial_world/tests.py +++ b/evennia/contrib/tutorials/tutorial_world/tests.py @@ -8,9 +8,8 @@ from twisted.trial.unittest import TestCase as TwistedTestCase from twisted.internet.base import DelayedCall from evennia.commands.default.tests import CommandTest from evennia.utils.create import create_object -from evennia.contrib.tutorial_world import mob, objects as tutobjects from evennia.utils.test_resources import EvenniaTest, mockdelay, mockdeferLater -from evennia.contrib.tutorial_world import rooms as tutrooms +from . import mob, objects as tutobjects, rooms as tutrooms class TestTutorialWorldMob(EvenniaTest): @@ -59,7 +58,7 @@ class TestTutorialWorldObjects(TwistedTestCase, CommandTest): obelisk = create_object(tutobjects.Obelisk, key="obelisk", location=self.room1) self.assertEqual(obelisk.return_appearance(self.char1).startswith("|cobelisk("), True) - @patch("evennia.contrib.tutorial_world.objects.delay", mockdelay) + @patch("evennia.contrib.tutorials.tutorial_world.objects.delay", mockdelay) @patch("evennia.scripts.taskhandler.deferLater", mockdeferLater) def test_lightsource(self): light = create_object(tutobjects.LightSource, key="torch", location=self.room1) @@ -71,7 +70,7 @@ class TestTutorialWorldObjects(TwistedTestCase, CommandTest): ) self.assertFalse(light.pk) - @patch("evennia.contrib.tutorial_world.objects.delay", mockdelay) + @patch("evennia.contrib.tutorials.tutorial_world.objects.delay", mockdelay) @patch("evennia.scripts.taskhandler.deferLater", mockdeferLater) def test_crumblingwall(self): wall = create_object(tutobjects.CrumblingWall, key="wall", location=self.room1) diff --git a/evennia/contrib/utils/__init__.py b/evennia/contrib/utils/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/evennia/contrib/utils/auditing/tests.py b/evennia/contrib/utils/auditing/tests.py index 0c38739156..2c37615844 100644 --- a/evennia/contrib/utils/auditing/tests.py +++ b/evennia/contrib/utils/auditing/tests.py @@ -1,5 +1,6 @@ """ Module containing the test cases for the Audit system. + """ from anything import Anything @@ -28,7 +29,7 @@ class AuditingTest(EvenniaTest): "@ccreate channel = for channeling", "@create/drop some stuff", "@create rock", - "@create a pretty shirt : evennia.contrib.clothing.Clothing", + "@create a pretty shirt : evennia.contrib.game_systems.clothing.Clothing", "@charcreate johnnyefhiwuhefwhef", 'Command "@logout" is not available. Maybe you meant "@color" or "@cboot"?', '/me says, "what is the password?"', diff --git a/evennia/contrib/utils/fieldfill/fieldfill.py b/evennia/contrib/utils/fieldfill/fieldfill.py index 269940040a..7dbd49f9ee 100644 --- a/evennia/contrib/utils/fieldfill/fieldfill.py +++ b/evennia/contrib/utils/fieldfill/fieldfill.py @@ -234,7 +234,7 @@ def init_fill_field( # Initialize menu of selections FieldEvMenu( caller, - "evennia.contrib.fieldfill", + "evennia.contrib.utils.fieldfill", startnode="menunode_fieldfill", auto_look=False, persistent=persistent, diff --git a/evennia/contrib/utils/random_string_generator/README.md b/evennia/contrib/utils/random_string_generator/README.md index 410a512c74..daaa19bc97 100644 --- a/evennia/contrib/utils/random_string_generator/README.md +++ b/evennia/contrib/utils/random_string_generator/README.md @@ -11,7 +11,7 @@ Here's a very simple example: ```python -from evennia.contrib.random_string_generator import RandomStringGenerator +from evennia.contrib.utils.random_string_generator import RandomStringGenerator # Create a generator for phone numbers phone_generator = RandomStringGenerator("phone number", r"555-[0-9]{3}-[0-9]{4}") diff --git a/evennia/contrib/utils/random_string_generator/random_string_generator.py b/evennia/contrib/utils/random_string_generator/random_string_generator.py index c3fd7d3df2..a639f407f4 100644 --- a/evennia/contrib/utils/random_string_generator/random_string_generator.py +++ b/evennia/contrib/utils/random_string_generator/random_string_generator.py @@ -11,7 +11,7 @@ stored and won't be available again in order to avoid repetition. Here's a very simple example: ```python -from evennia.contrib.random_string_generator import RandomStringGenerator +from evennia.contrib.utils.random_string_generator import RandomStringGenerator # Create a generator for phone numbers phone_generator = RandomStringGenerator("phone number", r"555-[0-9]{3}-[0-9]{4}") # Generate a phone number (555-XXX-XXXX with X as numbers) @@ -156,7 +156,7 @@ class RandomStringGenerator: self._find_elements(regex) def __repr__(self): - return "".format( + return "".format( self.name ) @@ -169,7 +169,7 @@ class RandomStringGenerator: script = ScriptDB.objects.get(db_key="generator_script") except ScriptDB.DoesNotExist: script = create_script( - "contrib.tutorials.random_string_generator.RandomStringGeneratorScript") + "evennia.contrib.utils.random_string_generator.RandomStringGeneratorScript") type(self).script = script return script diff --git a/evennia/contrib/utils/tree_select/tree_select.py b/evennia/contrib/utils/tree_select/tree_select.py index e958a471e3..a74c1c611a 100644 --- a/evennia/contrib/utils/tree_select/tree_select.py +++ b/evennia/contrib/utils/tree_select/tree_select.py @@ -224,7 +224,7 @@ def init_tree_selection( # Initialize menu of selections evmenu.EvMenu( caller, - "evennia.contrib.tree_select", + "evennia.contrib.utils.tree_select", startnode="menunode_treeselect", startnode_input=None, cmd_on_exit=cmd_on_exit,