mirror of
https://github.com/evennia/evennia.git
synced 2026-03-28 10:37:16 +01:00
Updated HTML docs.
This commit is contained in:
parent
8c528ba7f0
commit
a4d40b2ddb
51 changed files with 1410 additions and 505 deletions
|
|
@ -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: bfda895bec9f6f7a1075f79e5ffac768
|
||||
config: 295ad598aa65c8bc02f3edf95222c262
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
|
|
|||
|
|
@ -200,9 +200,19 @@
|
|||
<li><p><a class="reference external" href="https://github.com/evennia/evennia/pull/3421">Feature</a>: New <code class="docutils literal notranslate"><span class="pre">utils.compress_whitespace</span></code> utility used with
|
||||
default object’s <code class="docutils literal notranslate"><span class="pre">.format_appearance</span></code> to make it easier to overload without
|
||||
adding line breaks in hook returns. (InspectorCaracal)</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/evennia/evennia/pull/3458">Feature</a>: New <code class="docutils literal notranslate"><span class="pre">sethelp/category</span></code> switch to change a help topic’s
|
||||
category after it was created (chiizujin)</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/evennia/evennia/pull/3446">Fix</a>: Use plural (‘no apples’) instead of singular (‘no apple’) in
|
||||
<code class="docutils literal notranslate"><span class="pre">get_numbered_name</span></code> for better grammatical form (InspectorCaracal)</p></li>
|
||||
<li><p>Doc: Added Beginner Tutorial lessons for AI and Procedural dungeon (Griatch)</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/evennia/evennia/pull/3453">Fix</a>: Object aliases not showing in search multi-match
|
||||
disambiguation display (chiizujin)</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/evennia/evennia/pull/3455">Fix</a>: <code class="docutils literal notranslate"><span class="pre">sethelp/edit</span> <span class="pre"><topic></span></code> without a <code class="docutils literal notranslate"><span class="pre">=</span> <span class="pre">text</span></code> created a <code class="docutils literal notranslate"><span class="pre">None</span></code>
|
||||
entry that would lose the edit. (chiiziujin)</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/evennia/evennia/pull/3456">Fix</a>: <code class="docutils literal notranslate"><span class="pre">format_grid</span></code> utility used for <code class="docutils literal notranslate"><span class="pre">help</span></code> command caused commands
|
||||
to disappear for wider client widths (chiizujin)</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/evennia/evennia/pull/3457">Fix</a>: Help topic categories with different case would appear as
|
||||
duplicates (chiizujin)</p></li>
|
||||
<li><p>Doc: Added Beginner Tutorial lessons for AI, Quests and Procedural dungeon (Griatch)</p></li>
|
||||
<li><p>Doc fixes (Griatch, InspectorCaracal)</p></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -730,7 +730,17 @@ Click here to see the full index of all parts and lessons of the Beginner-Tutori
|
|||
<li class="toctree-l4"><a class="reference internal" href="Part3/Beginner-Tutorial-Dungeon.html#conclusions">13.11. Conclusions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html">14. Game Quests</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html">14. Game Quests</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html#the-quest-handler">14.1. The Quest Handler</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html#the-quest-class">14.2. The Quest class</a><ul>
|
||||
<li class="toctree-l5"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html#example-quest">14.2.1. Example quest</a></li>
|
||||
<li class="toctree-l5"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html#a-useful-command">14.2.2. A useful Command</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html#testing">14.3. Testing</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="Part3/Beginner-Tutorial-Quests.html#conclusions">14.4. Conclusions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Part3/Beginner-Tutorial-Shops.html">15. In-game Shops</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Part3/Beginner-Tutorial-Commands.html">16. In-game Commands</a></li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -170,6 +170,9 @@ At regular intervals, the AI entity will be ‘ticked’ by Evennia. This ‘tic
|
|||
<section id="the-aihandler">
|
||||
<h2><span class="section-number">12.2. </span>The AIHandler<a class="headerlink" href="#the-aihandler" title="Permalink to this headline">¶</a></h2>
|
||||
<p>This is the core logic for managing AI states. Create a new file <code class="docutils literal notranslate"><span class="pre">evadventure/ai.py</span></code>.</p>
|
||||
<blockquote>
|
||||
<div><p>Create a new file <code class="docutils literal notranslate"><span class="pre">evadventure/ai.py</span></code>.</p>
|
||||
</div></blockquote>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
||||
<span class="normal"> 2</span>
|
||||
<span class="normal"> 3</span>
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
<div><p>Create a new module <code class="docutils literal notranslate"><span class="pre">evadventure/combat_base.py</span></code></p>
|
||||
</div></blockquote>
|
||||
<aside class="sidebar">
|
||||
<p>In <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.combat_base.html#evennia-contrib-tutorials-evadventure-combat-base"><span class="std std-ref">evennia/contrib/tutorials/evadventure/combat_base.py</span></a> you’ll find a complete implementation of the base combat module.</p>
|
||||
<p>Under <code class="docutils literal notranslate"><span class="pre">evennia/contrib/tutorials/evadventure/</span></code>, in <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.combat_base.html#evennia-contrib-tutorials-evadventure-combat-base"><span class="std std-ref">combat_base.py</span></a> you’ll find a complete implementation of the base combat module.</p>
|
||||
</aside>
|
||||
<p>Our “Combat Handler” will handle the administration around combat. It needs to be <em>persistent</em> (even is we reload the server your combat should keep going).</p>
|
||||
<p>Creating the CombatHandler is a little of a catch-22 - how it works depends on how Actions and Action-dicts look. But without having the CombatHandler, it’s hard to know how to design Actions and Action-dicts. So we’ll start with its general structure and fill out the details later in this lesson.</p>
|
||||
|
|
@ -861,7 +861,7 @@
|
|||
<div><p>Create a module <code class="docutils literal notranslate"><span class="pre">evadventure/tests/test_combat.py</span></code>.</p>
|
||||
</div></blockquote>
|
||||
<aside class="sidebar">
|
||||
<p>See <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.tests.test_combat.html#evennia-contrib-tutorials-evadventure-tests-test-combat"><span class="std std-ref">evennia/contrib/tutorials/evadventure/tests/test_combat.py</span></a> for ready-made combat unit tests.</p>
|
||||
<p>Look under <code class="docutils literal notranslate"><span class="pre">evennia/contrib/tutorials/evadventure/</span></code>, in <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.tests.test_combat.html#evennia-contrib-tutorials-evadventure-tests-test-combat"><span class="std std-ref">tests/test_combat.py</span></a> for ready-made combat unit tests.</p>
|
||||
</aside>
|
||||
<p>Unit testing the combat base classes can seem impossible because we have not yet implemented most of it. We can however get very far by the use of <a class="reference external" href="https://docs.python.org/3/library/unittest.mock.html">Mocks</a>. The idea of a Mock is that you <em>replace</em> a piece of code with a dummy object (a ‘mock’) that can be called to return some specific value.</p>
|
||||
<p>For example, consider this following test of the <code class="docutils literal notranslate"><span class="pre">CombatHandler.get_combat_summary</span></code>. We can’t just call this because it internally calls <code class="docutils literal notranslate"><span class="pre">.get_sides</span></code> which would raise a <code class="docutils literal notranslate"><span class="pre">NotImplementedError</span></code>.</p>
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ You<span class="w"> </span>use<span class="w"> </span>Potion<span class="w"> </s
|
|||
<section id="general-principle">
|
||||
<h2><span class="section-number">11.1. </span>General Principle<a class="headerlink" href="#general-principle" title="Permalink to this headline">¶</a></h2>
|
||||
<aside class="sidebar">
|
||||
<p>An example of an implemented Turnbased combat system can be found in <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.combat_turnbased.html#evennia-contrib-tutorials-evadventure-combat-turnbased"><span class="std std-ref">evennia/contrib/tutorials/evadventure/combat_turnbased.py</span></a>.</p>
|
||||
<p>An example of an implemented Turnbased combat system can be found under <code class="docutils literal notranslate"><span class="pre">evennia/contrib/tutorials/evadventure/</span></code>, in <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.combat_turnbased.html#evennia-contrib-tutorials-evadventure-combat-turnbased"><span class="std std-ref">combat_turnbased.py</span></a>.</p>
|
||||
</aside>
|
||||
<p>Here is the general principle of the Turnbased combat handler:</p>
|
||||
<ul class="simple">
|
||||
|
|
|
|||
|
|
@ -293,7 +293,13 @@ of experience using Evennia and be really helpful for doing your own thing later
|
|||
<li class="toctree-l2"><a class="reference internal" href="Beginner-Tutorial-Dungeon.html#conclusions">13.11. Conclusions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Beginner-Tutorial-Quests.html">14. Game Quests</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Beginner-Tutorial-Quests.html">14. Game Quests</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Beginner-Tutorial-Quests.html#the-quest-handler">14.1. The Quest Handler</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Beginner-Tutorial-Quests.html#the-quest-class">14.2. The Quest class</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Beginner-Tutorial-Quests.html#testing">14.3. Testing</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Beginner-Tutorial-Quests.html#conclusions">14.4. Conclusions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Beginner-Tutorial-Shops.html">15. In-game Shops</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Beginner-Tutorial-Commands.html">16. In-game Commands</a></li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -65,6 +65,21 @@
|
|||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
<h3><a href="../../../index.html">Table of Contents</a></h3>
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">14. Game Quests</a><ul>
|
||||
<li><a class="reference internal" href="#the-quest-handler">14.1. The Quest Handler</a></li>
|
||||
<li><a class="reference internal" href="#the-quest-class">14.2. The Quest class</a><ul>
|
||||
<li><a class="reference internal" href="#example-quest">14.2.1. Example quest</a></li>
|
||||
<li><a class="reference internal" href="#a-useful-command">14.2.2. A useful Command</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#testing">14.3. Testing</a></li>
|
||||
<li><a class="reference internal" href="#conclusions">14.4. Conclusions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="Beginner-Tutorial-Dungeon.html"
|
||||
title="previous chapter"><span class="section-number">13. </span>Procedurally generated Dungeon</a></p>
|
||||
|
|
@ -118,9 +133,467 @@
|
|||
<p>A quest follows a specific development:</p>
|
||||
<ol class="simple">
|
||||
<li><p>The quest is <em>started</em>. This normally involves the player accepting the quest, from a quest-giver, job board or other source. But the quest could also be thrust on the player (“save the family from the burning house before it collapses!”)</p></li>
|
||||
<li><p>Once a quest has been accepted and assigned to a character, it is either either <code class="docutils literal notranslate"><span class="pre">Started</span></code> (that is, ‘in progress’), <code class="docutils literal notranslate"><span class="pre">Abandoned</span></code>, <code class="docutils literal notranslate"><span class="pre">Failed</span></code> or <code class="docutils literal notranslate"><span class="pre">Complete</span></code>.</p></li>
|
||||
<li><p>A quest may consist of one or more ‘steps’. Each step has its own set of finish conditions.</p></li>
|
||||
<li><p>At suitable times the quest is <em>checked</em>. This could happen on a timer or when trying to ‘hand in’ the quest. When checking, the current ‘step’ is checked against its finish conditions. If ok, that step is closed and the next step is checked until it either hits a step that is not yet complete, or there are no more steps, in which case the entire quest is complete.</p></li>
|
||||
<li><p>At suitable times the quest’s <em>progress</em> is checked. This could happen on a timer or when trying to ‘hand in’ the quest. When checking, the current ‘step’ is checked against its finish conditions. If ok, that step is closed and the next step is checked until it either hits a step that is not yet complete, or there are no more steps, in which case the entire quest is complete.</p></li>
|
||||
</ol>
|
||||
<aside class="sidebar">
|
||||
<p>An example implementation of quests is found under <code class="docutils literal notranslate"><span class="pre">evennia/contrib/tutorials</span></code>, in <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia-contrib-tutorials-evadventure-quests"><span class="std std-ref">evadvanture/quests.py</span></a>.</p>
|
||||
</aside>
|
||||
<p>To represent quests in code, we need</p>
|
||||
<ul class="simple">
|
||||
<li><p>A convenient flexible way to code how we check the status and current steps of the quest. We want this scripting to be as flexible as possible. Ideally we want to be able to code the quests’s logic in full Python.</p></li>
|
||||
<li><p>Persistence. The fact that we accepted the quest, as well as its status and other flags must be saved in the database and survive a server reboot.</p></li>
|
||||
</ul>
|
||||
<p>We’ll accomplish this using two pieces of Python code:</p>
|
||||
<ul class="simple">
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">EvAdventureQuest</span></code>: A Python class with helper methods that we can call to check current quest status, figure if a given quest-step is complete or not. We will create and script new quests by simply inheriting from this base class and implement new methods on it in a standardized way.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">EvAdventureQuestHandler</span></code> will sit ‘on’ each Character as <code class="docutils literal notranslate"><span class="pre">character.quests</span></code>. It will hold all <code class="docutils literal notranslate"><span class="pre">EvAdventureQuest</span></code>s that the character is or has been involved in. It is also responsible for storing quest state using <a class="reference internal" href="../../../Components/Attributes.html"><span class="doc std std-doc">Attributes</span></a> on the Character.</p></li>
|
||||
</ul>
|
||||
<section id="the-quest-handler">
|
||||
<h2><span class="section-number">14.1. </span>The Quest Handler<a class="headerlink" href="#the-quest-handler" title="Permalink to this headline">¶</a></h2>
|
||||
<blockquote>
|
||||
<div><p>Create a new module <code class="docutils literal notranslate"><span class="pre">evadventure/quests.py</span></code>.</p>
|
||||
</div></blockquote>
|
||||
<p>We saw the implementation of an on-object handler back in the <a class="reference internal" href="Beginner-Tutorial-AI.html#the-aihandler"><span class="std std-doc">lesson about NPC and monster AI</span></a> (the <code class="docutils literal notranslate"><span class="pre">AIHandler</span></code>).</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
||||
<span class="normal"> 2</span>
|
||||
<span class="normal"> 3</span>
|
||||
<span class="normal"> 4</span>
|
||||
<span class="normal"> 5</span>
|
||||
<span class="normal"> 6</span>
|
||||
<span class="normal"> 7</span>
|
||||
<span class="normal"> 8</span>
|
||||
<span class="normal"> 9</span>
|
||||
<span class="normal">10</span>
|
||||
<span class="normal">11</span>
|
||||
<span class="normal">12</span>
|
||||
<span class="normal">13</span>
|
||||
<span class="normal">14</span>
|
||||
<span class="normal">15</span>
|
||||
<span class="normal">16</span>
|
||||
<span class="normal">17</span>
|
||||
<span class="normal">18</span>
|
||||
<span class="normal">19</span>
|
||||
<span class="normal">20</span>
|
||||
<span class="normal">21</span>
|
||||
<span class="normal">22</span>
|
||||
<span class="normal">23</span>
|
||||
<span class="normal">24</span>
|
||||
<span class="normal">25</span>
|
||||
<span class="normal">26</span>
|
||||
<span class="normal">27</span>
|
||||
<span class="normal">28</span>
|
||||
<span class="normal">29</span>
|
||||
<span class="normal">30</span>
|
||||
<span class="normal">31</span>
|
||||
<span class="normal">32</span>
|
||||
<span class="normal">33</span>
|
||||
<span class="normal">34</span>
|
||||
<span class="normal">35</span>
|
||||
<span class="normal">36</span>
|
||||
<span class="normal">37</span>
|
||||
<span class="normal">38</span>
|
||||
<span class="normal">39</span>
|
||||
<span class="normal">40</span>
|
||||
<span class="normal">41</span>
|
||||
<span class="normal">42</span>
|
||||
<span class="normal">43</span>
|
||||
<span class="normal">44</span>
|
||||
<span class="normal">45</span></pre></div></td><td class="code"><div><pre><span></span><span class="c1"># in evadventure/quests.py</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">EvAdventureQuestHandler</span><span class="p">:</span>
|
||||
<span class="n">quest_storage_attribute_key</span> <span class="o">=</span> <span class="s2">"_quests"</span>
|
||||
<span class="n">quest_storage_attribute_category</span> <span class="o">=</span> <span class="s2">"evadventure"</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">obj</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span> <span class="o">=</span> <span class="n">obj</span>
|
||||
<span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
</span><span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
</span><span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">_load</span><span class="p">()</span>
|
||||
</span>
|
||||
<span class="k">def</span> <span class="nf">_load</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</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><span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quest_storage_attribute_key</span><span class="p">,</span>
|
||||
</span><span class="hll"> <span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_storage_attribute_category</span><span class="p">,</span>
|
||||
</span><span class="hll"> <span class="n">default</span><span class="o">=</span><span class="p">{},</span>
|
||||
</span><span class="hll"> <span class="p">)</span>
|
||||
</span> <span class="c1"># instantiate all quests</span>
|
||||
<span class="k">for</span> <span class="n">quest_key</span><span class="p">,</span> <span class="n">quest_class</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
|
||||
<span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">[</span><span class="n">quest_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">quest_class</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">)</span>
|
||||
</span>
|
||||
<span class="k">def</span> <span class="nf">_save</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
|
||||
</span><span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quest_storage_attribute_key</span><span class="p">,</span>
|
||||
</span><span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span><span class="p">,</span>
|
||||
</span><span class="hll"> <span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_storage_attribute_category</span><span class="p">,</span>
|
||||
</span><span class="hll"> <span class="p">)</span>
|
||||
</span>
|
||||
<span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">quest_key</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">all</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_class</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span><span class="p">[</span><span class="n">quest_class</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">quest_class</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">[</span><span class="n">quest_class</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">quest_class</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_save</span><span class="p">()</span>
|
||||
|
||||
<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">quest_key</span><span class="p">):</span>
|
||||
<span class="n">quest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">quest_key</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">quest_classes</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">quest_key</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">quests</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">quest_key</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">_save</span><span class="p">()</span>
|
||||
</pre></div></td></tr></table></div>
|
||||
</div>
|
||||
<aside class="sidebar">
|
||||
<p class="sidebar-title">Persistent handler pattern</p>
|
||||
<p>Persistent handlers are commonly used throughout Evennia. You can read more about them in the <a class="reference internal" href="../../Tutorial-Persistent-Handler.html"><span class="doc std std-doc">Making a Persistent object Handler</span></a> tutorial.</p>
|
||||
</aside>
|
||||
<ul class="simple">
|
||||
<li><p><strong>Line 9</strong>: We know that the quests themselves will be Python classes inheriting from <code class="docutils literal notranslate"><span class="pre">EvAdventureQuest</span></code> (which we haven’t created yet). We will store those classes in <code class="docutils literal notranslate"><span class="pre">self.quest_classes</span></code> on the handler. Note that there is a difference between a class and an <em>instance</em> of a class! The class cannot hold any <em>state</em> on its own, such as the status of that quest is for this particular character. The class only holds python code.</p></li>
|
||||
<li><p><strong>Line 10</strong>: We set aside another property on the handler - <code class="docutils literal notranslate"><span class="pre">self.quest</span></code> This is dictionary that will hold <code class="docutils literal notranslate"><span class="pre">EvAdventureQuest</span></code> <em>instances</em>.</p></li>
|
||||
<li><p><strong>Line 11</strong>: Note that we call the <code class="docutils literal notranslate"><span class="pre">self._load()</span></code> method here, this loads up data from the database whenever this handler is accessed.</p></li>
|
||||
<li><p><strong>Lines 14-18</strong>: We use <code class="docutils literal notranslate"><span class="pre">self.obj.attributes.get</span></code> to fetch an <a class="reference internal" href="../../../Components/Attributes.html"><span class="doc std std-doc">Attribute</span></a> on the Character named <code class="docutils literal notranslate"><span class="pre">_quests</span></code> and with a category of <code class="docutils literal notranslate"><span class="pre">evadventure</span></code>. If it doesn’t exist yet (because we never started any quests), we just return an empty dict.</p></li>
|
||||
<li><p><strong>Line 21</strong>: Here we loop over all the classes and instantiate them. We haven’t defined how these quest-classes look yet, but by instantiating them with <code class="docutils literal notranslate"><span class="pre">self.obj</span></code> (the Character) we should be covered - from the Character class the quest will be able to get to everything else (this handler itself will be accessible as <code class="docutils literal notranslate"><span class="pre">obj.quests</span></code> from that quest instance after all).</p></li>
|
||||
<li><p><strong>Line 24</strong>: Here we do the corresponding save operation.</p></li>
|
||||
</ul>
|
||||
<p>The rest of the handler are just access methods for getting, adding and removing quests from the handler. We make one assumption in those code, namely that the quest class has a property <code class="docutils literal notranslate"><span class="pre">.key</span></code> being the unique quest-name.</p>
|
||||
<p>This is how it would be used in practice:</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in some questing code </span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">search_object</span>
|
||||
<span class="kn">from</span> <span class="nn">evadventure</span> <span class="kn">import</span> <span class="n">quests</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">EvAdventureSuperQuest</span><span class="p">(</span><span class="n">quests</span><span class="o">.</span><span class="n">EvAdventureQuest</span><span class="p">):</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"superquest"</span>
|
||||
<span class="c1"># quest implementation here</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">start_super_quest</span><span class="p">(</span><span class="n">character</span><span class="p">):</span>
|
||||
<span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">EvAdventureSuperQuest</span><span class="p">)</span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
<aside class="sidebar">
|
||||
<p class="sidebar-title">What can be saved in Attributes?</p>
|
||||
<p>For more details, see <a class="reference internal" href="../../../Components/Attributes.html#what-types-of-data-can-i-save-in-an-attribute"><span class="std std-doc">the Attributes documentation</span></a> on the matter.</p>
|
||||
</aside>
|
||||
<p>We chose to store classes and not instances of classes above. The reason for this has to do with what can be stored in a database <code class="docutils literal notranslate"><span class="pre">Attribute</span></code> - one limitation of an Attribute is that we can’t save a class instance <em>with other database entities baked inside it</em>. If we saved quest instances as-is, it’s highly likely they’d contain database entities ‘hidden’ inside them - a reference to the Character, maybe to objects required for the quest to be complete etc. Evennia would fail trying to save that data.
|
||||
Instead we store only the classes, instantiate those classes with the Character, and let the quest store its state flags separately, like this:</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in evadventure/quests.py </span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">EvAdventureQuestHandler</span><span class="p">:</span>
|
||||
|
||||
<span class="c1"># ... </span>
|
||||
<span class="n">quest_data_attribute_template</span> <span class="o">=</span> <span class="s2">"_quest_data_</span><span class="si">{quest_key}</span><span class="s2">"</span>
|
||||
<span class="n">quest_data_attribute_category</span> <span class="o">=</span> <span class="s2">"evadventure"</span>
|
||||
|
||||
<span class="c1"># ... </span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">save_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="n">quest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">quest_key</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">quest</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">quest_key</span><span class="o">=</span><span class="n">quest_key</span><span class="p">),</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_category</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">load_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</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="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">quest_key</span><span class="o">=</span><span class="n">quest_key</span><span class="p">),</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_category</span><span class="p">,</span>
|
||||
<span class="n">default</span><span class="o">=</span><span class="p">{},</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This works the same as the <code class="docutils literal notranslate"><span class="pre">_load</span></code> and <code class="docutils literal notranslate"><span class="pre">_save</span></code> methods, except it fetches a property <code class="docutils literal notranslate"><span class="pre">.data</span></code> (this will be a <code class="docutils literal notranslate"><span class="pre">dict</span></code>) on the quest instance and save it. As long as we make sure to call these methods from the quest the quest whenever that <code class="docutils literal notranslate"><span class="pre">.data</span></code> property is changed, all will be well - this is because Attributes know how to properly analyze a <code class="docutils literal notranslate"><span class="pre">dict</span></code> to find and safely serialize any database entities found within.</p>
|
||||
<p>Our handler is ready. We created the <code class="docutils literal notranslate"><span class="pre">EvAdventureCharacter</span></code> class back in the <a class="reference internal" href="Beginner-Tutorial-Characters.html"><span class="doc std std-doc">Character lesson</span></a> - let’s add quest-support to it.</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in evadventure/characters.py</span>
|
||||
|
||||
<span class="c1"># ...</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="kn">import</span> <span class="n">lazy_property</span>
|
||||
<span class="kn">from</span> <span class="nn">evadventure.quests</span> <span class="kn">import</span> <span class="n">EvAdventureQuestHandler</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">EvAdventureCharacter</span><span class="p">(</span><span class="n">LivingMixin</span><span class="p">,</span> <span class="n">DefaultCharacter</span><span class="p">):</span>
|
||||
<span class="c1"># ...</span>
|
||||
|
||||
<span class="nd">@lazy_property</span>
|
||||
<span class="k">def</span> <span class="nf">quests</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">EvAdventureQuestHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># ...</span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>We also need a way to represent the quests themselves though!</p>
|
||||
</section>
|
||||
<section id="the-quest-class">
|
||||
<h2><span class="section-number">14.2. </span>The Quest class<a class="headerlink" href="#the-quest-class" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
||||
<span class="normal"> 2</span>
|
||||
<span class="normal"> 3</span>
|
||||
<span class="normal"> 4</span>
|
||||
<span class="normal"> 5</span>
|
||||
<span class="normal"> 6</span>
|
||||
<span class="normal"> 7</span>
|
||||
<span class="normal"> 8</span>
|
||||
<span class="normal"> 9</span>
|
||||
<span class="normal">10</span>
|
||||
<span class="normal">11</span>
|
||||
<span class="normal">12</span>
|
||||
<span class="normal">13</span>
|
||||
<span class="normal">14</span>
|
||||
<span class="normal">15</span>
|
||||
<span class="normal">16</span>
|
||||
<span class="normal">17</span>
|
||||
<span class="normal">18</span>
|
||||
<span class="normal">19</span>
|
||||
<span class="normal">20</span>
|
||||
<span class="normal">21</span>
|
||||
<span class="normal">22</span>
|
||||
<span class="normal">23</span>
|
||||
<span class="normal">24</span>
|
||||
<span class="normal">25</span>
|
||||
<span class="normal">26</span>
|
||||
<span class="normal">27</span>
|
||||
<span class="normal">28</span>
|
||||
<span class="normal">29</span>
|
||||
<span class="normal">30</span>
|
||||
<span class="normal">31</span>
|
||||
<span class="normal">32</span>
|
||||
<span class="normal">33</span>
|
||||
<span class="normal">34</span>
|
||||
<span class="normal">35</span>
|
||||
<span class="normal">36</span>
|
||||
<span class="normal">37</span>
|
||||
<span class="normal">38</span>
|
||||
<span class="normal">39</span>
|
||||
<span class="normal">40</span>
|
||||
<span class="normal">41</span></pre></div></td><td class="code"><div><pre><span></span><span class="c1"># in evadventure/quests.py</span>
|
||||
|
||||
<span class="c1"># ...</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">EvAdventureQuest</span><span class="p">:</span>
|
||||
|
||||
<span class="hll"> <span class="n">key</span> <span class="o">=</span> <span class="s2">"base-quest"</span>
|
||||
</span> <span class="n">desc</span> <span class="o">=</span> <span class="s2">"Base quest"</span>
|
||||
<span class="n">start_step</span> <span class="o">=</span> <span class="s2">"start"</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">quester</span><span class="p">):</span>
|
||||
<span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">quester</span> <span class="o">=</span> <span class="n">quester</span>
|
||||
</span><span class="hll"> <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">load_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
|
||||
</span> <span class="bp">self</span><span class="o">.</span><span class="n">_current_step</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_data</span><span class="p">(</span><span class="s2">"current_step"</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">current_step</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">current_step</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">start_step</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">add_data</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="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">save_quest_data</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="k">def</span> <span class="nf">get_data</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">default</span><span class="o">=</span><span class="kc">None</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">get</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">default</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">remove_data</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="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">key</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">questhandler</span><span class="o">.</span><span class="n">save_quest_data</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="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">questhandler</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">quester</span><span class="o">.</span><span class="n">quests</span>
|
||||
|
||||
<span class="hll"> <span class="nd">@property</span>
|
||||
</span><span class="hll"> <span class="k">def</span> <span class="nf">current_step</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
</span><span class="hll"> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_current_step</span>
|
||||
</span>
|
||||
<span class="nd">@current_step</span><span class="o">.</span><span class="n">setter</span>
|
||||
<span class="k">def</span> <span class="nf">current_step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">step_name</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_current_step</span> <span class="o">=</span> <span class="n">step_name</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_data</span><span class="p">(</span><span class="s2">"current_step"</span><span class="p">,</span> <span class="n">step_name</span><span class="p">)</span>
|
||||
</pre></div></td></tr></table></div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li><p><strong>Line 7</strong>: Each class must have a <code class="docutils literal notranslate"><span class="pre">.key</span></code> property unquely identifying the quest. We depend on this in the quest-handler.</p></li>
|
||||
<li><p><strong>Line 12</strong>: <code class="docutils literal notranslate"><span class="pre">quester</span></code> (the Character) is passed into this class when it is initiated inside <code class="docutils literal notranslate"><span class="pre">EvAdventureQuestHandler._load()</span></code>.</p></li>
|
||||
<li><p><strong>Line 13</strong>: We load the quest data into <code class="docutils literal notranslate"><span class="pre">self.data</span></code> directly using the <code class="docutils literal notranslate"><span class="pre">questhandler.load_quest-data</span></code> method (which in turn loads it from an Attribute on the Character). Note that the <code class="docutils literal notranslate"><span class="pre">.questhandler</span></code> property is defined on <strong>lines 34-36</strong> as a shortcut to get to the handler.</p></li>
|
||||
</ul>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">add/get/remove_data</span></code> methods are convenient wrappers for getting data in and out of the database using the matching methods on the handler. When we implement a quest we should prefer to use <code class="docutils literal notranslate"><span class="pre">.get_data</span></code>, <code class="docutils literal notranslate"><span class="pre">add_data</span></code> and <code class="docutils literal notranslate"><span class="pre">remove_data</span></code> over manipulating <code class="docutils literal notranslate"><span class="pre">.data</span></code> directly, since the former will make sure to save said that to the database automatically.</p>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">current_step</span></code> tracks the current quest ‘step’ we are in; what this means is up to each Quest. We set up convenient properties for setting the <code class="docutils literal notranslate"><span class="pre">current_state</span></code> and also make sure to save it in the data dict as “current_step”.</p>
|
||||
<p>The quest can have a few possible statuses: “started”, “completed”, “abandoned” and “failed”. We create a few properties and methods for easily control that, while saving everything under the hood:</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in evadventure/quests.py</span>
|
||||
|
||||
<span class="c1"># ... </span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">EvAdventureQuest</span><span class="p">:</span>
|
||||
|
||||
<span class="c1"># ... </span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">status</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="s2">"started"</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@status</span><span class="o">.</span><span class="n">setter</span>
|
||||
<span class="k">def</span> <span class="nf">status</span><span class="p">(</span><span class="bp">self</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">add_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_completed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s2">"completed"</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_abandoned</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s2">"abandoned"</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_failed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s2">"failed"</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">complete</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">status</span> <span class="o">=</span> <span class="s2">"completed"</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">abandon</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">status</span> <span class="o">=</span> <span class="s2">"abandoned"</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">fail</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">status</span> <span class="o">=</span> <span class="s2">"failed"</span>
|
||||
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>So far we have only added convenience functions for checking statuses. How will the actual “quest” aspect of this work?</p>
|
||||
<p>What will happen when the system wants to check the progress of the quest, is that it will call a method <code class="docutils literal notranslate"><span class="pre">.progress()</span></code> on this class. Similarly, to get help for the current step, it will call a method <code class="docutils literal notranslate"><span class="pre">.help()</span></code></p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>
|
||||
<span class="n">start_step</span> <span class="o">=</span> <span class="s2">"start"</span>
|
||||
|
||||
<span class="c1"># help entries for quests (could also be methods)</span>
|
||||
<span class="n">help_start</span> <span class="o">=</span> <span class="s2">"You need to start first"</span>
|
||||
<span class="n">help_end</span> <span class="o">=</span> <span class="s2">"You need to end the quest"</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">progress</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">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"step_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">current_step</span><span class="si">}</span><span class="s2">"</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">def</span> <span class="nf">help</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">status</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"abandoned"</span><span class="p">,</span> <span class="s2">"completed"</span><span class="p">,</span> <span class="s2">"failed"</span><span class="p">):</span>
|
||||
<span class="n">help_resource</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"help_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span>
|
||||
<span class="sa">f</span><span class="s2">"You have </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="s2"> this quest."</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">help_resource</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"help_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">current_step</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"No help available."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="nb">callable</span><span class="p">(</span><span class="n">help_resource</span><span class="p">):</span>
|
||||
<span class="c1"># the help_* methods can be used to dynamically generate help</span>
|
||||
<span class="k">return</span> <span class="n">help_resource</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">else</span><span class="p">:</span>
|
||||
<span class="c1"># normally it's just a string</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">help_resource</span><span class="p">)</span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
<aside class="sidebar">
|
||||
<p class="sidebar-title">What’s with the *args, **kwargs?</p>
|
||||
<p>These are optional, but allow you to pass extra information into your quest-check. This could be very powerful if you want to add extra context to determine if a quest-step is currently complete or not.</p>
|
||||
</aside>
|
||||
<p>Calling the <code class="docutils literal notranslate"><span class="pre">.progress(*args,</span> <span class="pre">**kwargs)</span></code> method will call a method named <code class="docutils literal notranslate"><span class="pre">step_<current_step>(*args,</span> <span class="pre">**kwargs)</span></code> on this class. That is, if we are on the <em>start</em> step, the method called will be <code class="docutils literal notranslate"><span class="pre">self.step_start(*args,</span> <span class="pre">**kwargs)</span></code>. Where is this method? It has not been implemented yet! In fact, it’s up to us to implement methods like this for each quest. By just adding a correctly added method, we will easily be able to add more steps to a quest.</p>
|
||||
<p>Similarly, calling <code class="docutils literal notranslate"><span class="pre">.help(*args,</span> <span class="pre">**kwargs)</span></code> will try to find a property <code class="docutils literal notranslate"><span class="pre">help_<current_step></span></code>. If this is a callable, it will be called as for example <code class="docutils literal notranslate"><span class="pre">self.help_start(*args,</span> <span class="pre">**kwargs)</span></code>. If it is given as a string, then the string will be returned as-is and the <code class="docutils literal notranslate"><span class="pre">*args,</span> <span class="pre">**kwargs</span></code> will be ignored.</p>
|
||||
<section id="example-quest">
|
||||
<h3><span class="section-number">14.2.1. </span>Example quest<a class="headerlink" href="#example-quest" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in some quest module, like world/myquests.py</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">evadventure.quests</span> <span class="kn">import</span> <span class="n">EvAdventureQuest</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">ShortQuest</span><span class="p">(</span><span class="n">EvAdventureQuest</span><span class="p">):</span>
|
||||
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"simple-quest"</span>
|
||||
<span class="n">desc</span> <span class="o">=</span> <span class="s2">"A very simple quest."</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">step_start</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="w"> </span><span class="sd">"""Example step!"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quester</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">"Quest started!"</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">current_step</span> <span class="o">=</span> <span class="s2">"end"</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">step_end</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="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_completed</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quester</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">"Quest ended!"</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">complete</span><span class="p">()</span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This is a very simple quest that will resolve on its own after two <code class="docutils literal notranslate"><span class="pre">.progress()</span></code> checks. Here’s the full life cycle of this quest:</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in some module somewhere, using evennia shell or in-game using py</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">search_object</span>
|
||||
<span class="kn">from</span> <span class="nn">world.myquests</span> <span class="kn">import</span> <span class="n">ShortQuest</span>
|
||||
|
||||
<span class="n">character</span> <span class="o">=</span> <span class="n">search_object</span><span class="p">(</span><span class="s2">"MyCharacterName"</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ShortQuest</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># this will echo "Quest started!" to character</span>
|
||||
<span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"short-quest"</span><span class="p">)</span><span class="o">.</span><span class="n">progress</span><span class="p">()</span>
|
||||
<span class="c1"># this will echo "Quest ended!" to character</span>
|
||||
<span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"short-quest"</span><span class="p">)</span><span class="o">.</span><span class="n">progress</span><span class="p">()</span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="a-useful-command">
|
||||
<h3><span class="section-number">14.2.2. </span>A useful Command<a class="headerlink" href="#a-useful-command" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The player must know which quests they have and be able to inspect them. Here’s a simple <code class="docutils literal notranslate"><span class="pre">quests</span></code> command to handle this:</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in evadventure/quests.py</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">CmdQuests</span><span class="p">(</span><span class="n">Command</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> List all quests and their statuses as well as get info about the status of</span>
|
||||
<span class="sd"> a specific quest.</span>
|
||||
|
||||
<span class="sd"> Usage:</span>
|
||||
<span class="sd"> quests</span>
|
||||
<span class="sd"> quest <questname></span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"quests"</span>
|
||||
<span class="n">aliases</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"quest"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">parse</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">quest_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">quest_name</span><span class="p">:</span>
|
||||
<span class="n">quest</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">quests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_name</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">quest</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">"Quest </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_name</span><span class="si">}</span><span class="s2"> not found."</span><span class="p">)</span>
|
||||
<span class="k">return</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">"Quest </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="se">\n</span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">help</span><span class="p">()</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="n">quests</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">quests</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">quests</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="s2">"No quests."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">quest</span> <span class="ow">in</span> <span class="n">quests</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">"Quest </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Add this to the <code class="docutils literal notranslate"><span class="pre">CharacterCmdSet</span></code> in <code class="docutils literal notranslate"><span class="pre">mygame/commands/default_cmdsets.py</span></code>. Follow the <a class="reference internal" href="../Part1/Beginner-Tutorial-Adding-Commands.html#add-the-echo-command-to-the-default-cmdset"><span class="std std-doc">Adding a command lesson</span></a> if you are unsure how to do this. Reload and if you are playing as an <code class="docutils literal notranslate"><span class="pre">EvAdventureCharacter</span></code> you should be able to use <code class="docutils literal notranslate"><span class="pre">quests</span></code> to view your quests.</p>
|
||||
</section>
|
||||
</section>
|
||||
<section id="testing">
|
||||
<h2><span class="section-number">14.3. </span>Testing<a class="headerlink" href="#testing" title="Permalink to this headline">¶</a></h2>
|
||||
<blockquote>
|
||||
<div><p>Create a new folder <code class="docutils literal notranslate"><span class="pre">evadventure/tests/test_quests.py</span></code>.</p>
|
||||
</div></blockquote>
|
||||
<aside class="sidebar">
|
||||
<p>An example test suite for quests is found in <code class="docutils literal notranslate"><span class="pre">evennia/contrib/tutorials/evadventure</span></code>, as <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.tests.test_quests.html#evennia-contrib-tutorials-evadventure-tests-test-quests"><span class="std std-ref">tests/test_quests.py</span></a>.</p>
|
||||
</aside>
|
||||
<p>Testing of the quests means creating a test character, making a dummy quest, add it to the character’s quest handler and making sure all methods work correcly. Create the testing quest so that it will automatically step forward when calling <code class="docutils literal notranslate"><span class="pre">.progress()</span></code>, so you can make sure it works as intended.</p>
|
||||
</section>
|
||||
<section id="conclusions">
|
||||
<h2><span class="section-number">14.4. </span>Conclusions<a class="headerlink" href="#conclusions" title="Permalink to this headline">¶</a></h2>
|
||||
<p>What we created here is just the framework for questing. The actual complexity will come when creating the quests themselves (that is, implementing the <code class="docutils literal notranslate"><span class="pre">step_<current_step>(*args,</span> <span class="pre">**kwargs)</span></code> methods), which is something we’ll get to later, in <a class="reference internal" href="../Part4/Beginner-Tutorial-Part4-Overview.html"><span class="doc std std-doc">Part 4</span></a> of this tutorial.</p>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -872,13 +872,14 @@
|
|||
<span class="sd"> Edit the help database.</span>
|
||||
|
||||
<span class="sd"> Usage:</span>
|
||||
<span class="sd"> sethelp[/switches] <topic>[[;alias;alias][,category[,locks]] [= <text>]</span>
|
||||
|
||||
<span class="sd"> sethelp[/switches] <topic>[[;alias;alias][,category[,locks]]</span>
|
||||
<span class="sd"> [= <text or new category>]</span>
|
||||
<span class="sd"> Switches:</span>
|
||||
<span class="sd"> edit - open a line editor to edit the topic's help text.</span>
|
||||
<span class="sd"> replace - overwrite existing help topic.</span>
|
||||
<span class="sd"> append - add text to the end of existing topic with a newline between.</span>
|
||||
<span class="sd"> extend - as append, but don't add a newline.</span>
|
||||
<span class="sd"> category - change category of existing help topic.</span>
|
||||
<span class="sd"> delete - remove help topic.</span>
|
||||
|
||||
<span class="sd"> Examples:</span>
|
||||
|
|
@ -886,6 +887,7 @@
|
|||
<span class="sd"> sethelp/append pickpocketing,Thievery = This steals ...</span>
|
||||
<span class="sd"> sethelp/replace pickpocketing, ,attr(is_thief) = This steals ...</span>
|
||||
<span class="sd"> sethelp/edit thievery</span>
|
||||
<span class="sd"> sethelp/category thievery = classes</span>
|
||||
|
||||
<span class="sd"> If not assigning a category, the `settings.DEFAULT_HELP_CATEGORY` category</span>
|
||||
<span class="sd"> will be used. If no lockstring is specified, everyone will be able to read</span>
|
||||
|
|
@ -932,7 +934,7 @@
|
|||
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"sethelp"</span>
|
||||
<span class="n">aliases</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">switch_options</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"edit"</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">,</span> <span class="s2">"append"</span><span class="p">,</span> <span class="s2">"extend"</span><span class="p">,</span> <span class="s2">"delete"</span><span class="p">)</span>
|
||||
<span class="n">switch_options</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"edit"</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">,</span> <span class="s2">"append"</span><span class="p">,</span> <span class="s2">"extend"</span><span class="p">,</span> <span class="s2">"category"</span><span class="p">,</span> <span class="s2">"delete"</span><span class="p">)</span>
|
||||
<span class="n">locks</span> <span class="o">=</span> <span class="s2">"cmd:perm(Helper)"</span>
|
||||
<span class="n">help_category</span> <span class="o">=</span> <span class="s2">"Building"</span>
|
||||
<span class="n">arg_regex</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
|
@ -949,7 +951,7 @@
|
|||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</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="s2">"Usage: sethelp[/switches] <topic>[;alias;alias][,category[,locks,..] = <text>"</span>
|
||||
<span class="s2">"Usage: sethelp[/switches] <topic>[[;alias;alias][,category[,locks]] [= <text or new category>]"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
|
|
@ -1045,7 +1047,7 @@
|
|||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">helpentry</span> <span class="o">=</span> <span class="n">create</span><span class="o">.</span><span class="n">create_help_entry</span><span class="p">(</span>
|
||||
<span class="n">topicstr</span><span class="p">,</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">rhs</span><span class="p">,</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">rhs</span> <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="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">,</span>
|
||||
<span class="n">locks</span><span class="o">=</span><span class="n">lockstring</span><span class="p">,</span>
|
||||
<span class="n">aliases</span><span class="o">=</span><span class="n">aliases</span><span class="p">,</span>
|
||||
|
|
@ -1078,6 +1080,19 @@
|
|||
<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">"Entry updated:</span><span class="se">\n</span><span class="si">{</span><span class="n">old_entry</span><span class="o">.</span><span class="n">entrytext</span><span class="si">}{</span><span class="n">aliastxt</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"category"</span> <span class="ow">in</span> <span class="n">switches</span><span class="p">:</span>
|
||||
<span class="c1"># set the category</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">old_entry</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">"Could not find topic '</span><span class="si">{</span><span class="n">topicstr</span><span class="si">}</span><span class="s2">'</span><span class="si">{</span><span class="n">aliastxt</span><span class="si">}</span><span class="s2">."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs</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="s2">"You must supply a category."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
<span class="n">category</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">lower</span><span class="p">()</span>
|
||||
<span class="n">old_entry</span><span class="o">.</span><span class="n">help_category</span> <span class="o">=</span> <span class="n">category</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">"Category for entry '</span><span class="si">{</span><span class="n">topicstr</span><span class="si">}</span><span class="s2">'</span><span class="si">{</span><span class="n">aliastxt</span><span class="si">}</span><span class="s2"> changed to '</span><span class="si">{</span><span class="n">category</span><span class="si">}</span><span class="s2">'."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"delete"</span> <span class="ow">in</span> <span class="n">switches</span> <span class="ow">or</span> <span class="s2">"del"</span> <span class="ow">in</span> <span class="n">switches</span><span class="p">:</span>
|
||||
<span class="c1"># delete the help entry</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">old_entry</span><span class="p">:</span>
|
||||
|
|
|
|||
|
|
@ -288,7 +288,13 @@
|
|||
<span class="s2">"Topic 'testhelp' was successfully created."</span><span class="p">,</span>
|
||||
<span class="n">cmdset</span><span class="o">=</span><span class="n">CharacterCmdSet</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">help_module</span><span class="o">.</span><span class="n">CmdHelp</span><span class="p">(),</span> <span class="s2">"testhelp"</span><span class="p">,</span> <span class="s2">"Help for testhelp"</span><span class="p">,</span> <span class="n">cmdset</span><span class="o">=</span><span class="n">CharacterCmdSet</span><span class="p">())</span></div>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">help_module</span><span class="o">.</span><span class="n">CmdHelp</span><span class="p">(),</span> <span class="s2">"testhelp"</span><span class="p">,</span> <span class="s2">"Help for testhelp"</span><span class="p">,</span> <span class="n">cmdset</span><span class="o">=</span><span class="n">CharacterCmdSet</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">help_module</span><span class="o">.</span><span class="n">CmdSetHelp</span><span class="p">(),</span>
|
||||
<span class="s2">"/category testhelp = misc"</span><span class="p">,</span>
|
||||
<span class="s2">"Category for entry 'testhelp' changed to 'misc'."</span><span class="p">,</span>
|
||||
<span class="n">cmdset</span><span class="o">=</span><span class="n">CharacterCmdSet</span><span class="p">(),</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
<span class="nd">@parameterized</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span>
|
||||
<span class="p">[</span>
|
||||
|
|
|
|||
|
|
@ -139,17 +139,8 @@
|
|||
|
||||
<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.db.models</span> <span class="kn">import</span> <span class="n">Q</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="p">(</span>
|
||||
<span class="n">CmdSet</span><span class="p">,</span>
|
||||
<span class="n">DefaultRoom</span><span class="p">,</span>
|
||||
<span class="n">EvEditor</span><span class="p">,</span>
|
||||
<span class="n">FuncParser</span><span class="p">,</span>
|
||||
<span class="n">InterruptCommand</span><span class="p">,</span>
|
||||
<span class="n">default_cmds</span><span class="p">,</span>
|
||||
<span class="n">gametime</span><span class="p">,</span>
|
||||
<span class="n">utils</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="p">(</span><span class="n">CmdSet</span><span class="p">,</span> <span class="n">DefaultRoom</span><span class="p">,</span> <span class="n">EvEditor</span><span class="p">,</span> <span class="n">FuncParser</span><span class="p">,</span>
|
||||
<span class="n">InterruptCommand</span><span class="p">,</span> <span class="n">default_cmds</span><span class="p">,</span> <span class="n">gametime</span><span class="p">,</span> <span class="n">utils</span><span class="p">)</span>
|
||||
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="kn">import</span> <span class="n">AttributeProperty</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">repeat</span>
|
||||
|
||||
|
|
|
|||
|
|
@ -176,18 +176,6 @@
|
|||
<span class="n">MAGIC</span> <span class="o">=</span> <span class="s2">"magic"</span>
|
||||
<span class="n">QUEST</span> <span class="o">=</span> <span class="s2">"quest"</span>
|
||||
<span class="n">TREASURE</span> <span class="o">=</span> <span class="s2">"treasure"</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="QuestStatus"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.enums.html#evennia.contrib.tutorials.evadventure.enums.QuestStatus">[docs]</a><span class="k">class</span> <span class="nc">QuestStatus</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Quest status</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">STARTED</span> <span class="o">=</span> <span class="s2">"started"</span>
|
||||
<span class="n">COMPLETED</span> <span class="o">=</span> <span class="s2">"completed"</span>
|
||||
<span class="n">ABANDONED</span> <span class="o">=</span> <span class="s2">"abandoned"</span>
|
||||
<span class="n">FAILED</span> <span class="o">=</span> <span class="s2">"failed"</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -94,19 +94,17 @@
|
|||
<span class="sd">A simple quest system for EvAdventure.</span>
|
||||
|
||||
<span class="sd">A quest is represented by a quest-handler sitting as</span>
|
||||
<span class="sd">.quest on a Character. Individual Quests are objects</span>
|
||||
<span class="sd">that track the state and can have multiple steps, each</span>
|
||||
<span class="sd">of which are checked off during the quest's progress.</span>
|
||||
|
||||
<span class="sd">The player can use the quest handler to track the</span>
|
||||
<span class="sd">progress of their quests.</span>
|
||||
<span class="sd">`.quests` on a Character. Individual Quests are child classes of `EvAdventureQuest` with</span>
|
||||
<span class="sd">methods for each step of the quest. The quest handler can add, remove, and track the progress</span>
|
||||
<span class="sd">by calling the `progress` method on the quest. Persistent changes are stored on the quester</span>
|
||||
<span class="sd">using the `add_data` and `get_data` methods with an Attribute as storage backend.</span>
|
||||
|
||||
<span class="sd">A quest ending can mean a reward or the start of</span>
|
||||
<span class="sd">another quest.</span>
|
||||
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">.enums</span> <span class="kn">import</span> <span class="n">QuestStatus</span>
|
||||
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">Command</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest">[docs]</a><span class="k">class</span> <span class="nc">EvAdventureQuest</span><span class="p">:</span>
|
||||
|
|
@ -139,6 +137,9 @@
|
|||
<span class="sd"> self.current_step = "end"</span>
|
||||
<span class="sd"> self.progress()</span>
|
||||
|
||||
<span class="sd"> def step_B(self, *args, **kwargs):</span>
|
||||
|
||||
|
||||
<span class="sd"> def step_end(self, *args, **kwargs):</span>
|
||||
<span class="sd"> if len(self.quester.contents) > 4:</span>
|
||||
<span class="sd"> self.quester.msg("Quest complete!")</span>
|
||||
|
|
@ -146,62 +147,23 @@
|
|||
<span class="sd"> ```</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"basequest"</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"base quest"</span>
|
||||
<span class="n">desc</span> <span class="o">=</span> <span class="s2">"This is the base quest class"</span>
|
||||
<span class="n">start_step</span> <span class="o">=</span> <span class="s2">"start"</span>
|
||||
|
||||
<span class="n">completed_text</span> <span class="o">=</span> <span class="s2">"This quest is completed!"</span>
|
||||
<span class="n">abandoned_text</span> <span class="o">=</span> <span class="s2">"This quest is abandoned."</span>
|
||||
|
||||
<span class="c1"># help entries for quests (could also be methods)</span>
|
||||
<span class="n">help_start</span> <span class="o">=</span> <span class="s2">"You need to start first"</span>
|
||||
<span class="n">help_end</span> <span class="o">=</span> <span class="s2">"You need to end the quest"</span>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.__init__"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.__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">quester</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="s2">" "</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">"The Quest name must not have spaces in it."</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.__init__"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.__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">quester</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quester</span> <span class="o">=</span> <span class="n">quester</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data</span> <span class="ow">or</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="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">load_quest_data</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="bp">self</span><span class="o">.</span><span class="n">_current_step</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_data</span><span class="p">(</span><span class="s2">"current_step"</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">current_step</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">current_step</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">start_step</span></div>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">questhandler</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">quester</span><span class="o">.</span><span class="n">quests</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">current_step</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_current_step</span>
|
||||
|
||||
<span class="nd">@current_step</span><span class="o">.</span><span class="n">setter</span>
|
||||
<span class="k">def</span> <span class="nf">current_step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">step_name</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_current_step</span> <span class="o">=</span> <span class="n">step_name</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_data</span><span class="p">(</span><span class="s2">"current_step"</span><span class="p">,</span> <span class="n">step_name</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">do_save</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">status</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">QuestStatus</span><span class="o">.</span><span class="n">STARTED</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@status</span><span class="o">.</span><span class="n">setter</span>
|
||||
<span class="k">def</span> <span class="nf">status</span><span class="p">(</span><span class="bp">self</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">add_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_completed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">QuestStatus</span><span class="o">.</span><span class="n">COMPLETED</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_abandoned</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">QuestStatus</span><span class="o">.</span><span class="n">ABANDONED</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_failed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">QuestStatus</span><span class="o">.</span><span class="n">FAILED</span>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.add_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.add_data">[docs]</a> <span class="k">def</span> <span class="nf">add_data</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Add data to the quest. This saves it permanently.</span>
|
||||
|
|
@ -212,18 +174,7 @@
|
|||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">save_quest_data</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="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.remove_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.remove_data">[docs]</a> <span class="k">def</span> <span class="nf">remove_data</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Remove data from the quest permanently.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> key (str): The key to remove.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">key</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">questhandler</span><span class="o">.</span><span class="n">save_quest_data</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="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span></div>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">save_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.get_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.get_data">[docs]</a> <span class="k">def</span> <span class="nf">get_data</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">default</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
|
@ -239,23 +190,70 @@
|
|||
<span class="sd"> """</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">get</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">default</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.abandon"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandon">[docs]</a> <span class="k">def</span> <span class="nf">abandon</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="EvAdventureQuest.remove_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.remove_data">[docs]</a> <span class="k">def</span> <span class="nf">remove_data</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Call when quest is abandoned.</span>
|
||||
<span class="sd"> Remove data from the quest permanently.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> key (str): The key to remove.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">QuestStatus</span><span class="o">.</span><span class="n">ABANDONED</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">clean_quest_data</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="bp">self</span><span class="o">.</span><span class="n">cleanup</span><span class="p">()</span></div>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">key</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">questhandler</span><span class="o">.</span><span class="n">save_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span></div>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">questhandler</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">quester</span><span class="o">.</span><span class="n">quests</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">current_step</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_current_step</span>
|
||||
|
||||
<span class="nd">@current_step</span><span class="o">.</span><span class="n">setter</span>
|
||||
<span class="k">def</span> <span class="nf">current_step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">step_name</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_current_step</span> <span class="o">=</span> <span class="n">step_name</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_data</span><span class="p">(</span><span class="s2">"current_step"</span><span class="p">,</span> <span class="n">step_name</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">status</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="s2">"started"</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@status</span><span class="o">.</span><span class="n">setter</span>
|
||||
<span class="k">def</span> <span class="nf">status</span><span class="p">(</span><span class="bp">self</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">add_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_completed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s2">"completed"</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_abandoned</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s2">"abandoned"</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">is_failed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s2">"failed"</span>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.complete"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.complete">[docs]</a> <span class="k">def</span> <span class="nf">complete</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Call this to end the quest.</span>
|
||||
<span class="sd"> Complete the quest.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_data</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">QuestStatus</span><span class="o">.</span><span class="n">COMPLETED</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">questhandler</span><span class="o">.</span><span class="n">clean_quest_data</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="bp">self</span><span class="o">.</span><span class="n">cleanup</span><span class="p">()</span></div>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s2">"completed"</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.abandon"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandon">[docs]</a> <span class="k">def</span> <span class="nf">abandon</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Abandon the quest.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s2">"abandoned"</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.fail"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.fail">[docs]</a> <span class="k">def</span> <span class="nf">fail</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fail the quest.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s2">"failed"</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.progress"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.progress">[docs]</a> <span class="k">def</span> <span class="nf">progress</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="w"> </span><span class="sd">"""</span>
|
||||
|
|
@ -266,34 +264,38 @@
|
|||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> *args, **kwargs: Will be passed into the step method.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"step_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">current_step</span><span class="si">}</span><span class="s2">"</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></div>
|
||||
<span class="sd"> Notes:</span>
|
||||
<span class="sd"> `self.quester` is available as the character following the quest.</span>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.help"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.help">[docs]</a> <span class="k">def</span> <span class="nf">help</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"step_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">current_step</span><span class="si">}</span><span class="s2">"</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></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.help"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.help">[docs]</a> <span class="k">def</span> <span class="nf">help</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> This is used to get help (or a reminder) of what needs to be done to complete the current</span>
|
||||
<span class="sd"> quest-step.</span>
|
||||
<span class="sd"> quest-step. It will look for a `help_<stepname>` method or string attribute on the quest.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> *args, **kwargs: Will be passed into any help_* method.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> str: The help text for the current step.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_completed</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">completed_text</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_abandoned</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">abandoned_text</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"abandoned"</span><span class="p">,</span> <span class="s2">"completed"</span><span class="p">,</span> <span class="s2">"failed"</span><span class="p">):</span>
|
||||
<span class="n">help_resource</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"help_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span>
|
||||
<span class="sa">f</span><span class="s2">"You have </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="s2"> this quest."</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">help_resource</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"help_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">current_step</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"No help available."</span><span class="p">)</span>
|
||||
|
||||
<span class="n">help_resource</span> <span class="o">=</span> <span class="p">(</span>
|
||||
<span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"help_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">current_step</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="ow">or</span> <span class="s2">"You need to </span><span class="si">{self.current_step}</span><span class="s2"> ..."</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">if</span> <span class="nb">callable</span><span class="p">(</span><span class="n">help_resource</span><span class="p">):</span>
|
||||
<span class="c1"># the help_<current_step> can be a method to call</span>
|
||||
<span class="k">return</span> <span class="n">help_resource</span><span class="p">()</span>
|
||||
<span class="c1"># the help_* methods can be used to dynamically generate help</span>
|
||||
<span class="k">return</span> <span class="n">help_resource</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">else</span><span class="p">:</span>
|
||||
<span class="c1"># normally it's just a string</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">help_resource</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<span class="c1"># step methods and hooks</span>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuest.step_start"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.step_start">[docs]</a> <span class="k">def</span> <span class="nf">step_start</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>
|
||||
|
|
@ -335,7 +337,6 @@
|
|||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.__init__"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.__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">obj</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span> <span class="o">=</span> <span class="n">obj</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">do_save</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quests</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_load</span><span class="p">()</span></div>
|
||||
|
|
@ -348,7 +349,7 @@
|
|||
<span class="p">)</span>
|
||||
<span class="c1"># instantiate all quests</span>
|
||||
<span class="k">for</span> <span class="n">quest_key</span><span class="p">,</span> <span class="n">quest_class</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">[</span><span class="n">quest_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">quest_class</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">load_quest_data</span><span class="p">(</span><span class="n">quest_key</span><span class="p">))</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">[</span><span class="n">quest_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">quest_class</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">_save</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">obj</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
|
||||
|
|
@ -356,57 +357,6 @@
|
|||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span><span class="p">,</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_storage_attribute_category</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_load</span><span class="p">()</span> <span class="c1"># important</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">do_save</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.save_quest_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.save_quest_data">[docs]</a> <span class="k">def</span> <span class="nf">save_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Save data for a quest. We store this on the quester as well as updating the quest itself.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> data (dict): The data to store. This is commonly flags or other data needed to track the</span>
|
||||
<span class="sd"> quest.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">quest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">quest_key</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">quest</span><span class="p">:</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">quest_key</span><span class="o">=</span><span class="n">quest_key</span><span class="p">),</span>
|
||||
<span class="n">data</span><span class="p">,</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_category</span><span class="p">,</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.load_quest_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.load_quest_data">[docs]</a> <span class="k">def</span> <span class="nf">load_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Load data for a quest.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> quest_key (str): The quest to load data for.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> dict: The data stored for the quest.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</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="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">quest_key</span><span class="o">=</span><span class="n">quest_key</span><span class="p">),</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_category</span><span class="p">,</span>
|
||||
<span class="n">default</span><span class="o">=</span><span class="p">{},</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.clean_quest_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.clean_quest_data">[docs]</a> <span class="k">def</span> <span class="nf">clean_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Remove data for a quest.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> quest_key (str): The quest to remove data for.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">attributes</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">quest_data_attribute_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">quest_key</span><span class="o">=</span><span class="n">quest_key</span><span class="p">),</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_category</span><span class="p">,</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.has"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.has">[docs]</a> <span class="k">def</span> <span class="nf">has</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
|
@ -436,6 +386,16 @@
|
|||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">quest_key</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.all"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.all">[docs]</a> <span class="k">def</span> <span class="nf">all</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get all quests stored on character.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> list: All quests stored on character.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">values</span><span class="p">())</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.add"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.add">[docs]</a> <span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_class</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Add a new quest</span>
|
||||
|
|
@ -445,6 +405,7 @@
|
|||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span><span class="p">[</span><span class="n">quest_class</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">quest_class</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">[</span><span class="n">quest_class</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">quest_class</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_save</span><span class="p">()</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.remove"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.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">quest_key</span><span class="p">):</span>
|
||||
|
|
@ -460,53 +421,77 @@
|
|||
<span class="c1"># make sure to cleanup</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">abandon</span><span class="p">()</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_classes</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">quest_key</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">quests</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">quest_key</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">_save</span><span class="p">()</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.get_help"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.get_help">[docs]</a> <span class="k">def</span> <span class="nf">get_help</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.save_quest_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.save_quest_data">[docs]</a> <span class="k">def</span> <span class="nf">save_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get help text for a quest or for all quests. The help text is</span>
|
||||
<span class="sd"> a combination of the description of the quest and the help-text</span>
|
||||
<span class="sd"> of the current step.</span>
|
||||
<span class="sd"> Save data for a quest. We store this on the quester as well as updating the quest itself.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> quest_key (str, optional): The quest-key. If not given, get help for all</span>
|
||||
<span class="sd"> quests in handler.</span>
|
||||
<span class="sd"> quest_key (str): The quest to save data for. The data is assumed to be stored on the</span>
|
||||
<span class="sd"> quest as `.data` (a dict).</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">quest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">quest_key</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">quest</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">quest_key</span><span class="o">=</span><span class="n">quest_key</span><span class="p">),</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_category</span><span class="p">,</span>
|
||||
<span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.load_quest_data"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.load_quest_data">[docs]</a> <span class="k">def</span> <span class="nf">load_quest_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Load data for a quest.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> quest_key (str): The quest to load data for.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> list: Help texts, one for each quest, or only one if `quest_key` is given.</span>
|
||||
<span class="sd"> dict: The data stored for the quest.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">help_texts</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="n">quest_key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">:</span>
|
||||
<span class="n">quests</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">[</span><span class="n">quest_key</span><span class="p">]]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">quests</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">values</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</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="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">quest_key</span><span class="o">=</span><span class="n">quest_key</span><span class="p">),</span>
|
||||
<span class="n">category</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_data_attribute_category</span><span class="p">,</span>
|
||||
<span class="n">default</span><span class="o">=</span><span class="p">{},</span>
|
||||
<span class="p">)</span></div></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="CmdQuests"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests">[docs]</a><span class="k">class</span> <span class="nc">CmdQuests</span><span class="p">(</span><span class="n">Command</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> List all quests and their statuses as well as get info about the status of</span>
|
||||
<span class="sd"> a specific quest.</span>
|
||||
|
||||
<span class="sd"> Usage:</span>
|
||||
<span class="sd"> quests</span>
|
||||
<span class="sd"> quest <questname></span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"quests"</span>
|
||||
<span class="n">aliases</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"quest"</span><span class="p">]</span>
|
||||
|
||||
<div class="viewcode-block" id="CmdQuests.parse"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.parse">[docs]</a> <span class="k">def</span> <span class="nf">parse</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">quest_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span></div>
|
||||
|
||||
<div class="viewcode-block" id="CmdQuests.func"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.func">[docs]</a> <span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">quest_name</span><span class="p">:</span>
|
||||
<span class="n">quest</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">quests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_name</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">quest</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">"Quest </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">quest_name</span><span class="si">}</span><span class="s2"> not found."</span><span class="p">)</span>
|
||||
<span class="k">return</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">"Quest </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="se">\n</span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">help</span><span class="p">()</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="n">quests</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">quests</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">quests</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="s2">"No quests."</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">quest</span> <span class="ow">in</span> <span class="n">quests</span><span class="p">:</span>
|
||||
<span class="n">help_texts</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"|c</span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">|n</span><span class="se">\n</span><span class="s2"> </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">desc</span><span class="si">}</span><span class="se">\n\n</span><span class="s2"> - </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">help</span><span class="p">()</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">help_texts</span></div>
|
||||
<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">"Quest </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">key</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">quest</span><span class="o">.</span><span class="n">status</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span></div></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestHandler.progress"><a class="viewcode-back" href="../../../../../api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.progress">[docs]</a> <span class="k">def</span> <span class="nf">progress</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">quest_key</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Check progress of a given quest or all quests.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> quest_key (str, optional): If given, check the progress of this quest (if we have it),</span>
|
||||
<span class="sd"> otherwise check progress on all quests.</span>
|
||||
<span class="sd"> *args, **kwargs: Will be passed into each quest's `progress` call.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">quest_key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">:</span>
|
||||
<span class="n">quests</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="p">[</span><span class="n">quest_key</span><span class="p">]]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">quests</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">values</span><span class="p">()</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">quest</span> <span class="ow">in</span> <span class="n">quests</span><span class="p">:</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">progress</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">do_save</span><span class="p">:</span>
|
||||
<span class="c1"># do_save is set by the quest</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_save</span><span class="p">()</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -191,55 +191,53 @@
|
|||
|
||||
<div class="viewcode-block" id="EvAdventureQuestTest.test_help"><a class="viewcode-back" href="../../../../../../api/evennia.contrib.tutorials.evadventure.tests.test_quests.html#evennia.contrib.tutorials.evadventure.tests.test_quests.EvAdventureQuestTest.test_help">[docs]</a> <span class="k">def</span> <span class="nf">test_help</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Get help"""</span>
|
||||
<span class="c1"># get help for all quests</span>
|
||||
<span class="n">help_txt</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">get_help</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">help_txt</span><span class="p">,</span> <span class="p">[</span><span class="s2">"|ctestquest|n</span><span class="se">\n</span><span class="s2"> A test quest!</span><span class="se">\n\n</span><span class="s2"> - You need to do A first."</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># get help for one specific quest</span>
|
||||
<span class="n">help_txt</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">get_help</span><span class="p">(</span><span class="n">_TestQuest</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">assertEqual</span><span class="p">(</span><span class="n">help_txt</span><span class="p">,</span> <span class="p">[</span><span class="s2">"|ctestquest|n</span><span class="se">\n</span><span class="s2"> A test quest!</span><span class="se">\n\n</span><span class="s2"> - You need to do A first."</span><span class="p">])</span>
|
||||
<span class="n">quest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_quest</span><span class="p">()</span>
|
||||
<span class="c1"># get help for a specific quest</span>
|
||||
<span class="n">help_txt</span> <span class="o">=</span> <span class="n">quest</span><span class="o">.</span><span class="n">help</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">help_txt</span><span class="p">,</span> <span class="s2">"You need to do A first."</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># help for finished quest</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_get_quest</span><span class="p">()</span><span class="o">.</span><span class="n">complete</span><span class="p">()</span>
|
||||
<span class="n">help_txt</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">get_help</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">help_txt</span><span class="p">,</span> <span class="p">[</span><span class="s2">"|ctestquest|n</span><span class="se">\n</span><span class="s2"> A test quest!</span><span class="se">\n\n</span><span class="s2"> - This quest is completed!"</span><span class="p">])</span></div>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">complete</span><span class="p">()</span>
|
||||
<span class="n">help_txt</span> <span class="o">=</span> <span class="n">quest</span><span class="o">.</span><span class="n">help</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">help_txt</span><span class="p">,</span> <span class="s2">"You have completed this quest."</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestTest.test_progress__fail"><a class="viewcode-back" href="../../../../../../api/evennia.contrib.tutorials.evadventure.tests.test_quests.html#evennia.contrib.tutorials.evadventure.tests.test_quests.EvAdventureQuestTest.test_progress__fail">[docs]</a> <span class="k">def</span> <span class="nf">test_progress__fail</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Check progress without having any.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># progress all quests</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">progress</span><span class="p">()</span>
|
||||
<span class="c1"># progress one quest</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">progress</span><span class="p">(</span><span class="n">_TestQuest</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
|
||||
<span class="n">quest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_quest</span><span class="p">()</span>
|
||||
<span class="c1"># progress quest</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">progress</span><span class="p">()</span>
|
||||
|
||||
<span class="c1"># still on step A</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">_get_quest</span><span class="p">()</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"A"</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">quest</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"A"</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="EvAdventureQuestTest.test_progress"><a class="viewcode-back" href="../../../../../../api/evennia.contrib.tutorials.evadventure.tests.test_quests.html#evennia.contrib.tutorials.evadventure.tests.test_quests.EvAdventureQuestTest.test_progress">[docs]</a> <span class="k">def</span> <span class="nf">test_progress</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fulfill the quest steps in sequess</span>
|
||||
<span class="sd"> Fulfill the quest steps in sequence.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">quest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_quest</span><span class="p">()</span>
|
||||
|
||||
<span class="c1"># A requires a certain object in inventory</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_fulfillA</span><span class="p">()</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">progress</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">_get_quest</span><span class="p">()</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"B"</span><span class="p">)</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">progress</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">quest</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"B"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># B requires progress be called with specific kwarg</span>
|
||||
<span class="c1"># should not step (no kwarg)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">progress</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">_get_quest</span><span class="p">()</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"B"</span><span class="p">)</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">progress</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">quest</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"B"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># should step (kwarg sent)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">progress</span><span class="p">(</span><span class="n">complete_quest_B</span><span class="o">=</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="bp">self</span><span class="o">.</span><span class="n">_get_quest</span><span class="p">()</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"C"</span><span class="p">)</span>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">progress</span><span class="p">(</span><span class="n">complete_quest_B</span><span class="o">=</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">quest</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"C"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># C requires a counter Attribute on char be high enough</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_fulfillC</span><span class="p">()</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">character</span><span class="o">.</span><span class="n">quests</span><span class="o">.</span><span class="n">progress</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">_get_quest</span><span class="p">()</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"C"</span><span class="p">)</span> <span class="c1"># still on last step</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">_get_quest</span><span class="p">()</span><span class="o">.</span><span class="n">is_completed</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span></div></div>
|
||||
<span class="n">quest</span><span class="o">.</span><span class="n">progress</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">quest</span><span class="o">.</span><span class="n">current_step</span><span class="p">,</span> <span class="s2">"C"</span><span class="p">)</span> <span class="c1"># still on last step</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">quest</span><span class="o">.</span><span class="n">is_completed</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@
|
|||
|
||||
<span class="k">for</span> <span class="n">dct</span> <span class="ow">in</span> <span class="n">loaded_help_dicts</span><span class="p">:</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="n">dct</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"key"</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||||
<span class="n">category</span> <span class="o">=</span> <span class="n">dct</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"category"</span><span class="p">,</span> <span class="n">_DEFAULT_HELP_CATEGORY</span><span class="p">)</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||||
<span class="n">category</span> <span class="o">=</span> <span class="n">dct</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"category"</span><span class="p">,</span> <span class="n">_DEFAULT_HELP_CATEGORY</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||||
<span class="n">aliases</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">dct</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"aliases"</span><span class="p">,</span> <span class="p">[]))</span>
|
||||
<span class="n">entrytext</span> <span class="o">=</span> <span class="n">dct</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"text"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
||||
<span class="n">locks</span> <span class="o">=</span> <span class="n">dct</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"locks"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
||||
|
|
|
|||
|
|
@ -2162,7 +2162,7 @@
|
|||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">row</span> <span class="o">+=</span> <span class="s2">" "</span> <span class="o">*</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">width</span> <span class="o">-</span> <span class="n">lrow</span><span class="p">)</span>
|
||||
<span class="n">rows</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">row</span><span class="p">)</span>
|
||||
<span class="n">row</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="n">row</span> <span class="o">=</span> <span class="n">element</span>
|
||||
<span class="n">ic</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># add a new slot</span>
|
||||
|
|
|
|||
|
|
@ -5,13 +5,28 @@
|
|||
- [Feature][pull3421]: New `utils.compress_whitespace` utility used with
|
||||
default object's `.format_appearance` to make it easier to overload without
|
||||
adding line breaks in hook returns. (InspectorCaracal)
|
||||
- [Feature][pull3458]: New `sethelp/category` switch to change a help topic's
|
||||
category after it was created (chiizujin)
|
||||
- [Fix][pull3446]: Use plural ('no apples') instead of singular ('no apple') in
|
||||
`get_numbered_name` for better grammatical form (InspectorCaracal)
|
||||
- Doc: Added Beginner Tutorial lessons for AI and Procedural dungeon (Griatch)
|
||||
- [Fix][pull3453]: Object aliases not showing in search multi-match
|
||||
disambiguation display (chiizujin)
|
||||
- [Fix][pull3455]: `sethelp/edit <topic>` without a `= text` created a `None`
|
||||
entry that would lose the edit. (chiiziujin)
|
||||
- [Fix][pull3456]: `format_grid` utility used for `help` command caused commands
|
||||
to disappear for wider client widths (chiizujin)
|
||||
- [Fix][pull3457]: Help topic categories with different case would appear as
|
||||
duplicates (chiizujin)
|
||||
- Doc: Added Beginner Tutorial lessons for AI, Quests and Procedural dungeon (Griatch)
|
||||
- Doc fixes (Griatch, InspectorCaracal)
|
||||
|
||||
[pull3421]: https://github.com/evennia/evennia/pull/3421
|
||||
[pull3446]: https://github.com/evennia/evennia/pull/3446
|
||||
[pull3453]: https://github.com/evennia/evennia/pull/3453
|
||||
[pull3455]: https://github.com/evennia/evennia/pull/3455
|
||||
[pull3456]: https://github.com/evennia/evennia/pull/3456
|
||||
[pull3457]: https://github.com/evennia/evennia/pull/3457
|
||||
[pull3458]: https://github.com/evennia/evennia/pull/3458
|
||||
|
||||
## Evennia 4.0.0
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ You can find an AIHandler implemented in `evennia/contrib/tutorials`, in [evadve
|
|||
```
|
||||
This is the core logic for managing AI states. Create a new file `evadventure/ai.py`.
|
||||
|
||||
> Create a new file `evadventure/ai.py`.
|
||||
|
||||
```{code-block} python
|
||||
:linenos:
|
||||
:emphasize-lines: 10,11-13,16,23
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ We will design a base combat system that supports both styles.
|
|||
> Create a new module `evadventure/combat_base.py`
|
||||
|
||||
```{sidebar}
|
||||
In [evennia/contrib/tutorials/evadventure/combat_base.py](evennia.contrib.tutorials.evadventure.combat_base) you'll find a complete implementation of the base combat module.
|
||||
Under `evennia/contrib/tutorials/evadventure/`, in [combat_base.py](evennia.contrib.tutorials.evadventure.combat_base) you'll find a complete implementation of the base combat module.
|
||||
```
|
||||
Our "Combat Handler" will handle the administration around combat. It needs to be _persistent_ (even is we reload the server your combat should keep going).
|
||||
|
||||
|
|
@ -718,7 +718,7 @@ We rely on the [Equipment handler](./Beginner-Tutorial-Equipment.md) we created
|
|||
> Create a module `evadventure/tests/test_combat.py`.
|
||||
|
||||
```{sidebar}
|
||||
See [evennia/contrib/tutorials/evadventure/tests/test_combat.py](evennia.contrib.tutorials.evadventure.tests.test_combat) for ready-made combat unit tests.
|
||||
Look under `evennia/contrib/tutorials/evadventure/`, in [tests/test_combat.py](evennia.contrib.tutorials.evadventure.tests.test_combat) for ready-made combat unit tests.
|
||||
```
|
||||
|
||||
Unit testing the combat base classes can seem impossible because we have not yet implemented most of it. We can however get very far by the use of [Mocks](https://docs.python.org/3/library/unittest.mock.html). The idea of a Mock is that you _replace_ a piece of code with a dummy object (a 'mock') that can be called to return some specific value.
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ The advantage of using a menu is that you have all possible actions directly ava
|
|||
## General Principle
|
||||
|
||||
```{sidebar}
|
||||
An example of an implemented Turnbased combat system can be found in [evennia/contrib/tutorials/evadventure/combat_turnbased.py](evennia.contrib.tutorials.evadventure.combat_turnbased).
|
||||
An example of an implemented Turnbased combat system can be found under `evennia/contrib/tutorials/evadventure/`, in [combat_turnbased.py](evennia.contrib.tutorials.evadventure.combat_turnbased).
|
||||
```
|
||||
Here is the general principle of the Turnbased combat handler:
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,401 @@
|
|||
|
||||
A _quest_ is a common feature of games. From classic fetch-quests like retrieving 10 flowers to complex quest chains involving drama and intrigue, quests need to be properly tracked in our game.
|
||||
|
||||
A quest follows a specific development:
|
||||
A quest follows a specific development:
|
||||
|
||||
1. The quest is _started_. This normally involves the player accepting the quest, from a quest-giver, job board or other source. But the quest could also be thrust on the player ("save the family from the burning house before it collapses!")
|
||||
2. A quest may consist of one or more 'steps'. Each step has its own set of finish conditions.
|
||||
3. At suitable times the quest is _checked_. This could happen on a timer or when trying to 'hand in' the quest. When checking, the current 'step' is checked against its finish conditions. If ok, that step is closed and the next step is checked until it either hits a step that is not yet complete, or there are no more steps, in which case the entire quest is complete.
|
||||
2. Once a quest has been accepted and assigned to a character, it is either either `Started` (that is, 'in progress'), `Abandoned`, `Failed` or `Complete`.
|
||||
3. A quest may consist of one or more 'steps'. Each step has its own set of finish conditions.
|
||||
4. At suitable times the quest's _progress_ is checked. This could happen on a timer or when trying to 'hand in' the quest. When checking, the current 'step' is checked against its finish conditions. If ok, that step is closed and the next step is checked until it either hits a step that is not yet complete, or there are no more steps, in which case the entire quest is complete.
|
||||
|
||||
```{sidebar}
|
||||
An example implementation of quests is found under `evennia/contrib/tutorials`, in [evadvanture/quests.py](evennia.contrib.tutorials.evadventure.quests).
|
||||
```
|
||||
To represent quests in code, we need
|
||||
- A convenient flexible way to code how we check the status and current steps of the quest. We want this scripting to be as flexible as possible. Ideally we want to be able to code the quests's logic in full Python.
|
||||
- Persistence. The fact that we accepted the quest, as well as its status and other flags must be saved in the database and survive a server reboot.
|
||||
|
||||
We'll accomplish this using two pieces of Python code:
|
||||
- `EvAdventureQuest`: A Python class with helper methods that we can call to check current quest status, figure if a given quest-step is complete or not. We will create and script new quests by simply inheriting from this base class and implement new methods on it in a standardized way.
|
||||
- `EvAdventureQuestHandler` will sit 'on' each Character as `character.quests`. It will hold all `EvAdventureQuest`s that the character is or has been involved in. It is also responsible for storing quest state using [Attributes](../../../Components/Attributes.md) on the Character.
|
||||
|
||||
## The Quest Handler
|
||||
|
||||
> Create a new module `evadventure/quests.py`.
|
||||
|
||||
We saw the implementation of an on-object handler back in the [lesson about NPC and monster AI](./Beginner-Tutorial-AI.md#the-aihandler) (the `AIHandler`).
|
||||
|
||||
```{code-block} python
|
||||
:linenos:
|
||||
:emphasize-lines: 9,10,11,14-18,21,24-28
|
||||
# in evadventure/quests.py
|
||||
|
||||
class EvAdventureQuestHandler:
|
||||
quest_storage_attribute_key = "_quests"
|
||||
quest_storage_attribute_category = "evadventure"
|
||||
|
||||
def __init__(self, obj):
|
||||
self.obj = obj
|
||||
self.quest_classes = {}
|
||||
self.quests = {}
|
||||
self._load()
|
||||
|
||||
def _load(self):
|
||||
self.quest_classes = self.obj.attributes.get(
|
||||
self.quest_storage_attribute_key,
|
||||
category=self.quest_storage_attribute_category,
|
||||
default={},
|
||||
)
|
||||
# instantiate all quests
|
||||
for quest_key, quest_class in self.quest_classes.items():
|
||||
self.quests[quest_key] = quest_class(self.obj)
|
||||
|
||||
def _save(self):
|
||||
self.obj.attributes.add(
|
||||
self.quest_storage_attribute_key,
|
||||
self.quest_classes,
|
||||
category=self.quest_storage_attribute_category,
|
||||
)
|
||||
|
||||
def get(self, quest_key):
|
||||
return self.quests.get(quest_key)
|
||||
|
||||
def all(self):
|
||||
return list(self.quests.values())
|
||||
|
||||
def add(self, quest_class):
|
||||
self.quest_classes[quest_class.key] = quest_class
|
||||
self.quests[quest_class.key] = quest_class(self.obj)
|
||||
self._save()
|
||||
|
||||
def remove(self, quest_key):
|
||||
quest = self.quests.pop(quest_key, None)
|
||||
self.quest_classes.pop(quest_key, None)
|
||||
self.quests.pop(quest_key, None)
|
||||
self._save()
|
||||
|
||||
```
|
||||
|
||||
```{sidebar} Persistent handler pattern
|
||||
Persistent handlers are commonly used throughout Evennia. You can read more about them in the [Making a Persistent object Handler](../../Tutorial-Persistent-Handler.md) tutorial.
|
||||
```
|
||||
- **Line 9**: We know that the quests themselves will be Python classes inheriting from `EvAdventureQuest` (which we haven't created yet). We will store those classes in `self.quest_classes` on the handler. Note that there is a difference between a class and an _instance_ of a class! The class cannot hold any _state_ on its own, such as the status of that quest is for this particular character. The class only holds python code.
|
||||
- **Line 10**: We set aside another property on the handler - `self.quest` This is dictionary that will hold `EvAdventureQuest` _instances_.
|
||||
- **Line 11**: Note that we call the `self._load()` method here, this loads up data from the database whenever this handler is accessed.
|
||||
- **Lines 14-18**: We use `self.obj.attributes.get` to fetch an [Attribute](../../../Components/Attributes.md) on the Character named `_quests` and with a category of `evadventure`. If it doesn't exist yet (because we never started any quests), we just return an empty dict.
|
||||
- **Line 21**: Here we loop over all the classes and instantiate them. We haven't defined how these quest-classes look yet, but by instantiating them with `self.obj` (the Character) we should be covered - from the Character class the quest will be able to get to everything else (this handler itself will be accessible as `obj.quests` from that quest instance after all).
|
||||
- **Line 24**: Here we do the corresponding save operation.
|
||||
|
||||
The rest of the handler are just access methods for getting, adding and removing quests from the handler. We make one assumption in those code, namely that the quest class has a property `.key` being the unique quest-name.
|
||||
|
||||
This is how it would be used in practice:
|
||||
|
||||
```python
|
||||
# in some questing code
|
||||
|
||||
from evennia import search_object
|
||||
from evadventure import quests
|
||||
|
||||
class EvAdventureSuperQuest(quests.EvAdventureQuest):
|
||||
key = "superquest"
|
||||
# quest implementation here
|
||||
|
||||
def start_super_quest(character):
|
||||
character.quests.add(EvAdventureSuperQuest)
|
||||
|
||||
```
|
||||
```{sidebar} What can be saved in Attributes?
|
||||
For more details, see [the Attributes documentation](../../../Components/Attributes.md#what-types-of-data-can-i-save-in-an-attribute) on the matter.
|
||||
```
|
||||
We chose to store classes and not instances of classes above. The reason for this has to do with what can be stored in a database `Attribute` - one limitation of an Attribute is that we can't save a class instance _with other database entities baked inside it_. If we saved quest instances as-is, it's highly likely they'd contain database entities 'hidden' inside them - a reference to the Character, maybe to objects required for the quest to be complete etc. Evennia would fail trying to save that data.
|
||||
Instead we store only the classes, instantiate those classes with the Character, and let the quest store its state flags separately, like this:
|
||||
|
||||
```python
|
||||
# in evadventure/quests.py
|
||||
|
||||
class EvAdventureQuestHandler:
|
||||
|
||||
# ...
|
||||
quest_data_attribute_template = "_quest_data_{quest_key}"
|
||||
quest_data_attribute_category = "evadventure"
|
||||
|
||||
# ...
|
||||
|
||||
def save_quest_data(self, quest_key):
|
||||
quest = self.get(quest_key)
|
||||
if quest:
|
||||
self.obj.attributes.add(
|
||||
self.quest_data_attribute_template.format(quest_key=quest_key),
|
||||
quest.data,
|
||||
category=self.quest_data_attribute_category,
|
||||
)
|
||||
|
||||
def load_quest_data(self, quest_key):
|
||||
return self.obj.attributes.get(
|
||||
self.quest_data_attribute_template.format(quest_key=quest_key),
|
||||
category=self.quest_data_attribute_category,
|
||||
default={},
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
This works the same as the `_load` and `_save` methods, except it fetches a property `.data` (this will be a `dict`) on the quest instance and save it. As long as we make sure to call these methods from the quest the quest whenever that `.data` property is changed, all will be well - this is because Attributes know how to properly analyze a `dict` to find and safely serialize any database entities found within.
|
||||
|
||||
Our handler is ready. We created the `EvAdventureCharacter` class back in the [Character lesson](./Beginner-Tutorial-Characters.md) - let's add quest-support to it.
|
||||
|
||||
```python
|
||||
# in evadventure/characters.py
|
||||
|
||||
# ...
|
||||
|
||||
from evennia.utils import lazy_property
|
||||
from evadventure.quests import EvAdventureQuestHandler
|
||||
|
||||
class EvAdventureCharacter(LivingMixin, DefaultCharacter):
|
||||
# ...
|
||||
|
||||
@lazy_property
|
||||
def quests(self):
|
||||
return EvAdventureQuestHandler(self)
|
||||
|
||||
# ...
|
||||
|
||||
```
|
||||
|
||||
We also need a way to represent the quests themselves though!
|
||||
## The Quest class
|
||||
|
||||
|
||||
```{code-block} python
|
||||
:linenos:
|
||||
:emphasize-lines: 7,12,13,34-36
|
||||
# in evadventure/quests.py
|
||||
|
||||
# ...
|
||||
|
||||
class EvAdventureQuest:
|
||||
|
||||
key = "base-quest"
|
||||
desc = "Base quest"
|
||||
start_step = "start"
|
||||
|
||||
def __init__(self, quester):
|
||||
self.quester = quester
|
||||
self.data = self.questhandler.load_quest_data(self.key)
|
||||
self._current_step = self.get_data("current_step")
|
||||
|
||||
if not self.current_step:
|
||||
self.current_step = self.start_step
|
||||
|
||||
def add_data(self, key, value):
|
||||
self.data[key] = value
|
||||
self.questhandler.save_quest_data(self.key)
|
||||
|
||||
def get_data(self, key, default=None):
|
||||
return self.data.get(key, default)
|
||||
|
||||
def remove_data(self, key):
|
||||
self.data.pop(key, None)
|
||||
self.questhandler.save_quest_data(self.key)
|
||||
|
||||
@property
|
||||
def questhandler(self):
|
||||
return self.quester.quests
|
||||
|
||||
@property
|
||||
def current_step(self):
|
||||
return self._current_step
|
||||
|
||||
@current_step.setter
|
||||
def current_step(self, step_name):
|
||||
self._current_step = step_name
|
||||
self.add_data("current_step", step_name)
|
||||
|
||||
```
|
||||
|
||||
- **Line 7**: Each class must have a `.key` property unquely identifying the quest. We depend on this in the quest-handler.
|
||||
- **Line 12**: `quester` (the Character) is passed into this class when it is initiated inside `EvAdventureQuestHandler._load()`.
|
||||
- **Line 13**: We load the quest data into `self.data` directly using the `questhandler.load_quest-data` method (which in turn loads it from an Attribute on the Character). Note that the `.questhandler` property is defined on **lines 34-36** as a shortcut to get to the handler.
|
||||
|
||||
The `add/get/remove_data` methods are convenient wrappers for getting data in and out of the database using the matching methods on the handler. When we implement a quest we should prefer to use `.get_data`, `add_data` and `remove_data` over manipulating `.data` directly, since the former will make sure to save said that to the database automatically.
|
||||
|
||||
The `current_step` tracks the current quest 'step' we are in; what this means is up to each Quest. We set up convenient properties for setting the `current_state` and also make sure to save it in the data dict as "current_step".
|
||||
|
||||
The quest can have a few possible statuses: "started", "completed", "abandoned" and "failed". We create a few properties and methods for easily control that, while saving everything under the hood:
|
||||
|
||||
```python
|
||||
# in evadventure/quests.py
|
||||
|
||||
# ...
|
||||
|
||||
class EvAdventureQuest:
|
||||
|
||||
# ...
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
return self.get_data("status", "started")
|
||||
|
||||
@status.setter
|
||||
def status(self, value):
|
||||
self.add_data("status", value)
|
||||
|
||||
@property
|
||||
def is_completed(self):
|
||||
return self.status == "completed"
|
||||
|
||||
@property
|
||||
def is_abandoned(self):
|
||||
return self.status == "abandoned"
|
||||
|
||||
@property
|
||||
def is_failed(self):
|
||||
return self.status == "failed"
|
||||
|
||||
def complete(self):
|
||||
self.status = "completed"
|
||||
|
||||
def abandon(self):
|
||||
self.status = "abandoned"
|
||||
|
||||
def fail(self):
|
||||
self.status = "failed"
|
||||
|
||||
|
||||
```
|
||||
|
||||
So far we have only added convenience functions for checking statuses. How will the actual "quest" aspect of this work?
|
||||
|
||||
What will happen when the system wants to check the progress of the quest, is that it will call a method `.progress()` on this class. Similarly, to get help for the current step, it will call a method `.help()`
|
||||
|
||||
```python
|
||||
|
||||
start_step = "start"
|
||||
|
||||
# help entries for quests (could also be methods)
|
||||
help_start = "You need to start first"
|
||||
help_end = "You need to end the quest"
|
||||
|
||||
def progress(self, *args, **kwargs):
|
||||
getattr(self, f"step_{self.current_step}")(*args, **kwargs)
|
||||
|
||||
def help(self, *args, **kwargs):
|
||||
if self.status in ("abandoned", "completed", "failed"):
|
||||
help_resource = getattr(self, f"help_{self.status}",
|
||||
f"You have {self.status} this quest.")
|
||||
else:
|
||||
help_resource = getattr(self, f"help_{self.current_step}", "No help available.")
|
||||
|
||||
if callable(help_resource):
|
||||
# the help_* methods can be used to dynamically generate help
|
||||
return help_resource(*args, **kwargs)
|
||||
else:
|
||||
# normally it's just a string
|
||||
return str(help_resource)
|
||||
|
||||
```
|
||||
|
||||
```{sidebar} What's with the *args, **kwargs?
|
||||
These are optional, but allow you to pass extra information into your quest-check. This could be very powerful if you want to add extra context to determine if a quest-step is currently complete or not.
|
||||
```
|
||||
Calling the `.progress(*args, **kwargs)` method will call a method named `step_<current_step>(*args, **kwargs)` on this class. That is, if we are on the _start_ step, the method called will be `self.step_start(*args, **kwargs)`. Where is this method? It has not been implemented yet! In fact, it's up to us to implement methods like this for each quest. By just adding a correctly added method, we will easily be able to add more steps to a quest.
|
||||
|
||||
Similarly, calling `.help(*args, **kwargs)` will try to find a property `help_<current_step>`. If this is a callable, it will be called as for example `self.help_start(*args, **kwargs)`. If it is given as a string, then the string will be returned as-is and the `*args, **kwargs` will be ignored.
|
||||
|
||||
### Example quest
|
||||
|
||||
```python
|
||||
# in some quest module, like world/myquests.py
|
||||
|
||||
from evadventure.quests import EvAdventureQuest
|
||||
|
||||
class ShortQuest(EvAdventureQuest):
|
||||
|
||||
key = "simple-quest"
|
||||
desc = "A very simple quest."
|
||||
|
||||
def step_start(self, *args, **kwargs):
|
||||
"""Example step!"""
|
||||
self.quester.msg("Quest started!")
|
||||
self.current_step = "end"
|
||||
|
||||
def step_end(self, *args, **kwargs):
|
||||
if not self.is_completed:
|
||||
self.quester.msg("Quest ended!")
|
||||
self.complete()
|
||||
|
||||
```
|
||||
|
||||
This is a very simple quest that will resolve on its own after two `.progress()` checks. Here's the full life cycle of this quest:
|
||||
|
||||
```python
|
||||
# in some module somewhere, using evennia shell or in-game using py
|
||||
|
||||
from evennia import search_object
|
||||
from world.myquests import ShortQuest
|
||||
|
||||
character = search_object("MyCharacterName")[0]
|
||||
character.quests.add(ShortQuest)
|
||||
|
||||
# this will echo "Quest started!" to character
|
||||
character.quests.get("short-quest").progress()
|
||||
# this will echo "Quest ended!" to character
|
||||
character.quests.get("short-quest").progress()
|
||||
|
||||
```
|
||||
|
||||
### A useful Command
|
||||
|
||||
The player must know which quests they have and be able to inspect them. Here's a simple `quests` command to handle this:
|
||||
|
||||
```python
|
||||
# in evadventure/quests.py
|
||||
|
||||
class CmdQuests(Command):
|
||||
"""
|
||||
List all quests and their statuses as well as get info about the status of
|
||||
a specific quest.
|
||||
|
||||
Usage:
|
||||
quests
|
||||
quest <questname>
|
||||
|
||||
"""
|
||||
key = "quests"
|
||||
aliases = ["quest"]
|
||||
|
||||
def parse(self):
|
||||
self.quest_name = self.args.strip()
|
||||
|
||||
def func(self):
|
||||
if self.quest_name:
|
||||
quest = self.caller.quests.get(self.quest_name)
|
||||
if not quest:
|
||||
self.msg(f"Quest {self.quest_name} not found.")
|
||||
return
|
||||
self.msg(f"Quest {quest.key}: {quest.status}\n{quest.help()}")
|
||||
return
|
||||
|
||||
quests = self.caller.quests.all()
|
||||
if not quests:
|
||||
self.msg("No quests.")
|
||||
return
|
||||
|
||||
for quest in quests:
|
||||
self.msg(f"Quest {quest.key}: {quest.status}")
|
||||
```
|
||||
|
||||
Add this to the `CharacterCmdSet` in `mygame/commands/default_cmdsets.py`. Follow the [Adding a command lesson](../Part1/Beginner-Tutorial-Adding-Commands.md#add-the-echo-command-to-the-default-cmdset) if you are unsure how to do this. Reload and if you are playing as an `EvAdventureCharacter` you should be able to use `quests` to view your quests.
|
||||
|
||||
## Testing
|
||||
|
||||
> Create a new folder `evadventure/tests/test_quests.py`.
|
||||
|
||||
```{sidebar}
|
||||
An example test suite for quests is found in `evennia/contrib/tutorials/evadventure`, as [tests/test_quests.py](evennia.contrib.tutorials.evadventure.tests.test_quests).
|
||||
```
|
||||
Testing of the quests means creating a test character, making a dummy quest, add it to the character's quest handler and making sure all methods work correcly. Create the testing quest so that it will automatically step forward when calling `.progress()`, so you can make sure it works as intended.
|
||||
|
||||
## Conclusions
|
||||
|
||||
What we created here is just the framework for questing. The actual complexity will come when creating the quests themselves (that is, implementing the `step_<current_step>(*args, **kwargs)` methods), which is something we'll get to later, in [Part 4](../Part4/Beginner-Tutorial-Part4-Overview.md) of this tutorial.
|
||||
|
|
@ -152,7 +152,7 @@ skipping, reloading etc.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.batchprocess.CmdBatchCommands.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['batchcommand', 'batchcmd']</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['batchcmd', 'batchcommand']</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -183,7 +183,7 @@ skipping, reloading etc.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.batchprocess.CmdBatchCommands.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'batchcommand batchcmd', 'category': 'building', 'key': 'batchcommands', 'no_prefix': ' batchcommand batchcmd', 'tags': '', 'text': '\n build from batch-command file\n\n Usage:\n batchcommands[/interactive] <python.path.to.file>\n\n Switch:\n interactive - this mode will offer more control when\n executing the batch file, like stepping,\n skipping, reloading etc.\n\n Runs batches of commands from a batch-cmd text file (*.ev).\n\n '}</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'batchcmd batchcommand', 'category': 'building', 'key': 'batchcommands', 'no_prefix': ' batchcmd batchcommand', 'tags': '', 'text': '\n build from batch-command file\n\n Usage:\n batchcommands[/interactive] <python.path.to.file>\n\n Switch:\n interactive - this mode will offer more control when\n executing the batch file, like stepping,\n skipping, reloading etc.\n\n Runs batches of commands from a batch-cmd text file (*.ev).\n\n '}</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -643,7 +643,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">
|
||||
|
|
@ -684,7 +684,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': '@delete @del', 'category': 'building', 'key': '@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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@del @delete', 'category': 'building', 'key': '@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>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -1411,7 +1411,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"> = ['@typeclasses', '@type', '@parent', '@update', '@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"> = ['@swap', '@parent', '@update', '@typeclasses', '@type']</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">
|
||||
|
|
@ -1442,7 +1442,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': '@typeclasses @type @parent @update @swap', 'category': 'building', 'key': '@typeclass', 'no_prefix': 'typeclass typeclasses type parent update swap', 'tags': '', 'text': "\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] <object> [= typeclass.path]\n typeclass/prototype <object> = prototype_key\n\n typeclasses or typeclass/list/show [typeclass.path]\n swap - this is a shorthand for using /force/reset flags.\n update - this is a shorthand for using the /force/reload flag.\n\n Switch:\n show, examine - display the current typeclass of object (default) or, if\n given a typeclass path, show the docstring of that typeclass.\n update - *only* re-run at_object_creation on this object\n meaning locks or other properties set later may remain.\n reset - clean out *all* the attributes and properties on the\n object - basically making this a new clean object. This will also\n reset cmdsets!\n force - change to the typeclass also if the object\n already has a typeclass of the same name.\n list - show available typeclasses. Only typeclasses in modules actually\n imported or used from somewhere in the code will show up here\n (those typeclasses are still available if you know the path)\n prototype - clean and overwrite the object with the specified\n prototype key - effectively making a whole new object.\n\n Example:\n type button = examples.red_button.RedButton\n type/prototype button=a red button\n\n If the typeclass_path is not given, the current object's typeclass is\n assumed.\n\n View or set an object's typeclass. If setting, the creation hooks of the\n new typeclass will be run on the object. If you have clashing properties on\n the old class, use /reset. By default you are protected from changing to a\n typeclass of the same name as the one you already have - use /force to\n override this protection.\n\n The given typeclass must be identified by its location using python\n dot-notation pointing to the correct module and class. If no typeclass is\n given (or a wrong typeclass is given). Errors in the path or new typeclass\n will lead to the old typeclass being kept. The location of the typeclass\n module is searched from the default typeclass directory, as defined in the\n server settings.\n\n "}</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': '@swap @parent @update @typeclasses @type', 'category': 'building', 'key': '@typeclass', 'no_prefix': 'typeclass swap parent update typeclasses type', 'tags': '', 'text': "\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] <object> [= typeclass.path]\n typeclass/prototype <object> = prototype_key\n\n typeclasses or typeclass/list/show [typeclass.path]\n swap - this is a shorthand for using /force/reset flags.\n update - this is a shorthand for using the /force/reload flag.\n\n Switch:\n show, examine - display the current typeclass of object (default) or, if\n given a typeclass path, show the docstring of that typeclass.\n update - *only* re-run at_object_creation on this object\n meaning locks or other properties set later may remain.\n reset - clean out *all* the attributes and properties on the\n object - basically making this a new clean object. This will also\n reset cmdsets!\n force - change to the typeclass also if the object\n already has a typeclass of the same name.\n list - show available typeclasses. Only typeclasses in modules actually\n imported or used from somewhere in the code will show up here\n (those typeclasses are still available if you know the path)\n prototype - clean and overwrite the object with the specified\n prototype key - effectively making a whole new object.\n\n Example:\n type button = examples.red_button.RedButton\n type/prototype button=a red button\n\n If the typeclass_path is not given, the current object's typeclass is\n assumed.\n\n View or set an object's typeclass. If setting, the creation hooks of the\n new typeclass will be run on the object. If you have clashing properties on\n the old class, use /reset. By default you are protected from changing to a\n typeclass of the same name as the one you already have - use /force to\n override this protection.\n\n The given typeclass must be identified by its location using python\n dot-notation pointing to the correct module and class. If no typeclass is\n given (or a wrong typeclass is given). Errors in the path or new typeclass\n will lead to the old typeclass being kept. The location of the typeclass\n module is searched from the default typeclass directory, as defined in the\n server settings.\n\n "}</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>
|
||||
|
|
@ -1597,7 +1597,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"> = ['@ex', '@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"> = ['@exam', '@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">
|
||||
|
|
@ -1870,7 +1870,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': '@ex @exam', 'category': 'building', 'key': '@examine', 'no_prefix': 'examine ex exam', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [<object>[/attrname]]\n examine [*<account>[/attrname]]\n\n Switch:\n account - examine an Account (same as adding *)\n object - examine an Object (useful when OOC)\n script - examine a Script\n channel - examine a Channel\n\n The examine command shows detailed game info about an\n object and optionally a specific attribute on it.\n If object is not specified, the current location is examined.\n\n Append a * before the search string to examine an account.\n\n '}</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': '@exam @ex', 'category': 'building', 'key': '@examine', 'no_prefix': 'examine exam ex', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [<object>[/attrname]]\n examine [*<account>[/attrname]]\n\n Switch:\n account - examine an Account (same as adding *)\n object - examine an Object (useful when OOC)\n script - examine a Script\n channel - examine a Channel\n\n The examine command shows detailed game info about an\n object and optionally a specific attribute on it.\n If object is not specified, the current location is examined.\n\n Append a * before the search string to examine an account.\n\n '}</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>
|
||||
|
|
@ -1904,7 +1904,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"> = ['@search', '@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"> = ['@locate', '@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">
|
||||
|
|
@ -1935,7 +1935,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': '@search @locate', 'category': 'building', 'key': '@find', 'no_prefix': 'find search locate', 'tags': '', 'text': '\n search the database for objects\n\n Usage:\n find[/switches] <name or dbref or *account> [= dbrefmin[-dbrefmax]]\n locate - this is a shorthand for using the /loc switch.\n\n Switches:\n room - only look for rooms (location=None)\n exit - only look for exits (destination!=None)\n char - only look for characters (BASE_CHARACTER_TYPECLASS)\n exact - only exact matches are returned.\n loc - display object location if exists and match has one result\n startswith - search for names starting with the string, rather than containing\n\n Searches the database for an object of a particular name or exact #dbref.\n Use *accountname to search for an account. The switches allows for\n limiting object matches to certain game entities. Dbrefmin and dbrefmax\n limits matches to within the given dbrefs range, or above/below if only\n one is given.\n '}</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': '@locate @search', 'category': 'building', 'key': '@find', 'no_prefix': 'find locate search', 'tags': '', 'text': '\n search the database for objects\n\n Usage:\n find[/switches] <name or dbref or *account> [= dbrefmin[-dbrefmax]]\n locate - this is a shorthand for using the /loc switch.\n\n Switches:\n room - only look for rooms (location=None)\n exit - only look for exits (destination!=None)\n char - only look for characters (BASE_CHARACTER_TYPECLASS)\n exact - only exact matches are returned.\n loc - display object location if exists and match has one result\n startswith - search for names starting with the string, rather than containing\n\n Searches the database for an object of a particular name or exact #dbref.\n Use *accountname to search for an account. The switches allows for\n limiting object matches to certain game entities. Dbrefmin and dbrefmax\n limits matches to within the given dbrefs range, or above/below if only\n one is given.\n '}</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>
|
||||
|
|
|
|||
|
|
@ -337,7 +337,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"> = ['inv', 'i']</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"> = ['i', 'inv']</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">
|
||||
|
|
@ -368,7 +368,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': '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>
|
||||
<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>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -787,7 +787,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"> = ['hierarchy', 'groups']</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"> = ['groups', 'hierarchy']</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">
|
||||
|
|
@ -818,7 +818,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': '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>
|
||||
<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>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -418,12 +418,16 @@ in the full command set (such as @open and open).</p>
|
|||
<dd><p>Bases: <a class="reference internal" href="#evennia.commands.default.help.CmdHelp" title="evennia.commands.default.help.CmdHelp"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.help.CmdHelp</span></code></a></p>
|
||||
<p>Edit the help database.</p>
|
||||
<dl class="simple">
|
||||
<dt>Usage:</dt><dd><p>sethelp[/switches] <topic>[[;alias;alias][,category[,locks]] [= <text>]</p>
|
||||
<dt>Usage:</dt><dd><dl class="simple">
|
||||
<dt>sethelp[/switches] <topic>[[;alias;alias][,category[,locks]]</dt><dd><p>[= <text or new category>]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>Switches:</dt><dd><p>edit - open a line editor to edit the topic’s help text.
|
||||
replace - overwrite existing help topic.
|
||||
append - add text to the end of existing topic with a newline between.
|
||||
extend - as append, but don’t add a newline.
|
||||
category - change category of existing help topic.
|
||||
delete - remove help topic.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
|
@ -431,7 +435,8 @@ delete - remove help topic.</p>
|
|||
<p>sethelp lore = In the beginning was …
|
||||
sethelp/append pickpocketing,Thievery = This steals …
|
||||
sethelp/replace pickpocketing, ,attr(is_thief) = This steals …
|
||||
sethelp/edit thievery</p>
|
||||
sethelp/edit thievery
|
||||
sethelp/category thievery = classes</p>
|
||||
<p>If not assigning a category, the <strong>settings.DEFAULT_HELP_CATEGORY</strong> category
|
||||
will be used. If no lockstring is specified, everyone will be able to read
|
||||
the help entry. Sub-topics are embedded in the help text.</p>
|
||||
|
|
@ -477,7 +482,7 @@ the user will be able to enter a partial match to access it.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.help.CmdSetHelp.switch_options">
|
||||
<code class="sig-name descname">switch_options</code><em class="property"> = ('edit', 'replace', 'append', 'extend', 'delete')</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.switch_options" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">switch_options</code><em class="property"> = ('edit', 'replace', 'append', 'extend', 'category', 'delete')</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.switch_options" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -514,7 +519,7 @@ the user will be able to enter a partial match to access it.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.help.CmdSetHelp.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'sethelp', 'no_prefix': ' ', 'tags': '', 'text': "\n Edit the help database.\n\n Usage:\n sethelp[/switches] <topic>[[;alias;alias][,category[,locks]] [= <text>]\n\n Switches:\n edit - open a line editor to edit the topic's help text.\n replace - overwrite existing help topic.\n append - add text to the end of existing topic with a newline between.\n extend - as append, but don't add a newline.\n delete - remove help topic.\n\n Examples:\n sethelp lore = In the beginning was ...\n sethelp/append pickpocketing,Thievery = This steals ...\n sethelp/replace pickpocketing, ,attr(is_thief) = This steals ...\n sethelp/edit thievery\n\n If not assigning a category, the `settings.DEFAULT_HELP_CATEGORY` category\n will be used. If no lockstring is specified, everyone will be able to read\n the help entry. Sub-topics are embedded in the help text.\n\n Note that this cannot modify command-help entries - these are modified\n in-code, outside the game.\n\n # SUBTOPICS\n\n ## Adding subtopics\n\n Subtopics helps to break up a long help entry into sub-sections. Users can\n access subtopics with |whelp topic/subtopic/...|n Subtopics are created and\n stored together with the main topic.\n\n To start adding subtopics, add the text '# SUBTOPICS' on a new line at the\n end of your help text. After this you can now add any number of subtopics,\n each starting with '## <subtopic-name>' on a line, followed by the\n help-text of that subtopic.\n Use '### <subsub-name>' to add a sub-subtopic and so on. Max depth is 5. A\n subtopic's title is case-insensitive and can consist of multiple words -\n the user will be able to enter a partial match to access it.\n\n For example:\n\n | Main help text for <topic>\n |\n | # SUBTOPICS\n |\n | ## about\n |\n | Text for the '<topic>/about' subtopic'\n |\n | ### more about-info\n |\n | Text for the '<topic>/about/more about-info sub-subtopic\n |\n | ## extra\n |\n | Text for the '<topic>/extra' subtopic\n\n "}</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'sethelp', 'no_prefix': ' ', 'tags': '', 'text': "\n Edit the help database.\n\n Usage:\n sethelp[/switches] <topic>[[;alias;alias][,category[,locks]]\n [= <text or new category>]\n Switches:\n edit - open a line editor to edit the topic's help text.\n replace - overwrite existing help topic.\n append - add text to the end of existing topic with a newline between.\n extend - as append, but don't add a newline.\n category - change category of existing help topic.\n delete - remove help topic.\n\n Examples:\n sethelp lore = In the beginning was ...\n sethelp/append pickpocketing,Thievery = This steals ...\n sethelp/replace pickpocketing, ,attr(is_thief) = This steals ...\n sethelp/edit thievery\n sethelp/category thievery = classes\n\n If not assigning a category, the `settings.DEFAULT_HELP_CATEGORY` category\n will be used. If no lockstring is specified, everyone will be able to read\n the help entry. Sub-topics are embedded in the help text.\n\n Note that this cannot modify command-help entries - these are modified\n in-code, outside the game.\n\n # SUBTOPICS\n\n ## Adding subtopics\n\n Subtopics helps to break up a long help entry into sub-sections. Users can\n access subtopics with |whelp topic/subtopic/...|n Subtopics are created and\n stored together with the main topic.\n\n To start adding subtopics, add the text '# SUBTOPICS' on a new line at the\n end of your help text. After this you can now add any number of subtopics,\n each starting with '## <subtopic-name>' on a line, followed by the\n help-text of that subtopic.\n Use '### <subsub-name>' to add a sub-subtopic and so on. Max depth is 5. A\n subtopic's title is case-insensitive and can consist of multiple words -\n the user will be able to enter a partial match to access it.\n\n For example:\n\n | Main help text for <topic>\n |\n | # SUBTOPICS\n |\n | ## about\n |\n | Text for the '<topic>/about' subtopic'\n |\n | ### more about-info\n |\n | Text for the '<topic>/about/more about-info sub-subtopic\n |\n | ## extra\n |\n | Text for the '<topic>/extra' subtopic\n\n "}</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -697,7 +697,7 @@ See <a href="#id11"><span class="problematic" id="id12">|</span></a>luhttps://ww
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.system.CmdTasks.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['@delays', '@task']</em><a class="headerlink" href="#evennia.commands.default.system.CmdTasks.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['@task', '@delays']</em><a class="headerlink" href="#evennia.commands.default.system.CmdTasks.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -743,7 +743,7 @@ to all the variables defined therein.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.system.CmdTasks.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@delays @task', 'category': 'system', 'key': '@tasks', 'no_prefix': 'tasks delays task', 'tags': '', 'text': "\n Display or terminate active tasks (delays).\n\n Usage:\n tasks[/switch] [task_id or function_name]\n\n Switches:\n pause - Pause the callback of a task.\n unpause - Process all callbacks made since pause() was called.\n do_task - Execute the task (call its callback).\n call - Call the callback of this task.\n remove - Remove a task without executing it.\n cancel - Stop a task from automatically executing.\n\n Notes:\n A task is a single use method of delaying the call of a function. Calls are created\n in code, using `evennia.utils.delay`.\n See |luhttps://www.evennia.com/docs/latest/Command-Duration.html|ltthe docs|le for help.\n\n By default, tasks that are canceled and never called are cleaned up after one minute.\n\n Examples:\n - `tasks/cancel move_callback` - Cancels all movement delays from the slow_exit contrib.\n In this example slow exits creates it's tasks with\n `utils.delay(move_delay, move_callback)`\n - `tasks/cancel 2` - Cancel task id 2.\n\n "}</em><a class="headerlink" href="#evennia.commands.default.system.CmdTasks.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@task @delays', 'category': 'system', 'key': '@tasks', 'no_prefix': 'tasks task delays', 'tags': '', 'text': "\n Display or terminate active tasks (delays).\n\n Usage:\n tasks[/switch] [task_id or function_name]\n\n Switches:\n pause - Pause the callback of a task.\n unpause - Process all callbacks made since pause() was called.\n do_task - Execute the task (call its callback).\n call - Call the callback of this task.\n remove - Remove a task without executing it.\n cancel - Stop a task from automatically executing.\n\n Notes:\n A task is a single use method of delaying the call of a function. Calls are created\n in code, using `evennia.utils.delay`.\n See |luhttps://www.evennia.com/docs/latest/Command-Duration.html|ltthe docs|le for help.\n\n By default, tasks that are canceled and never called are cleaned up after one minute.\n\n Examples:\n - `tasks/cancel move_callback` - Cancels all movement delays from the slow_exit contrib.\n In this example slow exits creates it's tasks with\n `utils.delay(move_delay, move_callback)`\n - `tasks/cancel 2` - Cancel task id 2.\n\n "}</em><a class="headerlink" href="#evennia.commands.default.system.CmdTasks.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -975,7 +975,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"> = <module 'evennia.contrib.tutorials.red_button.red_button' from '/tmp/tmpxy_k5v9x/a5a4d980933aa3d48973d8fc348cb9eed90669a5/evennia/contrib/tutorials/red_button/red_button.py'></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"> = <module 'evennia.contrib.tutorials.red_button.red_button' from '/tmp/tmppfkxchki/f1f1f6219a806e9a31d65cea7ef86b0a334f6fe2/evennia/contrib/tutorials/red_button/red_button.py'></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">
|
||||
|
|
|
|||
|
|
@ -136,7 +136,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"> = ['con', 'conn', 'co']</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"> = ['conn', 'con', 'co']</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">
|
||||
|
|
@ -171,7 +171,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': 'con conn co', 'category': 'general', 'key': 'connect', 'no_prefix': ' con conn co', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect "account name" "pass word"\n\n Use the create command to first create an account before logging in.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</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': 'conn con co', 'category': 'general', 'key': 'connect', 'no_prefix': ' conn con co', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect "account name" "pass word"\n\n Use the create command to first create an account before logging in.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</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>
|
||||
|
|
@ -195,7 +195,7 @@ create “account name” “pass word”</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedCreate.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['cre', 'cr']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['cr', 'cre']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -232,7 +232,7 @@ create “account name” “pass word”</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedCreate.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'cre cr', 'category': 'general', 'key': 'create', 'no_prefix': ' cre cr', 'tags': '', 'text': '\n create a new account account\n\n Usage (at login screen):\n create <accountname> <password>\n create "account name" "pass word"\n\n This creates a new account account.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'cr cre', 'category': 'general', 'key': 'create', 'no_prefix': ' cr cre', 'tags': '', 'text': '\n create a new account account\n\n Usage (at login screen):\n create <accountname> <password>\n create "account name" "pass word"\n\n This creates a new account account.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -355,7 +355,7 @@ for simplicity. It shows a pane of info.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedHelp.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['?', 'h']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -381,7 +381,7 @@ for simplicity. It shows a pane of info.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedHelp.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'h ?', 'category': 'general', 'key': 'help', 'no_prefix': ' h ?', 'tags': '', 'text': '\n get help when in unconnected-in state\n\n Usage:\n help\n\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'general', 'key': 'help', 'no_prefix': ' ? h', 'tags': '', 'text': '\n get help when in unconnected-in state\n\n Usage:\n help\n\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -153,7 +153,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"> = ['con', 'conn', 'co']</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"> = ['conn', 'con', 'co']</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">
|
||||
|
|
@ -183,7 +183,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': 'con conn co', 'category': 'general', 'key': 'connect', 'no_prefix': ' con conn co', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect <email> <password>\n\n Use the create command to first create an account before logging in.\n '}</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': 'conn con co', 'category': 'general', 'key': 'connect', 'no_prefix': ' conn con co', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect <email> <password>\n\n Use the create command to first create an account before logging in.\n '}</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>
|
||||
|
|
@ -205,7 +205,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.CmdUnconnectedCreate.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['cre', 'cr']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedCreate.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['cr', 'cre']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedCreate.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -247,7 +247,7 @@ name enclosed in quotes:</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedCreate.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'cre cr', 'category': 'general', 'key': 'create', 'no_prefix': ' cre cr', 'tags': '', 'text': '\n Create a new account.\n\n Usage (at login screen):\n create "accountname" <email> <password>\n\n This creates a new account account.\n\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedCreate.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'cr cre', 'category': 'general', 'key': 'create', 'no_prefix': ' cr cre', 'tags': '', 'text': '\n Create a new account.\n\n Usage (at login screen):\n create "accountname" <email> <password>\n\n This creates a new account account.\n\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedCreate.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -355,7 +355,7 @@ for simplicity. It shows a pane of info.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['?', 'h']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -381,7 +381,7 @@ for simplicity. It shows a pane of info.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'h ?', 'category': 'general', 'key': 'help', 'no_prefix': ' h ?', 'tags': '', 'text': '\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'general', 'key': 'help', 'no_prefix': ' ? h', 'tags': '', 'text': '\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -130,7 +130,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"> = ['@callback', '@callbacks', '@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"> = ['@callback', '@calls', '@callbacks']</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">
|
||||
|
|
@ -211,7 +211,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': '@callback @callbacks @calls', 'category': 'building', 'key': '@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': '@callback @calls @callbacks', 'category': 'building', 'key': '@call', 'no_prefix': 'call callback calls callbacks', '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>
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ aliases to an already joined channel.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['chanalias', 'aliaschan']</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['aliaschan', 'chanalias']</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -205,7 +205,7 @@ aliases to an already joined channel.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'chanalias aliaschan', 'category': 'comms', 'key': 'addcom', 'no_prefix': ' chanalias aliaschan', 'tags': '', 'text': '\n Add a channel alias and/or subscribe to a channel\n\n Usage:\n addcom [alias=] <channel>\n\n Joins a given channel. If alias is given, this will allow you to\n refer to the channel by this alias rather than the full channel\n name. Subsequent calls of this command can be used to add multiple\n aliases to an already joined channel.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'aliaschan chanalias', 'category': 'comms', 'key': 'addcom', 'no_prefix': ' aliaschan chanalias', 'tags': '', 'text': '\n Add a channel alias and/or subscribe to a channel\n\n Usage:\n addcom [alias=] <channel>\n\n Joins a given channel. If alias is given, this will allow you to\n refer to the channel by this alias rather than the full channel\n name. Subsequent calls of this command can be used to add multiple\n aliases to an already joined channel.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -231,7 +231,7 @@ for that channel.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdDelCom.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['delchanalias', 'delaliaschan']</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdDelCom.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['delaliaschan', 'delchanalias']</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdDelCom.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -262,7 +262,7 @@ for that channel.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdDelCom.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'delchanalias delaliaschan', 'category': 'comms', 'key': 'delcom', 'no_prefix': ' delchanalias delaliaschan', 'tags': '', 'text': "\n remove a channel alias and/or unsubscribe from channel\n\n Usage:\n delcom <alias or channel>\n delcom/all <channel>\n\n If the full channel name is given, unsubscribe from the\n channel. If an alias is given, remove the alias but don't\n unsubscribe. If the 'all' switch is used, remove all aliases\n for that channel.\n "}</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdDelCom.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'delaliaschan delchanalias', 'category': 'comms', 'key': 'delcom', 'no_prefix': ' delaliaschan delchanalias', 'tags': '', 'text': "\n remove a channel alias and/or unsubscribe from channel\n\n Usage:\n delcom <alias or channel>\n delcom/all <channel>\n\n If the full channel name is given, unsubscribe from the\n channel. If an alias is given, remove the alias but don't\n unsubscribe. If the 'all' switch is used, remove all aliases\n for that channel.\n "}</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdDelCom.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -225,7 +225,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', 'q', 'chicken out', '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"> = ['q', 'chicken out', 'quit', 'abort']</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">
|
||||
|
|
@ -249,7 +249,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 q chicken out quit', 'category': 'evscaperoom', 'key': 'give up', 'no_prefix': ' abort q chicken out 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': 'q chicken out quit abort', 'category': 'evscaperoom', 'key': 'give up', 'no_prefix': ' q chicken out quit abort', 'tags': '', 'text': '\n Give up\n\n Usage:\n give up\n\n Abandons your attempts at escaping and of ever winning the pie-eating contest.\n\n '}</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>
|
||||
|
|
@ -385,7 +385,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"> = ['whisper', 'shout', ';']</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">
|
||||
|
|
@ -414,7 +414,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 <text>\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': 'whisper shout ;', 'category': 'general', 'key': 'say', 'no_prefix': ' whisper shout ;', 'tags': '', 'text': '\n Perform an communication action.\n\n Usage:\n say <text>\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>
|
||||
|
|
@ -504,7 +504,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"> = ['e', 'examine', 'ex', 'unfocus']</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"> = ['e', 'examine', 'unfocus', 'ex']</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">
|
||||
|
|
@ -533,7 +533,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': 'e examine ex unfocus', 'category': 'evscaperoom', 'key': 'focus', 'no_prefix': ' e examine ex unfocus', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus <obj>\n\n Once focusing on an object, use look to get more information about how it\n looks and what actions is available.\n\n '}</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': 'e examine unfocus ex', 'category': 'evscaperoom', 'key': 'focus', 'no_prefix': ' e examine unfocus ex', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus <obj>\n\n Once focusing on an object, use look to get more information about how it\n looks and what actions is available.\n\n '}</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>
|
||||
|
|
@ -595,7 +595,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"> = ['inv', 'i', 'inventory', '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"> = ['inventory', 'i', 'give', 'inv']</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">
|
||||
|
|
@ -619,7 +619,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': 'inv i inventory give', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' inv i inventory 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': 'inventory i give inv', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' inventory i give inv', '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>
|
||||
|
|
@ -640,7 +640,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdRerouter.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['@dig', '@open']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdRerouter.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['@open', '@dig']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdRerouter.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -663,7 +663,7 @@ to all the variables defined therein.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdRerouter.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@dig @open', 'category': 'general', 'key': 'open', 'no_prefix': ' dig open', 'tags': '', 'text': '\n Interact with an object in focus.\n\n Usage:\n <action> [arg]\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdRerouter.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@open @dig', 'category': 'general', 'key': 'open', 'no_prefix': ' open dig', 'tags': '', 'text': '\n Interact with an object in focus.\n\n Usage:\n <action> [arg]\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdRerouter.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -636,7 +636,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"> = ['inv', 'i']</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"> = ['i', 'inv']</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">
|
||||
|
|
@ -667,7 +667,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': '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>
|
||||
<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>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ there is no room above/below you, your movement will fail.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['dive', 'fly']</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['fly', 'dive']</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -459,7 +459,7 @@ to all the variables defined therein.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'dive fly', 'category': 'general', 'key': 'fly or dive', 'no_prefix': ' dive fly', 'tags': '', 'text': '\n Fly or Dive up and down.\n\n Usage:\n fly\n dive\n\n Will fly up one room or dive down one room at your current position. If\n there is no room above/below you, your movement will fail.\n\n '}</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'fly dive', 'category': 'general', 'key': 'fly or dive', 'no_prefix': ' fly dive', 'tags': '', 'text': '\n Fly or Dive up and down.\n\n Usage:\n fly\n dive\n\n Will fly up one room or dive down one room at your current position. If\n there is no room above/below you, your movement will fail.\n\n '}</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ everyone but the person rolling.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.rpg.dice.dice.CmdDice.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['roll', '@dice']</em><a class="headerlink" href="#evennia.contrib.rpg.dice.dice.CmdDice.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['@dice', 'roll']</em><a class="headerlink" href="#evennia.contrib.rpg.dice.dice.CmdDice.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -366,7 +366,7 @@ everyone but the person rolling.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.rpg.dice.dice.CmdDice.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'roll @dice', 'category': 'general', 'key': 'dice', 'no_prefix': ' roll dice', 'tags': '', 'text': "\n roll dice\n\n Usage:\n dice[/switch] <nr>d<sides> [modifier] [success condition]\n\n Switch:\n hidden - tell the room the roll is being done, but don't show the result\n secret - don't inform the room about neither roll nor result\n\n Examples:\n dice 3d6 + 4\n dice 1d100 - 2 < 50\n\n This will roll the given number of dice with given sides and modifiers.\n So e.g. 2d6 + 3 means to 'roll a 6-sided die 2 times and add the result,\n then add 3 to the total'.\n Accepted modifiers are +, -, * and /.\n A success condition is given as normal Python conditionals\n (<,>,<=,>=,==,!=). So e.g. 2d6 + 3 > 10 means that the roll will succeed\n only if the final result is above 8. If a success condition is given, the\n outcome (pass/fail) will be echoed along with how much it succeeded/failed\n with. The hidden/secret switches will hide all or parts of the roll from\n everyone but the person rolling.\n "}</em><a class="headerlink" href="#evennia.contrib.rpg.dice.dice.CmdDice.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@dice roll', 'category': 'general', 'key': 'dice', 'no_prefix': ' dice roll', 'tags': '', 'text': "\n roll dice\n\n Usage:\n dice[/switch] <nr>d<sides> [modifier] [success condition]\n\n Switch:\n hidden - tell the room the roll is being done, but don't show the result\n secret - don't inform the room about neither roll nor result\n\n Examples:\n dice 3d6 + 4\n dice 1d100 - 2 < 50\n\n This will roll the given number of dice with given sides and modifiers.\n So e.g. 2d6 + 3 means to 'roll a 6-sided die 2 times and add the result,\n then add 3 to the total'.\n Accepted modifiers are +, -, * and /.\n A success condition is given as normal Python conditionals\n (<,>,<=,>=,==,!=). So e.g. 2d6 + 3 > 10 means that the roll will succeed\n only if the final result is above 8. If a success condition is given, the\n outcome (pass/fail) will be echoed along with how much it succeeded/failed\n with. The hidden/secret switches will hide all or parts of the roll from\n everyone but the person rolling.\n "}</em><a class="headerlink" href="#evennia.contrib.rpg.dice.dice.CmdDice.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ turn of combat, performing everyone’s actions in random order.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['hit', 'turnbased combat']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['turnbased combat', 'hit']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -526,7 +526,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hit turnbased combat', 'category': 'general', 'key': 'attack', 'no_prefix': ' hit turnbased combat', 'tags': '', 'text': '\n Start or join combat.\n\n Usage:\n attack [<target>]\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'turnbased combat hit', 'category': 'general', 'key': 'attack', 'no_prefix': ' turnbased combat hit', 'tags': '', 'text': '\n Start or join combat.\n\n Usage:\n attack [<target>]\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ boost INT Wizard Goblin</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.combat_twitch.CmdStunt.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['boost', 'foil']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_twitch.CmdStunt.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['foil', 'boost']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_twitch.CmdStunt.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -525,7 +525,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.combat_twitch.CmdStunt.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'boost foil', 'category': 'combat', 'key': 'stunt', 'no_prefix': ' boost foil', 'tags': '', 'text': '\n Perform a combat stunt, that boosts an ally against a target, or\n foils an enemy, giving them disadvantage against an ally.\n\n Usage:\n boost [ability] <recipient> <target>\n foil [ability] <recipient> <target>\n boost [ability] <target> (same as boost me <target>)\n foil [ability] <target> (same as foil <target> me)\n\n Example:\n boost STR me Goblin\n boost DEX Goblin\n foil STR Goblin me\n foil INT Goblin\n boost INT Wizard Goblin\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_twitch.CmdStunt.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'foil boost', 'category': 'combat', 'key': 'stunt', 'no_prefix': ' foil boost', 'tags': '', 'text': '\n Perform a combat stunt, that boosts an ally against a target, or\n foils an enemy, giving them disadvantage against an ally.\n\n Usage:\n boost [ability] <recipient> <target>\n foil [ability] <recipient> <target>\n boost [ability] <target> (same as boost me <target>)\n foil [ability] <target> (same as foil <target> me)\n\n Example:\n boost STR me Goblin\n boost DEX Goblin\n foil STR Goblin me\n foil INT Goblin\n boost INT Wizard Goblin\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_twitch.CmdStunt.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ self.args).</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.commands.CmdInventory.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['inv', 'i']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['i', 'inv']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -230,7 +230,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.commands.CmdInventory.search_index_entry">
|
||||
<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 your inventory\n\n Usage:\n inventory\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<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 your inventory\n\n Usage:\n inventory\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -291,33 +291,6 @@ enum, Python will give you an error while a typo in a string may go through sile
|
|||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py class">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.enums.QuestStatus">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorials.evadventure.enums.</code><code class="sig-name descname">QuestStatus</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">value</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/enums.html#QuestStatus"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.enums.QuestStatus" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">enum.Enum</span></code></p>
|
||||
<p>Quest status</p>
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.enums.QuestStatus.STARTED">
|
||||
<code class="sig-name descname">STARTED</code><em class="property"> = 'started'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.enums.QuestStatus.STARTED" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.enums.QuestStatus.COMPLETED">
|
||||
<code class="sig-name descname">COMPLETED</code><em class="property"> = 'completed'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.enums.QuestStatus.COMPLETED" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.enums.QuestStatus.ABANDONED">
|
||||
<code class="sig-name descname">ABANDONED</code><em class="property"> = 'abandoned'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.enums.QuestStatus.ABANDONED" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.enums.QuestStatus.FAILED">
|
||||
<code class="sig-name descname">FAILED</code><em class="property"> = 'failed'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.enums.QuestStatus.FAILED" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -119,16 +119,15 @@
|
|||
<span id="evennia-contrib-tutorials-evadventure-quests"></span><h1>evennia.contrib.tutorials.evadventure.quests<a class="headerlink" href="#module-evennia.contrib.tutorials.evadventure.quests" title="Permalink to this headline">¶</a></h1>
|
||||
<p>A simple quest system for EvAdventure.</p>
|
||||
<p>A quest is represented by a quest-handler sitting as
|
||||
.quest on a Character. Individual Quests are objects
|
||||
that track the state and can have multiple steps, each
|
||||
of which are checked off during the quest’s progress.</p>
|
||||
<p>The player can use the quest handler to track the
|
||||
progress of their quests.</p>
|
||||
<strong>.quests</strong> on a Character. Individual Quests are child classes of <strong>EvAdventureQuest</strong> with
|
||||
methods for each step of the quest. The quest handler can add, remove, and track the progress
|
||||
by calling the <strong>progress</strong> method on the quest. Persistent changes are stored on the quester
|
||||
using the <strong>add_data</strong> and <strong>get_data</strong> methods with an Attribute as storage backend.</p>
|
||||
<p>A quest ending can mean a reward or the start of
|
||||
another quest.</p>
|
||||
<dl class="py class">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorials.evadventure.quests.</code><code class="sig-name descname">EvAdventureQuest</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quester</span></em>, <em class="sig-param"><span class="n">data</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorials.evadventure.quests.</code><code class="sig-name descname">EvAdventureQuest</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quester</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||||
<p>This represents a single questing unit of quest.</p>
|
||||
<dl class="simple">
|
||||
|
|
@ -157,7 +156,10 @@ self.progress()</p>
|
|||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>def step_end(self, <a href="#id5"><span class="problematic" id="id6">*</span></a>args, <a href="#id7"><span class="problematic" id="id8">**</span></a>kwargs):</dt><dd><dl class="simple">
|
||||
</dl>
|
||||
<p>def step_B(self, <a href="#id5"><span class="problematic" id="id6">*</span></a>args, <a href="#id7"><span class="problematic" id="id8">**</span></a>kwargs):</p>
|
||||
<dl class="simple">
|
||||
<dt>def step_end(self, <a href="#id9"><span class="problematic" id="id10">*</span></a>args, <a href="#id11"><span class="problematic" id="id12">**</span></a>kwargs):</dt><dd><dl class="simple">
|
||||
<dt>if len(self.quester.contents) > 4:</dt><dd><p>self.quester.msg(“Quest complete!”)
|
||||
self.complete()</p>
|
||||
</dd>
|
||||
|
|
@ -167,7 +169,7 @@ self.complete()</p>
|
|||
</div></blockquote>
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.key">
|
||||
<code class="sig-name descname">key</code><em class="property"> = 'basequest'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.key" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">key</code><em class="property"> = 'base quest'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.key" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -180,16 +182,6 @@ self.complete()</p>
|
|||
<code class="sig-name descname">start_step</code><em class="property"> = 'start'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.start_step" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.completed_text">
|
||||
<code class="sig-name descname">completed_text</code><em class="property"> = 'This quest is completed!'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.completed_text" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandoned_text">
|
||||
<code class="sig-name descname">abandoned_text</code><em class="property"> = 'This quest is abandoned.'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandoned_text" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.help_start">
|
||||
<code class="sig-name descname">help_start</code><em class="property"> = 'You need to start first'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.help_start" title="Permalink to this definition">¶</a></dt>
|
||||
|
|
@ -202,10 +194,52 @@ self.complete()</p>
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.__init__">
|
||||
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quester</span></em>, <em class="sig-param"><span class="n">data</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.__init__" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quester</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.__init__" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.add_data">
|
||||
<code class="sig-name descname">add_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">value</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.add_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.add_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Add data to the quest. This saves it permanently.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em>) – The key to store the data under.</p></li>
|
||||
<li><p><strong>value</strong> (<em>any</em>) – The data to store.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.get_data">
|
||||
<code class="sig-name descname">get_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">default</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.get_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.get_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get data from the quest.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em>) – The key to get data for.</p></li>
|
||||
<li><p><strong>default</strong> (<em>any</em><em>, </em><em>optional</em>) – The default value to return if key is not found.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>any</em> – The data stored under the key.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.remove_data">
|
||||
<code class="sig-name descname">remove_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.remove_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.remove_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove data from the quest permanently.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>key</strong> (<em>str</em>) – The key to remove.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.questhandler">
|
||||
<em class="property">property </em><code class="sig-name descname">questhandler</code><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.questhandler" title="Permalink to this definition">¶</a></dt>
|
||||
|
|
@ -237,57 +271,21 @@ self.complete()</p>
|
|||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.add_data">
|
||||
<code class="sig-name descname">add_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">value</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.add_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.add_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Add data to the quest. This saves it permanently.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em>) – The key to store the data under.</p></li>
|
||||
<li><p><strong>value</strong> (<em>any</em>) – The data to store.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.remove_data">
|
||||
<code class="sig-name descname">remove_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.remove_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.remove_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove data from the quest permanently.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>key</strong> (<em>str</em>) – The key to remove.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.get_data">
|
||||
<code class="sig-name descname">get_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">default</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.get_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.get_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get data from the quest.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em>) – The key to get data for.</p></li>
|
||||
<li><p><strong>default</strong> (<em>any</em><em>, </em><em>optional</em>) – The default value to return if key is not found.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>any</em> – The data stored under the key.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.complete">
|
||||
<code class="sig-name descname">complete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.complete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.complete" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Complete the quest.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandon">
|
||||
<code class="sig-name descname">abandon</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.abandon"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandon" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Call when quest is abandoned.</p>
|
||||
<dd><p>Abandon the quest.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.complete">
|
||||
<code class="sig-name descname">complete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.complete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.complete" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Call this to end the quest.</p>
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.fail">
|
||||
<code class="sig-name descname">fail</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.fail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.fail" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Fail the quest.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -305,16 +303,25 @@ out if the step is complete or not.</p>
|
|||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<p class="rubric">Notes</p>
|
||||
<p><strong>self.quester</strong> is available as the character following the quest.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.help">
|
||||
<code class="sig-name descname">help</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuest.help"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.help" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">help</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/tutorials/evadventure/quests.html#EvAdventureQuest.help"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.help" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>This is used to get help (or a reminder) of what needs to be done to complete the current
|
||||
quest-step.</p>
|
||||
quest-step. It will look for a <strong>help_<stepname></strong> method or string attribute on the quest.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p><em>str</em> – The help text for the current step.</p>
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>*args</strong> – Will be passed into any help_* method.</p></li>
|
||||
<li><p><strong>**kwargs</strong> – <p>Will be passed into any help_* method.</p>
|
||||
</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>str</em> – The help text for the current step.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
|
@ -372,43 +379,6 @@ def quests(self):</p>
|
|||
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.save_quest_data">
|
||||
<code class="sig-name descname">save_quest_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</span></em>, <em class="sig-param"><span class="n">data</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.save_quest_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.save_quest_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Save data for a quest. We store this on the quester as well as updating the quest itself.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>data</strong> (<em>dict</em>) – The data to store. This is commonly flags or other data needed to track the
|
||||
quest.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.load_quest_data">
|
||||
<code class="sig-name descname">load_quest_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.load_quest_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.load_quest_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Load data for a quest.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>quest_key</strong> (<em>str</em>) – The quest to load data for.</p>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>dict</em> – The data stored for the quest.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.clean_quest_data">
|
||||
<code class="sig-name descname">clean_quest_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.clean_quest_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.clean_quest_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove data for a quest.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>quest_key</strong> (<em>str</em>) – The quest to remove data for.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.has">
|
||||
<code class="sig-name descname">has</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.has"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.has" title="Permalink to this definition">¶</a></dt>
|
||||
|
|
@ -445,6 +415,17 @@ quest.</p>
|
|||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.all">
|
||||
<code class="sig-name descname">all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.all" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get all quests stored on character.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p><em>list</em> – All quests stored on character.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.add">
|
||||
<code class="sig-name descname">add</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_class</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.add"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.add" title="Permalink to this definition">¶</a></dt>
|
||||
|
|
@ -468,41 +449,92 @@ quest.</p>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.get_help">
|
||||
<code class="sig-name descname">get_help</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.get_help"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.get_help" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get help text for a quest or for all quests. The help text is
|
||||
a combination of the description of the quest and the help-text
|
||||
of the current step.</p>
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.save_quest_data">
|
||||
<code class="sig-name descname">save_quest_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.save_quest_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.save_quest_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Save data for a quest. We store this on the quester as well as updating the quest itself.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>quest_key</strong> (<em>str</em><em>, </em><em>optional</em>) – The quest-key. If not given, get help for all
|
||||
quests in handler.</p>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>list</em> – Help texts, one for each quest, or only one if <strong>quest_key</strong> is given.</p>
|
||||
<dd class="field-odd"><p><strong>quest_key</strong> (<em>str</em>) – The quest to save data for. The data is assumed to be stored on the
|
||||
quest as <strong>.data</strong> (a dict).</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.progress">
|
||||
<code class="sig-name descname">progress</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</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/tutorials/evadventure/quests.html#EvAdventureQuestHandler.progress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.progress" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Check progress of a given quest or all quests.</p>
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.load_quest_data">
|
||||
<code class="sig-name descname">load_quest_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">quest_key</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#EvAdventureQuestHandler.load_quest_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.load_quest_data" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Load data for a quest.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>quest_key</strong> (<em>str</em><em>, </em><em>optional</em>) – If given, check the progress of this quest (if we have it),
|
||||
otherwise check progress on all quests.</p></li>
|
||||
<li><p><strong>*args</strong> – Will be passed into each quest’s <strong>progress</strong> call.</p></li>
|
||||
<li><p><strong>**kwargs</strong> – <p>Will be passed into each quest’s <strong>progress</strong> call.</p>
|
||||
</p></li>
|
||||
</ul>
|
||||
<dd class="field-odd"><p><strong>quest_key</strong> (<em>str</em>) – The quest to load data for.</p>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>dict</em> – The data stored for the quest.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py class">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorials.evadventure.quests.</code><code class="sig-name descname">CmdQuests</code><span class="sig-paren">(</span><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/tutorials/evadventure/quests.html#CmdQuests"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.command.html#evennia.commands.command.Command" title="evennia.commands.command.Command"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.command.Command</span></code></a></p>
|
||||
<p>List all quests and their statuses as well as get info about the status of
|
||||
a specific quest.</p>
|
||||
<dl class="simple">
|
||||
<dt>Usage:</dt><dd><p>quests
|
||||
quest <questname></p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests.key">
|
||||
<code class="sig-name descname">key</code><em class="property"> = 'quests'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests.key" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['quest']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests.help_category">
|
||||
<code class="sig-name descname">help_category</code><em class="property"> = 'general'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests.help_category" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests.lock_storage">
|
||||
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests.lock_storage" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'quest', 'category': 'general', 'key': 'quests', 'no_prefix': ' quest', 'tags': '', 'text': '\n List all quests and their statuses as well as get info about the status of\n a specific quest.\n\n Usage:\n quests\n quest <questname>\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests.parse">
|
||||
<code class="sig-name descname">parse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#CmdQuests.parse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests.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
|
||||
self.args).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.quests.CmdQuests.func">
|
||||
<code class="sig-name descname">func</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/quests.html#CmdQuests.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.quests.CmdQuests.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
|
||||
set in self.parse())</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@
|
|||
<dl class="py method">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.tests.test_quests.EvAdventureQuestTest.test_progress">
|
||||
<code class="sig-name descname">test_progress</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorials/evadventure/tests/test_quests.html#EvAdventureQuestTest.test_progress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.tests.test_quests.EvAdventureQuestTest.test_progress" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Fulfill the quest steps in sequess</p>
|
||||
<dd><p>Fulfill the quest steps in sequence.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -167,7 +167,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"> = ['press', 'push', '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">
|
||||
|
|
@ -196,7 +196,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': 'press push press button', 'category': 'general', 'key': 'push button', 'no_prefix': ' press push 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>
|
||||
|
|
@ -266,7 +266,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', 'smash lid', '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"> = ['break lid', 'smash', '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">
|
||||
|
|
@ -293,7 +293,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 smash lid break lid', 'category': 'general', 'key': 'smash glass', 'no_prefix': ' smash smash lid break lid', 'tags': '', 'text': '\n Smash the protective glass.\n\n Usage:\n smash glass\n\n Try to smash the glass of the button.\n\n '}</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': 'break lid smash smash lid', 'category': 'general', 'key': 'smash glass', 'no_prefix': ' break lid smash 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>
|
||||
|
|
@ -393,7 +393,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"> = ['press', 'push', '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">
|
||||
|
|
@ -422,7 +422,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': 'press push press button', 'category': 'general', 'key': 'push button', 'no_prefix': ' press push 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>
|
||||
|
|
@ -520,7 +520,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"> = ['examine', 'listen', 'l', 'get', 'feel', '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"> = ['ex', 'listen', 'l', 'feel', 'examine', 'get']</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">
|
||||
|
|
@ -546,7 +546,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': 'examine listen l get feel ex', 'category': 'general', 'key': 'look', 'no_prefix': ' examine listen l get feel ex', 'tags': '', 'text': "\n Looking around in darkness\n\n Usage:\n look <obj>\n\n ... not that there's much to see in the dark.\n\n "}</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': 'ex listen l feel examine get', 'category': 'general', 'key': 'look', 'no_prefix': ' ex listen l feel examine get', 'tags': '', 'text': "\n Looking around in darkness\n\n Usage:\n look <obj>\n\n ... not that there's much to see in the dark.\n\n "}</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>
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ of the object. We overload it with our own version.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdLight.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['burn', 'light']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdLight.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['light', 'burn']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdLight.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -466,7 +466,7 @@ to sit on a “lightable” object, we operate only on self.obj.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdLight.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'burn light', 'category': 'tutorialworld', 'key': 'on', 'no_prefix': ' burn light', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdLight.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'light burn', 'category': 'tutorialworld', 'key': 'on', 'no_prefix': ' light burn', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdLight.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -623,7 +623,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"> = ['press button', 'push 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"> = ['press button', 'button', 'push 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">
|
||||
|
|
@ -649,7 +649,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': 'press button push button button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' press button push 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': 'press button button push button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' press button button push 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>
|
||||
|
|
@ -793,7 +793,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"> = ['pierce', 'hit', 'defend', 'kill', 'fight', 'chop', 'slash', 'stab', 'thrust', 'parry', '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"> = ['chop', 'thrust', 'hit', 'pierce', 'slash', 'bash', 'defend', 'stab', 'kill', 'fight', 'parry']</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">
|
||||
|
|
@ -819,7 +819,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': 'pierce hit defend kill fight chop slash stab thrust parry bash', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' pierce hit defend kill fight chop slash stab thrust parry bash', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab <enemy>\n slash <enemy>\n parry\n\n stab - (thrust) makes a lot of damage but is harder to hit with.\n slash - is easier to land, but does not make as much damage.\n parry - forgoes your attack but will make you harder to hit on next\n enemy attack.\n\n '}</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': 'chop thrust hit pierce slash bash defend stab kill fight parry', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' chop thrust hit pierce slash bash defend stab kill fight parry', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab <enemy>\n slash <enemy>\n parry\n\n stab - (thrust) makes a lot of damage but is harder to hit with.\n slash - is easier to land, but does not make as much damage.\n parry - forgoes your attack but will make you harder to hit on next\n enemy attack.\n\n '}</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>
|
||||
|
|
|
|||
|
|
@ -830,7 +830,7 @@ if they fall off the bridge.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['?', 'h']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -856,7 +856,7 @@ if they fall off the bridge.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'h ?', 'category': 'tutorial world', 'key': 'help', 'no_prefix': ' h ?', 'tags': '', 'text': '\n Overwritten help command while on the bridge.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'tutorial world', 'key': 'help', 'no_prefix': ' ? h', 'tags': '', 'text': '\n Overwritten help command while on the bridge.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -982,7 +982,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"> = ['fiddle', 'l', 'feel around', 'feel', 'search']</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"> = ['feel around', 'l', '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">
|
||||
|
|
@ -1010,7 +1010,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': 'fiddle l feel around feel search', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' fiddle l feel around feel 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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'feel around l feel fiddle search', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' feel around l 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>
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ git evennia pull - Pull the latest evennia code.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.utils.git_integration.git_integration.CmdGitEvennia.directory">
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmpxy_k5v9x/a5a4d980933aa3d48973d8fc348cb9eed90669a5/evennia'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGitEvennia.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmppfkxchki/f1f1f6219a806e9a31d65cea7ef86b0a334f6fe2/evennia'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGitEvennia.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -283,7 +283,7 @@ git pull - Pull the latest code from your current branch.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.utils.git_integration.git_integration.CmdGit.directory">
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmpxy_k5v9x/a5a4d980933aa3d48973d8fc348cb9eed90669a5/evennia/game_template'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGit.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmppfkxchki/f1f1f6219a806e9a31d65cea7ef86b0a334f6fe2/evennia/game_template'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGit.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ indentation.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.utils.eveditor.CmdEditorGroup.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = [':I', ':r', ':x', ':u', ':echo', ':<', ':h', ':q', ':DD', ':s', ':f', ':!', ':::', ':w', ':q!', ':fd', '::', ':UU', ':j', ':=', ':i', ':', ':A', ':dd', ':>', ':y', ':wq', ':dw', ':p', ':fi', ':S', ':uu']</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"> = [':x', ':q', ':::', ':p', ':fi', ':h', ':dw', ':y', ':DD', ':q!', ':wq', ':f', ':uu', ':w', ':UU', ':j', ':dd', ':i', ':fd', ':s', ':r', ':>', ':A', ':=', ':<', ':', ':S', '::', ':I', ':!', ':echo', ':u']</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -378,7 +378,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': ':I :r :x :u :echo :< :h :q :DD :s :f :! ::: :w :q! :fd :: :UU :j := :i : :A :dd :> :y :wq :dw :p :fi :S :uu', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' :I :r :x :u :echo :< :h :q :DD :s :f :! ::: :w :q! :fd :: :UU :j := :i : :A :dd :> :y :wq :dw :p :fi :S :uu', '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': ':x :q ::: :p :fi :h :dw :y :DD :q! :wq :f :uu :w :UU :j :dd :i :fd :s :r :> :A := :< : :S :: :I :! :echo :u', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' :x :q ::: :p :fi :h :dw :y :DD :q! :wq :f :uu :w :UU :j :dd :i :fd :s :r :> :A := :< : :S :: :I :! :echo :u', '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>
|
||||
|
|
|
|||
|
|
@ -953,7 +953,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', '__nomatch_command', 'yes', 'a', 'abort', 'no', '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"> = ['abort', 'y', 'yes', 'no', '__nomatch_command', 'a', 'n']</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -979,7 +979,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 __nomatch_command yes a abort no y', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' n __nomatch_command yes a abort no 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': 'abort y yes no __nomatch_command a n', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' abort y yes no __nomatch_command a n', '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>
|
||||
|
|
|
|||
|
|
@ -151,7 +151,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', 'n', 'end', 'quit', 'abort', 'next', 'previous', 'p', 'e', 'a', '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"> = ['q', 'top', 'previous', 'end', 'abort', 't', 'next', 'quit', 'e', 'p', 'a', 'n']</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -177,7 +177,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 n end quit abort next previous p e a q', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' top t n end quit abort next previous p e a q', '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': 'q top previous end abort t next quit e p a n', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' q top previous end abort t next quit e p a n', '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>
|
||||
|
|
|
|||
|
|
@ -448,10 +448,6 @@
|
|||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandon">abandon() (evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.enums.html#evennia.contrib.tutorials.evadventure.enums.QuestStatus.ABANDONED">ABANDONED (evennia.contrib.tutorials.evadventure.enums.QuestStatus attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.abandoned_text">abandoned_text (evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.enums.html#evennia.contrib.tutorials.evadventure.enums.Ability">Ability (class in evennia.contrib.tutorials.evadventure.enums)</a>
|
||||
</li>
|
||||
|
|
@ -1323,6 +1319,8 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.aliases">(evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.aliases">(evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.aliases">(evennia.contrib.tutorials.evadventure.quests.CmdQuests attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.red_button.red_button.html#evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp.aliases">(evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp attribute)</a>
|
||||
</li>
|
||||
|
|
@ -1443,6 +1441,8 @@
|
|||
<li><a href="api/evennia.contrib.rpg.traits.traits.html#evennia.contrib.rpg.traits.traits.TraitHandler.all">(evennia.contrib.rpg.traits.traits.TraitHandler method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.equipment.html#evennia.contrib.tutorials.evadventure.equipment.EquipmentHandler.all">(evennia.contrib.tutorials.evadventure.equipment.EquipmentHandler method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.all">(evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.utils.random_string_generator.random_string_generator.html#evennia.contrib.utils.random_string_generator.random_string_generator.RandomStringGenerator.all">(evennia.contrib.utils.random_string_generator.random_string_generator.RandomStringGenerator method)</a>
|
||||
</li>
|
||||
|
|
@ -3608,8 +3608,6 @@
|
|||
</li>
|
||||
</ul></li>
|
||||
<li><a href="api/evennia.web.admin.attributes.html#evennia.web.admin.attributes.AttributeForm.clean_attr_value">clean_attr_value() (evennia.web.admin.attributes.AttributeForm method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.clean_quest_data">clean_quest_data() (evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.SessionHandler.clean_senddata">clean_senddata() (evennia.server.sessionhandler.SessionHandler method)</a>
|
||||
</li>
|
||||
|
|
@ -4134,6 +4132,8 @@
|
|||
<li><a href="api/evennia.commands.default.system.html#evennia.commands.default.system.CmdPy">CmdPy (class in evennia.commands.default.system)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdQuell">CmdQuell (class in evennia.commands.default.account)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests">CmdQuests (class in evennia.contrib.tutorials.evadventure.quests)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.commands.default.account.html#evennia.commands.default.account.CmdQuit">CmdQuit (class in evennia.commands.default.account)</a>
|
||||
</li>
|
||||
|
|
@ -4570,10 +4570,6 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.complete">complete() (evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.base_systems.ingame_python.scripts.html#evennia.contrib.base_systems.ingame_python.scripts.complete_task">complete_task() (in module evennia.contrib.base_systems.ingame_python.scripts)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.enums.html#evennia.contrib.tutorials.evadventure.enums.QuestStatus.COMPLETED">COMPLETED (evennia.contrib.tutorials.evadventure.enums.QuestStatus attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.completed_text">completed_text (evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.base_systems.components.component.html#evennia.contrib.base_systems.components.component.Component">Component (class in evennia.contrib.base_systems.components.component)</a>
|
||||
</li>
|
||||
|
|
@ -9395,7 +9391,7 @@
|
|||
<li><a href="api/evennia.accounts.bots.html#evennia.accounts.bots.IRCBot.factory_path">(evennia.accounts.bots.IRCBot attribute)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.enums.html#evennia.contrib.tutorials.evadventure.enums.QuestStatus.FAILED">FAILED (evennia.contrib.tutorials.evadventure.enums.QuestStatus attribute)</a>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.fail">fail() (evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.game_systems.crafting.example_recipes.html#evennia.contrib.game_systems.crafting.example_recipes.FireballRecipe.failure_effects">failure_effects (evennia.contrib.game_systems.crafting.example_recipes.FireballRecipe attribute)</a>
|
||||
|
||||
|
|
@ -10187,6 +10183,8 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.CmdTalk.func">(evennia.contrib.tutorials.evadventure.commands.CmdTalk method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.func">(evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.func">(evennia.contrib.tutorials.evadventure.quests.CmdQuests method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.red_button.red_button.html#evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp.func">(evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp method)</a>
|
||||
</li>
|
||||
|
|
@ -10824,11 +10822,11 @@
|
|||
<li><a href="api/evennia.contrib.grid.xyzgrid.xymap_legend.html#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.get_exit_spawn_name">get_exit_spawn_name() (evennia.contrib.grid.xyzgrid.xymap_legend.MapNode method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.web.api.serializers.html#evennia.web.api.serializers.ObjectDBSerializer.get_exits">get_exits() (evennia.web.api.serializers.ObjectDBSerializer static method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.get_extra_display_name_info">get_extra_display_name_info() (evennia.objects.objects.DefaultObject method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.get_extra_display_name_info">get_extra_display_name_info() (evennia.objects.objects.DefaultObject method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.commands.command.html#evennia.commands.command.Command.get_extra_info">get_extra_info() (evennia.commands.command.Command method)</a>
|
||||
|
||||
<ul>
|
||||
|
|
@ -10879,8 +10877,6 @@
|
|||
<li><a href="api/evennia.contrib.rpg.rpsystem.rpsystem.html#evennia.contrib.rpg.rpsystem.rpsystem.CmdEmote.get_help">(evennia.contrib.rpg.rpsystem.rpsystem.CmdEmote method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.objects.html#evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.get_help">(evennia.contrib.tutorials.evadventure.objects.EvAdventureObject method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.get_help">(evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.utils.evmenu.html#evennia.utils.evmenu.CmdEvMenuNode.get_help">(evennia.utils.evmenu.CmdEvMenuNode method)</a>
|
||||
</li>
|
||||
|
|
@ -11913,6 +11909,8 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.help_category">(evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.help_category">(evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.help_category">(evennia.contrib.tutorials.evadventure.quests.CmdQuests attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.red_button.red_button.html#evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp.help_category">(evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp attribute)</a>
|
||||
</li>
|
||||
|
|
@ -13111,6 +13109,8 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.key">(evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.objects.html#evennia.contrib.tutorials.evadventure.objects.WeaponBareHands.key">(evennia.contrib.tutorials.evadventure.objects.WeaponBareHands attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.key">(evennia.contrib.tutorials.evadventure.quests.CmdQuests attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.key">(evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest attribute)</a>
|
||||
</li>
|
||||
|
|
@ -14029,6 +14029,8 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.lock_storage">(evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.lock_storage">(evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.lock_storage">(evennia.contrib.tutorials.evadventure.quests.CmdQuests attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.red_button.red_button.html#evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp.lock_storage">(evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp attribute)</a>
|
||||
</li>
|
||||
|
|
@ -17044,6 +17046,8 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.CmdGive.parse">(evennia.contrib.tutorials.evadventure.commands.CmdGive method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.parse">(evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.parse">(evennia.contrib.tutorials.evadventure.quests.CmdQuests method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.tutorial_world.objects.html#evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.parse">(evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot method)</a>
|
||||
</li>
|
||||
|
|
@ -17784,8 +17788,6 @@
|
|||
|
||||
<ul>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.progress">(evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler.progress">(evennia.contrib.tutorials.evadventure.quests.EvAdventureQuestHandler method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="api/evennia.contrib.rpg.llm.llm_npc.html#evennia.contrib.rpg.llm.llm_npc.LLMNPC.prompt_prefix">prompt_prefix (evennia.contrib.rpg.llm.llm_npc.LLMNPC attribute)</a>
|
||||
|
|
@ -17959,8 +17961,6 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest.questhandler">questhandler() (evennia.contrib.tutorials.evadventure.quests.EvAdventureQuest property)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.characters.html#evennia.contrib.tutorials.evadventure.characters.EvAdventureCharacter.quests">quests (evennia.contrib.tutorials.evadventure.characters.EvAdventureCharacter attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.enums.html#evennia.contrib.tutorials.evadventure.enums.QuestStatus">QuestStatus (class in evennia.contrib.tutorials.evadventure.enums)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.combat_base.html#evennia.contrib.tutorials.evadventure.combat_base.EvAdventureCombatBaseHandler.queue_action">queue_action() (evennia.contrib.tutorials.evadventure.combat_base.EvAdventureCombatBaseHandler method)</a>
|
||||
|
||||
|
|
@ -19510,6 +19510,8 @@
|
|||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear.search_index_entry">(evennia.contrib.tutorials.evadventure.commands.CmdWieldOrWear attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.commands.html#evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand.search_index_entry">(evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.quests.html#evennia.contrib.tutorials.evadventure.quests.CmdQuests.search_index_entry">(evennia.contrib.tutorials.evadventure.quests.CmdQuests attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.contrib.tutorials.red_button.red_button.html#evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp.search_index_entry">(evennia.contrib.tutorials.red_button.red_button.CmdBlindHelp attribute)</a>
|
||||
</li>
|
||||
|
|
@ -19794,6 +19796,8 @@
|
|||
<li><a href="api/evennia.web.admin.scripts.html#evennia.web.admin.scripts.ScriptAdmin.serialized_string">(evennia.web.admin.scripts.ScriptAdmin method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/evennia.web.api.views.html#evennia.web.api.views.AccountDBViewSet.serializer_class">serializer_class (evennia.web.api.views.AccountDBViewSet attribute)</a>
|
||||
|
||||
<ul>
|
||||
|
|
@ -19804,8 +19808,6 @@
|
|||
<li><a href="api/evennia.web.api.views.html#evennia.web.api.views.ScriptDBViewSet.serializer_class">(evennia.web.api.views.ScriptDBViewSet attribute)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="api/evennia.server.portal.portalsessionhandler.html#evennia.server.portal.portalsessionhandler.PortalSessionHandler.server_connect">server_connect() (evennia.server.portal.portalsessionhandler.PortalSessionHandler method)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.server.portal.portalsessionhandler.html#evennia.server.portal.portalsessionhandler.PortalSessionHandler.server_disconnect">server_disconnect() (evennia.server.portal.portalsessionhandler.PortalSessionHandler method)</a>
|
||||
|
|
@ -20430,8 +20432,6 @@
|
|||
<li><a href="api/evennia.contrib.game_systems.turnbattle.tb_range.html#evennia.contrib.game_systems.turnbattle.tb_range.TBRangeTurnHandler.start_turn">(evennia.contrib.game_systems.turnbattle.tb_range.TBRangeTurnHandler method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="api/evennia.contrib.tutorials.evadventure.enums.html#evennia.contrib.tutorials.evadventure.enums.QuestStatus.STARTED">STARTED (evennia.contrib.tutorials.evadventure.enums.QuestStatus attribute)</a>
|
||||
</li>
|
||||
<li><a href="api/evennia.server.amp_client.html#evennia.server.amp_client.AMPClientFactory.startedConnecting">startedConnecting() (evennia.server.amp_client.AMPClientFactory method)</a>
|
||||
|
||||
<ul>
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue