<spanid="evennia-contrib-tutorials-evadventure-commands"></span><h1>evennia.contrib.tutorials.evadventure.commands<aclass="headerlink"href="#module-evennia.contrib.tutorials.evadventure.commands"title="Permalink to this headline">¶</a></h1>
<p>EvAdventure commands and cmdsets. We don’t need that many stand-alone new
commands since a lot of functionality is managed in menus. These commands
are in additional to normal Evennia commands and should be added
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">EvAdventureCommand</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#EvAdventureCommand"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">parse</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#EvAdventureCommand.parse"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.parse"title="Permalink to this definition">¶</a></dt>
<dd><p>Once the cmdhandler has identified this as the command we
want, this function is run. If many of your commands have a
similar syntax (for example ‘cmd arg1 = arg2’) you should
simply define this once and just let other commands of the
same form inherit from this. See the docstring of this module
for which object properties are available to use (notably
<codeclass="sig-name descname">aliases</code><emclass="property"> = []</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'general'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'command'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'no_prefix': ' ', 'tags': '', 'text': '\n Base EvAdventure command. This is on the form\n\n command <args>\n\n where whitespace around the argument(s) are stripped.\n\n '}</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">CmdInventory</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdInventory"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'inventory'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = ['inv', 'i']</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">func</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdInventory.func"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.func"title="Permalink to this definition">¶</a></dt>
<dd><p>This is the actual executing part of the command. It is
called directly after self.parse(). See the docstring of this
module for which object properties are available (beyond those
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'general'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.lock_storage"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">CmdWieldOrWear</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdWieldOrWear"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'wield'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = ['wear']</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">out_txts</code><emclass="property"> = {<WieldLocation.BACKPACK: 'backpack'>: 'You shuffle the position of {key} around in your backpack.', <WieldLocation.TWO_HANDS: 'two_handed_weapons'>: 'You hold {key} with both hands.', <WieldLocation.WEAPON_HAND: 'weapon_hand'>: 'You hold {key} in your strongest hand, ready for action.', <WieldLocation.SHIELD_HAND: 'shield_hand'>: 'You hold {key} in your off hand, ready to protect you.', <WieldLocation.BODY: 'body'>: 'You strap {key} on yourself.', <WieldLocation.HEAD: 'head'>: 'You put {key} on your head.'}</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.out_txts"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">func</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdWieldOrWear.func"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.func"title="Permalink to this definition">¶</a></dt>
<dd><p>This is the actual executing part of the command. It is
called directly after self.parse(). See the docstring of this
module for which object properties are available (beyond those
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'general'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': 'wear', 'category': 'general', 'key': 'wield', 'no_prefix': ' wear', 'tags': '', 'text': '\n Wield a weapon/shield, or wear a piece of armor or a helmet.\n\n Usage:\n wield <item>\n wear <item>\n\n The item will automatically end up in the suitable spot, replacing whatever\n was there previously.\n\n '}</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">CmdRemove</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdRemove"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdRemove"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'remove'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdRemove.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = ['unwield', 'unwear']</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdRemove.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">func</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdRemove.func"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdRemove.func"title="Permalink to this definition">¶</a></dt>
<dd><p>This is the actual executing part of the command. It is
called directly after self.parse(). See the docstring of this
module for which object properties are available (beyond those
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'general'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdRemove.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdRemove.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': 'unwield unwear', 'category': 'general', 'key': 'remove', 'no_prefix': ' unwield unwear', 'tags': '', 'text': '\n Remove a remove a weapon/shield, armor or helmet.\n\n Usage:\n remove <item>\n unwield <item>\n unwear <item>\n\n To remove an item from the backpack, use |wdrop|n instead.\n\n '}</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdRemove.search_index_entry"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">node_give</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">caller</span></em>, <emclass="sig-param"><spanclass="n">raw_string</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#node_give"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.node_give"title="Permalink to this definition">¶</a></dt>
<dd><p>This will show to the giver until receiver accepts/declines. It allows them
to rescind their offer.</p>
<p>The <strong>caller</strong> here is the one giving the item. We also make sure to feed
<codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">node_receive</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">caller</span></em>, <emclass="sig-param"><spanclass="n">raw_string</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#node_receive"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.node_receive"title="Permalink to this definition">¶</a></dt>
<dd><p>Will show to the receiver and allow them to accept/decline the offer for
as long as the giver didn’t rescind it.</p>
<p>The <strong>caller</strong> here is the one receiving the item. We also make sure to feed
<codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">node_end</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">caller</span></em>, <emclass="sig-param"><spanclass="n">raw_string</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#node_end"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.node_end"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">CmdGive</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdGive"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'give'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">parse</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdGive.parse"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive.parse"title="Permalink to this definition">¶</a></dt>
<dd><p>Parsing is a little more complex for this command.</p>
<codeclass="sig-name descname">func</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdGive.func"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive.func"title="Permalink to this definition">¶</a></dt>
<dd><p>This is the actual executing part of the command. It is
called directly after self.parse(). See the docstring of this
module for which object properties are available (beyond those
<codeclass="sig-name descname">aliases</code><emclass="property"> = []</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'general'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '', 'category': 'general', 'key': 'give', 'no_prefix': ' ', 'tags': '', 'text': '\n Give item or money to another person. Items need to be accepted before\n they change hands. Money changes hands immediately with no wait.\n\n Usage:\n give <item> to <receiver>\n give <number of coins> [coins] to receiver\n\n If item name includes \' to \', surround it in quotes.\n\n Examples:\n give apple to ranger\n give "road to happiness" to sad ranger\n give 10 coins to ranger\n give 12 to ranger\n\n '}</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdGive.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">CmdTalk</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdTalk"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdTalk"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'talk'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdTalk.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">func</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#CmdTalk.func"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdTalk.func"title="Permalink to this definition">¶</a></dt>
<dd><p>This is the actual executing part of the command. It is
called directly after self.parse(). See the docstring of this
module for which object properties are available (beyond those
<codeclass="sig-name descname">aliases</code><emclass="property"> = []</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdTalk.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'general'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdTalk.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdTalk.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '', 'category': 'general', 'key': 'talk', 'no_prefix': ' ', 'tags': '', 'text': '\n Start a conversations with shop keepers and other NPCs in the world.\n\n Args:\n talk <npc>\n\n '}</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.CmdTalk.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.tutorials.evadventure.commands.</code><codeclass="sig-name descname">EvAdventureCmdSet</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cmdsetobj</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">key</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#EvAdventureCmdSet"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCmdSet"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'evadventure'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCmdSet.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_cmdset_creation</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/tutorials/evadventure/commands.html#EvAdventureCmdSet.at_cmdset_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCmdSet.at_cmdset_creation"title="Permalink to this definition">¶</a></dt>
<dd><p>Hook method - this should be overloaded in the inheriting
class, and should take care of populating the cmdset by use of
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.contrib.tutorials.evadventure.commands.EvAdventureCmdSet'</em><aclass="headerlink"href="#evennia.contrib.tutorials.evadventure.commands.EvAdventureCmdSet.path"title="Permalink to this definition">¶</a></dt>