Updated HTML docs

This commit is contained in:
Evennia docbuilder action 2022-08-05 18:45:45 +00:00
parent e41f2ff6b2
commit 3e1506b2c2
104 changed files with 6668 additions and 348 deletions

View file

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 5fe7f891b0e577c9ccfd1992bb9ff906
config: 5c30377db0aba959976f60592b4f359e
tags: 645f666f9bcd5a90fca523b33c5a78b7

View file

@ -53,11 +53,11 @@ with <a class="reference internal" href="EvEditor.html"><span class="doc std std
<a class="reference internal" href="Batch-Processors.html"><span class="doc std std-doc">Batch-Processor</span></a>s interactive mode.</p>
</div>
<ul class="simple">
<li><p><a class="reference internal" href="api/evennia.commands.default.unloggedin.html#evennia.commands.default.unloggedin.CmdUnconnectedLook" title="evennia.commands.default.unloggedin.CmdUnconnectedLook"><span class="xref myst py py-class"><strong>__unloggedin_look_command</strong> [look, l]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_unloggedin.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet" title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><span class="xref myst py py-class">UnloggedinCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.unloggedin.html#evennia.commands.default.unloggedin.CmdUnconnectedLook" title="evennia.commands.default.unloggedin.CmdUnconnectedLook"><span class="xref myst py py-class"><strong>__unloggedin_look_command</strong> [l, look]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_unloggedin.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet" title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><span class="xref myst py py-class">UnloggedinCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdAbout" title="evennia.commands.default.system.CmdAbout"><span class="xref myst py py-class"><strong>about</strong> [version]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.general.html#evennia.commands.default.general.CmdAccess" title="evennia.commands.default.general.CmdAccess"><span class="xref myst py py-class"><strong>access</strong> [hierarchy, groups]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdAccounts" title="evennia.commands.default.system.CmdAccounts"><span class="xref myst py py-class"><strong>accounts</strong> [listaccounts, account]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdAddCom" title="evennia.commands.default.comms.CmdAddCom"><span class="xref myst py py-class"><strong>addcom</strong> [aliaschan, chanalias]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdAccounts" title="evennia.commands.default.system.CmdAccounts"><span class="xref myst py py-class"><strong>accounts</strong> [account, listaccounts]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdAddCom" title="evennia.commands.default.comms.CmdAddCom"><span class="xref myst py py-class"><strong>addcom</strong> [chanalias, aliaschan]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdSetObjAlias" title="evennia.commands.default.building.CmdSetObjAlias"><span class="xref myst py py-class"><strong>alias</strong> [setobjalias]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdAllCom" title="evennia.commands.default.comms.CmdAllCom"><span class="xref myst py py-class"><strong>allcom</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.batchprocess.html#evennia.commands.default.batchprocess.CmdBatchCode" title="evennia.commands.default.batchprocess.CmdBatchCode"><span class="xref myst py py-class"><strong>batchcode</strong> [batchcodes]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
@ -67,7 +67,7 @@ with <a class="reference internal" href="EvEditor.html"><span class="doc std std
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdCdesc" title="evennia.commands.default.comms.CmdCdesc"><span class="xref myst py py-class"><strong>cdesc</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdCdestroy" title="evennia.commands.default.comms.CmdCdestroy"><span class="xref myst py py-class"><strong>cdestroy</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdCemit" title="evennia.commands.default.comms.CmdCemit"><span class="xref myst py py-class"><strong>cemit</strong> [cmsg]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdChannels" title="evennia.commands.default.comms.CmdChannels"><span class="xref myst py py-class"><strong>channels</strong> [channellist, clist, comlist, all channels, chanlist]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdChannels" title="evennia.commands.default.comms.CmdChannels"><span class="xref myst py py-class"><strong>channels</strong> [all channels, chanlist, channellist, clist, comlist]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdCharCreate" title="evennia.commands.default.account.CmdCharCreate"><span class="xref myst py py-class"><strong>charcreate</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdCharDelete" title="evennia.commands.default.account.CmdCharDelete"><span class="xref myst py py-class"><strong>chardelete</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdClock" title="evennia.commands.default.comms.CmdClock"><span class="xref myst py py-class"><strong>clock</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
@ -81,12 +81,12 @@ with <a class="reference internal" href="EvEditor.html"><span class="doc std std
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdCWho" title="evennia.commands.default.comms.CmdCWho"><span class="xref myst py py-class"><strong>cwho</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdDelCom" title="evennia.commands.default.comms.CmdDelCom"><span class="xref myst py py-class"><strong>delcom</strong> [delchanalias, delaliaschan]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdDesc" title="evennia.commands.default.building.CmdDesc"><span class="xref myst py py-class"><strong>desc</strong> [describe]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdDestroy" title="evennia.commands.default.building.CmdDestroy"><span class="xref myst py py-class"><strong>destroy</strong> [delete, del]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdDestroy" title="evennia.commands.default.building.CmdDestroy"><span class="xref myst py py-class"><strong>destroy</strong> [del, delete]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdDig" title="evennia.commands.default.building.CmdDig"><span class="xref myst py py-class"><strong>dig</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.general.html#evennia.commands.default.general.CmdDrop" title="evennia.commands.default.general.CmdDrop"><span class="xref myst py py-class"><strong>drop</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.unloggedin.html#evennia.commands.default.unloggedin.CmdUnconnectedEncoding" title="evennia.commands.default.unloggedin.CmdUnconnectedEncoding"><span class="xref myst py py-class"><strong>encoding</strong> [encode]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_unloggedin.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet" title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><span class="xref myst py py-class">UnloggedinCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdExamine" title="evennia.commands.default.building.CmdExamine"><span class="xref myst py py-class"><strong>examine</strong> [ex, exam]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdFind" title="evennia.commands.default.building.CmdFind"><span class="xref myst py py-class"><strong>find</strong> [locate, search]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdFind" title="evennia.commands.default.building.CmdFind"><span class="xref myst py py-class"><strong>find</strong> [search, locate]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.general.html#evennia.commands.default.general.CmdGet" title="evennia.commands.default.general.CmdGet"><span class="xref myst py py-class"><strong>get</strong> [grab]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.general.html#evennia.commands.default.general.CmdGive" title="evennia.commands.default.general.CmdGive"><span class="xref myst py py-class"><strong>give</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdGrapevine2Chan" title="evennia.commands.default.comms.CmdGrapevine2Chan"><span class="xref myst py py-class"><strong>grapevine2chan</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
@ -105,7 +105,7 @@ with <a class="reference internal" href="EvEditor.html"><span class="doc std std
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdMvAttr" title="evennia.commands.default.building.CmdMvAttr"><span class="xref myst py py-class"><strong>mvattr</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdName" title="evennia.commands.default.building.CmdName"><span class="xref myst py py-class"><strong>name</strong> [rename]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.general.html#evennia.commands.default.general.CmdNick" title="evennia.commands.default.general.CmdNick"><span class="xref myst py py-class"><strong>nick</strong> [nickname, nicks]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdObjects" title="evennia.commands.default.system.CmdObjects"><span class="xref myst py py-class"><strong>objects</strong> [stats, db, listobjs, listobjects]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdObjects" title="evennia.commands.default.system.CmdObjects"><span class="xref myst py py-class"><strong>objects</strong> [listobjs, listobjects, db, stats]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdOOC" title="evennia.commands.default.account.CmdOOC"><span class="xref myst py py-class"><strong>ooc</strong> [unpuppet]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdOpen" title="evennia.commands.default.building.CmdOpen"><span class="xref myst py py-class"><strong>open</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdOption" title="evennia.commands.default.account.CmdOption"><span class="xref myst py py-class"><strong>option</strong> [options]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>
@ -115,7 +115,7 @@ with <a class="reference internal" href="EvEditor.html"><span class="doc std std
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdPy" title="evennia.commands.default.system.CmdPy"><span class="xref myst py py-class"><strong>py</strong> [!]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdQuell" title="evennia.commands.default.account.CmdQuell"><span class="xref myst py py-class"><strong>quell</strong> [unquell]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdQuit" title="evennia.commands.default.account.CmdQuit"><span class="xref myst py py-class"><strong>quit</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.unloggedin.html#evennia.commands.default.unloggedin.CmdUnconnectedQuit" title="evennia.commands.default.unloggedin.CmdUnconnectedQuit"><span class="xref myst py py-class"><strong>quit</strong> [qu, q]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_unloggedin.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet" title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><span class="xref myst py py-class">UnloggedinCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.unloggedin.html#evennia.commands.default.unloggedin.CmdUnconnectedQuit" title="evennia.commands.default.unloggedin.CmdUnconnectedQuit"><span class="xref myst py py-class"><strong>quit</strong> [q, qu]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_unloggedin.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet" title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><span class="xref myst py py-class">UnloggedinCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdReload" title="evennia.commands.default.system.CmdReload"><span class="xref myst py py-class"><strong>reload</strong> [restart]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdReset" title="evennia.commands.default.system.CmdReset"><span class="xref myst py py-class"><strong>reset</strong> [reboot]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.comms.html#evennia.commands.default.comms.CmdRSS2Chan" title="evennia.commands.default.comms.CmdRSS2Chan"><span class="xref myst py py-class"><strong>rss2chan</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>Comms</em>)</p></li>
@ -138,7 +138,7 @@ with <a class="reference internal" href="EvEditor.html"><span class="doc std std
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdTickers" title="evennia.commands.default.system.CmdTickers"><span class="xref myst py py-class"><strong>tickers</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdTime" title="evennia.commands.default.system.CmdTime"><span class="xref myst py py-class"><strong>time</strong> [uptime]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>System</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdTunnel" title="evennia.commands.default.building.CmdTunnel"><span class="xref myst py py-class"><strong>tunnel</strong> [tun]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdTypeclass" title="evennia.commands.default.building.CmdTypeclass"><span class="xref myst py py-class"><strong>typeclass</strong> [parent, update, type, swap]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdTypeclass" title="evennia.commands.default.building.CmdTypeclass"><span class="xref myst py py-class"><strong>typeclass</strong> [type, update, parent, swap]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.building.html#evennia.commands.default.building.CmdUnLink" title="evennia.commands.default.building.CmdUnLink"><span class="xref myst py py-class"><strong>unlink</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>Building</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.general.html#evennia.commands.default.general.CmdWhisper" title="evennia.commands.default.general.CmdWhisper"><span class="xref myst py py-class"><strong>whisper</strong></span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_character.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><span class="xref myst py py-class">CharacterCmdSet</span></a>, help-category: <em>General</em>)</p></li>
<li><p><a class="reference internal" href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdWho" title="evennia.commands.default.account.CmdWho"><span class="xref myst py py-class"><strong>who</strong> [doing]</span></a> (cmdset: <a class="reference internal" href="api/evennia.commands.default.cmdset_account.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><span class="xref myst py py-class">AccountCmdSet</span></a>, help-category: <em>General</em>)</p></li>

View file

@ -14,11 +14,11 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using
[Batch-Processor](./Batch-Processors.md)'s interactive mode.
```
- [**__unloggedin_look_command** [look, l]](evennia.commands.default.unloggedin.CmdUnconnectedLook) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_)
- [**__unloggedin_look_command** [l, look]](evennia.commands.default.unloggedin.CmdUnconnectedLook) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_)
- [**about** [version]](evennia.commands.default.system.CmdAbout) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_)
- [**access** [hierarchy, groups]](evennia.commands.default.general.CmdAccess) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_)
- [**accounts** [listaccounts, account]](evennia.commands.default.system.CmdAccounts) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_)
- [**addcom** [aliaschan, chanalias]](evennia.commands.default.comms.CmdAddCom) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**accounts** [account, listaccounts]](evennia.commands.default.system.CmdAccounts) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_)
- [**addcom** [chanalias, aliaschan]](evennia.commands.default.comms.CmdAddCom) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**alias** [setobjalias]](evennia.commands.default.building.CmdSetObjAlias) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**allcom**](evennia.commands.default.comms.CmdAllCom) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**batchcode** [batchcodes]](evennia.commands.default.batchprocess.CmdBatchCode) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
@ -28,7 +28,7 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using
- [**cdesc**](evennia.commands.default.comms.CmdCdesc) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**cdestroy**](evennia.commands.default.comms.CmdCdestroy) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**cemit** [cmsg]](evennia.commands.default.comms.CmdCemit) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**channels** [channellist, clist, comlist, all channels, chanlist]](evennia.commands.default.comms.CmdChannels) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**channels** [all channels, chanlist, channellist, clist, comlist]](evennia.commands.default.comms.CmdChannels) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**charcreate**](evennia.commands.default.account.CmdCharCreate) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)
- [**chardelete**](evennia.commands.default.account.CmdCharDelete) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)
- [**clock**](evennia.commands.default.comms.CmdClock) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
@ -42,12 +42,12 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using
- [**cwho**](evennia.commands.default.comms.CmdCWho) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**delcom** [delchanalias, delaliaschan]](evennia.commands.default.comms.CmdDelCom) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
- [**desc** [describe]](evennia.commands.default.building.CmdDesc) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**destroy** [delete, del]](evennia.commands.default.building.CmdDestroy) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**destroy** [del, delete]](evennia.commands.default.building.CmdDestroy) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**dig**](evennia.commands.default.building.CmdDig) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**drop**](evennia.commands.default.general.CmdDrop) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_)
- [**encoding** [encode]](evennia.commands.default.unloggedin.CmdUnconnectedEncoding) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_)
- [**examine** [ex, exam]](evennia.commands.default.building.CmdExamine) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Building_)
- [**find** [locate, search]](evennia.commands.default.building.CmdFind) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**find** [search, locate]](evennia.commands.default.building.CmdFind) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**get** [grab]](evennia.commands.default.general.CmdGet) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_)
- [**give**](evennia.commands.default.general.CmdGive) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_)
- [**grapevine2chan**](evennia.commands.default.comms.CmdGrapevine2Chan) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
@ -66,7 +66,7 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using
- [**mvattr**](evennia.commands.default.building.CmdMvAttr) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**name** [rename]](evennia.commands.default.building.CmdName) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**nick** [nickname, nicks]](evennia.commands.default.general.CmdNick) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)
- [**objects** [stats, db, listobjs, listobjects]](evennia.commands.default.system.CmdObjects) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_)
- [**objects** [listobjs, listobjects, db, stats]](evennia.commands.default.system.CmdObjects) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_)
- [**ooc** [unpuppet]](evennia.commands.default.account.CmdOOC) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)
- [**open**](evennia.commands.default.building.CmdOpen) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**option** [options]](evennia.commands.default.account.CmdOption) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)
@ -76,7 +76,7 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using
- [**py** [!]](evennia.commands.default.system.CmdPy) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _System_)
- [**quell** [unquell]](evennia.commands.default.account.CmdQuell) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)
- [**quit**](evennia.commands.default.account.CmdQuit) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)
- [**quit** [qu, q]](evennia.commands.default.unloggedin.CmdUnconnectedQuit) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_)
- [**quit** [q, qu]](evennia.commands.default.unloggedin.CmdUnconnectedQuit) (cmdset: [UnloggedinCmdSet](evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet), help-category: _General_)
- [**reload** [restart]](evennia.commands.default.system.CmdReload) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _System_)
- [**reset** [reboot]](evennia.commands.default.system.CmdReset) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _System_)
- [**rss2chan**](evennia.commands.default.comms.CmdRSS2Chan) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _Comms_)
@ -99,7 +99,7 @@ with [EvEditor](./EvEditor.md), flipping pages in [EvMore](./EvMore.md) or using
- [**tickers**](evennia.commands.default.system.CmdTickers) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_)
- [**time** [uptime]](evennia.commands.default.system.CmdTime) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _System_)
- [**tunnel** [tun]](evennia.commands.default.building.CmdTunnel) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**typeclass** [parent, update, type, swap]](evennia.commands.default.building.CmdTypeclass) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**typeclass** [type, update, parent, swap]](evennia.commands.default.building.CmdTypeclass) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**unlink**](evennia.commands.default.building.CmdUnLink) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _Building_)
- [**whisper**](evennia.commands.default.general.CmdWhisper) (cmdset: [CharacterCmdSet](evennia.commands.default.cmdset_character.CharacterCmdSet), help-category: _General_)
- [**who** [doing]](evennia.commands.default.account.CmdWho) (cmdset: [AccountCmdSet](evennia.commands.default.cmdset_account.AccountCmdSet), help-category: _General_)

View file

@ -241,7 +241,7 @@ to accounts respectively.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdEmit.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['remit', 'pemit']</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['pemit', 'remit']</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -496,7 +496,7 @@ You can specify the /force switch to bypass this confirmation.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdDestroy.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['delete', 'del']</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['del', 'delete']</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1186,7 +1186,7 @@ server settings.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTypeclass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['parent', 'update', 'type', 'swap']</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['type', 'update', 'parent', 'swap']</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1481,7 +1481,7 @@ one is given.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdFind.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['locate', 'search']</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['search', 'locate']</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -66,7 +66,7 @@ aliases to an already joined channel.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdAddCom.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['aliaschan', 'chanalias']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAddCom.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['chanalias', 'aliaschan']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAddCom.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -221,7 +221,7 @@ Use addcom/delcom to join and leave channels</p>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdChannels.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['channellist', 'clist', 'comlist', 'all channels', 'chanlist']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannels.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['all channels', 'chanlist', 'channellist', 'clist', 'comlist']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannels.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -351,7 +351,7 @@ given, &lt;nr&gt; defaults to 10.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdObjects.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['stats', 'db', 'listobjs', 'listobjects']</em><a class="headerlink" href="#evennia.commands.default.system.CmdObjects.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['listobjs', 'listobjects', 'db', 'stats']</em><a class="headerlink" href="#evennia.commands.default.system.CmdObjects.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -611,7 +611,7 @@ If not given, &lt;nr&gt; defaults to 10.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdAccounts.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['listaccounts', 'account']</em><a class="headerlink" href="#evennia.commands.default.system.CmdAccounts.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['account', 'listaccounts']</em><a class="headerlink" href="#evennia.commands.default.system.CmdAccounts.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -165,7 +165,7 @@ version is a bit more complicated.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedQuit.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['qu', 'q']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedQuit.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['q', 'qu']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedQuit.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -210,7 +210,7 @@ All it does is display the connect screen.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['look', 'l']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'look']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -173,7 +173,7 @@ version is a bit more complicated.</p>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedQuit.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['qu', 'q']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedQuit.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['q', 'qu']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedQuit.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -213,7 +213,7 @@ All it does is display the connect screen.</p>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['look', 'l']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'look']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -54,7 +54,7 @@
<dl class="py attribute">
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;callback', '&#64;callbacks', '&#64;calls']</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;callbacks', '&#64;callback', '&#64;calls']</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -775,7 +775,7 @@ Using the command without arguments will list all current recogs.</p>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdRecog.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['forget', 'recognize']</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdRecog.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['recognize', 'forget']</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdRecog.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">

View file

@ -562,7 +562,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -679,7 +679,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -713,7 +713,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -585,7 +585,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -997,7 +997,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -107,7 +107,7 @@ push the lid of the button away.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['press button', 'press', 'push']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['press', 'press button', 'push']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -155,7 +155,7 @@ lid-state respectively.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdSmashGlass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['smash lid', 'break lid', 'smash']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdSmashGlass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['smash', 'smash lid', 'break lid']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdSmashGlass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -198,7 +198,7 @@ of causing the lamp to break.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['open button', 'open']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['open', 'open button']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -284,7 +284,7 @@ of causing the lamp to break.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['examine', 'listen', 'l', 'ex', 'get', 'feel']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['listen', 'feel', 'l', 'examine', 'ex', 'get']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -479,7 +479,7 @@ shift green root up/down</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdShiftRoot.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['move', 'shiftroot', 'pull', 'push']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['push', 'move', 'pull', 'shiftroot']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -527,7 +527,7 @@ yellow/green - horizontal roots</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdPressButton.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['press button', 'push button', 'button']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdPressButton.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['push button', 'press button', 'button']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdPressButton.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -692,7 +692,7 @@ parry - forgoes your attack but will make you harder to hit on next</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdAttack.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['stab', 'kill', 'hit', 'thrust', 'chop', 'defend', 'parry', 'pierce', 'bash', 'fight', 'slash']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['hit', 'bash', 'fight', 'chop', 'parry', 'defend', 'kill', 'thrust', 'stab', 'pierce', 'slash']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -822,7 +822,7 @@ to find something.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdLookDark.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['fiddle', 'l', 'feel around', 'search', 'feel']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['feel', 'feel around', 'l', 'search', 'fiddle']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -267,7 +267,7 @@ indentation.</p>
<dl class="py attribute">
<dt id="evennia.utils.eveditor.CmdEditorGroup.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = [':s', ':y', ':q!', ':f', ':', ':wq', ':h', ':!', ':p', ':I', ':&gt;', ':echo', ':dw', ':S', ':w', ':uu', ':x', ':dd', ':UU', ':=', ':r', '::', ':&lt;', ':u', ':q', ':DD', ':::', ':A', ':i', ':fi', ':fd', ':j']</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = [':f', ':q!', ':p', ':q', ':y', ':S', ':=', ':UU', ':dw', ':A', ':w', ':fd', ':h', ':::', ':&lt;', ':wq', ':fi', ':u', ':I', ':!', ':', ':echo', '::', ':uu', ':&gt;', ':s', ':j', ':x', ':r', ':DD', ':dd', ':i']</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -77,7 +77,7 @@ the <strong>caller.msg()</strong> construct every time the page is updated.</p>
<dl class="py attribute">
<dt id="evennia.utils.evmore.CmdMore.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['back', 'a', 'next', 'abort', 'quit', 'b', 'e', 't', 'end', 'n', 'top', 'q']</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['abort', 'quit', 'a', 'back', 'top', 'end', 'q', 'e', 'next', 'n', 'b', 't']</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">

View file

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 4172de01fa675de362f3dc4707266eb8
config: 06d5db3adbc20a04c3c7c763dd6618db
tags: 645f666f9bcd5a90fca523b33c5a78b7

View file

@ -218,6 +218,22 @@ to allow custom packing/unpacking of nested dbobjs, to allow storing in Attribut
now return <code class="docutils literal notranslate"><span class="pre">None</span></code> instead of <code class="docutils literal notranslate"><span class="pre">.db.desc</span></code> if no sdesc is set; fallback in hook (inspectorCaracal)</p></li>
<li><p>Reworked text2html parser to avoid problems with stateful color tags (inspectorCaracal)</p></li>
<li><p>Simplified <code class="docutils literal notranslate"><span class="pre">EvMenu.options_formatter</span></code> hook to use <code class="docutils literal notranslate"><span class="pre">EvColumn</span></code> and f-strings (inspectorcaracal)</p></li>
<li><p>Added <code class="docutils literal notranslate"><span class="pre">move_type</span></code> str kwarg to <code class="docutils literal notranslate"><span class="pre">move_to()</span></code> calls, optionally identifying the type of
move being done (teleport, disembark, give etc). (volund)</p></li>
<li><p>Made RPSystem contrib msg calls pass <code class="docutils literal notranslate"><span class="pre">pose</span></code> or <code class="docutils literal notranslate"><span class="pre">say</span></code> as msg-<code class="docutils literal notranslate"><span class="pre">type</span></code> for use in
e.g. webclient pane filtering where desired. (volund)</p></li>
<li><p>Fixed bug in <code class="docutils literal notranslate"><span class="pre">cmdset.remove()</span></code> where a command could not be deleted by <code class="docutils literal notranslate"><span class="pre">key</span></code>,
even though doc suggested one could (ChrisLR)</p></li>
<li><p>New contrib <code class="docutils literal notranslate"><span class="pre">name_generator</span></code> for building random real-world based or fantasy-names
based on phonetic rules.</p></li>
<li><p>Enable proper serialization of dict subclasses in Attributes (aogier)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">object.search</span></code> fuzzy-matching now uses <code class="docutils literal notranslate"><span class="pre">icontains</span></code> instead of <code class="docutils literal notranslate"><span class="pre">istartswith</span></code>
to better match how search works elsewhere (volund)</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">.at_traverse</span></code> hook now receives a <code class="docutils literal notranslate"><span class="pre">exit_obj</span></code> kwarg, linking back to the
exit triggering the hook (volund)</p></li>
<li><p>Contrib <code class="docutils literal notranslate"><span class="pre">buffs</span></code> for managing temporary and permanent RPG status buffs effects (tegiminis)</p></li>
<li><p>New <code class="docutils literal notranslate"><span class="pre">at_server_init()</span></code> hook called before all other startup hooks for all
startup modes. Used for more generic overriding (volund)</p></li>
</ul>
</section>
<section id="evennia-0-9-5">

View file

@ -0,0 +1,520 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Buffs &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Dice roller" href="Contrib-Dice.html" />
<link rel="prev" title="XYZgrid" href="Contrib-XYZGrid.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Dice.html" title="Dice roller"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="Contrib-XYZGrid.html" title="XYZgrid"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" accesskey="U">Contribs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Buffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section class="tex2jax_ignore mathjax_ignore" id="buffs">
<h1>Buffs<a class="headerlink" href="#buffs" title="Permalink to this headline"></a></h1>
<p>Contribution by Tegiminis 2022</p>
<p>A buff is a timed object, attached to a game entity. It is capable of modifying values, triggering code, or both.
It is a common design pattern in RPGs, particularly action games.</p>
<p>Features:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">BuffHandler</span></code>: A buff handler to apply to your objects.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">BaseBuff</span></code>: A buff class to extend from to create your own buffs.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">BuffableProperty</span></code>: A sample property class to show how to automatically check modifiers.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">CmdBuff</span></code>: A command which applies buffs.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">samplebuffs.py</span></code>: Some sample buffs to learn from.</p></li>
</ul>
<section id="quick-start">
<h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to this headline"></a></h2>
<p>Assign the handler to a property on the object, like so.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">buffs</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">BuffHandler</span><span class="p">:</span>
<span class="k">return</span> <span class="n">BuffHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
</pre></div>
</div>
<p>You may then call the handler to add or manipulate buffs like so: <code class="docutils literal notranslate"><span class="pre">object.buffs</span></code>. See <strong>Using the Handler</strong>.</p>
<section id="customization">
<h3>Customization<a class="headerlink" href="#customization" title="Permalink to this headline"></a></h3>
<p>If you want to customize the handler, you can feed the constructor two arguments:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">dbkey</span></code>: The string you wish to use as the attribute key for the buff database. Defaults to “buffs”. This allows you to keep separate buff pools - for example, “buffs” and “perks”.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">autopause</span></code>: If you want this handler to automatically pause playtime buffs when its owning object is unpuppeted.</p></li>
</ul>
<blockquote>
<div><p><strong>Note</strong>: If you enable autopausing, you MUST initialize the property in your owning objects
<code class="docutils literal notranslate"><span class="pre">at_init</span></code> hook. Otherwise, a hot reload can cause playtime buffs to not update properly
on puppet/unpuppet. You have been warned!</p>
</div></blockquote>
<p>Lets say you want another handler for an object, <code class="docutils literal notranslate"><span class="pre">perks</span></code>, which has a separate database and
respects playtime buffs. Youd assign this new property as so:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">BuffableObject</span><span class="p">(</span><span class="n">Object</span><span class="p">):</span>
<span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">perks</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">BuffHandler</span><span class="p">:</span>
<span class="k">return</span> <span class="n">BuffHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dbkey</span><span class="o">=</span><span class="s1">&#39;perks&#39;</span><span class="p">,</span> <span class="n">autopause</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">at_init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">perks</span>
</pre></div>
</div>
</section>
</section>
<section id="using-the-handler">
<h2>Using the Handler<a class="headerlink" href="#using-the-handler" title="Permalink to this headline"></a></h2>
<p>Heres how to make use of your new handler.</p>
<section id="apply-a-buff">
<h3>Apply a Buff<a class="headerlink" href="#apply-a-buff" title="Permalink to this headline"></a></h3>
<p>Call the handlers <code class="docutils literal notranslate"><span class="pre">add</span></code> method. This requires a class reference, and also contains a number of
optional arguments to customize the buffs duration, stacks, and so on. You can also store any arbitrary value
in the buffs cache by passing a dictionary through the <code class="docutils literal notranslate"><span class="pre">to_cache</span></code> optional argument. This will not overwrite the normal
values on the cache.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StrengthBuff</span><span class="p">)</span> <span class="c1"># A single stack of StrengthBuff with normal duration</span>
<span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">DexBuff</span><span class="p">,</span> <span class="n">stacks</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">duration</span><span class="o">=</span><span class="mi">60</span><span class="p">)</span> <span class="c1"># Three stacks of DexBuff, with a duration of 60 seconds</span>
<span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ReflectBuff</span><span class="p">,</span> <span class="n">to_cache</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;reflect&#39;</span><span class="p">:</span> <span class="mf">0.5</span><span class="p">})</span> <span class="c1"># A single stack of ReflectBuff, with an extra cache value</span>
</pre></div>
</div>
<p>Two important attributes on the buff are checked when the buff is applied: <code class="docutils literal notranslate"><span class="pre">refresh</span></code> and <code class="docutils literal notranslate"><span class="pre">unique</span></code>.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">refresh</span></code> (default: True) determines if a buffs timer is refreshed when it is reapplied.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">unique</span></code> (default: True) determines if this buff is unique; that is, only one of it exists on the object.</p></li>
</ul>
<p>The combination of these two booleans creates one of three kinds of keys:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">Unique</span> <span class="pre">is</span> <span class="pre">True,</span> <span class="pre">Refresh</span> <span class="pre">is</span> <span class="pre">True/False</span></code>: The buffs default key.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">Unique</span> <span class="pre">is</span> <span class="pre">False,</span> <span class="pre">Refresh</span> <span class="pre">is</span> <span class="pre">True</span></code>: The default key mixed with the appliers dbref. This makes the buff “unique-per-player”, so you can refresh through reapplication.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">Unique</span> <span class="pre">is</span> <span class="pre">False,</span> <span class="pre">Refresh</span> <span class="pre">is</span> <span class="pre">False</span></code>: The default key mixed with a randomized number.</p></li>
</ul>
</section>
<section id="get-buffs">
<h3>Get Buffs<a class="headerlink" href="#get-buffs" title="Permalink to this headline"></a></h3>
<p>The handler has several getter methods which return instanced buffs. You wont need to use these for basic functionality, but if you want to manipulate
buffs after application, they are very useful. The handlers <code class="docutils literal notranslate"><span class="pre">check</span></code>/<code class="docutils literal notranslate"><span class="pre">trigger</span></code> methods utilize some of these getters, while others are just for developer convenience.</p>
<p><code class="docutils literal notranslate"><span class="pre">get(key)</span></code> is the most basic getter. It returns a single buff instance, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if the buff doesnt exist on the handler. It is also the only getter
that returns a single buff instance, rather than a dictionary.</p>
<p>Group getters, listed below, return a dictionary of values in the format <code class="docutils literal notranslate"><span class="pre">{buffkey:</span> <span class="pre">instance}</span></code>. If you want to iterate over all of these buffs,
you should do so via the <code class="docutils literal notranslate"><span class="pre">dict.values()</span></code> method.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">get_all()</span></code> returns all buffs on this handler. You can also use the <code class="docutils literal notranslate"><span class="pre">handler.all</span></code> property.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">get_by_type(BuffClass)</span></code> returns buffs of the specified type.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">get_by_stat(stat)</span></code> returns buffs with a <code class="docutils literal notranslate"><span class="pre">Mod</span></code> object of the specified <code class="docutils literal notranslate"><span class="pre">stat</span></code> string in their <code class="docutils literal notranslate"><span class="pre">mods</span></code> list.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">get_by_trigger(string)</span></code> returns buffs with the specified string in their <code class="docutils literal notranslate"><span class="pre">triggers</span></code> list.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">get_by_source(Object)</span></code> returns buffs applied by the specified <code class="docutils literal notranslate"><span class="pre">source</span></code> object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">get_by_cachevalue(key,</span> <span class="pre">value)</span></code> returns buffs with the matching <code class="docutils literal notranslate"><span class="pre">key:</span> <span class="pre">value</span></code> pair in their cache. <code class="docutils literal notranslate"><span class="pre">value</span></code> is optional.</p></li>
</ul>
<p>All group getters besides <code class="docutils literal notranslate"><span class="pre">get_all()</span></code> can “slice” an existing dictionary through the optional <code class="docutils literal notranslate"><span class="pre">to_filter</span></code> argument.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">dict1</span> <span class="o">=</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">Burned</span><span class="p">)</span> <span class="c1"># This finds all &quot;Burned&quot; buffs on the handler</span>
<span class="n">dict2</span> <span class="o">=</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_source</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">to_filter</span><span class="o">=</span><span class="n">dict1</span><span class="p">)</span> <span class="c1"># This filters dict1 to find buffs with the matching source</span>
</pre></div>
</div>
<blockquote>
<div><p><strong>Note</strong>: Most of these getters also have an associated handler property. For example, <code class="docutils literal notranslate"><span class="pre">handler.effects</span></code> returns all buffs that can be triggered, which
is then iterated over by the <code class="docutils literal notranslate"><span class="pre">get_by_trigger</span></code> method.</p>
</div></blockquote>
</section>
<section id="remove-buffs">
<h3>Remove Buffs<a class="headerlink" href="#remove-buffs" title="Permalink to this headline"></a></h3>
<p>There are also a number of remover methods. Generally speaking, these follow the same format as the getters.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">remove(key)</span></code> removes the buff with the specified key.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">clear()</span></code> removes all buffs.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">remove_by_type(BuffClass)</span></code> removes buffs of the specified type.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">remove_by_stat(stat)</span></code> removes buffs with a <code class="docutils literal notranslate"><span class="pre">Mod</span></code> object of the specified <code class="docutils literal notranslate"><span class="pre">stat</span></code> string in their <code class="docutils literal notranslate"><span class="pre">mods</span></code> list.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">remove_by_trigger(string)</span></code> removes buffs with the specified string in their <code class="docutils literal notranslate"><span class="pre">triggers</span></code> list.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">remove_by_source(Object)</span></code> removes buffs applied by the specified source</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">remove_by_cachevalue(key,</span> <span class="pre">value)</span></code> removes buffs with the matching <code class="docutils literal notranslate"><span class="pre">key:</span> <span class="pre">value</span></code> pair in their cache. <code class="docutils literal notranslate"><span class="pre">value</span></code> is optional.</p></li>
</ul>
<p>You can also remove a buff by calling the instances <code class="docutils literal notranslate"><span class="pre">remove</span></code> helper method. You can do this on the dictionaries returned by the
getters listed above.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">to_remove</span> <span class="o">=</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_trigger</span><span class="p">(</span><span class="n">trigger</span><span class="p">)</span> <span class="c1"># Finds all buffs with the specified trigger</span>
<span class="k">for</span> <span class="n">buff</span> <span class="ow">in</span> <span class="n">to_remove</span><span class="o">.</span><span class="n">values</span><span class="p">():</span> <span class="c1"># Removes all buffs in the to_remove dictionary via helper methods</span>
<span class="n">buff</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
</pre></div>
</div>
</section>
<section id="check-modifiers">
<h3>Check Modifiers<a class="headerlink" href="#check-modifiers" title="Permalink to this headline"></a></h3>
<p>Call the handler <code class="docutils literal notranslate"><span class="pre">check(value,</span> <span class="pre">stat)</span></code> method when you want to see the modified value.
This will return the <code class="docutils literal notranslate"><span class="pre">value</span></code>, modified by any relevant buffs on the handlers owner (identified by
the <code class="docutils literal notranslate"><span class="pre">stat</span></code> string).</p>
<p>For example, lets say you want to modify how much damage you take. That might look something like this:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># The method we call to damage ourselves</span>
<span class="k">def</span> <span class="nf">take_damage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source</span><span class="p">,</span> <span class="n">damage</span><span class="p">):</span>
<span class="n">_damage</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">damage</span><span class="p">,</span> <span class="s1">&#39;taken_damage&#39;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">health</span> <span class="o">-=</span> <span class="n">_damage</span>
</pre></div>
</div>
<p>This method calls the <code class="docutils literal notranslate"><span class="pre">at_pre_check</span></code> and <code class="docutils literal notranslate"><span class="pre">at_post_check</span></code> methods at the relevant points in the process. You can use to this make
buffs that are reactive to being checked; for example, removing themselves, altering their values, or interacting with the game state.</p>
<blockquote>
<div><p><strong>Note</strong>: You can also trigger relevant buffs at the same time as you check them by ensuring the optional argument <code class="docutils literal notranslate"><span class="pre">trigger</span></code> is True in the <code class="docutils literal notranslate"><span class="pre">check</span></code> method.</p>
</div></blockquote>
</section>
<section id="trigger-buffs">
<h3>Trigger Buffs<a class="headerlink" href="#trigger-buffs" title="Permalink to this headline"></a></h3>
<p>Call the handlers <code class="docutils literal notranslate"><span class="pre">trigger(string)</span></code> method when you want an event call. This will call the <code class="docutils literal notranslate"><span class="pre">at_trigger</span></code> hook method on all buffs with the relevant trigger <code class="docutils literal notranslate"><span class="pre">string</span></code>.</p>
<p>For example, lets say you want to trigger a buff to “detonate” when you hit your target with an attack.
Youd write a buff that might look like this:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Detonate</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;take_damage&#39;</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">take_damage</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
</pre></div>
</div>
<p>And then call <code class="docutils literal notranslate"><span class="pre">handler.trigger('take_damage')</span></code> in the method you use to take damage.</p>
<blockquote>
<div><p><strong>Note</strong> You could also do this through mods and <code class="docutils literal notranslate"><span class="pre">at_post_check</span></code> if you like, depending on how to want to add the damage.</p>
</div></blockquote>
</section>
<section id="ticking">
<h3>Ticking<a class="headerlink" href="#ticking" title="Permalink to this headline"></a></h3>
<p>Ticking buffs are slightly special. They are similar to trigger buffs in that they run code, but instead of
doing so on an event trigger, they do so on a periodic tick. A common use case for a buff like this is a poison,
or a heal over time.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Poison</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">tickrate</span> <span class="o">=</span> <span class="mi">5</span>
<span class="k">def</span> <span class="nf">at_tick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">initial</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">_dmg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">dmg</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">stacks</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">initial</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">(</span>
<span class="s2">&quot;Poison courses through </span><span class="si">{actor}</span><span class="s2">&#39;s body, dealing </span><span class="si">{damage}</span><span class="s2"> damage.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
<span class="n">actor</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">named</span><span class="p">,</span> <span class="n">damage</span><span class="o">=</span><span class="n">_dmg</span>
<span class="p">)</span>
<span class="p">)</span>
</pre></div>
</div>
<p>To make a buff ticking, ensure the <code class="docutils literal notranslate"><span class="pre">tickrate</span></code> is 1 or higher, and it has code in its <code class="docutils literal notranslate"><span class="pre">at_tick</span></code>
method. Once you add it to the handler, it starts ticking!</p>
<blockquote>
<div><p><strong>Note</strong>: Ticking buffs always tick on initial application, when <code class="docutils literal notranslate"><span class="pre">initial</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>. If you dont want your hook to fire at that time,
make sure to check the value of <code class="docutils literal notranslate"><span class="pre">initial</span></code> in your <code class="docutils literal notranslate"><span class="pre">at_tick</span></code> method.</p>
</div></blockquote>
</section>
<section id="context">
<h3>Context<a class="headerlink" href="#context" title="Permalink to this headline"></a></h3>
<p>Every important handler method optionally accepts a <code class="docutils literal notranslate"><span class="pre">context</span></code> dictionary.</p>
<p>Context is an important concept for this handler. Every method which checks, triggers, or ticks a buff passes this
dictionary (default: empty) to the buff hook methods as keyword arguments (<code class="docutils literal notranslate"><span class="pre">**kwargs</span></code>). It is used for nothing else. This allows you to make those
methods “event-aware” by storing relevant data in the dictionary you feed to the method.</p>
<p>For example, lets say you want a “thorns” buff which damages enemies that attack you. Lets take our <code class="docutils literal notranslate"><span class="pre">take_damage</span></code> method
and add a context to the mix.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">take_damage</span><span class="p">(</span><span class="n">attacker</span><span class="p">,</span> <span class="n">damage</span><span class="p">):</span>
<span class="n">context</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;attacker&#39;</span><span class="p">:</span> <span class="n">attacker</span><span class="p">,</span> <span class="s1">&#39;damage&#39;</span><span class="p">:</span> <span class="n">damage</span><span class="p">}</span>
<span class="n">_damage</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">damage</span><span class="p">,</span> <span class="s1">&#39;taken_damage&#39;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="n">context</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s1">&#39;taken_damage&#39;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="n">context</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">health</span> <span class="o">-=</span> <span class="n">_damage</span>
</pre></div>
</div>
<p>Now we use the values that context passes to the buff kwargs to customize our logic.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">ThornsBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;taken_damage&#39;</span><span class="p">]</span>
<span class="c1"># This is the hook method on our thorns buff</span>
<span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">,</span> <span class="n">attacker</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">damage</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">attacker</span><span class="p">:</span>
<span class="k">return</span>
<span class="n">attacker</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">health</span> <span class="o">-=</span> <span class="n">damage</span> <span class="o">*</span> <span class="mf">0.2</span>
</pre></div>
</div>
<p>Apply the buff, take damage, and watch the thorns buff do its work!</p>
</section>
</section>
<section id="creating-new-buffs">
<h2>Creating New Buffs<a class="headerlink" href="#creating-new-buffs" title="Permalink to this headline"></a></h2>
<p>Creating a new buff is very easy: extend <code class="docutils literal notranslate"><span class="pre">BaseBuff</span></code> into a new class, and fill in all the relevant buff details.
However, there are a lot of individual moving parts to a buff. Heres a step-through of the important stuff.</p>
<section id="basics">
<h3>Basics<a class="headerlink" href="#basics" title="Permalink to this headline"></a></h3>
<p>Regardless of any other functionality, all buffs have the following class attributes:</p>
<ul class="simple">
<li><p>They have customizable <code class="docutils literal notranslate"><span class="pre">key</span></code>, <code class="docutils literal notranslate"><span class="pre">name</span></code>, and <code class="docutils literal notranslate"><span class="pre">flavor</span></code> strings.</p></li>
<li><p>They have a <code class="docutils literal notranslate"><span class="pre">duration</span></code> (float), and automatically clean-up at the end. Use -1 for infinite duration, and 0 to clean-up immediately. (default: -1)</p></li>
<li><p>They can stack, if <code class="docutils literal notranslate"><span class="pre">maxstacks</span></code> (int) is not equal to 1. If its 0, the buff stacks forever. (default: 1)</p></li>
<li><p>They can be <code class="docutils literal notranslate"><span class="pre">unique</span></code> (bool), which determines if they have a unique namespace or not. (default: True)</p></li>
<li><p>They can <code class="docutils literal notranslate"><span class="pre">refresh</span></code> (bool), which resets the duration when stacked or reapplied. (default: True)</p></li>
<li><p>They can be <code class="docutils literal notranslate"><span class="pre">playtime</span></code> (bool) buffs, where duration only counts down during active play. (default: False)</p></li>
</ul>
<p>They also always store some useful mutable information about themselves in the cache:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ref</span></code> (class): The buff class path we use to construct the buff.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">start</span></code> (float): The timestamp of when the buff was applied.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">source</span></code> (Object): If specified; this allows you to track who or what applied the buff.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">prevtick</span></code> (float): The timestamp of the previous tick.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">duration</span></code> (float): The cached duration. This can vary from the class duration, depending on if the duration has been modified (paused, extended, shortened, etc).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">stacks</span></code> (int): How many stacks they have.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">paused</span></code> (bool): Paused buffs do not clean up, modify values, tick, or fire any hook methods.</p></li>
</ul>
<p>You can always access the raw cache dictionary through the <code class="docutils literal notranslate"><span class="pre">cache</span></code> attribute on an instanced buff. This is grabbed when you get the buff through
a handler method, so it may not always reflect recent changes youve made, depending on how you structure your buff calls. All of the above
mutable information can be found in this cache, as well as any arbitrary information you pass through the handler <code class="docutils literal notranslate"><span class="pre">add</span></code> method (via <code class="docutils literal notranslate"><span class="pre">to_cache</span></code>).</p>
</section>
<section id="modifiers">
<h3>Modifiers<a class="headerlink" href="#modifiers" title="Permalink to this headline"></a></h3>
<p>Mods are stored in the <code class="docutils literal notranslate"><span class="pre">mods</span></code> list attribute. Buffs which have one or more Mod objects in them can modify stats. You can use the handler method to check all
mods of a specific stat string and apply their modifications to the value; however, you are encouraged to use <code class="docutils literal notranslate"><span class="pre">check</span></code> in a getter/setter, for easy access.</p>
<p>Mod objects consist of only four values, assigned by the constructor in this order:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">stat</span></code>: The stat you want to modify. When <code class="docutils literal notranslate"><span class="pre">check</span></code> is called, this string is used to find all the mods that are to be collected.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">mod</span></code>: The modifier. Defaults are add and mult. Modifiers are calculated additively, and in standard arithmetic order (see <code class="docutils literal notranslate"><span class="pre">_calculate_mods</span></code> for more)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">value</span></code>: How much value the modifier gives regardless of stacks</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">perstack</span></code>: How much value the modifier grants per stack, INCLUDING the first. (default: 0)</p></li>
</ul>
<p>The most basic way to add a Mod to a buff is to do so in the buff class definition, like this:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">DamageBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="s1">&#39;damage&#39;</span><span class="p">,</span> <span class="s1">&#39;add&#39;</span><span class="p">,</span> <span class="mi">10</span><span class="p">)]</span>
</pre></div>
</div>
<p>No mods applied to the value are permanent in any way. All calculations are done at runtime, and the mod values are never stored
anywhere except on the buff in question. In other words: you dont need to track the origin of particular stat mods, and you will
never permanently change a stat modified by a buff. To remove the modification, simply remove the buff from the object.</p>
<blockquote>
<div><p><strong>Note</strong>: You can add your own modifier types by overloading the <code class="docutils literal notranslate"><span class="pre">_calculate_mods</span></code> method, which contains the basic modifier application logic.</p>
</div></blockquote>
<section id="generating-mods-advanced">
<h4>Generating Mods (Advanced)<a class="headerlink" href="#generating-mods-advanced" title="Permalink to this headline"></a></h4>
<p>An advanced way to do mods is to generate them when the buff is initialized. This lets you create mods on the fly that are reactive to the game state.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">GeneratedStatBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="o">...</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">buffkey</span><span class="p">,</span> <span class="n">cache</span><span class="o">=</span><span class="p">{})</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">buffkey</span><span class="p">,</span> <span class="n">cache</span><span class="p">)</span>
<span class="c1"># Finds our &quot;modgen&quot; cache value, and generates a mod from it</span>
<span class="n">modgen</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;modgen&quot;</span><span class="p">))</span>
<span class="k">if</span> <span class="n">modgen</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="o">*</span><span class="n">modgen</span><span class="p">)]</span>
</pre></div>
</div>
</section>
</section>
<section id="triggers">
<h3>Triggers<a class="headerlink" href="#triggers" title="Permalink to this headline"></a></h3>
<p>Buffs which have one or more strings in the <code class="docutils literal notranslate"><span class="pre">triggers</span></code> attribute can be triggered by events.</p>
<p>When the handlers <code class="docutils literal notranslate"><span class="pre">trigger</span></code> method is called, it searches all buffs on the handler for any with a matchingtrigger,
then calls their <code class="docutils literal notranslate"><span class="pre">at_trigger</span></code> hooks. Buffs can have multiple triggers, and you can tell which trigger was used by
the <code class="docutils literal notranslate"><span class="pre">trigger</span></code> argument in the hook.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">AmplifyBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;damage&#39;</span><span class="p">,</span> <span class="s1">&#39;heal&#39;</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="n">trigger</span> <span class="o">==</span> <span class="s1">&#39;damage&#39;</span><span class="p">:</span> <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Damage trigger called!&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">trigger</span> <span class="o">==</span> <span class="s1">&#39;heal&#39;</span><span class="p">:</span> <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Heal trigger called!&#39;</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="id1">
<h3>Ticking<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
<p>A buff which ticks isnt much different than one which triggers. Youre still executing arbitrary hooks on
the buff class. To tick, the buff must have a <code class="docutils literal notranslate"><span class="pre">tickrate</span></code> of 1 or higher.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Poison</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="o">...</span>
<span class="c1"># this buff will tick 6 times between application and cleanup.</span>
<span class="n">duration</span> <span class="o">=</span> <span class="mi">30</span>
<span class="n">tickrate</span> <span class="o">=</span> <span class="mi">5</span>
<span class="k">def</span> <span class="nf">at_tick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">initial</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">take_damage</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
</pre></div>
</div>
<blockquote>
<div><p><strong>Note</strong>: The buff always ticks once when applied. For this <strong>first tick only</strong>, <code class="docutils literal notranslate"><span class="pre">initial</span></code> will be True in the <code class="docutils literal notranslate"><span class="pre">at_tick</span></code> hook method. <code class="docutils literal notranslate"><span class="pre">initial</span></code> will be False on subsequent ticks.</p>
</div></blockquote>
<p>Ticks utilize a persistent delay, so they should be pickleable. As long as you are not adding new properties to your buff class, this shouldnt be a concern.
If you <strong>are</strong> adding new properties, try to ensure they do not end up with a circular code path to their object or handler, as this will cause pickling errors.</p>
</section>
<section id="extras">
<h3>Extras<a class="headerlink" href="#extras" title="Permalink to this headline"></a></h3>
<p>Buffs have a grab-bag of extra functionality to let you add complexity to your designs.</p>
<section id="conditionals">
<h4>Conditionals<a class="headerlink" href="#conditionals" title="Permalink to this headline"></a></h4>
<p>You can restrict whether or not the buff will <code class="docutils literal notranslate"><span class="pre">check</span></code>, <code class="docutils literal notranslate"><span class="pre">trigger</span></code>, or <code class="docutils literal notranslate"><span class="pre">tick</span></code> through defining the <code class="docutils literal notranslate"><span class="pre">conditional</span></code> hook. As long
as it returns a “truthy” value, the buff will apply itself. This is useful for making buffs dependent on game state - for
example, if you want a buff that makes the player take more damage when they are on fire:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">FireSick</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="o">...</span>
<span class="k">def</span> <span class="nf">conditional</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">FireBuff</span><span class="p">):</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="k">return</span> <span class="kc">False</span>
</pre></div>
</div>
<p>Conditionals for <code class="docutils literal notranslate"><span class="pre">check</span></code>/<code class="docutils literal notranslate"><span class="pre">trigger</span></code> are checked when the buffs are gathered by the handler methods for the respective operations. <code class="docutils literal notranslate"><span class="pre">Tick</span></code>
conditionals are checked each tick.</p>
</section>
<section id="helper-methods">
<h4>Helper Methods<a class="headerlink" href="#helper-methods" title="Permalink to this headline"></a></h4>
<p>Buff instances have a number of helper methods.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">remove</span></code>/<code class="docutils literal notranslate"><span class="pre">dispel</span></code>: Allows you to remove or dispel the buff. Calls <code class="docutils literal notranslate"><span class="pre">at_remove</span></code>/<code class="docutils literal notranslate"><span class="pre">at_dispel</span></code>, depending on optional arguments.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pause</span></code>/<code class="docutils literal notranslate"><span class="pre">unpause</span></code>: Pauses and unpauses the buff. Calls <code class="docutils literal notranslate"><span class="pre">at_pause</span></code>/<code class="docutils literal notranslate"><span class="pre">at_unpause</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">reset</span></code>: Resets the buffs start to the current time; same as “refreshing” it.</p></li>
</ul>
</section>
<section id="playtime-duration">
<h4>Playtime Duration<a class="headerlink" href="#playtime-duration" title="Permalink to this headline"></a></h4>
<p>If your handler has <code class="docutils literal notranslate"><span class="pre">autopause</span></code> enabled, any buffs with truthy <code class="docutils literal notranslate"><span class="pre">playtime</span></code> value will automatically pause
and unpause when the object the handler is attached to is puppetted or unpuppetted. This even works with ticking buffs,
although if you have less than 1 second of tick duration remaining, it will round up to 1s.</p>
<blockquote>
<div><p><strong>Note</strong>: If you want more control over this process, you can comment out the signal subscriptions on the handler and move the autopause logic
to your objects <code class="docutils literal notranslate"><span class="pre">at_pre/post_puppet/unpuppet</span></code> hooks.</p>
</div></blockquote>
<hr class="docutils" />
<p><small>This document page is generated from <code class="docutils literal notranslate"><span class="pre">evennia/contrib/rpg/buffs/README.md</span></code>. Changes to this
file will be overwritten, so edit that file rather than this one.</small></p>
</section>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<p><h3><a href="../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Buffs</a><ul>
<li><a class="reference internal" href="#quick-start">Quick Start</a><ul>
<li><a class="reference internal" href="#customization">Customization</a></li>
</ul>
</li>
<li><a class="reference internal" href="#using-the-handler">Using the Handler</a><ul>
<li><a class="reference internal" href="#apply-a-buff">Apply a Buff</a></li>
<li><a class="reference internal" href="#get-buffs">Get Buffs</a></li>
<li><a class="reference internal" href="#remove-buffs">Remove Buffs</a></li>
<li><a class="reference internal" href="#check-modifiers">Check Modifiers</a></li>
<li><a class="reference internal" href="#trigger-buffs">Trigger Buffs</a></li>
<li><a class="reference internal" href="#ticking">Ticking</a></li>
<li><a class="reference internal" href="#context">Context</a></li>
</ul>
</li>
<li><a class="reference internal" href="#creating-new-buffs">Creating New Buffs</a><ul>
<li><a class="reference internal" href="#basics">Basics</a></li>
<li><a class="reference internal" href="#modifiers">Modifiers</a><ul>
<li><a class="reference internal" href="#generating-mods-advanced">Generating Mods (Advanced)</a></li>
</ul>
</li>
<li><a class="reference internal" href="#triggers">Triggers</a></li>
<li><a class="reference internal" href="#id1">Ticking</a></li>
<li><a class="reference internal" href="#extras">Extras</a><ul>
<li><a class="reference internal" href="#conditionals">Conditionals</a></li>
<li><a class="reference internal" href="#helper-methods">Helper Methods</a></li>
<li><a class="reference internal" href="#playtime-duration">Playtime Duration</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="Contrib-XYZGrid.html"
title="previous chapter">XYZgrid</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="Contrib-Dice.html"
title="next chapter">Dice roller</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/Contribs/Contrib-Buffs.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="Contrib-Buffs.html">1.0-dev (develop branch)</a></li>
<li><a href="../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Dice.html" title="Dice roller"
>next</a> |</li>
<li class="right" >
<a href="Contrib-XYZGrid.html" title="XYZgrid"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" >Contribs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Buffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>

View file

@ -18,7 +18,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Health Bar" href="Contrib-Health-Bar.html" />
<link rel="prev" title="XYZgrid" href="Contrib-XYZGrid.html" />
<link rel="prev" title="Buffs" href="Contrib-Buffs.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
@ -33,7 +33,7 @@
<a href="Contrib-Health-Bar.html" title="Health Bar"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="Contrib-XYZGrid.html" title="XYZgrid"
<a href="Contrib-Buffs.html" title="Buffs"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" accesskey="U">Contribs</a> &#187;</li>
@ -145,8 +145,8 @@ file will be overwritten, so edit that file rather than this one.</small></p>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="Contrib-XYZGrid.html"
title="previous chapter">XYZgrid</a></p>
<p class="topless"><a href="Contrib-Buffs.html"
title="previous chapter">Buffs</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="Contrib-Health-Bar.html"
title="next chapter">Health Bar</a></p>
@ -190,7 +190,7 @@ file will be overwritten, so edit that file rather than this one.</small></p>
<a href="Contrib-Health-Bar.html" title="Health Bar"
>next</a> |</li>
<li class="right" >
<a href="Contrib-XYZGrid.html" title="XYZgrid"
<a href="Contrib-Buffs.html" title="Buffs"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" >Contribs</a> &#187;</li>

View file

@ -17,7 +17,7 @@
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Pseudo-random generator and registry" href="Contrib-Random-String-Generator.html" />
<link rel="next" title="Random Name Generator" href="Contrib-Name-Generator.html" />
<link rel="prev" title="Input/Output Auditing" href="Contrib-Auditing.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
@ -30,7 +30,7 @@
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Random-String-Generator.html" title="Pseudo-random generator and registry"
<a href="Contrib-Name-Generator.html" title="Random Name Generator"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="Contrib-Auditing.html" title="Input/Output Auditing"
@ -233,8 +233,8 @@ file will be overwritten, so edit that file rather than this one.</small></p>
<p class="topless"><a href="Contrib-Auditing.html"
title="previous chapter">Input/Output Auditing</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="Contrib-Random-String-Generator.html"
title="next chapter">Pseudo-random generator and registry</a></p>
<p class="topless"><a href="Contrib-Name-Generator.html"
title="next chapter">Random Name Generator</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
@ -272,7 +272,7 @@ file will be overwritten, so edit that file rather than this one.</small></p>
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Random-String-Generator.html" title="Pseudo-random generator and registry"
<a href="Contrib-Name-Generator.html" title="Random Name Generator"
>next</a> |</li>
<li class="right" >
<a href="Contrib-Auditing.html" title="Input/Output Auditing"

View file

@ -0,0 +1,415 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Random Name Generator &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Pseudo-random generator and registry" href="Contrib-Random-String-Generator.html" />
<link rel="prev" title="Easy fillable form" href="Contrib-Fieldfill.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Random-String-Generator.html" title="Pseudo-random generator and registry"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="Contrib-Fieldfill.html" title="Easy fillable form"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" accesskey="U">Contribs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Random Name Generator</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section class="tex2jax_ignore mathjax_ignore" id="random-name-generator">
<h1>Random Name Generator<a class="headerlink" href="#random-name-generator" title="Permalink to this headline"></a></h1>
<p>Contribution by InspectorCaracal (2022)</p>
<p>A module for generating random names, both real-world and fantasy. Real-world
names can be generated either as first (personal) names, family (last) names, or
full names (first, optional middles, and last). The name data is from <a class="reference external" href="https://www.behindthename.com/">Behind the Name</a>
and used under the <a class="reference external" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0 license</a>.</p>
<p>Fantasy names are generated from basic phonetic rules, using CVC syllable syntax.</p>
<p>Both real-world and fantasy name generation can be extended to include additional
information via your games <code class="docutils literal notranslate"><span class="pre">settings.py</span></code></p>
<section id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h2>
<p>This is a stand-alone utility. Just import this module (<code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">evennia.contrib.utils</span> <span class="pre">import</span> <span class="pre">name_generator</span></code>) and use its functions wherever you like.</p>
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<p>Import the module where you need it with the following:</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">evennia.contrib.utils.name_generator</span> <span class="kn">import</span> <span class="n">namegen</span>
</pre></div>
</div>
<p>By default, all of the functions will return a string with one generated name.
If you specify more than one, or pass <code class="docutils literal notranslate"><span class="pre">return_list=True</span></code> as a keyword argument, the returned value will be a list of strings.</p>
<p>The module is especially useful for naming newly-created NPCs, like so:</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="n">npc_name</span> <span class="o">=</span> <span class="n">namegen</span><span class="o">.</span><span class="n">full_name</span><span class="p">()</span>
<span class="n">npc_obj</span> <span class="o">=</span> <span class="n">create_object</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="n">npc_name</span><span class="p">,</span> <span class="n">typeclass</span><span class="o">=</span><span class="s2">&quot;typeclasses.characters.NPC&quot;</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="available-settings">
<h2>Available Settings<a class="headerlink" href="#available-settings" title="Permalink to this headline"></a></h2>
<p>These settings can all be defined in your games <code class="docutils literal notranslate"><span class="pre">server/conf/settings.py</span></code> file.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">NAMEGEN_FIRST_NAMES</span></code> adds a new list of first (personal) names.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">NAMEGEN_LAST_NAMES</span></code> adds a new list of last (family) names.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">NAMEGEN_REPLACE_LISTS</span></code> - set to <code class="docutils literal notranslate"><span class="pre">True</span></code> if you want to use only the names defined in your settings.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">NAMEGEN_FANTASY_RULES</span></code> lets you add new phonetic rules for generating entirely made-up names. See the section “Custom Fantasy Name style rules” for details on how this should look.</p></li>
</ul>
<p>Examples:</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="n">NAMEGEN_FIRST_NAMES</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">(</span><span class="s2">&quot;Evennia&quot;</span><span class="p">,</span> <span class="s1">&#39;mf&#39;</span><span class="p">),</span>
<span class="p">(</span><span class="s2">&quot;Green Tea&quot;</span><span class="p">,</span> <span class="s1">&#39;f&#39;</span><span class="p">),</span>
<span class="p">]</span>
<span class="n">NAMEGEN_LAST_NAMES</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">&quot;Beeblebrox&quot;</span><span class="p">,</span> <span class="s2">&quot;Son of Odin&quot;</span> <span class="p">]</span>
<span class="n">NAMEGEN_FANTASY_RULES</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;example_style&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;syllable&quot;</span><span class="p">:</span> <span class="s2">&quot;(C)VC&quot;</span><span class="p">,</span>
<span class="s2">&quot;consonants&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="s1">&#39;ph&#39;</span><span class="p">,</span><span class="s1">&#39;sh&#39;</span><span class="p">,</span><span class="s1">&#39;r&#39;</span><span class="p">,</span><span class="s1">&#39;n&#39;</span> <span class="p">],</span>
<span class="s2">&quot;start&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;m&#39;</span><span class="p">],</span>
<span class="s2">&quot;end&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;x&#39;</span><span class="p">,</span><span class="s1">&#39;n&#39;</span><span class="p">],</span>
<span class="s2">&quot;vowels&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s2">&quot;e&quot;</span><span class="p">,</span><span class="s2">&quot;e&quot;</span><span class="p">,</span><span class="s2">&quot;e&quot;</span><span class="p">,</span><span class="s2">&quot;a&quot;</span><span class="p">,</span><span class="s2">&quot;i&quot;</span><span class="p">,</span><span class="s2">&quot;i&quot;</span><span class="p">,</span><span class="s2">&quot;u&quot;</span><span class="p">,</span><span class="s2">&quot;o&quot;</span><span class="p">,</span> <span class="p">],</span>
<span class="s2">&quot;length&quot;</span><span class="p">:</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">4</span><span class="p">),</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</section>
<section id="generating-real-names">
<h2>Generating Real Names<a class="headerlink" href="#generating-real-names" title="Permalink to this headline"></a></h2>
<p>The contrib offers three functions for generating random real-world names:
<code class="docutils literal notranslate"><span class="pre">first_name()</span></code>, <code class="docutils literal notranslate"><span class="pre">last_name()</span></code>, and <code class="docutils literal notranslate"><span class="pre">full_name()</span></code>. If you want more than one name
generated at once, you can use the <code class="docutils literal notranslate"><span class="pre">num</span></code> keyword argument to specify how many.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">first_name</span><span class="p">(</span><span class="n">num</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
<span class="go">[&#39;Genesis&#39;, &#39;Tali&#39;, &#39;Budur&#39;, &#39;Dominykas&#39;, &#39;Kamau&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">first_name</span><span class="p">(</span><span class="n">gender</span><span class="o">=</span><span class="s1">&#39;m&#39;</span><span class="p">)</span>
<span class="go">&#39;Blanchard&#39;</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">first_name</span></code> function also takes a <code class="docutils literal notranslate"><span class="pre">gender</span></code> keyword argument to filter names
by gender association. f for feminine, m for masculine, mf for feminine
<em>and</em> masculine, or the default <code class="docutils literal notranslate"><span class="pre">None</span></code> to match any gendering.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">full_name</span></code> function also takes the <code class="docutils literal notranslate"><span class="pre">gender</span></code> keyword, as well as <code class="docutils literal notranslate"><span class="pre">parts</span></code> which
defines how many names make up the full name. The minimum is two: a first name and
a last name. You can also generate names with the family name first by setting
the keyword arg <code class="docutils literal notranslate"><span class="pre">surname_first</span></code> to <code class="docutils literal notranslate"><span class="pre">True</span></code></p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">full_name</span><span class="p">()</span>
<span class="go">&#39;Keeva Bernat&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">full_name</span><span class="p">(</span><span class="n">parts</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
<span class="go">&#39;Suzu Shabnam Kafka Baier&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">full_name</span><span class="p">(</span><span class="n">parts</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">surname_first</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">&#39;Ó Muircheartach Torunn Dyson&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">full_name</span><span class="p">(</span><span class="n">gender</span><span class="o">=</span><span class="s1">&#39;f&#39;</span><span class="p">)</span>
<span class="go">&#39;Wikolia Ó Deasmhumhnaigh&#39;</span>
</pre></div>
</div>
<section id="adding-your-own-names">
<h3>Adding your own names<a class="headerlink" href="#adding-your-own-names" title="Permalink to this headline"></a></h3>
<p>You can add additional names with the settings <code class="docutils literal notranslate"><span class="pre">NAMEGEN_FIRST_NAMES</span></code> and
<code class="docutils literal notranslate"><span class="pre">NAMEGEN_LAST_NAMES</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">NAMEGEN_FIRST_NAMES</span></code> should be a list of tuples, where the first value is the name
and then second value is the gender flag - m for masculine-only, f for feminine-
only, and mf for either one.</p>
<p><code class="docutils literal notranslate"><span class="pre">NAMEGEN_LAST_NAMES</span></code> should be a list of strings, where each item is an available
surname.</p>
<p>Examples:</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="n">NAMEGEN_FIRST_NAMES</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">(</span><span class="s2">&quot;Evennia&quot;</span><span class="p">,</span> <span class="s1">&#39;mf&#39;</span><span class="p">),</span>
<span class="p">(</span><span class="s2">&quot;Green Tea&quot;</span><span class="p">,</span> <span class="s1">&#39;f&#39;</span><span class="p">),</span>
<span class="p">]</span>
<span class="n">NAMEGEN_LAST_NAMES</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">&quot;Beeblebrox&quot;</span><span class="p">,</span> <span class="s2">&quot;Son of Odin&quot;</span> <span class="p">]</span>
</pre></div>
</div>
<p>Set <code class="docutils literal notranslate"><span class="pre">NAMEGEN_REPLACE_LISTS</span> <span class="pre">=</span> <span class="pre">True</span></code> if you want your custom lists above to entirely replace the built-in lists rather than extend them.</p>
</section>
</section>
<section id="generating-fantasy-names">
<h2>Generating Fantasy Names<a class="headerlink" href="#generating-fantasy-names" title="Permalink to this headline"></a></h2>
<p>Generating completely made-up names is done with the <code class="docutils literal notranslate"><span class="pre">fantasy_name</span></code> function. The
contrib comes with three built-in styles of names which you can use, or you can
put a dictionary of custom name rules into <code class="docutils literal notranslate"><span class="pre">settings.py</span></code></p>
<p>Generating a fantasy name takes the ruleset key as the “style” keyword, and can
return either a single name or multiple names. By default, it will return a
single name in the built-in “harsh” style. The contrib also comes with “fluid” and “alien” styles.</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">()</span>
<span class="go">&#39;Vhon&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">num</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="s2">&quot;harsh&quot;</span><span class="p">)</span>
<span class="go">[&#39;Kha&#39;, &#39;Kizdhu&#39;, &#39;Godögäk&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">num</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="s2">&quot;fluid&quot;</span><span class="p">)</span>
<span class="go">[&#39;Aewalisash&#39;, &#39;Ayi&#39;, &#39;Iaa&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">num</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="s2">&quot;alien&quot;</span><span class="p">)</span>
<span class="go">[&quot;Qz&#39;vko&#39;&quot;, &quot;Xv&#39;w&#39;hk&#39;hxyxyz&quot;, &quot;Wxqv&#39;hv&#39;k&quot;, &quot;Wh&#39;k&quot;, &quot;Xbx&#39;qk&#39;vz&quot;]</span>
</pre></div>
</div>
<section id="multi-word-fantasy-names">
<h3>Multi-Word Fantasy Names<a class="headerlink" href="#multi-word-fantasy-names" title="Permalink to this headline"></a></h3>
<p>The <code class="docutils literal notranslate"><span class="pre">fantasy_name</span></code> function will only generate one name-word at a time, so for multi-word names
youll need to combine pieces together. Depending on what kind of end result you want, there are
several approaches.</p>
<section id="the-simple-approach">
<h4>The simple approach<a class="headerlink" href="#the-simple-approach" title="Permalink to this headline"></a></h4>
<p>If all you need is for it to have multiple parts, you can generate multiple names at once and <code class="docutils literal notranslate"><span class="pre">join</span></code> them.</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">name</span> <span class="o">=</span> <span class="s2">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">num</span><span class="o">=</span><span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">name</span>
<span class="go">&#39;Dezhvözh Khäk&#39;</span>
</pre></div>
</div>
<p>If you want a little more variation between first/last names, you can also generate names for
different styles and then combine them.</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">first</span> <span class="o">=</span> <span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">style</span><span class="o">=</span><span class="s2">&quot;fluid&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">last</span> <span class="o">=</span> <span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">style</span><span class="o">=</span><span class="s2">&quot;harsh&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">name</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">first</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">last</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">name</span>
<span class="go">&#39;Ofasa Käkudhu&#39;</span>
</pre></div>
</div>
</section>
<section id="nakku-silversmith">
<h4>“Nakku Silversmith”<a class="headerlink" href="#nakku-silversmith" title="Permalink to this headline"></a></h4>
<p>One common fantasy name practice is profession- or title-based surnames. To achieve this effect,
you can use the <code class="docutils literal notranslate"><span class="pre">last_name</span></code> function with a custom list of last names and combine it with your generated
fantasy name.</p>
<p>Example:</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="n">NAMEGEN_LAST_NAMES</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">&quot;Silversmith&quot;</span><span class="p">,</span> <span class="s2">&quot;the Traveller&quot;</span><span class="p">,</span> <span class="s2">&quot;Destroyer of Worlds&quot;</span> <span class="p">]</span>
<span class="n">NAMEGEN_REPLACE_LISTS</span> <span class="o">=</span> <span class="kc">True</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">first</span> <span class="o">=</span> <span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">()</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">last</span> <span class="o">=</span> <span class="n">namegen</span><span class="o">.</span><span class="n">last_name</span><span class="p">()</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">name</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">first</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">last</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">name</span>
<span class="s1">&#39;Tözhkheko the Traveller&#39;</span>
</pre></div>
</div>
</section>
<section id="elarion-dyrinea-thror-obinson">
<h4>Elarion dYrinea, Thror Obinson<a class="headerlink" href="#elarion-dyrinea-thror-obinson" title="Permalink to this headline"></a></h4>
<p>Another common flavor of fantasy names is to use a surname suffix or prefix. For that, youll
need to add in the extra bit yourself.</p>
<p>Examples:</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">names</span> <span class="o">=</span> <span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">num</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">name</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">names</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="si">}</span><span class="s2"> za&#39;</span><span class="si">{</span><span class="n">names</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">name</span>
<span class="go">&quot;Tithe za&#39;Dhudozkok&quot;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">names</span> <span class="o">=</span> <span class="n">namegen</span><span class="o">.</span><span class="n">fantasy_name</span><span class="p">(</span><span class="n">num</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">name</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">names</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">names</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="si">}</span><span class="s2">son&quot;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">name</span>
<span class="go">&#39;Kön Ködhöddoson&#39;</span>
</pre></div>
</div>
</section>
</section>
<section id="custom-fantasy-name-style-rules">
<h3>Custom Fantasy Name style rules<a class="headerlink" href="#custom-fantasy-name-style-rules" title="Permalink to this headline"></a></h3>
<p>The style rules are contained in a dictionary of dictionaries, where the style name
is the key and the style rules are the dictionary value.</p>
<p>The following is how you would add a custom style to <code class="docutils literal notranslate"><span class="pre">settings.py</span></code>:</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="n">NAMEGEN_FANTASY_RULES</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;example_style&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;syllable&quot;</span><span class="p">:</span> <span class="s2">&quot;(C)VC&quot;</span><span class="p">,</span>
<span class="s2">&quot;consonants&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="s1">&#39;ph&#39;</span><span class="p">,</span><span class="s1">&#39;sh&#39;</span><span class="p">,</span><span class="s1">&#39;r&#39;</span><span class="p">,</span><span class="s1">&#39;n&#39;</span> <span class="p">],</span>
<span class="s2">&quot;start&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;m&#39;</span><span class="p">],</span>
<span class="s2">&quot;end&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;x&#39;</span><span class="p">,</span><span class="s1">&#39;n&#39;</span><span class="p">],</span>
<span class="s2">&quot;vowels&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s2">&quot;e&quot;</span><span class="p">,</span><span class="s2">&quot;e&quot;</span><span class="p">,</span><span class="s2">&quot;e&quot;</span><span class="p">,</span><span class="s2">&quot;a&quot;</span><span class="p">,</span><span class="s2">&quot;i&quot;</span><span class="p">,</span><span class="s2">&quot;i&quot;</span><span class="p">,</span><span class="s2">&quot;u&quot;</span><span class="p">,</span><span class="s2">&quot;o&quot;</span><span class="p">,</span> <span class="p">],</span>
<span class="s2">&quot;length&quot;</span><span class="p">:</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">4</span><span class="p">),</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Then you could generate names following that ruleset with <code class="docutils literal notranslate"><span class="pre">namegen.fantasy_name(style=&quot;example_style&quot;)</span></code>.</p>
<p>The keys <code class="docutils literal notranslate"><span class="pre">syllable</span></code>, <code class="docutils literal notranslate"><span class="pre">consonants</span></code>, <code class="docutils literal notranslate"><span class="pre">vowels</span></code>, and <code class="docutils literal notranslate"><span class="pre">length</span></code> must be present, and <code class="docutils literal notranslate"><span class="pre">length</span></code> must be the minimum and maximum syllable counts. <code class="docutils literal notranslate"><span class="pre">start</span></code> and <code class="docutils literal notranslate"><span class="pre">end</span></code> are optional.</p>
<section id="syllable">
<h4>syllable<a class="headerlink" href="#syllable" title="Permalink to this headline"></a></h4>
<p>The “syllable” field defines the structure of each syllable. C is consonant, V is vowel,
and parentheses mean its optional. So, the example <code class="docutils literal notranslate"><span class="pre">(C)VC</span></code> means that every syllable
will always have a vowel followed by a consonant, and will <em>sometimes</em> have another
consonant at the beginning. e.g. <code class="docutils literal notranslate"><span class="pre">en</span></code>, <code class="docutils literal notranslate"><span class="pre">bak</span></code></p>
<p><em>Note:</em> While its not standard, the contrib lets you nest parentheses, with each layer
being less likely to show up. Additionally, any other characters put into the syllable
structure - e.g. an apostrophe - will be read and inserted as written. The
“alien” style rules in the module gives an example of both: the syllable structure is <code class="docutils literal notranslate"><span class="pre">C(C(V))(')(C)</span></code>
which results in syllables such as <code class="docutils literal notranslate"><span class="pre">khq</span></code>, <code class="docutils literal notranslate"><span class="pre">xho'q</span></code>, and <code class="docutils literal notranslate"><span class="pre">q'</span></code> with a much lower frequency of vowels than
<code class="docutils literal notranslate"><span class="pre">C(C)(V)(')(C)</span></code> would have given.</p>
</section>
<section id="consonants">
<h4>consonants<a class="headerlink" href="#consonants" title="Permalink to this headline"></a></h4>
<p>A simple list of consonant phonemes that can be chosen from. Multi-character strings are
perfectly acceptable, such as “th”, but each one will be treated as a single consonant.</p>
<p>The function uses a naive form of weighting, where you make a phoneme more likely to
occur by putting more copies of it into the list.</p>
</section>
<section id="start-and-end">
<h4>start and end<a class="headerlink" href="#start-and-end" title="Permalink to this headline"></a></h4>
<p>These are <strong>optional</strong> lists for the first and last letters of a syllable, if theyre
a consonant. You can add on additional consonants which can only occur at the beginning
or end of a syllable, or you can add extra copies of already-defined consonants to
increase the frequency of them at the start/end of syllables.</p>
<p>For example, in the <code class="docutils literal notranslate"><span class="pre">example_style</span></code> above, we have a <code class="docutils literal notranslate"><span class="pre">start</span></code> of m, and <code class="docutils literal notranslate"><span class="pre">end</span></code> of x and n.
Taken with the rest of the consonants/vowels, this means you can have the syllables of <code class="docutils literal notranslate"><span class="pre">mez</span></code>
but not <code class="docutils literal notranslate"><span class="pre">zem</span></code>, and you can have <code class="docutils literal notranslate"><span class="pre">phex</span></code> or <code class="docutils literal notranslate"><span class="pre">phen</span></code> but not <code class="docutils literal notranslate"><span class="pre">xeph</span></code> or <code class="docutils literal notranslate"><span class="pre">neph</span></code>.</p>
<p>They can be left out of custom rulesets entirely.</p>
</section>
<section id="vowels">
<h4>vowels<a class="headerlink" href="#vowels" title="Permalink to this headline"></a></h4>
<p>Vowels is a simple list of vowel phonemes - exactly like consonants, but instead used for the
vowel selection. Single-or multi-character strings are equally fine. It uses the same naive weighting system
as consonants - you can increase the frequency of any given vowel by putting it into the list multiple times.</p>
</section>
<section id="length">
<h4>length<a class="headerlink" href="#length" title="Permalink to this headline"></a></h4>
<p>A tuple with the minimum and maximum number of syllables a name can have.</p>
<p>When setting this, keep in mind how long your syllables can get! 4 syllables might
not seem like very many, but if you have a ©(V)VC structure with one- and
two-letter phonemes, you can get up to eight characters per syllable.</p>
<hr class="docutils" />
<p><small>This document page is generated from <code class="docutils literal notranslate"><span class="pre">evennia/contrib/utils/name_generator/README.md</span></code>. Changes to this
file will be overwritten, so edit that file rather than this one.</small></p>
</section>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<p><h3><a href="../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Random Name Generator</a><ul>
<li><a class="reference internal" href="#installation">Installation</a></li>
<li><a class="reference internal" href="#usage">Usage</a></li>
<li><a class="reference internal" href="#available-settings">Available Settings</a></li>
<li><a class="reference internal" href="#generating-real-names">Generating Real Names</a><ul>
<li><a class="reference internal" href="#adding-your-own-names">Adding your own names</a></li>
</ul>
</li>
<li><a class="reference internal" href="#generating-fantasy-names">Generating Fantasy Names</a><ul>
<li><a class="reference internal" href="#multi-word-fantasy-names">Multi-Word Fantasy Names</a><ul>
<li><a class="reference internal" href="#the-simple-approach">The simple approach</a></li>
<li><a class="reference internal" href="#nakku-silversmith">“Nakku Silversmith”</a></li>
<li><a class="reference internal" href="#elarion-dyrinea-thror-obinson">Elarion dYrinea, Thror Obinson</a></li>
</ul>
</li>
<li><a class="reference internal" href="#custom-fantasy-name-style-rules">Custom Fantasy Name style rules</a><ul>
<li><a class="reference internal" href="#syllable">syllable</a></li>
<li><a class="reference internal" href="#consonants">consonants</a></li>
<li><a class="reference internal" href="#start-and-end">start and end</a></li>
<li><a class="reference internal" href="#vowels">vowels</a></li>
<li><a class="reference internal" href="#length">length</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="Contrib-Fieldfill.html"
title="previous chapter">Easy fillable form</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="Contrib-Random-String-Generator.html"
title="next chapter">Pseudo-random generator and registry</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/Contribs/Contrib-Name-Generator.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="Contrib-Name-Generator.html">1.0-dev (develop branch)</a></li>
<li><a href="../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Random-String-Generator.html" title="Pseudo-random generator and registry"
>next</a> |</li>
<li class="right" >
<a href="Contrib-Fieldfill.html" title="Easy fillable form"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" >Contribs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Random Name Generator</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>

View file

@ -18,7 +18,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Easy menu selection tree" href="Contrib-Tree-Select.html" />
<link rel="prev" title="Easy fillable form" href="Contrib-Fieldfill.html" />
<link rel="prev" title="Random Name Generator" href="Contrib-Name-Generator.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
@ -33,7 +33,7 @@
<a href="Contrib-Tree-Select.html" title="Easy menu selection tree"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="Contrib-Fieldfill.html" title="Easy fillable form"
<a href="Contrib-Name-Generator.html" title="Random Name Generator"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" accesskey="U">Contribs</a> &#187;</li>
@ -138,8 +138,8 @@ file will be overwritten, so edit that file rather than this one.</small></p>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="Contrib-Fieldfill.html"
title="previous chapter">Easy fillable form</a></p>
<p class="topless"><a href="Contrib-Name-Generator.html"
title="previous chapter">Random Name Generator</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="Contrib-Tree-Select.html"
title="next chapter">Easy menu selection tree</a></p>
@ -183,7 +183,7 @@ file will be overwritten, so edit that file rather than this one.</small></p>
<a href="Contrib-Tree-Select.html" title="Easy menu selection tree"
>next</a> |</li>
<li class="right" >
<a href="Contrib-Fieldfill.html" title="Easy fillable form"
<a href="Contrib-Name-Generator.html" title="Random Name Generator"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" >Contribs</a> &#187;</li>

View file

@ -17,7 +17,7 @@
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Dice roller" href="Contrib-Dice.html" />
<link rel="next" title="Buffs" href="Contrib-Buffs.html" />
<link rel="prev" title="Wilderness system" href="Contrib-Wilderness.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
@ -30,7 +30,7 @@
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Dice.html" title="Dice roller"
<a href="Contrib-Buffs.html" title="Buffs"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="Contrib-Wilderness.html" title="Wilderness system"
@ -1547,8 +1547,8 @@ file will be overwritten, so edit that file rather than this one.</small></p>
<p class="topless"><a href="Contrib-Wilderness.html"
title="previous chapter">Wilderness system</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="Contrib-Dice.html"
title="next chapter">Dice roller</a></p>
<p class="topless"><a href="Contrib-Buffs.html"
title="next chapter">Buffs</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
@ -1586,7 +1586,7 @@ file will be overwritten, so edit that file rather than this one.</small></p>
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Dice.html" title="Dice roller"
<a href="Contrib-Buffs.html" title="Buffs"
>next</a> |</li>
<li class="right" >
<a href="Contrib-Wilderness.html" title="Wilderness system"

View file

@ -384,12 +384,20 @@ current location (useful for displaying the grid as an in-game, updating map).</
and rule implementation like character traits, dice rolling and emoting.</em></p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Buffs.html">Buffs</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Dice.html">Dice roller</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Health-Bar.html">Health Bar</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-RPSystem.html">Roleplaying base system for Evennia</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Traits.html">Traits</a></li>
</ul>
</div>
<section id="contrib-buffs">
<h3>Contrib: <code class="docutils literal notranslate"><span class="pre">buffs</span></code><a class="headerlink" href="#contrib-buffs" title="Permalink to this headline"></a></h3>
<p><em>Contribution by Tegiminis 2022</em></p>
<p>A buff is a timed object, attached to a game entity. It is capable of modifying values, triggering code, or both.
It is a common design pattern in RPGs, particularly action games.</p>
<p><a class="reference internal" href="Contrib-Buffs.html"><span class="doc std std-doc">Read the documentation</span></a> - <a class="reference internal" href="../api/evennia.contrib.rpg.buffs.html#evennia-contrib-rpg-buffs"><span class="std std-ref">Browse the Code</span></a></p>
</section>
<section id="contrib-dice">
<h3>Contrib: <code class="docutils literal notranslate"><span class="pre">dice</span></code><a class="headerlink" href="#contrib-dice" title="Permalink to this headline"></a></h3>
<p><em>Contribution by Griatch, 2012</em></p>
@ -504,6 +512,7 @@ and more.</em></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Auditing.html">Input/Output Auditing</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Fieldfill.html">Easy fillable form</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Name-Generator.html">Random Name Generator</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Random-String-Generator.html">Pseudo-random generator and registry</a></li>
<li class="toctree-l1"><a class="reference internal" href="Contrib-Tree-Select.html">Easy menu selection tree</a></li>
</ul>
@ -528,6 +537,15 @@ function. Once the form is submitted, the forms data is submitted as a dictio
to any callable of your choice.</p>
<p><a class="reference internal" href="Contrib-Fieldfill.html"><span class="doc std std-doc">Read the documentation</span></a> - <a class="reference internal" href="../api/evennia.contrib.utils.fieldfill.html#evennia-contrib-utils-fieldfill"><span class="std std-ref">Browse the Code</span></a></p>
</section>
<section id="contrib-name-generator">
<h3>Contrib: <code class="docutils literal notranslate"><span class="pre">name_generator</span></code><a class="headerlink" href="#contrib-name-generator" title="Permalink to this headline"></a></h3>
<p><em>Contribution by InspectorCaracal (2022)</em></p>
<p>A module for generating random names, both real-world and fantasy. Real-world
names can be generated either as first (personal) names, family (last) names, or
full names (first, optional middles, and last). The name data is from <a class="reference external" href="https://www.behindthename.com/">Behind the Name</a>
and used under the <a class="reference external" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0 license</a>.</p>
<p><a class="reference internal" href="Contrib-Name-Generator.html"><span class="doc std std-doc">Read the documentation</span></a> - <span class="xref myst">Browse the Code</span></p>
</section>
<section id="contrib-random-string-generator">
<h3>Contrib: <code class="docutils literal notranslate"><span class="pre">random_string_generator</span></code><a class="headerlink" href="#contrib-random-string-generator" title="Permalink to this headline"></a></h3>
<p><em>Contribution by Vincent Le Goff (vlgeoff), 2017</em></p>
@ -615,6 +633,7 @@ will be overwritten.</small></p>
</ul>
</li>
<li><a class="reference internal" href="#rpg">rpg</a><ul>
<li><a class="reference internal" href="#contrib-buffs">Contrib: <code class="docutils literal notranslate"><span class="pre">buffs</span></code></a></li>
<li><a class="reference internal" href="#contrib-dice">Contrib: <code class="docutils literal notranslate"><span class="pre">dice</span></code></a></li>
<li><a class="reference internal" href="#contrib-health-bar">Contrib: <code class="docutils literal notranslate"><span class="pre">health_bar</span></code></a></li>
<li><a class="reference internal" href="#contrib-rpsystem">Contrib: <code class="docutils literal notranslate"><span class="pre">rpsystem</span></code></a></li>
@ -633,6 +652,7 @@ will be overwritten.</small></p>
<li><a class="reference internal" href="#utils">utils</a><ul>
<li><a class="reference internal" href="#contrib-auditing">Contrib: <code class="docutils literal notranslate"><span class="pre">auditing</span></code></a></li>
<li><a class="reference internal" href="#contrib-fieldfill">Contrib: <code class="docutils literal notranslate"><span class="pre">fieldfill</span></code></a></li>
<li><a class="reference internal" href="#contrib-name-generator">Contrib: <code class="docutils literal notranslate"><span class="pre">name_generator</span></code></a></li>
<li><a class="reference internal" href="#contrib-random-string-generator">Contrib: <code class="docutils literal notranslate"><span class="pre">random_string_generator</span></code></a></li>
<li><a class="reference internal" href="#contrib-tree-select">Contrib: <code class="docutils literal notranslate"><span class="pre">tree_select</span></code></a></li>
</ul>

View file

@ -74,12 +74,12 @@ to change into <code class="docutils literal notranslate"><span class="pre">myga
<span class="sd">always be sure of what you have changed and what is default behaviour.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">django.contrib.messages</span> <span class="kn">import</span> <span class="n">constants</span> <span class="k">as</span> <span class="n">messages</span>
<span class="kn">from</span> <span class="nn">django.urls</span> <span class="kn">import</span> <span class="n">reverse_lazy</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">from</span> <span class="nn">django.contrib.messages</span> <span class="kn">import</span> <span class="n">constants</span> <span class="k">as</span> <span class="n">messages</span>
<span class="kn">from</span> <span class="nn">django.urls</span> <span class="kn">import</span> <span class="n">reverse_lazy</span>
<span class="c1">######################################################################</span>
<span class="c1"># Evennia base server config</span>
<span class="c1">######################################################################</span>
@ -448,9 +448,11 @@ to change into <code class="docutils literal notranslate"><span class="pre">myga
<span class="c1"># the server&#39;s initial setup sequence (the very first startup of the system).</span>
<span class="c1"># The check will fail quietly if module doesn&#39;t exist or fails to load.</span>
<span class="n">AT_INITIAL_SETUP_HOOK_MODULE</span> <span class="o">=</span> <span class="s2">&quot;server.conf.at_initial_setup&quot;</span>
<span class="c1"># Module containing your custom at_server_start(), at_server_reload() and</span>
<span class="c1"># at_server_stop() methods. These methods will be called every time</span>
<span class="c1"># the server starts, reloads and resets/stops respectively.</span>
<span class="c1"># Module(s) containing custom at_server_init(), at_server_start(),</span>
<span class="c1"># at_server_reload() and at_server_stop() methods. These methods will be called</span>
<span class="c1"># every time the server starts, reloads and resets/stops</span>
<span class="c1"># respectively. Can be given as a single path or a list of paths. If a list,</span>
<span class="c1"># each module&#39;s hooks will be called in list order.</span>
<span class="n">AT_SERVER_STARTSTOP_MODULE</span> <span class="o">=</span> <span class="s2">&quot;server.conf.at_server_startstop&quot;</span>
<span class="c1"># List of one or more module paths to modules containing a function start_</span>
<span class="c1"># plugin_services(application). This module will be called with the main</span>

View file

@ -340,7 +340,7 @@
<span class="k">return</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">obj</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;puppet&quot;</span><span class="p">):</span>
<span class="c1"># no access</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;You don&#39;t have permission to puppet &#39;</span><span class="si">{obj.key}</span><span class="s2">&#39;.&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;You don&#39;t have permission to puppet &#39;</span><span class="si">{</span><span class="n">obj</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">&#39;.&quot;</span><span class="p">)</span>
<span class="k">return</span>
<span class="k">if</span> <span class="n">obj</span><span class="o">.</span><span class="n">account</span><span class="p">:</span>
<span class="c1"># object already puppeted</span>

View file

@ -103,38 +103,14 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">matches</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">if</span> <span class="n">include_prefixes</span><span class="p">:</span>
<span class="c1"># use the cmdname as-is</span>
<span class="n">l_raw_string</span> <span class="o">=</span> <span class="n">raw_string</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">cmdset</span><span class="p">:</span>
<span class="n">matches</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span>
<span class="p">[</span>
<span class="n">create_match</span><span class="p">(</span><span class="n">cmdname</span><span class="p">,</span> <span class="n">raw_string</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">cmdname</span><span class="p">)</span>
<span class="k">for</span> <span class="n">cmdname</span> <span class="ow">in</span> <span class="p">[</span><span class="n">cmd</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">cmd</span><span class="o">.</span><span class="n">aliases</span>
<span class="k">if</span> <span class="n">cmdname</span>
<span class="ow">and</span> <span class="n">l_raw_string</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">cmdname</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="n">cmd</span><span class="o">.</span><span class="n">arg_regex</span> <span class="ow">or</span> <span class="n">cmd</span><span class="o">.</span><span class="n">arg_regex</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">l_raw_string</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">cmdname</span><span class="p">)</span> <span class="p">:]))</span>
<span class="p">]</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># strip prefixes set in settings</span>
<span class="n">raw_string</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">raw_string</span><span class="o">.</span><span class="n">lstrip</span><span class="p">(</span><span class="n">_CMD_IGNORE_PREFIXES</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">raw_string</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span> <span class="k">else</span> <span class="n">raw_string</span>
<span class="p">)</span>
<span class="n">l_raw_string</span> <span class="o">=</span> <span class="n">raw_string</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">cmdset</span><span class="p">:</span>
<span class="k">for</span> <span class="n">raw_cmdname</span> <span class="ow">in</span> <span class="p">[</span><span class="n">cmd</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">cmd</span><span class="o">.</span><span class="n">aliases</span><span class="p">:</span>
<span class="n">cmdname</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">raw_cmdname</span><span class="o">.</span><span class="n">lstrip</span><span class="p">(</span><span class="n">_CMD_IGNORE_PREFIXES</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">raw_cmdname</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span>
<span class="k">else</span> <span class="n">raw_cmdname</span>
<span class="p">)</span>
<span class="k">if</span> <span class="p">(</span>
<span class="n">cmdname</span>
<span class="ow">and</span> <span class="n">l_raw_string</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">cmdname</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="n">cmd</span><span class="o">.</span><span class="n">arg_regex</span> <span class="ow">or</span> <span class="n">cmd</span><span class="o">.</span><span class="n">arg_regex</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">l_raw_string</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">cmdname</span><span class="p">)</span> <span class="p">:]))</span>
<span class="p">):</span>
<span class="n">matches</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">create_match</span><span class="p">(</span><span class="n">cmdname</span><span class="p">,</span> <span class="n">raw_string</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">raw_cmdname</span><span class="p">))</span>
<span class="n">orig_string</span> <span class="o">=</span> <span class="n">raw_string</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">include_prefixes</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">raw_string</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">raw_string</span> <span class="o">=</span> <span class="n">raw_string</span><span class="o">.</span><span class="n">lstrip</span><span class="p">(</span><span class="n">_CMD_IGNORE_PREFIXES</span><span class="p">)</span>
<span class="n">search_string</span> <span class="o">=</span> <span class="n">raw_string</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">cmdset</span><span class="p">:</span>
<span class="n">cmdname</span><span class="p">,</span> <span class="n">raw_cmdname</span> <span class="o">=</span> <span class="n">cmd</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">search_string</span><span class="p">,</span> <span class="n">include_prefixes</span><span class="o">=</span><span class="n">include_prefixes</span><span class="p">)</span>
<span class="k">if</span> <span class="n">cmdname</span><span class="p">:</span>
<span class="n">matches</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">create_match</span><span class="p">(</span><span class="n">cmdname</span><span class="p">,</span> <span class="n">raw_string</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">raw_cmdname</span><span class="p">))</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="n">log_trace</span><span class="p">(</span><span class="s2">&quot;cmdhandler error. raw_input:</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">raw_string</span><span class="p">)</span>
<span class="k">return</span> <span class="n">matches</span></div>

View file

@ -69,6 +69,7 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">weakref</span> <span class="kn">import</span> <span class="n">WeakKeyDictionary</span>
<span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="kn">import</span> <span class="n">gettext</span> <span class="k">as</span> <span class="n">_</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="kn">import</span> <span class="n">inherits_from</span><span class="p">,</span> <span class="n">is_iter</span>
@ -588,10 +589,7 @@
<span class="n">commands</span><span class="p">[</span><span class="n">ic</span><span class="p">]</span> <span class="o">=</span> <span class="n">cmd</span> <span class="c1"># replace</span>
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
<span class="n">commands</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">commands</span> <span class="o">=</span> <span class="n">commands</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">allow_duplicates</span><span class="p">:</span>
<span class="c1"># extra run to make sure to avoid doublets</span>
<span class="bp">self</span><span class="o">.</span><span class="n">commands</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">commands</span><span class="p">))</span>
<span class="c1"># add system_command to separate list as well,</span>
<span class="c1"># for quick look-up</span>
<span class="k">if</span> <span class="n">cmd</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;__&quot;</span><span class="p">):</span>
@ -599,7 +597,12 @@
<span class="n">ic</span> <span class="o">=</span> <span class="n">system_commands</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
<span class="n">system_commands</span><span class="p">[</span><span class="n">ic</span><span class="p">]</span> <span class="o">=</span> <span class="n">cmd</span> <span class="c1"># replace</span>
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
<span class="n">system_commands</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span></div>
<span class="n">system_commands</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">commands</span> <span class="o">=</span> <span class="n">commands</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">allow_duplicates</span><span class="p">:</span>
<span class="c1"># extra run to make sure to avoid doublets</span>
<span class="bp">self</span><span class="o">.</span><span class="n">commands</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">commands</span><span class="p">))</span></div>
<div class="viewcode-block" id="CmdSet.remove"><a class="viewcode-back" href="../../../api/evennia.commands.cmdset.html#evennia.commands.cmdset.CmdSet.remove">[docs]</a> <span class="k">def</span> <span class="nf">remove</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cmd</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -610,6 +613,15 @@
<span class="sd"> or the key of such a command.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">_cmd</span> <span class="o">=</span> <span class="nb">next</span><span class="p">((</span><span class="n">_cmd</span> <span class="k">for</span> <span class="n">_cmd</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">commands</span> <span class="k">if</span> <span class="n">_cmd</span><span class="o">.</span><span class="n">key</span> <span class="o">==</span> <span class="n">cmd</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span>
<span class="k">if</span> <span class="n">_cmd</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">cmd</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;__&quot;</span><span class="p">):</span>
<span class="c1"># if a syscommand, keep the original string and instantiate on it</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">=</span> <span class="n">_cmd</span>
<span class="n">cmd</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_instantiate</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
<span class="k">if</span> <span class="n">cmd</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;__&quot;</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
@ -633,6 +645,15 @@
<span class="sd"> cmd (Command): The first matching Command in the set.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">_cmd</span> <span class="o">=</span> <span class="nb">next</span><span class="p">((</span><span class="n">_cmd</span> <span class="k">for</span> <span class="n">_cmd</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">commands</span> <span class="k">if</span> <span class="n">_cmd</span><span class="o">.</span><span class="n">key</span> <span class="o">==</span> <span class="n">cmd</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span>
<span class="k">if</span> <span class="n">_cmd</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">cmd</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;__&quot;</span><span class="p">):</span>
<span class="c1"># if a syscommand, keep the original string and instantiate on it</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">=</span> <span class="n">_cmd</span>
<span class="n">cmd</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_instantiate</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
<span class="k">for</span> <span class="n">thiscmd</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">commands</span><span class="p">:</span>
<span class="k">if</span> <span class="n">thiscmd</span> <span class="o">==</span> <span class="n">cmd</span><span class="p">:</span>

View file

@ -262,7 +262,8 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">kwargs</span><span class="p">:</span>
<span class="n">_init_command</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
<span class="n">_init_command</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_optimize</span><span class="p">()</span></div>
<div class="viewcode-block" id="Command.lockhandler"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.Command.lockhandler">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">lockhandler</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -339,10 +340,15 @@
<span class="sd"> Optimize the key and aliases for lookups.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># optimization - a set is much faster to match against than a list</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_matchset</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">aliases</span><span class="p">)</span>
<span class="n">matches</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">lower</span><span class="p">()]</span>
<span class="n">matches</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">aliases</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_matchset</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">matches</span><span class="p">)</span>
<span class="c1"># optimization for looping over keys+aliases</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_keyaliases</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_matchset</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_noprefix_aliases</span> <span class="o">=</span> <span class="p">{</span><span class="n">x</span><span class="o">.</span><span class="n">lstrip</span><span class="p">(</span><span class="n">CMD_IGNORE_PREFIXES</span><span class="p">):</span> <span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">matches</span><span class="p">}</span>
<div class="viewcode-block" id="Command.set_key"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.Command.set_key">[docs]</a> <span class="k">def</span> <span class="nf">set_key</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">new_key</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Update key.</span>
@ -378,7 +384,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">aliases</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">alias</span> <span class="k">for</span> <span class="n">alias</span> <span class="ow">in</span> <span class="n">aliases</span> <span class="k">if</span> <span class="n">alias</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_optimize</span><span class="p">()</span></div>
<div class="viewcode-block" id="Command.match"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.Command.match">[docs]</a> <span class="k">def</span> <span class="nf">match</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cmdname</span><span class="p">):</span>
<div class="viewcode-block" id="Command.match"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.Command.match">[docs]</a> <span class="k">def</span> <span class="nf">match</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cmdname</span><span class="p">,</span> <span class="n">include_prefixes</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is called by the system when searching the available commands,</span>
<span class="sd"> in order to determine if this is the one we wanted. cmdname was</span>
@ -387,11 +393,23 @@
<span class="sd"> Args:</span>
<span class="sd"> cmdname (str): Always lowercase when reaching this point.</span>
<span class="sd"> Kwargs:</span>
<span class="sd"> include_prefixes (bool): If false, will compare against the _noprefix</span>
<span class="sd"> variants of commandnames.</span>
<span class="sd"> Returns:</span>
<span class="sd"> result (bool): Match result.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">cmdname</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_matchset</span></div>
<span class="k">if</span> <span class="n">include_prefixes</span><span class="p">:</span>
<span class="k">for</span> <span class="n">cmd_key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_keyaliases</span><span class="p">:</span>
<span class="k">if</span> <span class="n">cmdname</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">cmd_key</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_regex</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_regex</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">cmdname</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">cmd_key</span><span class="p">)</span> <span class="p">:])):</span>
<span class="k">return</span> <span class="n">cmd_key</span><span class="p">,</span> <span class="n">cmd_key</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_noprefix_aliases</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="k">if</span> <span class="n">cmdname</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_regex</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_regex</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">cmdname</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> <span class="p">:])):</span>
<span class="k">return</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span>
<span class="k">return</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span></div>
<div class="viewcode-block" id="Command.access"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.Command.access">[docs]</a> <span class="k">def</span> <span class="nf">access</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">srcobj</span><span class="p">,</span> <span class="n">access_type</span><span class="o">=</span><span class="s2">&quot;cmd&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>

View file

@ -77,6 +77,8 @@
<span class="n">_FUNCPARSER</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">_ATTRFUNCPARSER</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">_KEY_REGEX</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;(?P&lt;attr&gt;.*?)(?P&lt;key&gt;(\[.*\]\ *)+)?$&quot;</span><span class="p">)</span>
<span class="c1"># limit symbol import for API</span>
<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span>
<span class="s2">&quot;ObjManipCommand&quot;</span><span class="p">,</span>
@ -168,7 +170,28 @@
<span class="n">aliases</span> <span class="o">=</span> <span class="p">[</span><span class="n">alias</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">alias</span> <span class="ow">in</span> <span class="n">aliases</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;;&quot;</span><span class="p">)</span> <span class="k">if</span> <span class="n">alias</span><span class="o">.</span><span class="n">strip</span><span class="p">()]</span>
<span class="k">if</span> <span class="s2">&quot;/&quot;</span> <span class="ow">in</span> <span class="n">objdef</span><span class="p">:</span>
<span class="n">objdef</span><span class="p">,</span> <span class="n">attrs</span> <span class="o">=</span> <span class="p">[</span><span class="n">part</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="n">objdef</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;/&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)]</span>
<span class="n">attrs</span> <span class="o">=</span> <span class="p">[</span><span class="n">part</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="n">attrs</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;/&quot;</span><span class="p">)</span> <span class="k">if</span> <span class="n">part</span><span class="o">.</span><span class="n">strip</span><span class="p">()]</span>
<span class="n">_attrs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="c1"># Should an attribute key is specified, ie. we&#39;re working</span>
<span class="c1"># on a dict, what we want is to lowercase attribute name</span>
<span class="c1"># as usual but to preserve dict key case as one would</span>
<span class="c1"># expect:</span>
<span class="c1">#</span>
<span class="c1"># set box/MyAttr = {&#39;FooBar&#39;: 1}</span>
<span class="c1"># Created attribute box/myattr [category:None] = {&#39;FooBar&#39;: 1}</span>
<span class="c1"># set box/MyAttr[&#39;FooBar&#39;] = 2</span>
<span class="c1"># Modified attribute box/myattr [category:None] = {&#39;FooBar&#39;: 2}</span>
<span class="k">for</span> <span class="n">match</span> <span class="ow">in</span> <span class="p">(</span>
<span class="k">match</span>
<span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="nb">map</span><span class="p">(</span><span class="nb">str</span><span class="o">.</span><span class="n">strip</span><span class="p">,</span> <span class="n">attrs</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;/&quot;</span><span class="p">))</span>
<span class="k">if</span> <span class="n">part</span> <span class="ow">and</span> <span class="p">(</span><span class="n">match</span> <span class="o">:=</span> <span class="n">_KEY_REGEX</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">part</span><span class="o">.</span><span class="n">strip</span><span class="p">()))</span>
<span class="p">):</span>
<span class="n">attr</span> <span class="o">=</span> <span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="s2">&quot;attr&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="c1"># reappend untouched key, if present</span>
<span class="k">if</span> <span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="s2">&quot;key&quot;</span><span class="p">):</span>
<span class="n">attr</span> <span class="o">+=</span> <span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="s2">&quot;key&quot;</span><span class="p">)</span>
<span class="n">_attrs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">attr</span><span class="p">)</span>
<span class="n">attrs</span> <span class="o">=</span> <span class="n">_attrs</span>
<span class="c1"># store data</span>
<span class="n">obj_defs</span><span class="p">[</span><span class="n">iside</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="n">objdef</span><span class="p">,</span> <span class="s2">&quot;option&quot;</span><span class="p">:</span> <span class="n">option</span><span class="p">,</span> <span class="s2">&quot;aliases&quot;</span><span class="p">:</span> <span class="n">aliases</span><span class="p">})</span>
<span class="n">obj_attrs</span><span class="p">[</span><span class="n">iside</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="n">objdef</span><span class="p">,</span> <span class="s2">&quot;attrs&quot;</span><span class="p">:</span> <span class="n">attrs</span><span class="p">})</span>
@ -1969,7 +1992,7 @@
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="c1"># no = means we inspect the attribute(s)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">attrs</span><span class="p">:</span>
<span class="n">attrs</span> <span class="o">=</span> <span class="p">[</span><span class="n">attr</span><span class="o">.</span><span class="n">key</span> <span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">obj</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">category</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">return_obj</span><span class="o">=</span><span class="kc">True</span><span class="p">)]</span>
<span class="n">attrs</span> <span class="o">=</span> <span class="p">[</span><span class="n">attr</span><span class="o">.</span><span class="n">key</span> <span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">obj</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">category</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">return_obj</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">return_list</span><span class="o">=</span><span class="kc">True</span><span class="p">)]</span>
<span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">attrs</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">check_attr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">attr</span><span class="p">,</span> <span class="n">category</span><span class="p">):</span>
<span class="k">continue</span>

View file

@ -916,14 +916,14 @@
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">match</span><span class="p">,</span> <span class="n">HelpCategory</span><span class="p">):</span>
<span class="n">warning</span> <span class="o">=</span> <span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;&#39;</span><span class="si">{</span><span class="n">querystr</span><span class="si">}</span><span class="s2">&#39; matches (or partially matches) the name of &quot;</span>
<span class="s2">&quot;help-category &#39;</span><span class="si">{match.key}</span><span class="s2">&#39;. If you continue, your help entry will &quot;</span>
<span class="sa">f</span><span class="s2">&quot;help-category &#39;</span><span class="si">{</span><span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">&#39;. If you continue, your help entry will &quot;</span>
<span class="s2">&quot;take precedence and the category (or part of its name) *may* not &quot;</span>
<span class="s2">&quot;be usable for grouping help entries anymore.&quot;</span>
<span class="p">)</span>
<span class="k">elif</span> <span class="n">inherits_from</span><span class="p">(</span><span class="n">match</span><span class="p">,</span> <span class="s2">&quot;evennia.commands.command.Command&quot;</span><span class="p">):</span>
<span class="n">warning</span> <span class="o">=</span> <span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;&#39;</span><span class="si">{</span><span class="n">querystr</span><span class="si">}</span><span class="s2">&#39; matches (or partially matches) the key/alias of &quot;</span>
<span class="s2">&quot;Command &#39;</span><span class="si">{match.key}</span><span class="s2">&#39;. Command-help take precedence over other &quot;</span>
<span class="sa">f</span><span class="s2">&quot;Command &#39;</span><span class="si">{</span><span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">&#39;. Command-help take precedence over other &quot;</span>
<span class="s2">&quot;help entries so your help *may* be impossible to reach for those &quot;</span>
<span class="s2">&quot;with access to that command.&quot;</span>
<span class="p">)</span>

View file

@ -999,6 +999,39 @@
<span class="s2">&quot;{&#39;one&#39;: 99, &#39;three&#39;: 3, &#39;+&#39;: 42, &#39;+1&#39;: 33}&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="c1"># dict - case sensitive keys</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">building</span><span class="o">.</span><span class="n">CmdSetAttribute</span><span class="p">(),</span>
<span class="s2">&quot;Obj/test_case = {&#39;FooBar&#39;: 1}&quot;</span><span class="p">,</span>
<span class="s2">&quot;Created attribute Obj/test_case [category:None] = {&#39;FooBar&#39;: 1}&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">building</span><span class="o">.</span><span class="n">CmdSetAttribute</span><span class="p">(),</span>
<span class="s2">&quot;Obj/test_case[&#39;FooBar&#39;] = 2&quot;</span><span class="p">,</span>
<span class="s2">&quot;Modified attribute Obj/test_case [category:None] = {&#39;FooBar&#39;: 2}&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">building</span><span class="o">.</span><span class="n">CmdSetAttribute</span><span class="p">(),</span>
<span class="s2">&quot;Obj/test_case&quot;</span><span class="p">,</span>
<span class="s2">&quot;Attribute Obj/test_case [category:None] = {&#39;FooBar&#39;: 2}&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">building</span><span class="o">.</span><span class="n">CmdSetAttribute</span><span class="p">(),</span>
<span class="s2">&quot;Obj/test_case[&#39;FooBar&#39;] = {&#39;BarBaz&#39;: 1}&quot;</span><span class="p">,</span>
<span class="s2">&quot;Modified attribute Obj/test_case [category:None] = {&#39;FooBar&#39;: {&#39;BarBaz&#39;: 1}}&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">building</span><span class="o">.</span><span class="n">CmdSetAttribute</span><span class="p">(),</span>
<span class="s2">&quot;Obj/test_case[&#39;FooBar&#39;][&#39;BarBaz&#39;] = 2&quot;</span><span class="p">,</span>
<span class="s2">&quot;Modified attribute Obj/test_case [category:None] = {&#39;FooBar&#39;: {&#39;BarBaz&#39;: 2}}&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">building</span><span class="o">.</span><span class="n">CmdSetAttribute</span><span class="p">(),</span>
<span class="s2">&quot;Obj/test_case&quot;</span><span class="p">,</span>
<span class="s2">&quot;Attribute Obj/test_case [category:None] = {&#39;FooBar&#39;: {&#39;BarBaz&#39;: 2}}&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="c1"># tuple</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">building</span><span class="o">.</span><span class="n">CmdSetAttribute</span><span class="p">(),</span>

View file

@ -667,7 +667,7 @@
<span class="n">mapping</span><span class="p">[</span><span class="s2">&quot;outputs&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">iter_to_str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">output_names</span><span class="p">)</span>
<span class="c1"># populate template and return</span>
<span class="k">return</span> <span class="n">message</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">mapping</span><span class="p">)</span>
<span class="k">return</span> <span class="n">message</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">mapping</span><span class="p">)</span>
<div class="viewcode-block" id="CraftingRecipe.seed"><a class="viewcode-back" href="../../../../../api/evennia.contrib.game_systems.crafting.crafting.html#evennia.contrib.game_systems.crafting.crafting.CraftingRecipe.seed">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">seed</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">tool_kwargs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">consumable_kwargs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">location</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>

View file

@ -232,7 +232,7 @@
<span class="p">}</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">_format_message</span><span class="p">(</span><span class="n">msg</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">msg</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">expected</span><span class="p">))</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">msg</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">expected</span><span class="p">))</span></div>
<div class="viewcode-block" id="TestCraftingRecipe.test_craft__success"><a class="viewcode-back" href="../../../../../api/evennia.contrib.game_systems.crafting.tests.html#evennia.contrib.game_systems.crafting.tests.TestCraftingRecipe.test_craft__success">[docs]</a> <span class="k">def</span> <span class="nf">test_craft__success</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Test to create a result from the recipe&quot;&quot;&quot;</span>

View file

@ -50,14 +50,14 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">namedtuple</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="kn">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">InterruptCommand</span>
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">default_cmds</span><span class="p">,</span> <span class="n">CmdSet</span>
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">CmdSet</span><span class="p">,</span> <span class="n">InterruptCommand</span><span class="p">,</span> <span class="n">default_cmds</span>
<span class="kn">from</span> <span class="nn">evennia.commands.default</span> <span class="kn">import</span> <span class="n">building</span>
<span class="kn">from</span> <span class="nn">evennia.contrib.grid.xyzgrid.xyzroom</span> <span class="kn">import</span> <span class="n">XYZRoom</span>
<span class="kn">from</span> <span class="nn">evennia.contrib.grid.xyzgrid.xyzgrid</span> <span class="kn">import</span> <span class="n">get_xyzgrid</span>
<span class="kn">from</span> <span class="nn">evennia.contrib.grid.xyzgrid.xyzroom</span> <span class="kn">import</span> <span class="n">XYZRoom</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="kn">import</span> <span class="n">ansi</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="kn">import</span> <span class="n">list_to_string</span><span class="p">,</span> <span class="n">class_from_module</span><span class="p">,</span> <span class="n">delay</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="kn">import</span> <span class="n">class_from_module</span><span class="p">,</span> <span class="n">delay</span><span class="p">,</span> <span class="n">list_to_string</span>
<span class="n">COMMAND_DEFAULT_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">COMMAND_DEFAULT_CLASS</span><span class="p">)</span>
@ -191,7 +191,8 @@
<span class="k">if</span> <span class="nb">all</span><span class="p">(</span><span class="n">char</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs</span> <span class="k">for</span> <span class="n">char</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;(&quot;</span><span class="p">,</span> <span class="s2">&quot;)&quot;</span><span class="p">,</span> <span class="s2">&quot;,&quot;</span><span class="p">)):</span>
<span class="c1"># search by (X,Y) or (X,Y,Z)</span>
<span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="o">*</span><span class="n">Z</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;,&quot;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="n">inp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s2">&quot;()&quot;</span><span class="p">)</span>
<span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="o">*</span><span class="n">Z</span> <span class="o">=</span> <span class="n">inp</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;,&quot;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">Z</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;A full (X,Y,Z) coordinate must be given for the destination.&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">InterruptCommand</span>
@ -201,7 +202,7 @@
<span class="k">try</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">destination</span> <span class="o">=</span> <span class="n">XYZRoom</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">get_xyz</span><span class="p">(</span><span class="n">xyz</span><span class="o">=</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="n">Z</span><span class="p">))</span>
<span class="k">except</span> <span class="n">XYZRoom</span><span class="o">.</span><span class="n">DoesNotExist</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;Found no target XYZRoom at (</span><span class="si">{X}</span><span class="s2">,</span><span class="si">{Y}</span><span class="s2">,</span><span class="si">{Y}</span><span class="s2">).&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Found no target XYZRoom at (</span><span class="si">{</span><span class="n">X</span><span class="si">}</span><span class="s2">,</span><span class="si">{</span><span class="n">Y</span><span class="si">}</span><span class="s2">,</span><span class="si">{</span><span class="n">Z</span><span class="si">}</span><span class="s2">).&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">InterruptCommand</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># regular search query</span>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,246 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>evennia.contrib.rpg.buffs.samplebuffs &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../../../../../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../../../../../" src="../../../../../_static/documentation_options.js"></script>
<script src="../../../../../_static/jquery.js"></script>
<script src="../../../../../_static/underscore.js"></script>
<script src="../../../../../_static/doctools.js"></script>
<script src="../../../../../_static/language_data.js"></script>
<link rel="shortcut icon" href="../../../../../_static/favicon.ico"/>
<link rel="index" title="Index" href="../../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../../search.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../../index.html" >Module code</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../../../../evennia.html" accesskey="U">evennia</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.samplebuffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for evennia.contrib.rpg.buffs.samplebuffs</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">random</span>
<span class="kn">from</span> <span class="nn">.buff</span> <span class="kn">import</span> <span class="n">BaseBuff</span><span class="p">,</span> <span class="n">Mod</span>
<div class="viewcode-block" id="Exploit"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Exploit">[docs]</a><span class="k">class</span> <span class="nc">Exploit</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;exploit&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Exploit&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;You are learning your opponent&#39;s weaknesses.&quot;</span>
<span class="n">duration</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span>
<span class="n">maxstacks</span> <span class="o">=</span> <span class="mi">20</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;hit&quot;</span><span class="p">]</span>
<span class="n">stack_msg</span> <span class="o">=</span> <span class="p">{</span>
<span class="mi">1</span><span class="p">:</span> <span class="s2">&quot;You begin to notice flaws in your opponent&#39;s defense.&quot;</span><span class="p">,</span>
<span class="mi">10</span><span class="p">:</span> <span class="s2">&quot;You&#39;ve begun to match the battle&#39;s rhythm.&quot;</span><span class="p">,</span>
<span class="mi">20</span><span class="p">:</span> <span class="s2">&quot;You&#39;ve found a gap in the guard!&quot;</span><span class="p">,</span>
<span class="p">}</span>
<div class="viewcode-block" id="Exploit.conditional"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Exploit.conditional">[docs]</a> <span class="k">def</span> <span class="nf">conditional</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">Exploited</span><span class="p">):</span>
<span class="k">return</span> <span class="kc">False</span>
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="Exploit.at_trigger"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Exploit.at_trigger">[docs]</a> <span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">chance</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">stacks</span> <span class="o">/</span> <span class="mi">20</span>
<span class="n">roll</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">()</span>
<span class="k">if</span> <span class="n">chance</span> <span class="o">&gt;</span> <span class="n">roll</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">Exploited</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;An opportunity presents itself!&quot;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">chance</span> <span class="o">&lt;</span> <span class="n">roll</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">Exploit</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">stacks</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">stack_msg</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">stack_msg</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">stacks</span><span class="p">])</span></div></div>
<div class="viewcode-block" id="Exploited"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Exploited">[docs]</a><span class="k">class</span> <span class="nc">Exploited</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;exploited&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Exploited&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;You have sensed your target&#39;s vulnerability, and are poised to strike.&quot;</span>
<span class="n">duration</span> <span class="o">=</span> <span class="mi">30</span>
<span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;damage&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">100</span><span class="p">)]</span>
<div class="viewcode-block" id="Exploited.at_post_check"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Exploited.at_post_check">[docs]</a> <span class="k">def</span> <span class="nf">at_post_check</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;You ruthlessly exploit your target&#39;s weakness!&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">quiet</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
<div class="viewcode-block" id="Exploited.at_remove"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Exploited.at_remove">[docs]</a> <span class="k">def</span> <span class="nf">at_remove</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;You have waited too long; the opportunity passes.&quot;</span><span class="p">)</span></div></div>
<div class="viewcode-block" id="Leeching"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Leeching">[docs]</a><span class="k">class</span> <span class="nc">Leeching</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;leeching&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Leeching&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;Attacking this target fills you with vigor.&quot;</span>
<span class="n">duration</span> <span class="o">=</span> <span class="mi">30</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;taken_damage&quot;</span><span class="p">]</span>
<div class="viewcode-block" id="Leeching.at_trigger"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Leeching.at_trigger">[docs]</a> <span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">attacker</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">damage</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">attacker</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">damage</span><span class="p">:</span>
<span class="k">return</span>
<span class="n">attacker</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;You have been healed for </span><span class="si">{heal}</span><span class="s2"> life!&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">heal</span><span class="o">=</span><span class="n">damage</span> <span class="o">*</span> <span class="mf">0.1</span><span class="p">))</span></div></div>
<div class="viewcode-block" id="Poison"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Poison">[docs]</a><span class="k">class</span> <span class="nc">Poison</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;poison&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Poison&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;A poison wracks this body with painful spasms.&quot;</span>
<span class="n">duration</span> <span class="o">=</span> <span class="mi">120</span>
<span class="n">maxstacks</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">tickrate</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">dmg</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">playtime</span> <span class="o">=</span> <span class="kc">True</span>
<div class="viewcode-block" id="Poison.at_pause"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Poison.at_pause">[docs]</a> <span class="k">def</span> <span class="nf">at_pause</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">prelogout_location</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">(</span>
<span class="s2">&quot;</span><span class="si">{actor}</span><span class="s2"> stops twitching, their flesh a deathly pallor.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">actor</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">named</span><span class="p">)</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="Poison.at_unpause"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Poison.at_unpause">[docs]</a> <span class="k">def</span> <span class="nf">at_unpause</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">(</span>
<span class="s2">&quot;</span><span class="si">{actor}</span><span class="s2"> begins to twitch again, their cheeks flushing red with blood.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
<span class="n">actor</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">named</span>
<span class="p">)</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="Poison.at_tick"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Poison.at_tick">[docs]</a> <span class="k">def</span> <span class="nf">at_tick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">initial</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">_dmg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">dmg</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">stacks</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">initial</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">(</span>
<span class="s2">&quot;Poison courses through </span><span class="si">{actor}</span><span class="s2">&#39;s body, dealing </span><span class="si">{damage}</span><span class="s2"> damage.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
<span class="n">actor</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">named</span><span class="p">,</span> <span class="n">damage</span><span class="o">=</span><span class="n">_dmg</span>
<span class="p">)</span>
<span class="p">)</span></div></div>
<div class="viewcode-block" id="Sated"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.Sated">[docs]</a><span class="k">class</span> <span class="nc">Sated</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;sated&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Sated&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;You have eaten a great meal!&quot;</span>
<span class="n">duration</span> <span class="o">=</span> <span class="mi">180</span>
<span class="n">maxstacks</span> <span class="o">=</span> <span class="mi">3</span>
<span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;mood&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">15</span><span class="p">)]</span></div>
<div class="viewcode-block" id="StatBuff"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.StatBuff">[docs]</a><span class="k">class</span> <span class="nc">StatBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Customize the stat this buff affects by feeding a list in the order [stat, mod, base, perstack] to the cache argument when added&quot;&quot;&quot;</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;statbuff&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;statbuff&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;This buff affects the following stats: </span><span class="si">{stats}</span><span class="s2">&quot;</span>
<span class="n">maxstacks</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">refresh</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">unique</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">cache</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;modgen&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;foo&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]}</span>
<div class="viewcode-block" id="StatBuff.__init__"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.samplebuffs.html#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.__init__">[docs]</a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">buffkey</span><span class="p">,</span> <span class="n">cache</span><span class="o">=</span><span class="p">{})</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">buffkey</span><span class="p">,</span> <span class="n">cache</span><span class="p">)</span>
<span class="c1"># Finds our &quot;modgen&quot; cache value, which we pass on application</span>
<span class="n">modgen</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;modgen&quot;</span><span class="p">))</span>
<span class="k">if</span> <span class="n">modgen</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="o">*</span><span class="n">modgen</span><span class="p">)]</span>
<span class="n">msg</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">_msg</span> <span class="o">=</span> <span class="p">[</span><span class="n">mod</span><span class="o">.</span><span class="n">stat</span> <span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mods</span><span class="p">]</span>
<span class="k">for</span> <span class="n">stat</span> <span class="ow">in</span> <span class="n">_msg</span><span class="p">:</span>
<span class="n">msg</span> <span class="o">+=</span> <span class="n">stat</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flavor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">flavor</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">stats</span><span class="o">=</span><span class="n">msg</span><span class="p">)</span></div></div>
</pre></div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../../../../index.html">
<img class="logo" src="../../../../../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="samplebuffs.html">1.0-dev (develop branch)</a></li>
<li><a href="../../../../../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../../index.html" >Module code</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../../../../evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.samplebuffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>

View file

@ -0,0 +1,498 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>evennia.contrib.rpg.buffs.tests &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../../../../../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../../../../../" src="../../../../../_static/documentation_options.js"></script>
<script src="../../../../../_static/jquery.js"></script>
<script src="../../../../../_static/underscore.js"></script>
<script src="../../../../../_static/doctools.js"></script>
<script src="../../../../../_static/language_data.js"></script>
<link rel="shortcut icon" href="../../../../../_static/favicon.ico"/>
<link rel="index" title="Index" href="../../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../../search.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../../index.html" >Module code</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../../../../evennia.html" accesskey="U">evennia</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for evennia.contrib.rpg.buffs.tests</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">Tests for the buff system contrib</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">unittest.mock</span> <span class="kn">import</span> <span class="n">Mock</span><span class="p">,</span> <span class="n">call</span><span class="p">,</span> <span class="n">patch</span>
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">DefaultObject</span><span class="p">,</span> <span class="n">create_object</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="kn">import</span> <span class="n">create</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="kn">import</span> <span class="n">lazy_property</span>
<span class="kn">from</span> <span class="nn">.samplebuffs</span> <span class="kn">import</span> <span class="n">StatBuff</span>
<span class="kn">from</span> <span class="nn">.buff</span> <span class="kn">import</span> <span class="n">BaseBuff</span><span class="p">,</span> <span class="n">Mod</span><span class="p">,</span> <span class="n">BuffHandler</span><span class="p">,</span> <span class="n">BuffableProperty</span>
<span class="kn">from</span> <span class="nn">evennia.utils.test_resources</span> <span class="kn">import</span> <span class="n">EvenniaTest</span>
<span class="kn">from</span> <span class="nn">evennia.contrib.rpg.buffs</span> <span class="kn">import</span> <span class="n">buff</span>
<span class="k">class</span> <span class="nc">_EmptyBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="k">pass</span>
<span class="k">class</span> <span class="nc">_TestModBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;tmb&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;tmb&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;modderbuff&quot;</span>
<span class="n">maxstacks</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;stat1&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">5</span><span class="p">),</span> <span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;stat2&quot;</span><span class="p">,</span> <span class="s2">&quot;mult&quot;</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)]</span>
<span class="k">class</span> <span class="nc">_TestModBuff2</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;tmb2&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;tmb2&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;modderbuff2&quot;</span>
<span class="n">maxstacks</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;stat1&quot;</span><span class="p">,</span> <span class="s2">&quot;mult&quot;</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;stat1&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">10</span><span class="p">)]</span>
<span class="k">class</span> <span class="nc">_TestTrigBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;ttb&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;ttb&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;triggerbuff&quot;</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;test1&quot;</span><span class="p">,</span> <span class="s2">&quot;test2&quot;</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="n">trigger</span> <span class="o">==</span> <span class="s2">&quot;test1&quot;</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest1</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">if</span> <span class="n">trigger</span> <span class="o">==</span> <span class="s2">&quot;test2&quot;</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest2</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">class</span> <span class="nc">_TestConBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;tcb&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;tcb&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;condbuff&quot;</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;condtest&quot;</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">conditional</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">cond1</span>
<span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">attacker</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">defender</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">damage</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">defender</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">att</span><span class="p">,</span> <span class="n">defender</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">dmg</span> <span class="o">=</span> <span class="n">attacker</span><span class="p">,</span> <span class="n">damage</span>
<span class="k">class</span> <span class="nc">_TestComplexBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;tcomb&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;complex&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;combuff&quot;</span>
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;comtest&quot;</span><span class="p">,</span> <span class="s2">&quot;complextest&quot;</span><span class="p">]</span>
<span class="n">mods</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;com1&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">),</span>
<span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;com1&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">15</span><span class="p">),</span>
<span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;com1&quot;</span><span class="p">,</span> <span class="s2">&quot;mult&quot;</span><span class="p">,</span> <span class="mf">2.0</span><span class="p">),</span>
<span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;com2&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">100</span><span class="p">),</span>
<span class="p">]</span>
<span class="k">def</span> <span class="nf">conditional</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cond</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">return</span> <span class="ow">not</span> <span class="n">cond</span>
<span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="n">trigger</span> <span class="o">==</span> <span class="s2">&quot;comtest&quot;</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;cond&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">class</span> <span class="nc">_TestTimeBuff</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;ttib&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;ttib&quot;</span>
<span class="n">flavor</span> <span class="o">=</span> <span class="s2">&quot;timerbuff&quot;</span>
<span class="n">maxstacks</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">tickrate</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">duration</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">mods</span> <span class="o">=</span> <span class="p">[</span><span class="n">Mod</span><span class="p">(</span><span class="s2">&quot;timetest&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">665</span><span class="p">)]</span>
<span class="k">def</span> <span class="nf">at_tick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">initial</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">ticktest</span> <span class="o">=</span> <span class="kc">True</span>
<div class="viewcode-block" id="BuffableObject"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.BuffableObject">[docs]</a><span class="k">class</span> <span class="nc">BuffableObject</span><span class="p">(</span><span class="n">DefaultObject</span><span class="p">):</span>
<span class="n">stat1</span> <span class="o">=</span> <span class="n">BuffableProperty</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<div class="viewcode-block" id="BuffableObject.buffs"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.BuffableObject.buffs">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">buffs</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">BuffHandler</span><span class="p">:</span>
<span class="k">return</span> <span class="n">BuffHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
<div class="viewcode-block" id="BuffableObject.at_init"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.BuffableObject.at_init">[docs]</a> <span class="k">def</span> <span class="nf">at_init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">stat1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">buffs</span>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">at_init</span><span class="p">()</span></div></div>
<div class="viewcode-block" id="TestBuffsAndHandler"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler">[docs]</a><span class="k">class</span> <span class="nc">TestBuffsAndHandler</span><span class="p">(</span><span class="n">EvenniaTest</span><span class="p">):</span>
<span class="s2">&quot;This tests a number of things about buffs.&quot;</span>
<div class="viewcode-block" id="TestBuffsAndHandler.setUp"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.setUp">[docs]</a> <span class="k">def</span> <span class="nf">setUp</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setUp</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span> <span class="o">=</span> <span class="n">create</span><span class="o">.</span><span class="n">create_object</span><span class="p">(</span><span class="n">BuffableObject</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="s2">&quot;testobj&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.tearDown"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.tearDown">[docs]</a> <span class="k">def</span> <span class="nf">tearDown</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;done after every test_* method below&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">tearDown</span><span class="p">()</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_addremove"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_addremove">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_addremove</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests adding and removing buffs&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="c1"># add</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">,</span> <span class="n">to_cache</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;cachetest&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">})</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestTrigBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="p">[</span><span class="s2">&quot;tmb&quot;</span><span class="p">][</span><span class="s2">&quot;ref&quot;</span><span class="p">],</span> <span class="n">_TestModBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="p">[</span><span class="s2">&quot;tmb&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;cachetest&quot;</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="p">[</span><span class="s2">&quot;ttb&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;cachetest&quot;</span><span class="p">))</span>
<span class="c1"># has</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">has</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">has</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">has</span><span class="p">(</span><span class="n">_EmptyBuff</span><span class="p">))</span>
<span class="c1"># remove</span>
<span class="n">handler</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">))</span>
<span class="c1"># remove stacks</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">,</span> <span class="n">stacks</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">,</span> <span class="n">stacks</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">))</span>
<span class="c1"># remove by type</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">remove_by_type</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">))</span>
<span class="c1"># remove by buff instance</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">all</span><span class="p">[</span><span class="s2">&quot;tmb&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">))</span>
<span class="c1"># remove by source</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">remove_by_source</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">))</span>
<span class="c1"># remove by cachevalue</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">remove_by_cachevalue</span><span class="p">(</span><span class="s2">&quot;failure&quot;</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">))</span>
<span class="c1"># remove all</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">all</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_getters"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_getters">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_getters</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests all built-in getters&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">,</span> <span class="n">source</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">obj2</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestTrigBuff</span><span class="p">,</span> <span class="n">to_cache</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;ttbcache&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">})</span>
<span class="c1"># normal getter</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">),</span> <span class="n">_TestModBuff</span><span class="p">))</span>
<span class="c1"># stat getters</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get_by_stat</span><span class="p">(</span><span class="s2">&quot;stat1&quot;</span><span class="p">)[</span><span class="s2">&quot;tmb&quot;</span><span class="p">],</span> <span class="n">_TestModBuff</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get_by_stat</span><span class="p">(</span><span class="s2">&quot;nullstat&quot;</span><span class="p">))</span>
<span class="c1"># trigger getters</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="s2">&quot;ttb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_trigger</span><span class="p">(</span><span class="s2">&quot;test1&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="s2">&quot;ttb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_trigger</span><span class="p">(</span><span class="s2">&quot;nulltrig&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="c1"># type getters</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">_EmptyBuff</span><span class="p">))</span>
<span class="c1"># source getter</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_source</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj2</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="s2">&quot;ttb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_source</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj2</span><span class="p">))</span>
<span class="c1"># cachevalue getter</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_cachevalue</span><span class="p">(</span><span class="s2">&quot;ttbcache&quot;</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="s2">&quot;ttb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_cachevalue</span><span class="p">(</span><span class="s2">&quot;ttbcache&quot;</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="s2">&quot;ttb&quot;</span> <span class="ow">in</span> <span class="n">handler</span><span class="o">.</span><span class="n">get_by_cachevalue</span><span class="p">(</span><span class="s2">&quot;ttbcache&quot;</span><span class="p">,</span> <span class="kc">True</span><span class="p">))</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_details"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_details">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_details</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests that buff details like name and flavor are correct&quot;&quot;&quot;</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestTrigBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">flavor</span><span class="p">,</span> <span class="s2">&quot;modderbuff&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;ttb&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="s2">&quot;ttb&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_modify"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_modify">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_modify</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests to ensure that values are modified correctly, and stack across mods&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="n">_stat1</span><span class="p">,</span> <span class="n">_stat2</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">10</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="c1"># stat1 and 2 basic mods</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">15</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat2</span><span class="p">,</span> <span class="s2">&quot;stat2&quot;</span><span class="p">),</span> <span class="mi">15</span><span class="p">)</span>
<span class="c1"># checks can take any base value</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat2&quot;</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat2</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">25</span><span class="p">)</span>
<span class="c1"># change to base stat reflected in check</span>
<span class="n">_stat1</span> <span class="o">+=</span> <span class="mi">5</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">20</span><span class="p">)</span>
<span class="n">_stat2</span> <span class="o">+=</span> <span class="mi">10</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat2</span><span class="p">,</span> <span class="s2">&quot;stat2&quot;</span><span class="p">),</span> <span class="mi">30</span><span class="p">)</span>
<span class="c1"># test stacking; single stack, multiple stack, max stacks</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">25</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">,</span> <span class="n">stacks</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">40</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">,</span> <span class="n">stacks</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">40</span><span class="p">)</span>
<span class="c1"># stat2 mod doesn&#39;t stack</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat2</span><span class="p">,</span> <span class="s2">&quot;stat2&quot;</span><span class="p">),</span> <span class="mi">30</span><span class="p">)</span>
<span class="c1"># layers with second mod</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff2</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">100</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat2</span><span class="p">,</span> <span class="s2">&quot;stat2&quot;</span><span class="p">),</span> <span class="mi">30</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">remove_by_type</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat1</span><span class="p">,</span> <span class="s2">&quot;stat1&quot;</span><span class="p">),</span> <span class="mi">30</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">_stat2</span><span class="p">,</span> <span class="s2">&quot;stat2&quot;</span><span class="p">),</span> <span class="mi">20</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_trigger"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_trigger">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests to ensure triggers correctly fire&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestTrigBuff</span><span class="p">)</span>
<span class="c1"># trigger buffs</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;nulltest&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest2</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;test1&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest2</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;test2&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">triggertest2</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_context_conditional"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_context_conditional">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_context_conditional</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests to ensure context is passed to buffs, and also tests conditionals&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestConBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">cond1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">att</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">dmg</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="mi">0</span>
<span class="c1"># context to pass, containing basic event data and a little extra to be ignored</span>
<span class="n">_testcontext</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;attacker&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">obj2</span><span class="p">,</span>
<span class="s2">&quot;defender&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="p">,</span>
<span class="s2">&quot;damage&quot;</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>
<span class="s2">&quot;overflow&quot;</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span>
<span class="p">}</span>
<span class="c1"># test negative conditional</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">_TestConBuff</span><span class="p">)[</span><span class="s2">&quot;tcb&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">conditional</span><span class="p">(</span><span class="o">**</span><span class="n">_testcontext</span><span class="p">),</span> <span class="kc">False</span>
<span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;condtest&quot;</span><span class="p">,</span> <span class="n">_testcontext</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">att</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">dmg</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="c1"># test positive conditional + context passing</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">cond1</span> <span class="o">=</span> <span class="kc">True</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">_TestConBuff</span><span class="p">)[</span><span class="s2">&quot;tcb&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">conditional</span><span class="p">(</span><span class="o">**</span><span class="n">_testcontext</span><span class="p">),</span> <span class="kc">True</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;condtest&quot;</span><span class="p">,</span> <span class="n">_testcontext</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">att</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">obj2</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">dmg</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_complex"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_complex">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_complex</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests a complex mod (conditionals, multiple triggers/mods)&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comone</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtwo</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span> <span class="o">=</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">{}</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestComplexBuff</span><span class="p">)</span>
<span class="c1"># stat checks work correctly and separately</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">,</span> <span class="p">{})</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comone</span><span class="p">,</span> <span class="s2">&quot;com1&quot;</span><span class="p">),</span> <span class="mi">105</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtwo</span><span class="p">,</span> <span class="s2">&quot;com2&quot;</span><span class="p">),</span> <span class="mi">100</span><span class="p">)</span>
<span class="c1"># stat checks don&#39;t happen if the conditional is true</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;comtest&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">,</span> <span class="p">{</span><span class="s2">&quot;cond&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">})</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">get_by_type</span><span class="p">(</span><span class="n">_TestComplexBuff</span><span class="p">)[</span><span class="s2">&quot;tcomb&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">conditional</span><span class="p">(</span><span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">),</span>
<span class="kc">False</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comone</span><span class="p">,</span> <span class="s2">&quot;com1&quot;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">),</span> <span class="mi">10</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtwo</span><span class="p">,</span> <span class="s2">&quot;com2&quot;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">),</span> <span class="mi">0</span>
<span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;complextest&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comone</span><span class="p">,</span> <span class="s2">&quot;com1&quot;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">),</span> <span class="mi">10</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtwo</span><span class="p">,</span> <span class="s2">&quot;com2&quot;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">),</span> <span class="mi">0</span>
<span class="p">)</span>
<span class="c1"># separate trigger follows different codepath</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;cond&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span>
<span class="n">handler</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;complextest&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">,</span> <span class="p">{})</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comone</span><span class="p">,</span> <span class="s2">&quot;com1&quot;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">),</span> <span class="mi">105</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtwo</span><span class="p">,</span> <span class="s2">&quot;com2&quot;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">comtext</span><span class="p">),</span> <span class="mi">100</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_timing"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_timing">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">test_timing</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mock_delay</span><span class="p">:</span> <span class="n">Mock</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests timing-related features, such as ticking and duration&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="n">mock_delay</span><span class="o">.</span><span class="n">side_effect</span> <span class="o">=</span> <span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="n">handler</span><span class="o">.</span><span class="n">cleanup</span><span class="p">]</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestTimeBuff</span><span class="p">)</span>
<span class="n">calls</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">call</span><span class="p">(</span>
<span class="mi">1</span><span class="p">,</span>
<span class="n">buff</span><span class="o">.</span><span class="n">tick_buff</span><span class="p">,</span>
<span class="n">handler</span><span class="o">=</span><span class="n">handler</span><span class="p">,</span>
<span class="n">buffkey</span><span class="o">=</span><span class="s2">&quot;ttib&quot;</span><span class="p">,</span>
<span class="n">context</span><span class="o">=</span><span class="p">{},</span>
<span class="n">initial</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">persistent</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="p">),</span>
<span class="n">call</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">handler</span><span class="o">.</span><span class="n">cleanup</span><span class="p">,</span> <span class="n">persistent</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span>
<span class="p">]</span>
<span class="n">mock_delay</span><span class="o">.</span><span class="n">assert_has_calls</span><span class="p">(</span><span class="n">calls</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">timetest</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">ticktest</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="kc">False</span>
<span class="c1"># test duration and ticking</span>
<span class="n">_instance</span> <span class="o">=</span> <span class="n">handler</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;ttib&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="n">_instance</span><span class="o">.</span><span class="n">ticking</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">_instance</span><span class="o">.</span><span class="n">duration</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="n">_instance</span><span class="o">.</span><span class="n">at_tick</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertTrue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">ticktest</span><span class="p">)</span>
<span class="c1"># test duration modification and cleanup</span>
<span class="n">handler</span><span class="o">.</span><span class="n">set_duration</span><span class="p">(</span><span class="s2">&quot;ttib&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;ttib&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">duration</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="n">handler</span><span class="o">.</span><span class="n">cleanup</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;ttib&quot;</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_buffableproperty"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_buffableproperty">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_buffableproperty</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests buffable properties&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">stat1</span><span class="p">,</span> <span class="mi">25</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="s2">&quot;tmb&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">stat1</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_stresstest"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_stresstest">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_stresstest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;tests large amounts of buffs, and related removal methods&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">20</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="s2">&quot;test&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">_TestTrigBuff</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="s2">&quot;trig&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">stat1</span><span class="p">,</span> <span class="mi">295</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s2">&quot;test1&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">remove_by_type</span><span class="p">(</span><span class="n">_TestModBuff</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">stat1</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertFalse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">all</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestBuffsAndHandler.test_modgen"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.buffs.tests.html#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_modgen">[docs]</a> <span class="nd">@patch</span><span class="p">(</span><span class="s2">&quot;evennia.contrib.rpg.buffs.buff.utils.delay&quot;</span><span class="p">,</span> <span class="n">new</span><span class="o">=</span><span class="n">Mock</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">test_modgen</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;test generating mods on the fly&quot;&quot;&quot;</span>
<span class="c1"># setup</span>
<span class="n">handler</span><span class="p">:</span> <span class="n">BuffHandler</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">buffs</span>
<span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">gentest</span> <span class="o">=</span> <span class="mi">5</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">gentest</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="n">tc</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;modgen&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;gentest&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">]}</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StatBuff</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="s2">&quot;gentest&quot;</span><span class="p">,</span> <span class="n">to_cache</span><span class="o">=</span><span class="n">tc</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">gentest</span><span class="p">,</span> <span class="s2">&quot;gentest&quot;</span><span class="p">),</span> <span class="mi">10</span><span class="p">)</span>
<span class="n">tc</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;modgen&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;gentest&quot;</span><span class="p">,</span> <span class="s2">&quot;add&quot;</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">]}</span>
<span class="n">handler</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StatBuff</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="s2">&quot;gentest&quot;</span><span class="p">,</span> <span class="n">to_cache</span><span class="o">=</span><span class="n">tc</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">handler</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">testobj</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">gentest</span><span class="p">,</span> <span class="s2">&quot;gentest&quot;</span><span class="p">),</span> <span class="mi">15</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="n">handler</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;gentest&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">flavor</span><span class="p">,</span> <span class="s2">&quot;This buff affects the following stats: gentest&quot;</span>
<span class="p">)</span></div></div>
</pre></div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../../../../index.html">
<img class="logo" src="../../../../../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="tests.html">1.0-dev (develop branch)</a></li>
<li><a href="../../../../../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../../index.html" >Module code</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../../../../evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>

View file

@ -255,6 +255,7 @@
<span class="c1"># this regex returns in groups (langname, say), where langname can be empty.</span>
<span class="n">_RE_LANGUAGE</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;(?:\((\w+)\))*(</span><span class="se">\&quot;</span><span class="s2">.+?</span><span class="se">\&quot;</span><span class="s2">)&quot;</span><span class="p">)</span>
<span class="c1"># the emote parser works in two steps:</span>
<span class="c1"># 1) convert the incoming emote into an intermediary</span>
<span class="c1"># form with all object references mapped to ids.</span>
@ -446,7 +447,7 @@
<span class="n">match_index</span> <span class="o">=</span> <span class="n">marker_match</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="c1"># split the emote string at the reference marker, to process everything after it</span>
<span class="n">head</span> <span class="o">=</span> <span class="n">string</span><span class="p">[:</span><span class="n">match_index</span><span class="p">]</span>
<span class="n">tail</span> <span class="o">=</span> <span class="n">string</span><span class="p">[</span><span class="n">match_index</span> <span class="o">+</span> <span class="mi">1</span> <span class="p">:]</span>
<span class="n">tail</span> <span class="o">=</span> <span class="n">string</span><span class="p">[</span><span class="n">match_index</span> <span class="o">+</span> <span class="mi">1</span><span class="p">:]</span>
<span class="k">if</span> <span class="n">search_mode</span><span class="p">:</span>
<span class="c1"># match the candidates against the whole search string after the marker</span>
@ -492,7 +493,7 @@
<span class="c1"># save search string</span>
<span class="n">matched_text</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tail</span><span class="p">[</span><span class="mi">1</span><span class="p">:</span><span class="n">iend</span><span class="p">])</span>
<span class="c1"># recombine remainder of emote back into a string</span>
<span class="n">tail</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tail</span><span class="p">[</span><span class="n">iend</span> <span class="o">+</span> <span class="mi">1</span> <span class="p">:])</span>
<span class="n">tail</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tail</span><span class="p">[</span><span class="n">iend</span> <span class="o">+</span> <span class="mi">1</span><span class="p">:])</span>
<span class="n">nmatches</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">bestmatches</span><span class="p">)</span>
@ -569,7 +570,7 @@
<span class="k">return</span> <span class="n">string</span><span class="p">,</span> <span class="n">mapping</span></div>
<div class="viewcode-block" id="send_emote"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.rpsystem.rpsystem.html#evennia.contrib.rpg.rpsystem.rpsystem.send_emote">[docs]</a><span class="k">def</span> <span class="nf">send_emote</span><span class="p">(</span><span class="n">sender</span><span class="p">,</span> <span class="n">receivers</span><span class="p">,</span> <span class="n">emote</span><span class="p">,</span> <span class="n">anonymous_add</span><span class="o">=</span><span class="s2">&quot;first&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<div class="viewcode-block" id="send_emote"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.rpsystem.rpsystem.html#evennia.contrib.rpg.rpsystem.rpsystem.send_emote">[docs]</a><span class="k">def</span> <span class="nf">send_emote</span><span class="p">(</span><span class="n">sender</span><span class="p">,</span> <span class="n">receivers</span><span class="p">,</span> <span class="n">emote</span><span class="p">,</span> <span class="n">msg_type</span><span class="o">=</span><span class="s2">&quot;pose&quot;</span><span class="p">,</span> <span class="n">anonymous_add</span><span class="o">=</span><span class="s2">&quot;first&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Main access function for distribute an emote.</span>
@ -579,6 +580,9 @@
<span class="sd"> will also form the basis for which sdescs are</span>
<span class="sd"> &#39;valid&#39; to use in the emote.</span>
<span class="sd"> emote (str): The raw emote string as input by emoter.</span>
<span class="sd"> msg_type (str): The type of emote this is. &quot;say&quot; or &quot;pose&quot;</span>
<span class="sd"> for example. This is arbitrary and used for generating</span>
<span class="sd"> extra data for .msg(text) tuple.</span>
<span class="sd"> anonymous_add (str or None, optional): If `sender` is not</span>
<span class="sd"> self-referencing in the emote, this will auto-add</span>
<span class="sd"> `sender`&#39;s data to the emote. Possible values are</span>
@ -643,7 +647,7 @@
<span class="p">}</span>
<span class="c1"># map the language {##num} markers. This will convert the escaped sdesc markers on</span>
<span class="c1"># the form {{#num}} to {#num} markers ready to sdesc-map in the next step.</span>
<span class="n">sendemote</span> <span class="o">=</span> <span class="n">emote</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">receiver_lang_mapping</span><span class="p">)</span>
<span class="n">sendemote</span> <span class="o">=</span> <span class="n">emote</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">receiver_lang_mapping</span><span class="p">)</span>
<span class="c1"># map the ref keys to sdescs</span>
<span class="n">receiver_sdesc_mapping</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span>
@ -655,7 +659,11 @@
<span class="p">)</span>
<span class="c1"># do the template replacement of the sdesc/recog {#num} markers</span>
<span class="n">receiver</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="n">sendemote</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">receiver_sdesc_mapping</span><span class="p">),</span> <span class="n">from_obj</span><span class="o">=</span><span class="n">sender</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
<span class="n">receiver</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span>
<span class="n">text</span><span class="o">=</span><span class="p">(</span><span class="n">sendemote</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">receiver_sdesc_mapping</span><span class="p">),</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">msg_type</span><span class="p">}),</span>
<span class="n">from_obj</span><span class="o">=</span><span class="n">sender</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span></div>
<span class="c1"># ------------------------------------------------------------</span>
@ -966,7 +974,7 @@
<span class="c1"># calling the speech modifying hook</span>
<span class="n">speech</span> <span class="o">=</span> <span class="n">caller</span><span class="o">.</span><span class="n">at_pre_say</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">)</span>
<span class="n">targets</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">contents</span>
<span class="n">send_emote</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="p">,</span> <span class="n">targets</span><span class="p">,</span> <span class="n">speech</span><span class="p">,</span> <span class="n">anonymous_add</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span></div></div>
<span class="n">send_emote</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="p">,</span> <span class="n">targets</span><span class="p">,</span> <span class="n">speech</span><span class="p">,</span> <span class="n">msg_type</span><span class="o">=</span><span class="s2">&quot;say&quot;</span><span class="p">,</span> <span class="n">anonymous_add</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span></div></div>
<div class="viewcode-block" id="CmdSdesc"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.rpsystem.rpsystem.html#evennia.contrib.rpg.rpsystem.rpsystem.CmdSdesc">[docs]</a><span class="k">class</span> <span class="nc">CmdSdesc</span><span class="p">(</span><span class="n">RPCommand</span><span class="p">):</span> <span class="c1"># set/look at own sdesc</span>
@ -1093,7 +1101,7 @@
<span class="p">(</span><span class="n">ref</span><span class="p">,</span> <span class="n">obj</span><span class="o">.</span><span class="n">sdesc</span><span class="o">.</span><span class="n">get</span><span class="p">()</span> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">&quot;sdesc&quot;</span><span class="p">)</span> <span class="k">else</span> <span class="n">obj</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
<span class="k">for</span> <span class="n">ref</span><span class="p">,</span> <span class="n">obj</span> <span class="ow">in</span> <span class="n">mapping</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="n">pose</span> <span class="o">=</span> <span class="n">parsed</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">mapping</span><span class="p">)</span>
<span class="n">pose</span> <span class="o">=</span> <span class="n">parsed</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">mapping</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">target_name</span><span class="p">)</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="n">pose</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">60</span><span class="p">:</span>
<span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;&#39;</span><span class="si">{</span><span class="n">pose</span><span class="si">}</span><span class="s2">&#39; is too long.&quot;</span><span class="p">)</span>
@ -1309,19 +1317,19 @@
<span class="bp">self</span><span class="o">.</span><span class="n">sdesc</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s2">&quot;Something&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="ContribRPObject.search"><a class="viewcode-back" href="../../../../../api/evennia.contrib.rpg.rpsystem.rpsystem.html#evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject.search">[docs]</a> <span class="k">def</span> <span class="nf">search</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">searchdata</span><span class="p">,</span>
<span class="n">global_search</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">use_nicks</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">typeclass</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">location</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">attribute_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">quiet</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">exact</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">candidates</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">nofound_string</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">multimatch_string</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">use_dbref</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">searchdata</span><span class="p">,</span>
<span class="n">global_search</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">use_nicks</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">typeclass</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">location</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">attribute_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">quiet</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">exact</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">candidates</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">nofound_string</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">multimatch_string</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">use_dbref</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns an Object matching a search string/condition, taking</span>
@ -1405,10 +1413,10 @@
<span class="p">)</span>
<span class="k">if</span> <span class="n">global_search</span> <span class="ow">or</span> <span class="p">(</span>
<span class="n">is_string</span>
<span class="ow">and</span> <span class="n">searchdata</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;#&quot;</span><span class="p">)</span>
<span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">searchdata</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span>
<span class="ow">and</span> <span class="n">searchdata</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span><span class="o">.</span><span class="n">isdigit</span><span class="p">()</span>
<span class="n">is_string</span>
<span class="ow">and</span> <span class="n">searchdata</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;#&quot;</span><span class="p">)</span>
<span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">searchdata</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span>
<span class="ow">and</span> <span class="n">searchdata</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span><span class="o">.</span><span class="n">isdigit</span><span class="p">()</span>
<span class="p">):</span>
<span class="c1"># only allow exact matching if searching the entire database</span>
<span class="c1"># or unique #dbrefs</span>

View file

@ -264,17 +264,17 @@
<span class="n">receiver2</span><span class="o">.</span><span class="n">msg</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">text</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="nb">setattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;out2&quot;</span><span class="p">,</span> <span class="n">text</span><span class="p">)</span>
<span class="n">rpsystem</span><span class="o">.</span><span class="n">send_emote</span><span class="p">(</span><span class="n">speaker</span><span class="p">,</span> <span class="n">receivers</span><span class="p">,</span> <span class="n">emote</span><span class="p">,</span> <span class="n">case_sensitive</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out0</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out0</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="s2">&quot;With a flair, |mSender|n looks at |bThe first receiver of emotes.|n &quot;</span>
<span class="s1">&#39;and |bAnother nice colliding sdesc-guy for tests|n. She says |w&quot;This is a test.&quot;|n&#39;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out1</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out1</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="s2">&quot;With a flair, |bA nice sender of emotes|n looks at |mReceiver1|n and &quot;</span>
<span class="s1">&#39;|bAnother nice colliding sdesc-guy for tests|n. She says |w&quot;This is a test.&quot;|n&#39;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out2</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out2</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="s2">&quot;With a flair, |bA nice sender of emotes|n looks at |bThe first &quot;</span>
<span class="s1">&#39;receiver of emotes.|n and |mReceiver2|n. She says |w&quot;This is a test.&quot;|n&#39;</span><span class="p">,</span>
<span class="p">)</span></div>
@ -293,19 +293,19 @@
<span class="n">receiver2</span><span class="o">.</span><span class="n">msg</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">text</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="nb">setattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;out2&quot;</span><span class="p">,</span> <span class="n">text</span><span class="p">)</span>
<span class="n">rpsystem</span><span class="o">.</span><span class="n">send_emote</span><span class="p">(</span><span class="n">speaker</span><span class="p">,</span> <span class="n">receivers</span><span class="p">,</span> <span class="n">case_emote</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out0</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out0</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="s2">&quot;|mSender|n looks at |bthe first receiver of emotes.|n. Then, |mSender|n &quot;</span>
<span class="s2">&quot;looks at |bTHE FIRST RECEIVER OF EMOTES.|n, |bThe first receiver of emotes.|n &quot;</span>
<span class="s2">&quot;and |bAnother nice colliding sdesc-guy for tests|n twice.&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out1</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out1</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="s2">&quot;|bA nice sender of emotes|n looks at |mReceiver1|n. Then, &quot;</span>
<span class="s2">&quot;|ba nice sender of emotes|n looks at |mReceiver1|n, |mReceiver1|n &quot;</span>
<span class="s2">&quot;and |bAnother nice colliding sdesc-guy for tests|n twice.&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out2</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">out2</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="s2">&quot;|bA nice sender of emotes|n looks at |bthe first receiver of emotes.|n. &quot;</span>
<span class="s2">&quot;Then, |ba nice sender of emotes|n looks at |bTHE FIRST RECEIVER OF EMOTES.|n, &quot;</span>
<span class="s2">&quot;|bThe first receiver of emotes.|n and |mReceiver2|n twice.&quot;</span><span class="p">,</span>

View file

@ -366,7 +366,7 @@
<span class="n">search_candidates</span> <span class="o">=</span> <span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
<span class="n">type_restriction</span>
<span class="o">&amp;</span> <span class="p">(</span><span class="n">Q</span><span class="p">(</span><span class="n">db_key__istartswith</span><span class="o">=</span><span class="n">ostring</span><span class="p">)</span> <span class="o">|</span> <span class="n">Q</span><span class="p">(</span><span class="n">db_tags__db_key__istartswith</span><span class="o">=</span><span class="n">ostring</span><span class="p">))</span>
<span class="o">&amp;</span> <span class="p">(</span><span class="n">Q</span><span class="p">(</span><span class="n">db_key__icontains</span><span class="o">=</span><span class="n">ostring</span><span class="p">)</span> <span class="o">|</span> <span class="n">Q</span><span class="p">(</span><span class="n">db_tags__db_key__icontains</span><span class="o">=</span><span class="n">ostring</span><span class="p">))</span>
<span class="p">)</span>
<span class="o">.</span><span class="n">distinct</span><span class="p">()</span>
<span class="o">.</span><span class="n">order_by</span><span class="p">(</span><span class="s2">&quot;id&quot;</span><span class="p">)</span>

View file

@ -55,7 +55,6 @@
<span class="kn">import</span> <span class="nn">inflect</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="kn">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="kn">import</span> <span class="n">gettext</span> <span class="k">as</span> <span class="n">_</span>
<span class="kn">from</span> <span class="nn">evennia.commands</span> <span class="kn">import</span> <span class="n">cmdset</span>
<span class="kn">from</span> <span class="nn">evennia.commands.cmdsethandler</span> <span class="kn">import</span> <span class="n">CmdSetHandler</span>
<span class="kn">from</span> <span class="nn">evennia.objects.manager</span> <span class="kn">import</span> <span class="n">ObjectManager</span>
@ -859,8 +858,8 @@
<span class="p">)</span>
<span class="c1"># director-stance replacements</span>
<span class="n">outmessage</span> <span class="o">=</span> <span class="n">inmessage</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
<span class="o">**</span><span class="p">{</span>
<span class="n">outmessage</span> <span class="o">=</span> <span class="n">inmessage</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span>
<span class="p">{</span>
<span class="n">key</span><span class="p">:</span> <span class="n">obj</span><span class="o">.</span><span class="n">get_display_name</span><span class="p">(</span><span class="n">looker</span><span class="o">=</span><span class="n">receiver</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">&quot;get_display_name&quot;</span><span class="p">)</span>
<span class="k">else</span> <span class="nb">str</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
@ -908,6 +907,7 @@
<span class="sd"> Keyword Args:</span>
<span class="sd"> Passed on to announce_move_to and announce_move_from hooks.</span>
<span class="sd"> Exits will set the &quot;exit_obj&quot; kwarg to themselves.</span>
<span class="sd"> Returns:</span>
<span class="sd"> result (bool): True/False depending on if there were problems with the move.</span>
@ -1597,7 +1597,9 @@
<span class="p">}</span>
<span class="p">)</span>
<span class="n">location</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">((</span><span class="n">string</span><span class="p">,</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">move_type</span><span class="p">}),</span> <span class="n">exclude</span><span class="o">=</span><span class="p">(</span><span class="bp">self</span><span class="p">,),</span> <span class="n">from_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="n">mapping</span><span class="p">)</span></div>
<span class="n">location</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">(</span>
<span class="p">(</span><span class="n">string</span><span class="p">,</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">move_type</span><span class="p">}),</span> <span class="n">exclude</span><span class="o">=</span><span class="p">(</span><span class="bp">self</span><span class="p">,),</span> <span class="n">from_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="n">mapping</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="DefaultObject.announce_move_to"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.announce_move_to">[docs]</a> <span class="k">def</span> <span class="nf">announce_move_to</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source_location</span><span class="p">,</span> <span class="n">msg</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">move_type</span><span class="o">=</span><span class="s2">&quot;move&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -1665,7 +1667,9 @@
<span class="p">}</span>
<span class="p">)</span>
<span class="n">destination</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">((</span><span class="n">string</span><span class="p">,</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">move_type</span><span class="p">}),</span> <span class="n">exclude</span><span class="o">=</span><span class="p">(</span><span class="bp">self</span><span class="p">,),</span> <span class="n">from_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="n">mapping</span><span class="p">)</span></div>
<span class="n">destination</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">(</span>
<span class="p">(</span><span class="n">string</span><span class="p">,</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">move_type</span><span class="p">}),</span> <span class="n">exclude</span><span class="o">=</span><span class="p">(</span><span class="bp">self</span><span class="p">,),</span> <span class="n">from_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="n">mapping</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="DefaultObject.at_post_move"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.at_post_move">[docs]</a> <span class="k">def</span> <span class="nf">at_post_move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source_location</span><span class="p">,</span> <span class="n">move_type</span><span class="o">=</span><span class="s2">&quot;move&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -2241,7 +2245,7 @@
<span class="s2">&quot;speech&quot;</span><span class="p">:</span> <span class="n">message</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">self_mapping</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">custom_mapping</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="p">(</span><span class="n">msg_self</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">self_mapping</span><span class="p">),</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">msg_type</span><span class="p">}),</span> <span class="n">from_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="p">(</span><span class="n">msg_self</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">self_mapping</span><span class="p">),</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">msg_type</span><span class="p">}),</span> <span class="n">from_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">)</span>
<span class="k">if</span> <span class="n">receivers</span> <span class="ow">and</span> <span class="n">msg_receivers</span><span class="p">:</span>
<span class="n">receiver_mapping</span> <span class="o">=</span> <span class="p">{</span>
@ -2264,7 +2268,7 @@
<span class="n">receiver_mapping</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">individual_mapping</span><span class="p">)</span>
<span class="n">receiver_mapping</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">custom_mapping</span><span class="p">)</span>
<span class="n">receiver</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span>
<span class="n">text</span><span class="o">=</span><span class="p">(</span><span class="n">msg_receivers</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">receiver_mapping</span><span class="p">),</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">msg_type</span><span class="p">}),</span>
<span class="n">text</span><span class="o">=</span><span class="p">(</span><span class="n">msg_receivers</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">receiver_mapping</span><span class="p">),</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="n">msg_type</span><span class="p">}),</span>
<span class="n">from_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span>
<span class="p">)</span>
@ -2387,9 +2391,9 @@
<span class="k">if</span> <span class="ow">not</span> <span class="n">locks</span> <span class="ow">and</span> <span class="n">account</span><span class="p">:</span>
<span class="c1"># Allow only the character itself and the creator account to puppet this character</span>
<span class="c1"># (and Developers).</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="s2">&quot;character_id&quot;</span><span class="p">:</span> <span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="s2">&quot;account_id&quot;</span><span class="p">:</span> <span class="n">account</span><span class="o">.</span><span class="n">id</span><span class="p">})</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">character_id</span><span class="o">=</span><span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">account_id</span><span class="o">=</span><span class="n">account</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="k">elif</span> <span class="ow">not</span> <span class="n">locks</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">account</span><span class="p">:</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="s2">&quot;character_id&quot;</span><span class="p">:</span> <span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="s2">&quot;account_id&quot;</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">})</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">character_id</span><span class="o">=</span><span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">account_id</span><span class="o">=-</span><span class="mi">1</span><span class="p">)</span>
<span class="n">obj</span><span class="o">.</span><span class="n">locks</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">locks</span><span class="p">)</span>
@ -2638,9 +2642,9 @@
<span class="c1"># Add locks</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">locks</span> <span class="ow">and</span> <span class="n">account</span><span class="p">:</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="n">account</span><span class="o">.</span><span class="n">id</span><span class="p">})</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">account</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="k">elif</span> <span class="ow">not</span> <span class="n">locks</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">account</span><span class="p">:</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">})</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="n">obj</span><span class="o">.</span><span class="n">locks</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">locks</span><span class="p">)</span>
@ -2846,9 +2850,9 @@
<span class="c1"># Set appropriate locks</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">locks</span> <span class="ow">and</span> <span class="n">account</span><span class="p">:</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="n">account</span><span class="o">.</span><span class="n">id</span><span class="p">})</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">account</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="k">elif</span> <span class="ow">not</span> <span class="n">locks</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">account</span><span class="p">:</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">})</span>
<span class="n">locks</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lockstring</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">obj</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="n">obj</span><span class="o">.</span><span class="n">locks</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">locks</span><span class="p">)</span>
<span class="c1"># Record creator id and creation IP</span>
@ -2888,8 +2892,8 @@
<span class="p">)</span>
<span class="p">)</span>
<span class="c1"># an exit should have a destination (this is replaced at creation time)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">location</span><span class="p">:</span>
<span class="c1"># an exit should have a destination - try to make sure it does</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">location</span> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">destination</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">destination</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">location</span></div>
<div class="viewcode-block" id="DefaultExit.at_cmdset_get"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultExit.at_cmdset_get">[docs]</a> <span class="k">def</span> <span class="nf">at_cmdset_get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
@ -2931,7 +2935,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">source_location</span> <span class="o">=</span> <span class="n">traversing_object</span><span class="o">.</span><span class="n">location</span>
<span class="k">if</span> <span class="n">traversing_object</span><span class="o">.</span><span class="n">move_to</span><span class="p">(</span><span class="n">target_location</span><span class="p">,</span> <span class="n">move_type</span><span class="o">=</span><span class="s2">&quot;traverse&quot;</span><span class="p">):</span>
<span class="k">if</span> <span class="n">traversing_object</span><span class="o">.</span><span class="n">move_to</span><span class="p">(</span><span class="n">target_location</span><span class="p">,</span> <span class="n">move_type</span><span class="o">=</span><span class="s2">&quot;traverse&quot;</span><span class="p">,</span> <span class="n">exit_obj</span><span class="o">=</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">at_post_traverse</span><span class="p">(</span><span class="n">traversing_object</span><span class="p">,</span> <span class="n">source_location</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">err_traverse</span><span class="p">:</span>

View file

@ -540,11 +540,11 @@
<span class="n">pstr</span><span class="p">,</span> <span class="n">sstr</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span>
<span class="k">if</span> <span class="n">portal_info_dict</span><span class="p">:</span>
<span class="n">pdict</span> <span class="o">=</span> <span class="n">_prepare_dict</span><span class="p">(</span><span class="n">portal_info_dict</span><span class="p">)</span>
<span class="n">pstr</span> <span class="o">=</span> <span class="n">_strip_empty_lines</span><span class="p">(</span><span class="n">PORTAL_INFO</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">pdict</span><span class="p">))</span>
<span class="n">pstr</span> <span class="o">=</span> <span class="n">_strip_empty_lines</span><span class="p">(</span><span class="n">PORTAL_INFO</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">pdict</span><span class="p">))</span>
<span class="k">if</span> <span class="n">server_info_dict</span><span class="p">:</span>
<span class="n">sdict</span> <span class="o">=</span> <span class="n">_prepare_dict</span><span class="p">(</span><span class="n">server_info_dict</span><span class="p">)</span>
<span class="n">sstr</span> <span class="o">=</span> <span class="n">_strip_empty_lines</span><span class="p">(</span><span class="n">SERVER_INFO</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">sdict</span><span class="p">))</span>
<span class="n">sstr</span> <span class="o">=</span> <span class="n">_strip_empty_lines</span><span class="p">(</span><span class="n">SERVER_INFO</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">sdict</span><span class="p">))</span>
<span class="n">info</span> <span class="o">=</span> <span class="n">pstr</span> <span class="o">+</span> <span class="p">(</span><span class="s2">&quot;</span><span class="se">\n\n</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">sstr</span> <span class="k">if</span> <span class="n">sstr</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span><span class="p">)</span>
<span class="n">maxwidth</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">))</span>
@ -1425,7 +1425,7 @@
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">settings_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">settings_string</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="n">settings_string</span> <span class="o">=</span> <span class="n">settings_string</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">setting_dict</span><span class="p">)</span>
<span class="n">settings_string</span> <span class="o">=</span> <span class="n">settings_string</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">setting_dict</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">settings_path</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">settings_string</span><span class="p">)</span></div>

View file

@ -88,8 +88,9 @@
<span class="c1"># a file with a flag telling the server to restart after shutdown or not.</span>
<span class="n">SERVER_RESTART</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">GAME_DIR</span><span class="p">,</span> <span class="s2">&quot;server&quot;</span><span class="p">,</span> <span class="s2">&quot;server.restart&quot;</span><span class="p">)</span>
<span class="c1"># module containing hook methods called during start_stop</span>
<span class="n">SERVER_STARTSTOP_MODULE</span> <span class="o">=</span> <span class="n">mod_import</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">AT_SERVER_STARTSTOP_MODULE</span><span class="p">)</span>
<span class="c1"># modules containing hook methods called during start_stop</span>
<span class="n">SERVER_STARTSTOP_MODULES</span> <span class="o">=</span> <span class="p">[</span><span class="n">mod_import</span><span class="p">(</span><span class="n">mod</span><span class="p">)</span> <span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">make_iter</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">AT_SERVER_STARTSTOP_MODULE</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="nb">str</span><span class="p">)]</span>
<span class="c1"># modules containing plugin services</span>
<span class="n">SERVER_SERVICES_PLUGIN_MODULES</span> <span class="o">=</span> <span class="n">make_iter</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">SERVER_SERVICES_PLUGIN_MODULES</span><span class="p">)</span>
@ -455,6 +456,8 @@
<span class="k">for</span> <span class="n">typeclass_db</span> <span class="ow">in</span> <span class="n">TypedObject</span><span class="o">.</span><span class="n">__subclasses__</span><span class="p">()</span>
<span class="p">]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">at_server_init</span><span class="p">()</span>
<span class="c1"># call correct server hook based on start file value</span>
<span class="k">if</span> <span class="n">mode</span> <span class="o">==</span> <span class="s2">&quot;reload&quot;</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">log_msg</span><span class="p">(</span><span class="s2">&quot;Server successfully reloaded.&quot;</span><span class="p">)</span>
@ -567,14 +570,23 @@
<span class="c1"># server start/stop hooks</span>
<div class="viewcode-block" id="Evennia.at_server_init"><a class="viewcode-back" href="../../../api/evennia.server.server.html#evennia.server.server.Evennia.at_server_init">[docs]</a> <span class="k">def</span> <span class="nf">at_server_init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is called first when the server is starting, before any other hooks, regardless of how it&#39;s starting.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">SERVER_STARTSTOP_MODULES</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;at_server_init&quot;</span><span class="p">):</span>
<span class="n">mod</span><span class="o">.</span><span class="n">at_server_init</span><span class="p">()</span></div>
<div class="viewcode-block" id="Evennia.at_server_start"><a class="viewcode-back" href="../../../api/evennia.server.server.html#evennia.server.server.Evennia.at_server_start">[docs]</a> <span class="k">def</span> <span class="nf">at_server_start</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is called every time the server starts up, regardless of</span>
<span class="sd"> how it was shut down.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">SERVER_STARTSTOP_MODULE</span><span class="p">:</span>
<span class="n">SERVER_STARTSTOP_MODULE</span><span class="o">.</span><span class="n">at_server_start</span><span class="p">()</span></div>
<span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">SERVER_STARTSTOP_MODULES</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;at_server_start&quot;</span><span class="p">):</span>
<span class="n">mod</span><span class="o">.</span><span class="n">at_server_start</span><span class="p">()</span></div>
<div class="viewcode-block" id="Evennia.at_server_stop"><a class="viewcode-back" href="../../../api/evennia.server.server.html#evennia.server.server.Evennia.at_server_stop">[docs]</a> <span class="k">def</span> <span class="nf">at_server_stop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -582,16 +594,18 @@
<span class="sd"> of it is fore a reload, reset or shutdown.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">SERVER_STARTSTOP_MODULE</span><span class="p">:</span>
<span class="n">SERVER_STARTSTOP_MODULE</span><span class="o">.</span><span class="n">at_server_stop</span><span class="p">()</span></div>
<span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">SERVER_STARTSTOP_MODULES</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;at_server_stop&quot;</span><span class="p">):</span>
<span class="n">mod</span><span class="o">.</span><span class="n">at_server_stop</span><span class="p">()</span></div>
<div class="viewcode-block" id="Evennia.at_server_reload_start"><a class="viewcode-back" href="../../../api/evennia.server.server.html#evennia.server.server.Evennia.at_server_reload_start">[docs]</a> <span class="k">def</span> <span class="nf">at_server_reload_start</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is called only when server starts back up after a reload.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">SERVER_STARTSTOP_MODULE</span><span class="p">:</span>
<span class="n">SERVER_STARTSTOP_MODULE</span><span class="o">.</span><span class="n">at_server_reload_start</span><span class="p">()</span></div>
<span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">SERVER_STARTSTOP_MODULES</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;at_server_reload_start&quot;</span><span class="p">):</span>
<span class="n">mod</span><span class="o">.</span><span class="n">at_server_reload_start</span><span class="p">()</span></div>
<div class="viewcode-block" id="Evennia.at_post_portal_sync"><a class="viewcode-back" href="../../../api/evennia.server.server.html#evennia.server.server.Evennia.at_post_portal_sync">[docs]</a> <span class="k">def</span> <span class="nf">at_post_portal_sync</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mode</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -631,8 +645,9 @@
<span class="sd"> This is called only time the server stops before a reload.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">SERVER_STARTSTOP_MODULE</span><span class="p">:</span>
<span class="n">SERVER_STARTSTOP_MODULE</span><span class="o">.</span><span class="n">at_server_reload_stop</span><span class="p">()</span></div>
<span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">SERVER_STARTSTOP_MODULES</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;at_server_reload_stop&quot;</span><span class="p">):</span>
<span class="n">mod</span><span class="o">.</span><span class="n">at_server_reload_stop</span><span class="p">()</span></div>
<div class="viewcode-block" id="Evennia.at_server_cold_start"><a class="viewcode-back" href="../../../api/evennia.server.server.html#evennia.server.server.Evennia.at_server_cold_start">[docs]</a> <span class="k">def</span> <span class="nf">at_server_cold_start</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -660,16 +675,18 @@
<span class="k">if</span> <span class="n">character</span><span class="p">:</span>
<span class="n">character</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
<span class="n">guest</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
<span class="k">if</span> <span class="n">SERVER_STARTSTOP_MODULE</span><span class="p">:</span>
<span class="n">SERVER_STARTSTOP_MODULE</span><span class="o">.</span><span class="n">at_server_cold_start</span><span class="p">()</span></div>
<span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">SERVER_STARTSTOP_MODULES</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;at_server_cold_start&quot;</span><span class="p">):</span>
<span class="n">mod</span><span class="o">.</span><span class="n">at_server_cold_start</span><span class="p">()</span></div>
<div class="viewcode-block" id="Evennia.at_server_cold_stop"><a class="viewcode-back" href="../../../api/evennia.server.server.html#evennia.server.server.Evennia.at_server_cold_stop">[docs]</a> <span class="k">def</span> <span class="nf">at_server_cold_stop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is called only when the server goes down due to a shutdown or reset.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">SERVER_STARTSTOP_MODULE</span><span class="p">:</span>
<span class="n">SERVER_STARTSTOP_MODULE</span><span class="o">.</span><span class="n">at_server_cold_stop</span><span class="p">()</span></div></div>
<span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">SERVER_STARTSTOP_MODULES</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;at_server_cold_stop&quot;</span><span class="p">):</span>
<span class="n">mod</span><span class="o">.</span><span class="n">at_server_cold_stop</span><span class="p">()</span></div></div>
<span class="c1"># ------------------------------------------------------------</span>

View file

@ -1594,7 +1594,7 @@
<span class="n">matchdict</span> <span class="o">=</span> <span class="p">{</span>
<span class="n">key</span><span class="p">:</span> <span class="n">value</span> <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">match</span><span class="o">.</span><span class="n">groupdict</span><span class="p">()</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">}</span>
<span class="k">return</span> <span class="kc">True</span><span class="p">,</span> <span class="n">outtemplate</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">matchdict</span><span class="p">)</span>
<span class="k">return</span> <span class="kc">True</span><span class="p">,</span> <span class="n">outtemplate</span><span class="o">.</span><span class="n">format_map</span><span class="p">(</span><span class="n">matchdict</span><span class="p">)</span>
<span class="k">return</span> <span class="kc">False</span><span class="p">,</span> <span class="n">string</span></div>

View file

@ -285,6 +285,9 @@
<span class="k">def</span> <span class="fm">__or__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">|</span> <span class="n">other</span>
<span class="k">def</span> <span class="fm">__ror__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">|</span> <span class="n">other</span>
<span class="nd">@_save</span>
<span class="k">def</span> <span class="fm">__setitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="fm">__setitem__</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_convert_mutables</span><span class="p">(</span><span class="n">value</span><span class="p">))</span>
@ -305,7 +308,7 @@
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;_class&quot;</span><span class="p">,</span> <span class="nb">list</span><span class="p">)()</span>
<span class="nd">@_save</span>
<span class="k">def</span> <span class="fm">__iadd__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">otherlist</span><span class="p">):</span>
@ -349,7 +352,7 @@
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;_class&quot;</span><span class="p">,</span> <span class="nb">dict</span><span class="p">)()</span>
<span class="k">def</span> <span class="nf">has_key</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
<span class="k">return</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_data</span>
@ -687,11 +690,20 @@
<span class="k">pass</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="s2">&quot;__iter__&quot;</span><span class="p">):</span>
<span class="c1"># we try to conserve the iterable class, if not convert to list</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">([</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">])</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="k">return</span> <span class="p">[</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">]</span>
<span class="c1"># we try to conserve the iterable class, if not convert to dict</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span>
<span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">))</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="k">return</span> <span class="p">{</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">):</span> <span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="c1"># we try to conserve the iterable class, if not convert to list</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">([</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">])</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="k">return</span> <span class="p">[</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">]</span>
<span class="k">elif</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="s2">&quot;sessid&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="s2">&quot;conn_time&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="n">pack_session</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
@ -756,11 +768,20 @@
<span class="k">return</span> <span class="n">deque</span><span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">)</span>
<span class="k">elif</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="s2">&quot;__iter__&quot;</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># we try to conserve the iterable class if</span>
<span class="c1"># it accepts an iterator</span>
<span class="k">return</span> <span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="k">return</span> <span class="p">[</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">]</span>
<span class="c1"># we try to conserve the iterable class, if not convert to dict</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span>
<span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">))</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="k">return</span> <span class="p">{</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">):</span> <span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># we try to conserve the iterable class if</span>
<span class="c1"># it accepts an iterator</span>
<span class="k">return</span> <span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="k">return</span> <span class="p">[</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="s2">&quot;__deserialize_dbobjs__&quot;</span><span class="p">):</span>
<span class="c1"># this allows the object to custom-deserialize any embedded dbobjs</span>
@ -822,13 +843,30 @@
<span class="k">return</span> <span class="n">dat</span>
<span class="k">elif</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="s2">&quot;__iter__&quot;</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># we try to conserve the iterable class if it</span>
<span class="c1"># accepts an iterator</span>
<span class="k">return</span> <span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">parent</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverList</span><span class="p">(</span><span class="n">_parent</span><span class="o">=</span><span class="n">parent</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="c1"># we try to conserve the iterable class, if not convert to dict</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverDict</span><span class="p">(</span><span class="n">_parent</span><span class="o">=</span><span class="n">parent</span><span class="p">,</span> <span class="n">_class</span><span class="o">=</span><span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">))</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverDict</span><span class="p">(</span><span class="n">_parent</span><span class="o">=</span><span class="n">parent</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">))</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># we try to conserve the iterable class if it</span>
<span class="c1"># accepts an iterator</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverList</span><span class="p">(</span><span class="n">_parent</span><span class="o">=</span><span class="n">parent</span><span class="p">,</span> <span class="n">_class</span><span class="o">=</span><span class="n">item</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverList</span><span class="p">(</span><span class="n">_parent</span><span class="o">=</span><span class="n">parent</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">item</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="s2">&quot;__deserialize_dbobjs__&quot;</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
@ -842,7 +880,9 @@
<span class="c1"># convert lists, dicts and sets to their Saved* counterparts. It</span>
<span class="c1"># is only relevant if the &quot;root&quot; is an iterable of the right type.</span>
<span class="n">dtype</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="k">if</span> <span class="n">dtype</span> <span class="o">==</span> <span class="nb">list</span><span class="p">:</span>
<span class="k">if</span> <span class="n">dtype</span> <span class="ow">in</span> <span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="nb">bool</span><span class="p">,</span> <span class="nb">bytes</span><span class="p">,</span> <span class="n">SafeString</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">):</span>
<span class="k">return</span> <span class="n">process_item</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">dtype</span> <span class="o">==</span> <span class="nb">list</span><span class="p">:</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverList</span><span class="p">(</span><span class="n">_db_obj</span><span class="o">=</span><span class="n">db_obj</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">data</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
@ -872,6 +912,34 @@
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverDeque</span><span class="p">(</span><span class="n">_db_obj</span><span class="o">=</span><span class="n">db_obj</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">data</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">elif</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="s2">&quot;__iter__&quot;</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># we try to conserve the iterable class, if not convert to dict</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverDict</span><span class="p">(</span><span class="n">_db_obj</span><span class="o">=</span><span class="n">db_obj</span><span class="p">,</span> <span class="n">_class</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">))</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverDict</span><span class="p">(</span><span class="n">_db_obj</span><span class="o">=</span><span class="n">db_obj</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="p">(</span><span class="n">process_item</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">))</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># we try to conserve the iterable class if it</span>
<span class="c1"># accepts an iterator</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverList</span><span class="p">(</span><span class="n">_db_obj</span><span class="o">=</span><span class="n">db_obj</span><span class="p">,</span> <span class="n">_class</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">data</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">AttributeError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">):</span>
<span class="n">dat</span> <span class="o">=</span> <span class="n">_SaverList</span><span class="p">(</span><span class="n">_db_obj</span><span class="o">=</span><span class="n">db_obj</span><span class="p">)</span>
<span class="n">dat</span><span class="o">.</span><span class="n">_data</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">process_tree</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">data</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dat</span>
<span class="k">return</span> <span class="n">process_item</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div>

View file

@ -145,6 +145,9 @@
<li><a href="evennia/contrib/grid/xyzgrid/xymap_legend.html">evennia.contrib.grid.xyzgrid.xymap_legend</a></li>
<li><a href="evennia/contrib/grid/xyzgrid/xyzgrid.html">evennia.contrib.grid.xyzgrid.xyzgrid</a></li>
<li><a href="evennia/contrib/grid/xyzgrid/xyzroom.html">evennia.contrib.grid.xyzgrid.xyzroom</a></li>
<li><a href="evennia/contrib/rpg/buffs/buff.html">evennia.contrib.rpg.buffs.buff</a></li>
<li><a href="evennia/contrib/rpg/buffs/samplebuffs.html">evennia.contrib.rpg.buffs.samplebuffs</a></li>
<li><a href="evennia/contrib/rpg/buffs/tests.html">evennia.contrib.rpg.buffs.tests</a></li>
<li><a href="evennia/contrib/rpg/dice/dice.html">evennia.contrib.rpg.dice.dice</a></li>
<li><a href="evennia/contrib/rpg/dice/tests.html">evennia.contrib.rpg.dice.tests</a></li>
<li><a href="evennia/contrib/rpg/health_bar/health_bar.html">evennia.contrib.rpg.health_bar.health_bar</a></li>

View file

@ -168,6 +168,22 @@ Up requirements to Django 4.0+, Twisted 22+, Python 3.9 or 3.10
now return `None` instead of `.db.desc` if no sdesc is set; fallback in hook (inspectorCaracal)
- Reworked text2html parser to avoid problems with stateful color tags (inspectorCaracal)
- Simplified `EvMenu.options_formatter` hook to use `EvColumn` and f-strings (inspectorcaracal)
- Added `move_type` str kwarg to `move_to()` calls, optionally identifying the type of
move being done ('teleport', 'disembark', 'give' etc). (volund)
- Made RPSystem contrib msg calls pass `pose` or `say` as msg-`type` for use in
e.g. webclient pane filtering where desired. (volund)
- Fixed bug in `cmdset.remove()` where a command could not be deleted by `key`,
even though doc suggested one could (ChrisLR)
- New contrib `name_generator` for building random real-world based or fantasy-names
based on phonetic rules.
- Enable proper serialization of dict subclasses in Attributes (aogier)
- `object.search` fuzzy-matching now uses `icontains` instead of `istartswith`
to better match how search works elsewhere (volund)
- The `.at_traverse` hook now receives a `exit_obj` kwarg, linking back to the
exit triggering the hook (volund)
- Contrib `buffs` for managing temporary and permanent RPG status buffs effects (tegiminis)
- New `at_server_init()` hook called before all other startup hooks for all
startup modes. Used for more generic overriding (volund)
## Evennia 0.9.5

View file

@ -0,0 +1,371 @@
# Buffs
Contribution by Tegiminis 2022
A buff is a timed object, attached to a game entity. It is capable of modifying values, triggering code, or both.
It is a common design pattern in RPGs, particularly action games.
Features:
- `BuffHandler`: A buff handler to apply to your objects.
- `BaseBuff`: A buff class to extend from to create your own buffs.
- `BuffableProperty`: A sample property class to show how to automatically check modifiers.
- `CmdBuff`: A command which applies buffs.
- `samplebuffs.py`: Some sample buffs to learn from.
## Quick Start
Assign the handler to a property on the object, like so.
```python
@lazy_property
def buffs(self) -> BuffHandler:
return BuffHandler(self)
```
You may then call the handler to add or manipulate buffs like so: `object.buffs`. See **Using the Handler**.
### Customization
If you want to customize the handler, you can feed the constructor two arguments:
- `dbkey`: The string you wish to use as the attribute key for the buff database. Defaults to "buffs". This allows you to keep separate buff pools - for example, "buffs" and "perks".
- `autopause`: If you want this handler to automatically pause playtime buffs when its owning object is unpuppeted.
> **Note**: If you enable autopausing, you MUST initialize the property in your owning object's
> `at_init` hook. Otherwise, a hot reload can cause playtime buffs to not update properly
> on puppet/unpuppet. You have been warned!
Let's say you want another handler for an object, `perks`, which has a separate database and
respects playtime buffs. You'd assign this new property as so:
```python
class BuffableObject(Object):
@lazy_property
def perks(self) -> BuffHandler:
return BuffHandler(self, dbkey='perks', autopause=True)
def at_init(self):
self.perks
```
## Using the Handler
Here's how to make use of your new handler.
### Apply a Buff
Call the handler's `add` method. This requires a class reference, and also contains a number of
optional arguments to customize the buff's duration, stacks, and so on. You can also store any arbitrary value
in the buff's cache by passing a dictionary through the `to_cache` optional argument. This will not overwrite the normal
values on the cache.
```python
self.buffs.add(StrengthBuff) # A single stack of StrengthBuff with normal duration
self.buffs.add(DexBuff, stacks=3, duration=60) # Three stacks of DexBuff, with a duration of 60 seconds
self.buffs.add(ReflectBuff, to_cache={'reflect': 0.5}) # A single stack of ReflectBuff, with an extra cache value
```
Two important attributes on the buff are checked when the buff is applied: `refresh` and `unique`.
- `refresh` (default: True) determines if a buff's timer is refreshed when it is reapplied.
- `unique` (default: True) determines if this buff is unique; that is, only one of it exists on the object.
The combination of these two booleans creates one of three kinds of keys:
- `Unique is True, Refresh is True/False`: The buff's default key.
- `Unique is False, Refresh is True`: The default key mixed with the applier's dbref. This makes the buff "unique-per-player", so you can refresh through reapplication.
- `Unique is False, Refresh is False`: The default key mixed with a randomized number.
### Get Buffs
The handler has several getter methods which return instanced buffs. You won't need to use these for basic functionality, but if you want to manipulate
buffs after application, they are very useful. The handler's `check`/`trigger` methods utilize some of these getters, while others are just for developer convenience.
`get(key)` is the most basic getter. It returns a single buff instance, or `None` if the buff doesn't exist on the handler. It is also the only getter
that returns a single buff instance, rather than a dictionary.
Group getters, listed below, return a dictionary of values in the format `{buffkey: instance}`. If you want to iterate over all of these buffs,
you should do so via the `dict.values()` method.
- `get_all()` returns all buffs on this handler. You can also use the `handler.all` property.
- `get_by_type(BuffClass)` returns buffs of the specified type.
- `get_by_stat(stat)` returns buffs with a `Mod` object of the specified `stat` string in their `mods` list.
- `get_by_trigger(string)` returns buffs with the specified string in their `triggers` list.
- `get_by_source(Object)` returns buffs applied by the specified `source` object.
- `get_by_cachevalue(key, value)` returns buffs with the matching `key: value` pair in their cache. `value` is optional.
All group getters besides `get_all()` can "slice" an existing dictionary through the optional `to_filter` argument.
```python
dict1 = handler.get_by_type(Burned) # This finds all "Burned" buffs on the handler
dict2 = handler.get_by_source(self, to_filter=dict1) # This filters dict1 to find buffs with the matching source
```
> **Note**: Most of these getters also have an associated handler property. For example, `handler.effects` returns all buffs that can be triggered, which
> is then iterated over by the `get_by_trigger` method.
### Remove Buffs
There are also a number of remover methods. Generally speaking, these follow the same format as the getters.
- `remove(key)` removes the buff with the specified key.
- `clear()` removes all buffs.
- `remove_by_type(BuffClass)` removes buffs of the specified type.
- `remove_by_stat(stat)` removes buffs with a `Mod` object of the specified `stat` string in their `mods` list.
- `remove_by_trigger(string)` removes buffs with the specified string in their `triggers` list.
- `remove_by_source(Object)` removes buffs applied by the specified source
- `remove_by_cachevalue(key, value)` removes buffs with the matching `key: value` pair in their cache. `value` is optional.
You can also remove a buff by calling the instance's `remove` helper method. You can do this on the dictionaries returned by the
getters listed above.
```python
to_remove = handler.get_by_trigger(trigger) # Finds all buffs with the specified trigger
for buff in to_remove.values(): # Removes all buffs in the to_remove dictionary via helper methods
buff.remove()
```
### Check Modifiers
Call the handler `check(value, stat)` method when you want to see the modified value.
This will return the `value`, modified by any relevant buffs on the handler's owner (identified by
the `stat` string).
For example, let's say you want to modify how much damage you take. That might look something like this:
```python
# The method we call to damage ourselves
def take_damage(self, source, damage):
_damage = self.buffs.check(damage, 'taken_damage')
self.db.health -= _damage
```
This method calls the `at_pre_check` and `at_post_check` methods at the relevant points in the process. You can use to this make
buffs that are reactive to being checked; for example, removing themselves, altering their values, or interacting with the game state.
> **Note**: You can also trigger relevant buffs at the same time as you check them by ensuring the optional argument `trigger` is True in the `check` method.
### Trigger Buffs
Call the handler's `trigger(string)` method when you want an event call. This will call the `at_trigger` hook method on all buffs with the relevant trigger `string`.
For example, let's say you want to trigger a buff to "detonate" when you hit your target with an attack.
You'd write a buff that might look like this:
```python
class Detonate(BaseBuff):
...
triggers = ['take_damage']
def at_trigger(self, trigger, *args, **kwargs)
self.owner.take_damage(100)
self.remove()
```
And then call `handler.trigger('take_damage')` in the method you use to take damage.
> **Note** You could also do this through mods and `at_post_check` if you like, depending on how to want to add the damage.
### Ticking
Ticking buffs are slightly special. They are similar to trigger buffs in that they run code, but instead of
doing so on an event trigger, they do so on a periodic tick. A common use case for a buff like this is a poison,
or a heal over time.
```python
class Poison(BaseBuff):
...
tickrate = 5
def at_tick(self, initial=True, *args, **kwargs):
_dmg = self.dmg * self.stacks
if not initial:
self.owner.location.msg_contents(
"Poison courses through {actor}'s body, dealing {damage} damage.".format(
actor=self.owner.named, damage=_dmg
)
)
```
To make a buff ticking, ensure the `tickrate` is 1 or higher, and it has code in its `at_tick`
method. Once you add it to the handler, it starts ticking!
> **Note**: Ticking buffs always tick on initial application, when `initial` is `True`. If you don't want your hook to fire at that time,
> make sure to check the value of `initial` in your `at_tick` method.
### Context
Every important handler method optionally accepts a `context` dictionary.
Context is an important concept for this handler. Every method which checks, triggers, or ticks a buff passes this
dictionary (default: empty) to the buff hook methods as keyword arguments (`**kwargs`). It is used for nothing else. This allows you to make those
methods "event-aware" by storing relevant data in the dictionary you feed to the method.
For example, let's say you want a "thorns" buff which damages enemies that attack you. Let's take our `take_damage` method
and add a context to the mix.
```python
def take_damage(attacker, damage):
context = {'attacker': attacker, 'damage': damage}
_damage = self.buffs.check(damage, 'taken_damage', context=context)
self.buffs.trigger('taken_damage', context=context)
self.db.health -= _damage
```
Now we use the values that context passes to the buff kwargs to customize our logic.
```python
class ThornsBuff(BaseBuff):
...
triggers = ['taken_damage']
# This is the hook method on our thorns buff
def at_trigger(self, trigger, attacker=None, damage=0, **kwargs):
if not attacker:
return
attacker.db.health -= damage * 0.2
```
Apply the buff, take damage, and watch the thorns buff do its work!
## Creating New Buffs
Creating a new buff is very easy: extend `BaseBuff` into a new class, and fill in all the relevant buff details.
However, there are a lot of individual moving parts to a buff. Here's a step-through of the important stuff.
### Basics
Regardless of any other functionality, all buffs have the following class attributes:
- They have customizable `key`, `name`, and `flavor` strings.
- They have a `duration` (float), and automatically clean-up at the end. Use -1 for infinite duration, and 0 to clean-up immediately. (default: -1)
- They can stack, if `maxstacks` (int) is not equal to 1. If it's 0, the buff stacks forever. (default: 1)
- They can be `unique` (bool), which determines if they have a unique namespace or not. (default: True)
- They can `refresh` (bool), which resets the duration when stacked or reapplied. (default: True)
- They can be `playtime` (bool) buffs, where duration only counts down during active play. (default: False)
They also always store some useful mutable information about themselves in the cache:
- `ref` (class): The buff class path we use to construct the buff.
- `start` (float): The timestamp of when the buff was applied.
- `source` (Object): If specified; this allows you to track who or what applied the buff.
- `prevtick` (float): The timestamp of the previous tick.
- `duration` (float): The cached duration. This can vary from the class duration, depending on if the duration has been modified (paused, extended, shortened, etc).
- `stacks` (int): How many stacks they have.
- `paused` (bool): Paused buffs do not clean up, modify values, tick, or fire any hook methods.
You can always access the raw cache dictionary through the `cache` attribute on an instanced buff. This is grabbed when you get the buff through
a handler method, so it may not always reflect recent changes you've made, depending on how you structure your buff calls. All of the above
mutable information can be found in this cache, as well as any arbitrary information you pass through the handler `add` method (via `to_cache`).
### Modifiers
Mods are stored in the `mods` list attribute. Buffs which have one or more Mod objects in them can modify stats. You can use the handler method to check all
mods of a specific stat string and apply their modifications to the value; however, you are encouraged to use `check` in a getter/setter, for easy access.
Mod objects consist of only four values, assigned by the constructor in this order:
- `stat`: The stat you want to modify. When `check` is called, this string is used to find all the mods that are to be collected.
- `mod`: The modifier. Defaults are 'add' and 'mult'. Modifiers are calculated additively, and in standard arithmetic order (see `_calculate_mods` for more)
- `value`: How much value the modifier gives regardless of stacks
- `perstack`: How much value the modifier grants per stack, INCLUDING the first. (default: 0)
The most basic way to add a Mod to a buff is to do so in the buff class definition, like this:
```python
class DamageBuff(BaseBuff):
mods = [Mod('damage', 'add', 10)]
```
No mods applied to the value are permanent in any way. All calculations are done at runtime, and the mod values are never stored
anywhere except on the buff in question. In other words: you don't need to track the origin of particular stat mods, and you will
never permanently change a stat modified by a buff. To remove the modification, simply remove the buff from the object.
> **Note**: You can add your own modifier types by overloading the `_calculate_mods` method, which contains the basic modifier application logic.
#### Generating Mods (Advanced)
An advanced way to do mods is to generate them when the buff is initialized. This lets you create mods on the fly that are reactive to the game state.
```python
class GeneratedStatBuff(BaseBuff):
...
def __init__(self, handler, buffkey, cache={}) -> None:
super().__init__(handler, buffkey, cache)
# Finds our "modgen" cache value, and generates a mod from it
modgen = list(self.cache.get("modgen"))
if modgen:
self.mods = [Mod(*modgen)]
```
### Triggers
Buffs which have one or more strings in the `triggers` attribute can be triggered by events.
When the handler's `trigger` method is called, it searches all buffs on the handler for any with a matchingtrigger,
then calls their `at_trigger` hooks. Buffs can have multiple triggers, and you can tell which trigger was used by
the `trigger` argument in the hook.
```python
class AmplifyBuff(BaseBuff):
triggers = ['damage', 'heal']
def at_trigger(self, trigger, **kwargs):
if trigger == 'damage': print('Damage trigger called!')
if trigger == 'heal': print('Heal trigger called!')
```
### Ticking
A buff which ticks isn't much different than one which triggers. You're still executing arbitrary hooks on
the buff class. To tick, the buff must have a `tickrate` of 1 or higher.
```python
class Poison(BaseBuff):
...
# this buff will tick 6 times between application and cleanup.
duration = 30
tickrate = 5
def at_tick(self, initial, **kwargs):
self.owner.take_damage(10)
```
> **Note**: The buff always ticks once when applied. For this **first tick only**, `initial` will be True in the `at_tick` hook method. `initial` will be False on subsequent ticks.
Ticks utilize a persistent delay, so they should be pickleable. As long as you are not adding new properties to your buff class, this shouldn't be a concern.
If you **are** adding new properties, try to ensure they do not end up with a circular code path to their object or handler, as this will cause pickling errors.
### Extras
Buffs have a grab-bag of extra functionality to let you add complexity to your designs.
#### Conditionals
You can restrict whether or not the buff will `check`, `trigger`, or `tick` through defining the `conditional` hook. As long
as it returns a "truthy" value, the buff will apply itself. This is useful for making buffs dependent on game state - for
example, if you want a buff that makes the player take more damage when they are on fire:
```python
class FireSick(BaseBuff):
...
def conditional(self, *args, **kwargs):
if self.owner.buffs.get_by_type(FireBuff):
return True
return False
```
Conditionals for `check`/`trigger` are checked when the buffs are gathered by the handler methods for the respective operations. `Tick`
conditionals are checked each tick.
#### Helper Methods
Buff instances have a number of helper methods.
- `remove`/`dispel`: Allows you to remove or dispel the buff. Calls `at_remove`/`at_dispel`, depending on optional arguments.
- `pause`/`unpause`: Pauses and unpauses the buff. Calls `at_pause`/`at_unpause`.
- `reset`: Resets the buff's start to the current time; same as "refreshing" it.
#### Playtime Duration
If your handler has `autopause` enabled, any buffs with truthy `playtime` value will automatically pause
and unpause when the object the handler is attached to is puppetted or unpuppetted. This even works with ticking buffs,
although if you have less than 1 second of tick duration remaining, it will round up to 1s.
> **Note**: If you want more control over this process, you can comment out the signal subscriptions on the handler and move the autopause logic
> to your object's `at_pre/post_puppet/unpuppet` hooks.
----
<small>This document page is generated from `evennia/contrib/rpg/buffs/README.md`. Changes to this
file will be overwritten, so edit that file rather than this one.</small>

View file

@ -0,0 +1,282 @@
# Random Name Generator
Contribution by InspectorCaracal (2022)
A module for generating random names, both real-world and fantasy. Real-world
names can be generated either as first (personal) names, family (last) names, or
full names (first, optional middles, and last). The name data is from [Behind the Name](https://www.behindthename.com/)
and used under the [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).
Fantasy names are generated from basic phonetic rules, using CVC syllable syntax.
Both real-world and fantasy name generation can be extended to include additional
information via your game's `settings.py`
## Installation
This is a stand-alone utility. Just import this module (`from evennia.contrib.utils import name_generator`) and use its functions wherever you like.
## Usage
Import the module where you need it with the following:
```py
from evennia.contrib.utils.name_generator import namegen
```
By default, all of the functions will return a string with one generated name.
If you specify more than one, or pass `return_list=True` as a keyword argument, the returned value will be a list of strings.
The module is especially useful for naming newly-created NPCs, like so:
```py
npc_name = namegen.full_name()
npc_obj = create_object(key=npc_name, typeclass="typeclasses.characters.NPC")
```
## Available Settings
These settings can all be defined in your game's `server/conf/settings.py` file.
- `NAMEGEN_FIRST_NAMES` adds a new list of first (personal) names.
- `NAMEGEN_LAST_NAMES` adds a new list of last (family) names.
- `NAMEGEN_REPLACE_LISTS` - set to `True` if you want to use only the names defined in your settings.
- `NAMEGEN_FANTASY_RULES` lets you add new phonetic rules for generating entirely made-up names. See the section "Custom Fantasy Name style rules" for details on how this should look.
Examples:
```py
NAMEGEN_FIRST_NAMES = [
("Evennia", 'mf'),
("Green Tea", 'f'),
]
NAMEGEN_LAST_NAMES = [ "Beeblebrox", "Son of Odin" ]
NAMEGEN_FANTASY_RULES = {
"example_style": {
"syllable": "(C)VC",
"consonants": [ 'z','z','ph','sh','r','n' ],
"start": ['m'],
"end": ['x','n'],
"vowels": [ "e","e","e","a","i","i","u","o", ],
"length": (2,4),
}
}
```
## Generating Real Names
The contrib offers three functions for generating random real-world names:
`first_name()`, `last_name()`, and `full_name()`. If you want more than one name
generated at once, you can use the `num` keyword argument to specify how many.
Example:
```
>>> namegen.first_name(num=5)
['Genesis', 'Tali', 'Budur', 'Dominykas', 'Kamau']
>>> namegen.first_name(gender='m')
'Blanchard'
```
The `first_name` function also takes a `gender` keyword argument to filter names
by gender association. 'f' for feminine, 'm' for masculine, 'mf' for feminine
_and_ masculine, or the default `None` to match any gendering.
The `full_name` function also takes the `gender` keyword, as well as `parts` which
defines how many names make up the full name. The minimum is two: a first name and
a last name. You can also generate names with the family name first by setting
the keyword arg `surname_first` to `True`
Example:
```
>>> namegen.full_name()
'Keeva Bernat'
>>> namegen.full_name(parts=4)
'Suzu Shabnam Kafka Baier'
>>> namegen.full_name(parts=3, surname_first=True)
'Ó Muircheartach Torunn Dyson'
>>> namegen.full_name(gender='f')
'Wikolia Ó Deasmhumhnaigh'
```
### Adding your own names
You can add additional names with the settings `NAMEGEN_FIRST_NAMES` and
`NAMEGEN_LAST_NAMES`
`NAMEGEN_FIRST_NAMES` should be a list of tuples, where the first value is the name
and then second value is the gender flag - 'm' for masculine-only, 'f' for feminine-
only, and 'mf' for either one.
`NAMEGEN_LAST_NAMES` should be a list of strings, where each item is an available
surname.
Examples:
```py
NAMEGEN_FIRST_NAMES = [
("Evennia", 'mf'),
("Green Tea", 'f'),
]
NAMEGEN_LAST_NAMES = [ "Beeblebrox", "Son of Odin" ]
```
Set `NAMEGEN_REPLACE_LISTS = True` if you want your custom lists above to entirely replace the built-in lists rather than extend them.
## Generating Fantasy Names
Generating completely made-up names is done with the `fantasy_name` function. The
contrib comes with three built-in styles of names which you can use, or you can
put a dictionary of custom name rules into `settings.py`
Generating a fantasy name takes the ruleset key as the "style" keyword, and can
return either a single name or multiple names. By default, it will return a
single name in the built-in "harsh" style. The contrib also comes with "fluid" and "alien" styles.
```py
>>> namegen.fantasy_name()
'Vhon'
>>> namegen.fantasy_name(num=3, style="harsh")
['Kha', 'Kizdhu', 'Godögäk']
>>> namegen.fantasy_name(num=3, style="fluid")
['Aewalisash', 'Ayi', 'Iaa']
>>> namegen.fantasy_name(num=5, style="alien")
["Qz'vko'", "Xv'w'hk'hxyxyz", "Wxqv'hv'k", "Wh'k", "Xbx'qk'vz"]
```
### Multi-Word Fantasy Names
The `fantasy_name` function will only generate one name-word at a time, so for multi-word names
you'll need to combine pieces together. Depending on what kind of end result you want, there are
several approaches.
#### The simple approach
If all you need is for it to have multiple parts, you can generate multiple names at once and `join` them.
```py
>>> name = " ".join(namegen.fantasy_name(num=2))
>>> name
'Dezhvözh Khäk'
```
If you want a little more variation between first/last names, you can also generate names for
different styles and then combine them.
```py
>>> first = namegen.fantasy_name(style="fluid")
>>> last = namegen.fantasy_name(style="harsh")
>>> name = f"{first} {last}"
>>> name
'Ofasa Käkudhu'
```
#### "Nakku Silversmith"
One common fantasy name practice is profession- or title-based surnames. To achieve this effect,
you can use the `last_name` function with a custom list of last names and combine it with your generated
fantasy name.
Example:
```py
NAMEGEN_LAST_NAMES = [ "Silversmith", "the Traveller", "Destroyer of Worlds" ]
NAMEGEN_REPLACE_LISTS = True
>>> first = namegen.fantasy_name()
>>> last = namegen.last_name()
>>> name = f"{first} {last}"
>>> name
'Tözhkheko the Traveller'
```
#### Elarion d'Yrinea, Thror Obinson
Another common flavor of fantasy names is to use a surname suffix or prefix. For that, you'll
need to add in the extra bit yourself.
Examples:
```py
>>> names = namegen.fantasy_name(num=2)
>>> name = f"{names[0]} za'{names[1]}"
>>> name
"Tithe za'Dhudozkok"
>>> names = namegen.fantasy_name(num=2)
>>> name = f"{names[0]} {names[1]}son"
>>> name
'Kön Ködhöddoson'
```
### Custom Fantasy Name style rules
The style rules are contained in a dictionary of dictionaries, where the style name
is the key and the style rules are the dictionary value.
The following is how you would add a custom style to `settings.py`:
```py
NAMEGEN_FANTASY_RULES = {
"example_style": {
"syllable": "(C)VC",
"consonants": [ 'z','z','ph','sh','r','n' ],
"start": ['m'],
"end": ['x','n'],
"vowels": [ "e","e","e","a","i","i","u","o", ],
"length": (2,4),
}
}
```
Then you could generate names following that ruleset with `namegen.fantasy_name(style="example_style")`.
The keys `syllable`, `consonants`, `vowels`, and `length` must be present, and `length` must be the minimum and maximum syllable counts. `start` and `end` are optional.
#### syllable
The "syllable" field defines the structure of each syllable. C is consonant, V is vowel,
and parentheses mean it's optional. So, the example `(C)VC` means that every syllable
will always have a vowel followed by a consonant, and will *sometimes* have another
consonant at the beginning. e.g. `en`, `bak`
*Note:* While it's not standard, the contrib lets you nest parentheses, with each layer
being less likely to show up. Additionally, any other characters put into the syllable
structure - e.g. an apostrophe - will be read and inserted as written. The
"alien" style rules in the module gives an example of both: the syllable structure is `C(C(V))(')(C)`
which results in syllables such as `khq`, `xho'q`, and `q'` with a much lower frequency of vowels than
`C(C)(V)(')(C)` would have given.
#### consonants
A simple list of consonant phonemes that can be chosen from. Multi-character strings are
perfectly acceptable, such as "th", but each one will be treated as a single consonant.
The function uses a naive form of weighting, where you make a phoneme more likely to
occur by putting more copies of it into the list.
#### start and end
These are **optional** lists for the first and last letters of a syllable, if they're
a consonant. You can add on additional consonants which can only occur at the beginning
or end of a syllable, or you can add extra copies of already-defined consonants to
increase the frequency of them at the start/end of syllables.
For example, in the `example_style` above, we have a `start` of m, and `end` of x and n.
Taken with the rest of the consonants/vowels, this means you can have the syllables of `mez`
but not `zem`, and you can have `phex` or `phen` but not `xeph` or `neph`.
They can be left out of custom rulesets entirely.
#### vowels
Vowels is a simple list of vowel phonemes - exactly like consonants, but instead used for the
vowel selection. Single-or multi-character strings are equally fine. It uses the same naive weighting system
as consonants - you can increase the frequency of any given vowel by putting it into the list multiple times.
#### length
A tuple with the minimum and maximum number of syllables a name can have.
When setting this, keep in mind how long your syllables can get! 4 syllables might
not seem like very many, but if you have a (C)(V)VC structure with one- and
two-letter phonemes, you can get up to eight characters per syllable.
----
<small>This document page is generated from `evennia/contrib/utils/name_generator/README.md`. Changes to this
file will be overwritten, so edit that file rather than this one.</small>

View file

@ -458,6 +458,7 @@ and rule implementation like character traits, dice rolling and emoting._
```{toctree}
:maxdepth: 1
Contrib-Buffs.md
Contrib-Dice.md
Contrib-Health-Bar.md
Contrib-RPSystem.md
@ -465,6 +466,17 @@ Contrib-Traits.md
```
### Contrib: `buffs`
_Contribution by Tegiminis 2022_
A buff is a timed object, attached to a game entity. It is capable of modifying values, triggering code, or both.
It is a common design pattern in RPGs, particularly action games.
[Read the documentation](./Contrib-Buffs.md) - [Browse the Code](evennia.contrib.rpg.buffs)
### Contrib: `dice`
_Contribution by Griatch, 2012_
@ -628,6 +640,7 @@ and more._
Contrib-Auditing.md
Contrib-Fieldfill.md
Contrib-Name-Generator.md
Contrib-Random-String-Generator.md
Contrib-Tree-Select.md
```
@ -661,6 +674,19 @@ to any callable of your choice.
### Contrib: `name_generator`
_Contribution by InspectorCaracal (2022)_
A module for generating random names, both real-world and fantasy. Real-world
names can be generated either as first (personal) names, family (last) names, or
full names (first, optional middles, and last). The name data is from [Behind the Name](https://www.behindthename.com/)
and used under the [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).
[Read the documentation](./Contrib-Name-Generator.md) - [Browse the Code](evennia.contrib.utils.name_generator)
### Contrib: `random_string_generator`
_Contribution by Vincent Le Goff (vlgeoff), 2017_

View file

@ -31,12 +31,12 @@ value - which may change as Evennia is developed. This way you can
always be sure of what you have changed and what is default behaviour.
"""
from django.contrib.messages import constants as messages
from django.urls import reverse_lazy
import os
import sys
from django.contrib.messages import constants as messages
from django.urls import reverse_lazy
######################################################################
# Evennia base server config
######################################################################
@ -405,9 +405,11 @@ INITIAL_SETUP_MODULE = "evennia.server.initial_setup"
# the server's initial setup sequence (the very first startup of the system).
# The check will fail quietly if module doesn't exist or fails to load.
AT_INITIAL_SETUP_HOOK_MODULE = "server.conf.at_initial_setup"
# Module containing your custom at_server_start(), at_server_reload() and
# at_server_stop() methods. These methods will be called every time
# the server starts, reloads and resets/stops respectively.
# Module(s) containing custom at_server_init(), at_server_start(),
# at_server_reload() and at_server_stop() methods. These methods will be called
# every time the server starts, reloads and resets/stops
# respectively. Can be given as a single path or a list of paths. If a list,
# each module's hooks will be called in list order.
AT_SERVER_STARTSTOP_MODULE = "server.conf.at_server_startstop"
# List of one or more module paths to modules containing a function start_
# plugin_services(application). This module will be called with the main

View file

@ -0,0 +1,10 @@
```{eval-rst}
evennia.contrib.rpg.buffs.buff
=====================================
.. automodule:: evennia.contrib.rpg.buffs.buff
:members:
:undoc-members:
:show-inheritance:
```

View file

@ -0,0 +1,19 @@
```{eval-rst}
evennia.contrib.rpg.buffs
=================================
.. automodule:: evennia.contrib.rpg.buffs
:members:
:undoc-members:
:show-inheritance:
.. toctree::
:maxdepth: 6
evennia.contrib.rpg.buffs.buff
evennia.contrib.rpg.buffs.samplebuffs
evennia.contrib.rpg.buffs.tests
```

View file

@ -0,0 +1,10 @@
```{eval-rst}
evennia.contrib.rpg.buffs.samplebuffs
============================================
.. automodule:: evennia.contrib.rpg.buffs.samplebuffs
:members:
:undoc-members:
:show-inheritance:
```

View file

@ -0,0 +1,10 @@
```{eval-rst}
evennia.contrib.rpg.buffs.tests
======================================
.. automodule:: evennia.contrib.rpg.buffs.tests
:members:
:undoc-members:
:show-inheritance:
```

View file

@ -11,6 +11,7 @@ evennia.contrib.rpg
.. toctree::
:maxdepth: 6
evennia.contrib.rpg.buffs
evennia.contrib.rpg.dice
evennia.contrib.rpg.health_bar
evennia.contrib.rpg.rpsystem

View file

@ -292,6 +292,17 @@
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.html">evennia.contrib.rpg</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.html">evennia.contrib.rpg.buffs</a><ul>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html">evennia.contrib.rpg.buffs.buff</a><ul>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#installation">Installation</a></li>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#using-the-handler">Using the Handler</a></li>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#buffs">Buffs</a></li>
</ul>
</li>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.samplebuffs.html">evennia.contrib.rpg.buffs.samplebuffs</a></li>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.tests.html">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.dice.html">evennia.contrib.rpg.dice</a><ul>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html">evennia.contrib.rpg.dice.dice</a><ul>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html#dice">Dice</a></li>

View file

@ -218,7 +218,7 @@ caches are properly updated as well.</p>
<dl class="py method">
<dt id="evennia.commands.command.Command.match">
<code class="sig-name descname">match</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cmdname</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/command.html#Command.match"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.command.Command.match" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">match</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cmdname</span></em>, <em class="sig-param"><span class="n">include_prefixes</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/command.html#Command.match"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.command.Command.match" title="Permalink to this definition"></a></dt>
<dd><p>This is called by the system when searching the available commands,
in order to determine if this is the one we wanted. cmdname was
previously extracted from the raw string by the system.</p>
@ -226,8 +226,17 @@ previously extracted from the raw string by the system.</p>
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cmdname</strong> (<em>str</em>) Always lowercase when reaching this point.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>result (bool)</em> Match result.</p>
</dl>
<dl class="simple">
<dt>Kwargs:</dt><dd><dl class="simple">
<dt>include_prefixes (bool): If false, will compare against the _noprefix</dt><dd><p>variants of commandnames.</p>
</dd>
</dl>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>result (bool)</em> Match result.</p>
</dd>
</dl>
</dd></dl>

View file

@ -84,7 +84,7 @@ method. Otherwise all text will be returned to all connected sessions.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdOOCLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['ls', 'l']</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOCLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'ls']</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOCLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -115,7 +115,7 @@ method. Otherwise all text will be returned to all connected sessions.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdOOCLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOCLook.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOCLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -268,7 +268,7 @@ to accounts respectively.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdEmit.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['pemit', 'remit']</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['remit', 'pemit']</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -299,7 +299,7 @@ to accounts respectively.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdEmit.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'pemit remit', 'category': 'admin', 'key': 'emit', 'no_prefix': ' pemit remit', 'tags': '', 'text': '\n admin command for emitting message to multiple objects\n\n Usage:\n emit[/switches] [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n remit [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n pemit [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n\n Switches:\n room - limit emits to rooms only (default)\n accounts - limit emits to accounts only\n contents - send to the contents of matched objects too\n\n Emits a message to the selected objects or to\n your immediate surroundings. If the object is a room,\n send to its contents. remit and pemit are just\n limited forms of emit, for sending to rooms and\n to accounts respectively.\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'remit pemit', 'category': 'admin', 'key': 'emit', 'no_prefix': ' remit pemit', 'tags': '', 'text': '\n admin command for emitting message to multiple objects\n\n Usage:\n emit[/switches] [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n remit [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n pemit [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n\n Switches:\n room - limit emits to rooms only (default)\n accounts - limit emits to accounts only\n contents - send to the contents of matched objects too\n\n Emits a message to the selected objects or to\n your immediate surroundings. If the object is a room,\n send to its contents. remit and pemit are just\n limited forms of emit, for sending to rooms and\n to accounts respectively.\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -543,7 +543,7 @@ You can specify the /force switch to bypass this confirmation.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdDestroy.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;del', '&#64;delete']</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;delete', '&#64;del']</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -584,7 +584,7 @@ You can specify the /force switch to bypass this confirmation.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdDestroy.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;del &#64;delete', 'category': 'building', 'key': '&#64;destroy', 'no_prefix': 'destroy del delete', 'tags': '', 'text': '\n permanently delete objects\n\n Usage:\n destroy[/switches] [obj, obj2, obj3, [dbref-dbref], ...]\n\n Switches:\n override - The destroy command will usually avoid accidentally\n destroying account objects. This switch overrides this safety.\n force - destroy without confirmation.\n Examples:\n destroy house, roof, door, 44-78\n destroy 5-10, flower, 45\n destroy/force north\n\n Destroys one or many objects. If dbrefs are used, a range to delete can be\n given, e.g. 4-10. Also the end points will be deleted. This command\n displays a confirmation before destroying, to make sure of your choice.\n You can specify the /force switch to bypass this confirmation.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;delete &#64;del', 'category': 'building', 'key': '&#64;destroy', 'no_prefix': 'destroy delete del', 'tags': '', 'text': '\n permanently delete objects\n\n Usage:\n destroy[/switches] [obj, obj2, obj3, [dbref-dbref], ...]\n\n Switches:\n override - The destroy command will usually avoid accidentally\n destroying account objects. This switch overrides this safety.\n force - destroy without confirmation.\n Examples:\n destroy house, roof, door, 44-78\n destroy 5-10, flower, 45\n destroy/force north\n\n Destroys one or many objects. If dbrefs are used, a range to delete can be\n given, e.g. 4-10. Also the end points will be deleted. This command\n displays a confirmation before destroying, to make sure of your choice.\n You can specify the /force switch to bypass this confirmation.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -1296,7 +1296,7 @@ server settings.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTypeclass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;type', '&#64;typeclasses', '&#64;parent', '&#64;update', '&#64;swap']</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;typeclasses', '&#64;swap', '&#64;parent', '&#64;type', '&#64;update']</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1327,7 +1327,7 @@ server settings.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTypeclass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;type &#64;typeclasses &#64;parent &#64;update &#64;swap', 'category': 'building', 'key': '&#64;typeclass', 'no_prefix': 'typeclass type typeclasses parent update swap', 'tags': '', 'text': &quot;\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] &lt;object&gt; [= typeclass.path]\n typeclass/prototype &lt;object&gt; = 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 &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;typeclasses &#64;swap &#64;parent &#64;type &#64;update', 'category': 'building', 'key': '&#64;typeclass', 'no_prefix': 'typeclass typeclasses swap parent type update', 'tags': '', 'text': &quot;\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] &lt;object&gt; [= typeclass.path]\n typeclass/prototype &lt;object&gt; = 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 &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -1482,7 +1482,7 @@ If object is not specified, the current location is examined.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdExamine.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;ex', '&#64;exam']</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;exam', '&#64;ex']</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1750,7 +1750,7 @@ the cases, see the module doc.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdExamine.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;ex &#64;exam', 'category': 'building', 'key': '&#64;examine', 'no_prefix': 'examine ex exam', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [&lt;object&gt;[/attrname]]\n examine [*&lt;account&gt;[/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 '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;exam &#64;ex', 'category': 'building', 'key': '&#64;examine', 'no_prefix': 'examine exam ex', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [&lt;object&gt;[/attrname]]\n examine [*&lt;account&gt;[/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 '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -1784,7 +1784,7 @@ one is given.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdFind.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;search', '&#64;locate']</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;locate', '&#64;search']</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1815,7 +1815,7 @@ one is given.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdFind.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;search &#64;locate', 'category': 'building', 'key': '&#64;find', 'no_prefix': 'find search locate', 'tags': '', 'text': '\n search the database for objects\n\n Usage:\n find[/switches] &lt;name or dbref or *account&gt; [= 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 '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;locate &#64;search', 'category': 'building', 'key': '&#64;find', 'no_prefix': 'find locate search', 'tags': '', 'text': '\n search the database for objects\n\n Usage:\n find[/switches] &lt;name or dbref or *account&gt; [= 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 '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -126,7 +126,7 @@ look <a href="#id1"><span class="problematic" id="id2">*</span></a>&lt;account&g
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['ls', 'l']</em><a class="headerlink" href="#evennia.commands.default.general.CmdLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'ls']</em><a class="headerlink" href="#evennia.commands.default.general.CmdLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -157,7 +157,7 @@ look <a href="#id1"><span class="problematic" id="id2">*</span></a>&lt;account&g
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 &lt;obj&gt;\n look *&lt;account&gt;\n\n Observes your location or objects in your vicinity.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdLook.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 &lt;obj&gt;\n look *&lt;account&gt;\n\n Observes your location or objects in your vicinity.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -219,7 +219,7 @@ for everyone to use, you need build privileges and the alias command.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdNick.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['nickname', 'nicks']</em><a class="headerlink" href="#evennia.commands.default.general.CmdNick.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['nicks', 'nickname']</em><a class="headerlink" href="#evennia.commands.default.general.CmdNick.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -251,7 +251,7 @@ for everyone to use, you need build privileges and the alias command.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdNick.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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] &lt;string&gt; [= [replacement_string]]\n nick[/switches] &lt;template&gt; = &lt;replacement_template&gt;\n nick/delete &lt;string&gt; 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 &quot;nicks&quot; 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 &lt;string&gt;:\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 &lt;string&gt;\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 '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdNick.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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] &lt;string&gt; [= [replacement_string]]\n nick[/switches] &lt;template&gt; = &lt;replacement_template&gt;\n nick/delete &lt;string&gt; 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 &quot;nicks&quot; 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 &lt;string&gt;:\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 &lt;string&gt;\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 '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdNick.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -274,7 +274,7 @@ inv</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdInventory.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['i', 'inv']</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['inv', 'i']</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -305,7 +305,7 @@ inv</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdInventory.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -549,7 +549,7 @@ placing it in their inventory.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdSay.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = [&quot;'&quot;, '&quot;']</em><a class="headerlink" href="#evennia.commands.default.general.CmdSay.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&quot;', &quot;'&quot;]</em><a class="headerlink" href="#evennia.commands.default.general.CmdSay.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -580,7 +580,7 @@ placing it in their inventory.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdSay.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '\' &quot;', 'category': 'general', 'key': 'say', 'no_prefix': ' \' &quot;', 'tags': '', 'text': '\n speak as your character\n\n Usage:\n say &lt;message&gt;\n\n Talk to those in your current location.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdSay.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&quot; \'', 'category': 'general', 'key': 'say', 'no_prefix': ' &quot; \'', 'tags': '', 'text': '\n speak as your character\n\n Usage:\n say &lt;message&gt;\n\n Talk to those in your current location.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdSay.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -660,7 +660,7 @@ automatically begin with your name.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdPose.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['emote', ':']</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = [':', 'emote']</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -701,7 +701,7 @@ space.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdPose.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'emote :', 'category': 'general', 'key': 'pose', 'no_prefix': ' emote :', 'tags': '', 'text': &quot;\n strike a pose\n\n Usage:\n pose &lt;pose text&gt;\n pose's &lt;pose text&gt;\n\n Example:\n pose is standing by the wall, smiling.\n -&gt; 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 &quot;}</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ': emote', 'category': 'general', 'key': 'pose', 'no_prefix': ' : emote', 'tags': '', 'text': &quot;\n strike a pose\n\n Usage:\n pose &lt;pose text&gt;\n pose's &lt;pose text&gt;\n\n Example:\n pose is standing by the wall, smiling.\n -&gt; 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 &quot;}</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -724,7 +724,7 @@ which permission groups you are a member of.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdAccess.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['groups', 'hierarchy']</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['hierarchy', 'groups']</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -755,7 +755,7 @@ which permission groups you are a member of.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdAccess.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'groups hierarchy', 'category': 'general', 'key': 'access', 'no_prefix': ' groups hierarchy', 'tags': '', 'text': '\n show your current game access\n\n Usage:\n access\n\n This command shows you the permission hierarchy and\n which permission groups you are a member of.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hierarchy groups', 'category': 'general', 'key': 'access', 'no_prefix': ' hierarchy groups', 'tags': '', 'text': '\n show your current game access\n\n Usage:\n access\n\n This command shows you the permission hierarchy and\n which permission groups you are a member of.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -772,7 +772,7 @@ main test suite started with</p>
<p>Test the batch processor.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.tests.TestBatchProcess.red_button">
<code class="sig-name descname">red_button</code><em class="property"> = &lt;module 'evennia.contrib.tutorials.red_button.red_button' from '/tmp/tmppa13r6sb/78167dfd3f20cf80799bed0efadf376904813569/evennia/contrib/tutorials/red_button/red_button.py'&gt;</em><a class="headerlink" href="#evennia.commands.default.tests.TestBatchProcess.red_button" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">red_button</code><em class="property"> = &lt;module 'evennia.contrib.tutorials.red_button.red_button' from '/tmp/tmp9h38qvwr/9d1f35a8883a595ebf829cfbe47630b5d973d4ee/evennia/contrib/tutorials/red_button/red_button.py'&gt;</em><a class="headerlink" href="#evennia.commands.default.tests.TestBatchProcess.red_button" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">

View file

@ -73,7 +73,7 @@ connect “account name” “pass word”</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedConnect.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['conn', 'co', 'con']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['co', 'conn', 'con']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -108,7 +108,7 @@ there is no object yet before the account has logged in)</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedConnect.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'conn co con', 'category': 'general', 'key': 'connect', 'no_prefix': ' conn co con', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect &quot;account name&quot; &quot;pass word&quot;\n\n Use the create command to first create an account before logging in.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'co conn con', 'category': 'general', 'key': 'connect', 'no_prefix': ' co conn con', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect &quot;account name&quot; &quot;pass word&quot;\n\n Use the create command to first create an account before logging in.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -90,7 +90,7 @@ the module given by settings.CONNECTION_SCREEN_MODULE.</p>
<dl class="py attribute">
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['conn', 'co', 'con']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['co', 'conn', 'con']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -120,7 +120,7 @@ there is no object yet before the account has logged in)</p>
<dl class="py attribute">
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'conn co con', 'category': 'general', 'key': 'connect', 'no_prefix': ' conn co con', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect &lt;email&gt; &lt;password&gt;\n\n Use the create command to first create an account before logging in.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'co conn con', 'category': 'general', 'key': 'connect', 'no_prefix': ' co conn con', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect &lt;email&gt; &lt;password&gt;\n\n Use the create command to first create an account before logging in.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -67,7 +67,7 @@
<dl class="py attribute">
<dt id="evennia.contrib.base_systems.ingame_python.commands.CmdCallback.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;callback', '&#64;callbacks', '&#64;calls']</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;callbacks', '&#64;callback', '&#64;calls']</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -148,7 +148,7 @@ on user permission.</p>
<dl class="py attribute">
<dt id="evennia.contrib.base_systems.ingame_python.commands.CmdCallback.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;callback &#64;callbacks &#64;calls', 'category': 'building', 'key': '&#64;call', 'no_prefix': 'call callback callbacks calls', 'tags': '', 'text': '\n Command to edit callbacks.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;callbacks &#64;callback &#64;calls', 'category': 'building', 'key': '&#64;call', 'no_prefix': 'call callbacks callback calls', 'tags': '', 'text': '\n Command to edit callbacks.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -162,7 +162,7 @@ the operation will be general or on the room.</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdGiveUp.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['abort', 'chicken out', 'q', 'quit']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGiveUp.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['abort', 'quit', 'chicken out', 'q']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGiveUp.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
@ -186,7 +186,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdGiveUp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'abort chicken out q quit', 'category': 'evscaperoom', 'key': 'give up', 'no_prefix': ' abort chicken out q quit', '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 '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGiveUp.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'abort quit chicken out q', 'category': 'evscaperoom', 'key': 'give up', 'no_prefix': ' abort quit chicken out q', '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 '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGiveUp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -207,7 +207,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['ls', 'l']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'ls']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -241,7 +241,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdLook.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -322,7 +322,7 @@ shout</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = [';', 'whisper', 'shout']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['shout', 'whisper', ';']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -351,7 +351,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '; whisper shout', 'category': 'general', 'key': 'say', 'no_prefix': ' ; whisper shout', 'tags': '', 'text': '\n Perform an communication action.\n\n Usage:\n say &lt;text&gt;\n whisper\n shout\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'shout whisper ;', 'category': 'general', 'key': 'say', 'no_prefix': ' shout whisper ;', 'tags': '', 'text': '\n Perform an communication action.\n\n Usage:\n say &lt;text&gt;\n whisper\n shout\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -379,7 +379,7 @@ emote /me points to /box and /lever.</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['pose', ':']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = [':', 'pose']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -418,7 +418,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'pose :', 'category': 'general', 'key': 'emote', 'no_prefix': ' pose :', 'tags': '', 'text': '\n Perform a free-form emote. Use /me to\n include yourself in the emote and /name\n to include other objects or characters.\n Use &quot;...&quot; to enact speech.\n\n Usage:\n emote &lt;emote&gt;\n :&lt;emote\n\n Example:\n emote /me smiles at /peter\n emote /me points to /box and /lever.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ': pose', 'category': 'general', 'key': 'emote', 'no_prefix': ' : pose', 'tags': '', 'text': '\n Perform a free-form emote. Use /me to\n include yourself in the emote and /name\n to include other objects or characters.\n Use &quot;...&quot; to enact speech.\n\n Usage:\n emote &lt;emote&gt;\n :&lt;emote\n\n Example:\n emote /me smiles at /peter\n emote /me points to /box and /lever.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -441,7 +441,7 @@ looks and what actions is available.</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['unfocus', 'ex', 'e', 'examine']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['ex', 'unfocus', 'e', 'examine']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -470,7 +470,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'unfocus ex e examine', 'category': 'evscaperoom', 'key': 'focus', 'no_prefix': ' unfocus ex e examine', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus &lt;obj&gt;\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 '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'ex unfocus e examine', 'category': 'evscaperoom', 'key': 'focus', 'no_prefix': ' ex unfocus e examine', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus &lt;obj&gt;\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 '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -532,7 +532,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdGet.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['inventory', 'i', 'inv', 'give']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['give', 'inv', 'i', 'inventory']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
@ -556,7 +556,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdGet.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'inventory i inv give', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' inventory i inv give', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'give inv i inventory', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' give inv i inventory', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -696,7 +696,7 @@ try to influence the other part in the deal.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.barter.barter.CmdStatus.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['offers', 'deal']</em><a class="headerlink" href="#evennia.contrib.game_systems.barter.barter.CmdStatus.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['deal', 'offers']</em><a class="headerlink" href="#evennia.contrib.game_systems.barter.barter.CmdStatus.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -722,7 +722,7 @@ try to influence the other part in the deal.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.barter.barter.CmdStatus.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'offers deal', 'category': 'trading', 'key': 'status', 'no_prefix': ' offers deal', 'tags': '', 'text': &quot;\n show a list of the current deal\n\n Usage:\n status\n deal\n offers\n\n Shows the currently suggested offers on each sides of the deal. To\n accept the current deal, use the 'accept' command. Use 'offer' to\n change your deal. You might also want to use 'say', 'emote' etc to\n try to influence the other part in the deal.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.game_systems.barter.barter.CmdStatus.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'deal offers', 'category': 'trading', 'key': 'status', 'no_prefix': ' deal offers', 'tags': '', 'text': &quot;\n show a list of the current deal\n\n Usage:\n status\n deal\n offers\n\n Shows the currently suggested offers on each sides of the deal. To\n accept the current deal, use the 'accept' command. Use 'offer' to\n change your deal. You might also want to use 'say', 'emote' etc to\n try to influence the other part in the deal.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.game_systems.barter.barter.CmdStatus.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -643,7 +643,7 @@ inv</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.clothing.clothing.CmdInventory.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['i', 'inv']</em><a class="headerlink" href="#evennia.contrib.game_systems.clothing.clothing.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['inv', 'i']</em><a class="headerlink" href="#evennia.contrib.game_systems.clothing.clothing.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -674,7 +674,7 @@ inv</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.clothing.clothing.CmdInventory.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.contrib.game_systems.clothing.clothing.CmdInventory.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'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 '}</em><a class="headerlink" href="#evennia.contrib.game_systems.clothing.clothing.CmdInventory.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -623,7 +623,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_basic.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_basic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_basic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -649,7 +649,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_basic.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hold wait', 'category': 'combat', 'key': 'pass', 'no_prefix': ' hold wait', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_basic.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'no_prefix': ' wait hold', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_basic.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -518,7 +518,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_equip.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_equip.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_equip.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -538,7 +538,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_equip.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hold wait', 'category': 'combat', 'key': 'pass', 'no_prefix': ' hold wait', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_equip.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'no_prefix': ' wait hold', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_equip.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -641,7 +641,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -661,7 +661,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hold wait', 'category': 'combat', 'key': 'pass', 'no_prefix': ' hold wait', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'no_prefix': ' wait hold', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -420,7 +420,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_magic.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_magic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_magic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -440,7 +440,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_magic.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hold wait', 'category': 'combat', 'key': 'pass', 'no_prefix': ' hold wait', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_magic.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'no_prefix': ' wait hold', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_magic.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -880,7 +880,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_range.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_range.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_range.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -900,7 +900,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.game_systems.turnbattle.tb_range.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hold wait', 'category': 'combat', 'key': 'pass', 'no_prefix': ' hold wait', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_range.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'no_prefix': ' wait hold', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.game_systems.turnbattle.tb_range.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -291,7 +291,7 @@ look <a href="#id1"><span class="problematic" id="id2">*</span></a>&lt;account&g
<dl class="py attribute">
<dt id="evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['ls', 'l']</em><a class="headerlink" href="#evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'ls']</em><a class="headerlink" href="#evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -311,7 +311,7 @@ look <a href="#id1"><span class="problematic" id="id2">*</span></a>&lt;account&g
<dl class="py attribute">
<dt id="evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'ls l', 'category': 'general', 'key': 'look', 'no_prefix': ' ls l', 'tags': '', 'text': '\n look\n\n Usage:\n look\n look &lt;obj&gt;\n look &lt;room detail&gt;\n look *&lt;account&gt;\n\n Observes your location, details at your location or objects in your vicinity.\n '}</em><a class="headerlink" href="#evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomLook.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'no_prefix': ' l ls', 'tags': '', 'text': '\n look\n\n Usage:\n look\n look &lt;obj&gt;\n look &lt;room detail&gt;\n look *&lt;account&gt;\n\n Observes your location, details at your location or objects in your vicinity.\n '}</em><a class="headerlink" href="#evennia.contrib.grid.extended_room.extended_room.CmdExtendedRoomLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -257,6 +257,23 @@ useful but are deemed too game-specific to go into the core library.</p>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="evennia.contrib.rpg.html">evennia.contrib.rpg</a><ul>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.buffs.html">evennia.contrib.rpg.buffs</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html">evennia.contrib.rpg.buffs.buff</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#installation">Installation</a></li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#using-the-handler">Using the Handler</a><ul>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#applying-a-buff">Applying a Buff</a></li>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#modify">Modify</a></li>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#trigger">Trigger</a></li>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#tick">Tick</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#buffs">Buffs</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.samplebuffs.html">evennia.contrib.rpg.buffs.samplebuffs</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.tests.html">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.dice.html">evennia.contrib.rpg.dice</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html">evennia.contrib.rpg.dice.dice</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html#dice">Dice</a></li>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,159 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>evennia.contrib.rpg.buffs &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="evennia.contrib.rpg.buffs.buff" href="evennia.contrib.rpg.buffs.buff.html" />
<link rel="prev" title="evennia.contrib.rpg" href="evennia.contrib.rpg.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.buff.html" title="evennia.contrib.rpg.buffs.buff"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.html" title="evennia.contrib.rpg"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" accesskey="U">evennia.contrib.rpg</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.contrib.rpg.buffs">
<span id="evennia-contrib-rpg-buffs"></span><h1>evennia.contrib.rpg.buffs<a class="headerlink" href="#module-evennia.contrib.rpg.buffs" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html">evennia.contrib.rpg.buffs.buff</a><ul>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#using-the-handler">Using the Handler</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#applying-a-buff">Applying a Buff</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#modify">Modify</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#trigger">Trigger</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#tick">Tick</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#buffs">Buffs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="evennia.contrib.rpg.buffs.samplebuffs.html">evennia.contrib.rpg.buffs.samplebuffs</a></li>
<li class="toctree-l1"><a class="reference internal" href="evennia.contrib.rpg.buffs.tests.html">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
</div>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<h4>Previous topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.html"
title="previous chapter">evennia.contrib.rpg</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.buffs.buff.html"
title="next chapter">evennia.contrib.rpg.buffs.buff</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.contrib.rpg.buffs.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="evennia.contrib.rpg.buffs.html">1.0-dev (develop branch)</a></li>
<li><a href="../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.buff.html" title="evennia.contrib.rpg.buffs.buff"
>next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.html" title="evennia.contrib.rpg"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" >evennia.contrib.rpg</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>

View file

@ -0,0 +1,433 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>evennia.contrib.rpg.buffs.samplebuffs &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="evennia.contrib.rpg.buffs.tests" href="evennia.contrib.rpg.buffs.tests.html" />
<link rel="prev" title="evennia.contrib.rpg.buffs.buff" href="evennia.contrib.rpg.buffs.buff.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.tests.html" title="evennia.contrib.rpg.buffs.tests"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.buff.html" title="evennia.contrib.rpg.buffs.buff"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" >evennia.contrib.rpg</a> &#187;</li>
<li class="nav-item nav-item-6"><a href="evennia.contrib.rpg.buffs.html" accesskey="U">evennia.contrib.rpg.buffs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.samplebuffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.contrib.rpg.buffs.samplebuffs">
<span id="evennia-contrib-rpg-buffs-samplebuffs"></span><h1>evennia.contrib.rpg.buffs.samplebuffs<a class="headerlink" href="#module-evennia.contrib.rpg.buffs.samplebuffs" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.samplebuffs.</code><code class="sig-name descname">Exploit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Exploit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.rpg.buffs.buff.BaseBuff</span></code></a></p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.key">
<code class="sig-name descname">key</code><em class="property"> = 'exploit'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.name">
<code class="sig-name descname">name</code><em class="property"> = 'Exploit'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.flavor">
<code class="sig-name descname">flavor</code><em class="property"> = &quot;You are learning your opponent's weaknesses.&quot;</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.flavor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.duration">
<code class="sig-name descname">duration</code><em class="property"> = -1</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.duration" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.maxstacks">
<code class="sig-name descname">maxstacks</code><em class="property"> = 20</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.maxstacks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.triggers">
<code class="sig-name descname">triggers</code><em class="property"> = ['hit']</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.triggers" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.stack_msg">
<code class="sig-name descname">stack_msg</code><em class="property"> = {1: &quot;You begin to notice flaws in your opponent's defense.&quot;, 10: &quot;You've begun to match the battle's rhythm.&quot;, 20: &quot;You've found a gap in the guard!&quot;}</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.stack_msg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.conditional">
<code class="sig-name descname">conditional</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Exploit.conditional"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.conditional" title="Permalink to this definition"></a></dt>
<dd><p>Hook function for conditional evaluation.</p>
<p>This must return True for a buff to apply modifiers, trigger effects, or tick.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploit.at_trigger">
<code class="sig-name descname">at_trigger</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trigger</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Exploit.at_trigger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploit.at_trigger" title="Permalink to this definition"></a></dt>
<dd><p>Hook for the code you want to run whenever the effect is triggered.
Passes the trigger string to the function, so you can have multiple
triggers on one buff.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.samplebuffs.</code><code class="sig-name descname">Exploited</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Exploited"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.rpg.buffs.buff.BaseBuff</span></code></a></p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited.key">
<code class="sig-name descname">key</code><em class="property"> = 'exploited'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited.name">
<code class="sig-name descname">name</code><em class="property"> = 'Exploited'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited.name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited.flavor">
<code class="sig-name descname">flavor</code><em class="property"> = &quot;You have sensed your target's vulnerability, and are poised to strike.&quot;</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited.flavor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited.duration">
<code class="sig-name descname">duration</code><em class="property"> = 30</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited.duration" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited.mods">
<code class="sig-name descname">mods</code><em class="property"> = [&lt;evennia.contrib.rpg.buffs.buff.Mod object&gt;]</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited.mods" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited.at_post_check">
<code class="sig-name descname">at_post_check</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Exploited.at_post_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited.at_post_check" title="Permalink to this definition"></a></dt>
<dd><p>Hook function to run after this buffs mods are checked.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Exploited.at_remove">
<code class="sig-name descname">at_remove</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Exploited.at_remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Exploited.at_remove" title="Permalink to this definition"></a></dt>
<dd><p>Hook function to run when this buff is removed from an object.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Leeching">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.samplebuffs.</code><code class="sig-name descname">Leeching</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Leeching"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Leeching" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.rpg.buffs.buff.BaseBuff</span></code></a></p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Leeching.key">
<code class="sig-name descname">key</code><em class="property"> = 'leeching'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Leeching.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Leeching.name">
<code class="sig-name descname">name</code><em class="property"> = 'Leeching'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Leeching.name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Leeching.flavor">
<code class="sig-name descname">flavor</code><em class="property"> = 'Attacking this target fills you with vigor.'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Leeching.flavor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Leeching.duration">
<code class="sig-name descname">duration</code><em class="property"> = 30</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Leeching.duration" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Leeching.triggers">
<code class="sig-name descname">triggers</code><em class="property"> = ['taken_damage']</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Leeching.triggers" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Leeching.at_trigger">
<code class="sig-name descname">at_trigger</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trigger</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">attacker</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">damage</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Leeching.at_trigger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Leeching.at_trigger" title="Permalink to this definition"></a></dt>
<dd><p>Hook for the code you want to run whenever the effect is triggered.
Passes the trigger string to the function, so you can have multiple
triggers on one buff.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.samplebuffs.</code><code class="sig-name descname">Poison</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Poison"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.rpg.buffs.buff.BaseBuff</span></code></a></p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.key">
<code class="sig-name descname">key</code><em class="property"> = 'poison'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.name">
<code class="sig-name descname">name</code><em class="property"> = 'Poison'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.flavor">
<code class="sig-name descname">flavor</code><em class="property"> = 'A poison wracks this body with painful spasms.'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.flavor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.duration">
<code class="sig-name descname">duration</code><em class="property"> = 120</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.duration" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.maxstacks">
<code class="sig-name descname">maxstacks</code><em class="property"> = 5</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.maxstacks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.tickrate">
<code class="sig-name descname">tickrate</code><em class="property"> = 5</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.tickrate" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.dmg">
<code class="sig-name descname">dmg</code><em class="property"> = 5</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.dmg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.playtime">
<code class="sig-name descname">playtime</code><em class="property"> = True</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.playtime" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.at_pause">
<code class="sig-name descname">at_pause</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Poison.at_pause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.at_pause" title="Permalink to this definition"></a></dt>
<dd><p>Hook for when this buff is paused</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.at_unpause">
<code class="sig-name descname">at_unpause</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Poison.at_unpause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.at_unpause" title="Permalink to this definition"></a></dt>
<dd><p>Hook for when this buff is unpaused.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Poison.at_tick">
<code class="sig-name descname">at_tick</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">initial</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Poison.at_tick"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Poison.at_tick" title="Permalink to this definition"></a></dt>
<dd><p>Hook for actions that occur per-tick, a designer-set sub-duration.
<strong>initial</strong> tells you if its the first tick that happens (when a buff is applied).</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Sated">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.samplebuffs.</code><code class="sig-name descname">Sated</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#Sated"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Sated" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.rpg.buffs.buff.BaseBuff</span></code></a></p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Sated.key">
<code class="sig-name descname">key</code><em class="property"> = 'sated'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Sated.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Sated.name">
<code class="sig-name descname">name</code><em class="property"> = 'Sated'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Sated.name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Sated.flavor">
<code class="sig-name descname">flavor</code><em class="property"> = 'You have eaten a great meal!'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Sated.flavor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Sated.duration">
<code class="sig-name descname">duration</code><em class="property"> = 180</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Sated.duration" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Sated.maxstacks">
<code class="sig-name descname">maxstacks</code><em class="property"> = 3</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Sated.maxstacks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.Sated.mods">
<code class="sig-name descname">mods</code><em class="property"> = [&lt;evennia.contrib.rpg.buffs.buff.Mod object&gt;]</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.Sated.mods" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.samplebuffs.</code><code class="sig-name descname">StatBuff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span><span class="o">=</span><span class="default_value">{}</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#StatBuff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.rpg.buffs.buff.BaseBuff</span></code></a></p>
<p>Customize the stat this buff affects by feeding a list in the order [stat, mod, base, perstack] to the cache argument when added</p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.key">
<code class="sig-name descname">key</code><em class="property"> = 'statbuff'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.name">
<code class="sig-name descname">name</code><em class="property"> = 'statbuff'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.maxstacks">
<code class="sig-name descname">maxstacks</code><em class="property"> = 0</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.maxstacks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.refresh">
<code class="sig-name descname">refresh</code><em class="property"> = True</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.refresh" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.unique">
<code class="sig-name descname">unique</code><em class="property"> = False</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.unique" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.cache">
<code class="sig-name descname">cache</code><em class="property"> = {'modgen': ['foo', 'add', 0, 0]}</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.cache" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span><span class="o">=</span><span class="default_value">{}</span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/samplebuffs.html#StatBuff.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Args:
handler: The handler this buff is attached to
buffkey: The key this buff uses on the cache
cache: The cache dictionary (what you get if you use <strong>handler.buffcache.get(key)</strong>)</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.samplebuffs.StatBuff.flavor">
<code class="sig-name descname">flavor</code><em class="property"> = 'This buff affects the following stats: {stats}'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.samplebuffs.StatBuff.flavor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<h4>Previous topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.buffs.buff.html"
title="previous chapter">evennia.contrib.rpg.buffs.buff</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.buffs.tests.html"
title="next chapter">evennia.contrib.rpg.buffs.tests</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.contrib.rpg.buffs.samplebuffs.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="evennia.contrib.rpg.buffs.samplebuffs.html">1.0-dev (develop branch)</a></li>
<li><a href="../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.tests.html" title="evennia.contrib.rpg.buffs.tests"
>next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.buff.html" title="evennia.contrib.rpg.buffs.buff"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" >evennia.contrib.rpg</a> &#187;</li>
<li class="nav-item nav-item-6"><a href="evennia.contrib.rpg.buffs.html" >evennia.contrib.rpg.buffs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.samplebuffs</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>

View file

@ -0,0 +1,278 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>evennia.contrib.rpg.buffs.tests &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="evennia.contrib.rpg.dice" href="evennia.contrib.rpg.dice.html" />
<link rel="prev" title="evennia.contrib.rpg.buffs.samplebuffs" href="evennia.contrib.rpg.buffs.samplebuffs.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.dice.html" title="evennia.contrib.rpg.dice"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.samplebuffs.html" title="evennia.contrib.rpg.buffs.samplebuffs"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" >evennia.contrib.rpg</a> &#187;</li>
<li class="nav-item nav-item-6"><a href="evennia.contrib.rpg.buffs.html" accesskey="U">evennia.contrib.rpg.buffs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.contrib.rpg.buffs.tests">
<span id="evennia-contrib-rpg-buffs-tests"></span><h1>evennia.contrib.rpg.buffs.tests<a class="headerlink" href="#module-evennia.contrib.rpg.buffs.tests" title="Permalink to this headline"></a></h1>
<p>Tests for the buff system contrib</p>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.tests.</code><code class="sig-name descname">BuffableObject</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">id</span></em>, <em class="sig-param"><span class="n">db_key</span></em>, <em class="sig-param"><span class="n">db_typeclass_path</span></em>, <em class="sig-param"><span class="n">db_date_created</span></em>, <em class="sig-param"><span class="n">db_lock_storage</span></em>, <em class="sig-param"><span class="n">db_account</span></em>, <em class="sig-param"><span class="n">db_sessid</span></em>, <em class="sig-param"><span class="n">db_location</span></em>, <em class="sig-param"><span class="n">db_home</span></em>, <em class="sig-param"><span class="n">db_destination</span></em>, <em class="sig-param"><span class="n">db_cmdset_storage</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#BuffableObject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.objects.objects.html#evennia.objects.objects.DefaultObject" title="evennia.objects.objects.DefaultObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultObject</span></code></a></p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject.stat1">
<code class="sig-name descname">stat1</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject.stat1" title="Permalink to this definition"></a></dt>
<dd><p>An example of a way you can extend AttributeProperty to create properties that automatically check buffs for you.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject.buffs">
<code class="sig-name descname">buffs</code><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#BuffableObject.buffs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject.buffs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject.at_init">
<code class="sig-name descname">at_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#BuffableObject.at_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject.at_init" title="Permalink to this definition"></a></dt>
<dd><p>This is always called whenever this object is initiated
that is, whenever it its typeclass is cached from memory. This
happens on-demand first time the object is used or activated
in some way after being created but also after each server
restart or reload.</p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject.DoesNotExist" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.objects.objects.html#evennia.objects.objects.DefaultObject.DoesNotExist" title="evennia.objects.objects.DefaultObject.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultObject.DoesNotExist</span></code></a></p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.objects.objects.html#evennia.objects.objects.DefaultObject.MultipleObjectsReturned" title="evennia.objects.objects.DefaultObject.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultObject.MultipleObjectsReturned</span></code></a></p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.rpg.buffs.tests.BuffableObject'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject.path" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.buffs.tests.BuffableObject.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'BuffableObject'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.BuffableObject.typename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.tests.</code><code class="sig-name descname">TestBuffsAndHandler</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">methodName</span><span class="o">=</span><span class="default_value">'runTest'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.utils.test_resources.html#evennia.utils.test_resources.EvenniaTest" title="evennia.utils.test_resources.EvenniaTest"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.utils.test_resources.EvenniaTest</span></code></a></p>
<p>This tests a number of things about buffs.</p>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.setUp">
<code class="sig-name descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.setUp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.setUp" title="Permalink to this definition"></a></dt>
<dd><p>Sets up testing environment</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.tearDown">
<code class="sig-name descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.tearDown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.tearDown" title="Permalink to this definition"></a></dt>
<dd><p>done after every test_* method below</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_addremove">
<code class="sig-name descname">test_addremove</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_addremove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_addremove" title="Permalink to this definition"></a></dt>
<dd><p>tests adding and removing buffs</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_getters">
<code class="sig-name descname">test_getters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_getters"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_getters" title="Permalink to this definition"></a></dt>
<dd><p>tests all built-in getters</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_details">
<code class="sig-name descname">test_details</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_details" title="Permalink to this definition"></a></dt>
<dd><p>tests that buff details like name and flavor are correct</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_modify">
<code class="sig-name descname">test_modify</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_modify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_modify" title="Permalink to this definition"></a></dt>
<dd><p>tests to ensure that values are modified correctly, and stack across mods</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_trigger">
<code class="sig-name descname">test_trigger</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_trigger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_trigger" title="Permalink to this definition"></a></dt>
<dd><p>tests to ensure triggers correctly fire</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_context_conditional">
<code class="sig-name descname">test_context_conditional</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_context_conditional"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_context_conditional" title="Permalink to this definition"></a></dt>
<dd><p>tests to ensure context is passed to buffs, and also tests conditionals</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_complex">
<code class="sig-name descname">test_complex</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_complex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_complex" title="Permalink to this definition"></a></dt>
<dd><p>tests a complex mod (conditionals, multiple triggers/mods)</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_timing">
<code class="sig-name descname">test_timing</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mock_delay</span><span class="p">:</span> <span class="n">unittest.mock.Mock</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_timing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_timing" title="Permalink to this definition"></a></dt>
<dd><p>tests timing-related features, such as ticking and duration</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_buffableproperty">
<code class="sig-name descname">test_buffableproperty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_buffableproperty"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_buffableproperty" title="Permalink to this definition"></a></dt>
<dd><p>tests buffable properties</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_stresstest">
<code class="sig-name descname">test_stresstest</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_stresstest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_stresstest" title="Permalink to this definition"></a></dt>
<dd><p>tests large amounts of buffs, and related removal methods</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_modgen">
<code class="sig-name descname">test_modgen</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/tests.html#TestBuffsAndHandler.test_modgen"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler.test_modgen" title="Permalink to this definition"></a></dt>
<dd><p>test generating mods on the fly</p>
</dd></dl>
</dd></dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<h4>Previous topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.buffs.samplebuffs.html"
title="previous chapter">evennia.contrib.rpg.buffs.samplebuffs</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.dice.html"
title="next chapter">evennia.contrib.rpg.dice</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.contrib.rpg.buffs.tests.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="evennia.contrib.rpg.buffs.tests.html">1.0-dev (develop branch)</a></li>
<li><a href="../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.dice.html" title="evennia.contrib.rpg.dice"
>next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.buffs.samplebuffs.html" title="evennia.contrib.rpg.buffs.samplebuffs"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" >evennia.contrib.rpg</a> &#187;</li>
<li class="nav-item nav-item-6"><a href="evennia.contrib.rpg.buffs.html" >evennia.contrib.rpg.buffs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>

View file

@ -18,7 +18,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="evennia.contrib.rpg.dice.dice" href="evennia.contrib.rpg.dice.dice.html" />
<link rel="prev" title="evennia.contrib.rpg" href="evennia.contrib.rpg.html" />
<link rel="prev" title="evennia.contrib.rpg.buffs.tests" href="evennia.contrib.rpg.buffs.tests.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
@ -33,7 +33,7 @@
<a href="evennia.contrib.rpg.dice.dice.html" title="evennia.contrib.rpg.dice.dice"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.html" title="evennia.contrib.rpg"
<a href="evennia.contrib.rpg.buffs.tests.html" title="evennia.contrib.rpg.buffs.tests"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
@ -88,8 +88,8 @@
</div>
<script>$('#searchbox').show(0);</script>
<h4>Previous topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.html"
title="previous chapter">evennia.contrib.rpg</a></p>
<p class="topless"><a href="evennia.contrib.rpg.buffs.tests.html"
title="previous chapter">evennia.contrib.rpg.buffs.tests</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.dice.dice.html"
title="next chapter">evennia.contrib.rpg.dice.dice</a></p>
@ -133,7 +133,7 @@
<a href="evennia.contrib.rpg.dice.dice.html" title="evennia.contrib.rpg.dice.dice"
>next</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.html" title="evennia.contrib.rpg"
<a href="evennia.contrib.rpg.buffs.tests.html" title="evennia.contrib.rpg.buffs.tests"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>

View file

@ -17,7 +17,7 @@
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="evennia.contrib.rpg.dice" href="evennia.contrib.rpg.dice.html" />
<link rel="next" title="evennia.contrib.rpg.buffs" href="evennia.contrib.rpg.buffs.html" />
<link rel="prev" title="evennia.contrib.grid.xyzgrid.xyzroom" href="evennia.contrib.grid.xyzgrid.xyzroom.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
@ -30,7 +30,7 @@
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.dice.html" title="evennia.contrib.rpg.dice"
<a href="evennia.contrib.rpg.buffs.html" title="evennia.contrib.rpg.buffs"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="evennia.contrib.grid.xyzgrid.xyzroom.html" title="evennia.contrib.grid.xyzgrid.xyzroom"
@ -54,6 +54,23 @@
<span id="evennia-contrib-rpg"></span><h1>evennia.contrib.rpg<a class="headerlink" href="#module-evennia.contrib.rpg" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="evennia.contrib.rpg.buffs.html">evennia.contrib.rpg.buffs</a><ul>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html">evennia.contrib.rpg.buffs.buff</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#installation">Installation</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#using-the-handler">Using the Handler</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#applying-a-buff">Applying a Buff</a></li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#modify">Modify</a></li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#trigger">Trigger</a></li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#tick">Tick</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#buffs">Buffs</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.buffs.samplebuffs.html">evennia.contrib.rpg.buffs.samplebuffs</a></li>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.buffs.tests.html">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="evennia.contrib.rpg.dice.html">evennia.contrib.rpg.dice</a><ul>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html">evennia.contrib.rpg.dice.dice</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html#dice">Dice</a></li>
@ -129,8 +146,8 @@
<p class="topless"><a href="evennia.contrib.grid.xyzgrid.xyzroom.html"
title="previous chapter">evennia.contrib.grid.xyzgrid.xyzroom</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="evennia.contrib.rpg.dice.html"
title="next chapter">evennia.contrib.rpg.dice</a></p>
<p class="topless"><a href="evennia.contrib.rpg.buffs.html"
title="next chapter">evennia.contrib.rpg.buffs</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
@ -168,7 +185,7 @@
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.contrib.rpg.dice.html" title="evennia.contrib.rpg.dice"
<a href="evennia.contrib.rpg.buffs.html" title="evennia.contrib.rpg.buffs"
>next</a> |</li>
<li class="right" >
<a href="evennia.contrib.grid.xyzgrid.xyzroom.html" title="evennia.contrib.grid.xyzgrid.xyzroom"

View file

@ -337,7 +337,7 @@ _PREFIX-tagged structures in the emote:
<dl class="py function">
<dt id="evennia.contrib.rpg.rpsystem.rpsystem.send_emote">
<code class="sig-prename descclassname">evennia.contrib.rpg.rpsystem.rpsystem.</code><code class="sig-name descname">send_emote</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sender</span></em>, <em class="sig-param"><span class="n">receivers</span></em>, <em class="sig-param"><span class="n">emote</span></em>, <em class="sig-param"><span class="n">anonymous_add</span><span class="o">=</span><span class="default_value">'first'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/rpsystem/rpsystem.html#send_emote"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.rpsystem.rpsystem.send_emote" title="Permalink to this definition"></a></dt>
<code class="sig-prename descclassname">evennia.contrib.rpg.rpsystem.rpsystem.</code><code class="sig-name descname">send_emote</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sender</span></em>, <em class="sig-param"><span class="n">receivers</span></em>, <em class="sig-param"><span class="n">emote</span></em>, <em class="sig-param"><span class="n">msg_type</span><span class="o">=</span><span class="default_value">'pose'</span></em>, <em class="sig-param"><span class="n">anonymous_add</span><span class="o">=</span><span class="default_value">'first'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/rpsystem/rpsystem.html#send_emote"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.rpsystem.rpsystem.send_emote" title="Permalink to this definition"></a></dt>
<dd><p>Main access function for distribute an emote.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
@ -347,6 +347,9 @@ _PREFIX-tagged structures in the emote:
will also form the basis for which sdescs are
valid to use in the emote.</p></li>
<li><p><strong>emote</strong> (<em>str</em>) The raw emote string as input by emoter.</p></li>
<li><p><strong>msg_type</strong> (<em>str</em>) The type of emote this is. “say” or “pose”
for example. This is arbitrary and used for generating
extra data for .msg(text) tuple.</p></li>
<li><p><strong>anonymous_add</strong> (<em>str</em><em> or </em><em>None</em><em>, </em><em>optional</em>) If <strong>sender</strong> is not
self-referencing in the emote, this will auto-add
<strong>sender</strong>s data to the emote. Possible values are
@ -640,7 +643,7 @@ a different language.</p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.rpsystem.rpsystem.CmdSay.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = [&quot;'&quot;, '&quot;']</em><a class="headerlink" href="#evennia.contrib.rpg.rpsystem.rpsystem.CmdSay.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&quot;', &quot;'&quot;]</em><a class="headerlink" href="#evennia.contrib.rpg.rpsystem.rpsystem.CmdSay.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -671,7 +674,7 @@ a different language.</p>
<dl class="py attribute">
<dt id="evennia.contrib.rpg.rpsystem.rpsystem.CmdSay.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '\' &quot;', 'category': 'general', 'key': 'say', 'no_prefix': ' \' &quot;', 'tags': '', 'text': '\n speak as your character\n\n Usage:\n say &lt;message&gt;\n\n Talk to those in your current location.\n '}</em><a class="headerlink" href="#evennia.contrib.rpg.rpsystem.rpsystem.CmdSay.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&quot; \'', 'category': 'general', 'key': 'say', 'no_prefix': ' &quot; \'', 'tags': '', 'text': '\n speak as your character\n\n Usage:\n say &lt;message&gt;\n\n Talk to those in your current location.\n '}</em><a class="headerlink" href="#evennia.contrib.rpg.rpsystem.rpsystem.CmdSay.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -96,7 +96,7 @@ such as when closing the lid and un-blinding a character.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdPushLidClosed.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['push', 'press button', 'press']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidClosed.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['push', 'press', 'press button']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidClosed.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -125,7 +125,7 @@ check if the lid is open or closed.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdPushLidClosed.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'push press button press', 'category': 'general', 'key': 'push button', 'no_prefix': ' push press button press', 'tags': '', 'text': '\n Push the red button (lid closed)\n\n Usage:\n push button\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidClosed.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'push press press button', 'category': 'general', 'key': 'push button', 'no_prefix': ' push press press button', 'tags': '', 'text': '\n Push the red button (lid closed)\n\n Usage:\n push button\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidClosed.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -195,7 +195,7 @@ check if the lid is open or closed.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['smash lid', 'smash', 'break lid']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['smash', 'break lid', 'smash lid']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -222,7 +222,7 @@ break.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'smash lid smash break lid', 'category': 'general', 'key': 'smash glass', 'no_prefix': ' smash lid smash 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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'smash break lid smash lid', 'category': 'general', 'key': 'smash glass', 'no_prefix': ' smash break lid smash 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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -322,7 +322,7 @@ be mutually exclusive.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdPushLidOpen.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['push', 'press button', 'press']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidOpen.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['push', 'press', 'press button']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidOpen.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -351,7 +351,7 @@ set in self.parse())</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdPushLidOpen.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'push press button press', 'category': 'general', 'key': 'push button', 'no_prefix': ' push press button press', 'tags': '', 'text': '\n Push the red button\n\n Usage:\n push button\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidOpen.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'push press press button', 'category': 'general', 'key': 'push button', 'no_prefix': ' push press press button', 'tags': '', 'text': '\n Push the red button\n\n Usage:\n push button\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdPushLidOpen.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -449,7 +449,7 @@ be mutually exclusive.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['listen', 'get', 'feel', 'examine', 'l', 'ex']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'get', 'feel', 'listen', 'ex', 'examine']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -475,7 +475,7 @@ be mutually exclusive.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'listen get feel examine l ex', 'category': 'general', 'key': 'look', 'no_prefix': ' listen get feel examine l ex', 'tags': '', 'text': &quot;\n Looking around in darkness\n\n Usage:\n look &lt;obj&gt;\n\n ... not that there's much to see in the dark.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l get feel listen ex examine', 'category': 'general', 'key': 'look', 'no_prefix': ' l get feel listen ex examine', 'tags': '', 'text': &quot;\n Looking around in darkness\n\n Usage:\n look &lt;obj&gt;\n\n ... not that there's much to see in the dark.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -507,7 +507,7 @@ shift green root up/down</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['shiftroot', 'push', 'move', 'pull']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['push', 'shiftroot', 'move', 'pull']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -543,7 +543,7 @@ yellow/green - horizontal roots</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'shiftroot push move pull', 'category': 'tutorialworld', 'key': 'shift', 'no_prefix': ' shiftroot push move 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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'push shiftroot move pull', 'category': 'tutorialworld', 'key': 'shift', 'no_prefix': ' push shiftroot move 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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -560,7 +560,7 @@ yellow/green - horizontal roots</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdPressButton.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['push button', 'press button', 'button']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdPressButton.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['button', 'push button', 'press button']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdPressButton.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -586,7 +586,7 @@ yellow/green - horizontal roots</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdPressButton.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'push button press button button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' push button press button button', 'tags': '', 'text': '\n Presses a button.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdPressButton.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'button push button press button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' button push button press button', 'tags': '', 'text': '\n Presses a button.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdPressButton.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -730,7 +730,7 @@ parry - forgoes your attack but will make you harder to hit on next</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['defend', 'stab', 'parry', 'thrust', 'pierce', 'hit', 'kill', 'slash', 'fight', 'chop', 'bash']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['kill', 'chop', 'pierce', 'bash', 'thrust', 'hit', 'stab', 'parry', 'slash', 'defend', 'fight']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -756,7 +756,7 @@ parry - forgoes your attack but will make you harder to hit on next</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'defend stab parry thrust pierce hit kill slash fight chop bash', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' defend stab parry thrust pierce hit kill slash fight chop bash', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab &lt;enemy&gt;\n slash &lt;enemy&gt;\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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'kill chop pierce bash thrust hit stab parry slash defend fight', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' kill chop pierce bash thrust hit stab parry slash defend fight', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab &lt;enemy&gt;\n slash &lt;enemy&gt;\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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -199,7 +199,7 @@ code except for adding in the details.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdTutorialLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['ls', 'l']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdTutorialLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'ls']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdTutorialLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -214,7 +214,7 @@ code except for adding in the details.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdTutorialLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'ls l', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' ls l', 'tags': '', 'text': '\n looks at the room and on details\n\n Usage:\n look &lt;obj&gt;\n look &lt;room detail&gt;\n look *&lt;account&gt;\n\n Observes your location, details at your location or objects\n in your vicinity.\n\n Tutorial: This is a child of the default Look command, that also\n allows us to look at &quot;details&quot; in the room. These details are\n things to examine and offers some extra description without\n actually having to be actual database objects. It uses the\n return_detail() hook on TutorialRooms for this.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdTutorialLook.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l ls', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' l ls', 'tags': '', 'text': '\n looks at the room and on details\n\n Usage:\n look &lt;obj&gt;\n look &lt;room detail&gt;\n look *&lt;account&gt;\n\n Observes your location, details at your location or objects\n in your vicinity.\n\n Tutorial: This is a child of the default Look command, that also\n allows us to look at &quot;details&quot; in the room. These details are\n things to examine and offers some extra description without\n actually having to be actual database objects. It uses the\n return_detail() hook on TutorialRooms for this.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdTutorialLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -919,7 +919,7 @@ to find something.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['feel', 'feel around', 'search', 'l', 'fiddle']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'feel around', 'feel', 'fiddle', 'search']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -947,7 +947,7 @@ random chance of eventually finding a light source.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'feel feel around search l fiddle', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' feel feel around search l fiddle', '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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l feel around feel fiddle search', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' l feel around feel fiddle 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 '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -392,6 +392,23 @@ with q, remove the break line and restart server when finished.</p></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="evennia.contrib.rpg.html">evennia.contrib.rpg</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.buffs.html">evennia.contrib.rpg.buffs</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html">evennia.contrib.rpg.buffs.buff</a><ul>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#installation">Installation</a></li>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#using-the-handler">Using the Handler</a><ul>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#applying-a-buff">Applying a Buff</a></li>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#modify">Modify</a></li>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#trigger">Trigger</a></li>
<li class="toctree-l6"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#tick">Tick</a></li>
</ul>
</li>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.buffs.buff.html#buffs">Buffs</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.samplebuffs.html">evennia.contrib.rpg.buffs.samplebuffs</a></li>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.buffs.tests.html">evennia.contrib.rpg.buffs.tests</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="evennia.contrib.rpg.dice.html">evennia.contrib.rpg.dice</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html">evennia.contrib.rpg.dice.dice</a><ul>
<li class="toctree-l5"><a class="reference internal" href="evennia.contrib.rpg.dice.dice.html#dice">Dice</a></li>

View file

@ -649,7 +649,10 @@ messages and/or overloaded hook behaviors.</p></li>
</ul>
</dd>
<dt class="field-even">Keyword Arguments</dt>
<dd class="field-even"><p><strong>on to announce_move_to and announce_move_from hooks.</strong> (<em>Passed</em>) </p>
<dd class="field-even"><ul class="simple">
<li><p><strong>on to announce_move_to and announce_move_from hooks.</strong> (<em>Passed</em>) </p></li>
<li><p><strong>will set the &quot;exit_obj&quot; kwarg to themselves.</strong> (<em>Exits</em>) </p></li>
</ul>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><p><em>result (bool)</em> </p>

View file

@ -142,6 +142,12 @@ dead/stopping already.</p>
<dd><p>Return the server info, for display.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.server.server.Evennia.at_server_init">
<code class="sig-name descname">at_server_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/server/server.html#Evennia.at_server_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.server.server.Evennia.at_server_init" title="Permalink to this definition"></a></dt>
<dd><p>This is called first when the server is starting, before any other hooks, regardless of how its starting.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.server.server.Evennia.at_server_start">
<code class="sig-name descname">at_server_start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/server/server.html#Evennia.at_server_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.server.server.Evennia.at_server_start" title="Permalink to this definition"></a></dt>

View file

@ -287,7 +287,7 @@ indentation.</p>
<dl class="py attribute">
<dt id="evennia.utils.eveditor.CmdEditorGroup.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = [':r', ':j', ':h', ':UU', ':s', ':y', ':i', ':w', ':::', ':dw', ':x', ':echo', ':u', ':S', ':&lt;', '::', ':&gt;', ':!', ':dd', ':uu', ':', ':I', ':q', ':wq', ':fi', ':p', ':DD', ':q!', ':fd', ':=', ':f', ':A']</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = [':wq', ':echo', ':y', ':q!', ':w', ':i', '::', ':r', ':h', ':', ':=', ':fi', ':u', ':A', ':&gt;', ':!', ':s', ':fd', ':p', ':x', ':uu', ':dw', ':q', ':UU', ':DD', ':dd', ':f', ':S', ':&lt;', ':j', ':I', ':::']</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -315,7 +315,7 @@ efficient presentation.</p>
<dl class="py attribute">
<dt id="evennia.utils.eveditor.CmdEditorGroup.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ':r :j :h :UU :s :y :i :w ::: :dw :x :echo :u :S :&lt; :: :&gt; :! :dd :uu : :I :q :wq :fi :p :DD :q! :fd := :f :A', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' :r :j :h :UU :s :y :i :w ::: :dw :x :echo :u :S :&lt; :: :&gt; :! :dd :uu : :I :q :wq :fi :p :DD :q! :fd := :f :A', 'tags': '', 'text': '\n Commands for the editor\n '}</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ':wq :echo :y :q! :w :i :: :r :h : := :fi :u :A :&gt; :! :s :fd :p :x :uu :dw :q :UU :DD :dd :f :S :&lt; :j :I :::', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' :wq :echo :y :q! :w :i :: :r :h : := :fi :u :A :&gt; :! :s :fd :p :x :uu :dw :q :UU :DD :dd :f :S :&lt; :j :I :::', 'tags': '', 'text': '\n Commands for the editor\n '}</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -954,7 +954,7 @@ single question.</p>
<dl class="py attribute">
<dt id="evennia.utils.evmenu.CmdYesNoQuestion.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['n', 'a', 'abort', 'no', '__nomatch_command', 'yes', 'y']</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['no', 'abort', 'yes', 'y', '__nomatch_command', 'n', 'a']</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -980,7 +980,7 @@ single question.</p>
<dl class="py attribute">
<dt id="evennia.utils.evmenu.CmdYesNoQuestion.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'n a abort no __nomatch_command yes y', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' n a abort no __nomatch_command yes y', 'tags': '', 'text': '\n Handle a prompt for yes or no. Press [return] for the default choice.\n\n '}</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'no abort yes y __nomatch_command n a', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' no abort yes y __nomatch_command n a', 'tags': '', 'text': '\n Handle a prompt for yes or no. Press [return] for the default choice.\n\n '}</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -88,7 +88,7 @@ the <strong>caller.msg()</strong> construct every time the page is updated.</p>
<dl class="py attribute">
<dt id="evennia.utils.evmore.CmdMore.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['top', 't', 'end', 'n', 'a', 'p', 'e', 'abort', 'next', 'q', 'quit', 'previous']</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['end', 'next', 'quit', 'q', 'abort', 'p', 'top', 'previous', 'n', 'a', 't', 'e']</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -114,7 +114,7 @@ the <strong>caller.msg()</strong> construct every time the page is updated.</p>
<dl class="py attribute">
<dt id="evennia.utils.evmore.CmdMore.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'top t end n a p e abort next q quit previous', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' top t end n a p e abort next q quit previous', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.search_index_entry" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'end next quit q abort p top previous n a t e', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' end next quit q abort p top previous n a t e', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more