<spanid="evennia-contrib-game-systems-turnbattle-tb-items"></span><h1>evennia.contrib.game_systems.turnbattle.tb_items<aclass="headerlink"href="#module-evennia.contrib.game_systems.turnbattle.tb_items"title="Permalink to this headline">¶</a></h1>
<p>Simple turn-based combat system with items and status effects</p>
<p>Contrib - Tim Ashley Jenkins 2017</p>
<p>This is a version of the ‘turnbattle’ combat system that includes
conditions and usable items, which can instill these conditions, cure
them, or do just about anything else.</p>
<p>Conditions are stored on characters as a dictionary, where the key
is the name of the condition and the value is a list of two items:
an integer representing the number of turns left until the condition
runs out, and the character upon whose turn the condition timer is
ticked down. Unlike most combat-related attributes, conditions aren’t
wiped once combat ends - if out of combat, they tick down in real time
instead.</p>
<p>This module includes a number of example conditions:</p>
<blockquote>
<div><p>Regeneration: Character recovers HP every turn
Poisoned: Character loses HP every turn
Accuracy Up: +25 to character’s attack rolls
Accuracy Down: -25 to character’s attack rolls
Damage Up: +5 to character’s damage
Damage Down: -5 to character’s damage
Defense Up: +15 to character’s defense
Defense Down: -15 to character’s defense
Haste: +1 action per turn
Paralyzed: No actions per turn
Frightened: Character can’t use the ‘attack’ command</p>
</div></blockquote>
<p>Since conditions can have a wide variety of effects, their code is
scattered throughout the other functions wherever they may apply.</p>
<p>Items aren’t given any sort of special typeclass - instead, whether or
not an object counts as an item is determined by its attributes. To make
an object into an item, it must have the attribute ‘item_func’, with
the value given as a callable - this is the function that will be called
when an item is used. Other properties of the item, such as how many
uses it has, whether it’s destroyed when its uses are depleted, and such
can be specified on the item as well, but they are optional.</p>
<p>To install and test, import this module’s TBItemsCharacter object into
<codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">DEF_DOWN_MOD</code><emclass="property"> = -15</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.DEF_DOWN_MOD"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">ItemCombatRules</code><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">get_attack</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">attacker</span></em>, <emclass="sig-param"><spanclass="n">defender</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.get_attack"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.get_attack"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a value for an attack roll.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>attacker</strong> (<em>obj</em>) – Character doing the attacking</p></li>
<li><p><strong>defender</strong> (<em>obj</em>) – Character being attacked</p></li>
<codeclass="sig-name descname">get_defense</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">attacker</span></em>, <emclass="sig-param"><spanclass="n">defender</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.get_defense"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.get_defense"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a value for defense, which an attack roll must equal or exceed in order
for an attack to hit.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>attacker</strong> (<em>obj</em>) – Character doing the attacking</p></li>
<li><p><strong>defender</strong> (<em>obj</em>) – Character being attacked</p></li>
<codeclass="sig-name descname">get_damage</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">attacker</span></em>, <emclass="sig-param"><spanclass="n">defender</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.get_damage"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.get_damage"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a value for damage to be deducted from the defender’s HP after abilities
successful hit.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>attacker</strong> (<em>obj</em>) – Character doing the attacking</p></li>
<li><p><strong>defender</strong> (<em>obj</em>) – Character being damaged</p></li>
<codeclass="sig-name descname">spend_item_use</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">item</span></em>, <emclass="sig-param"><spanclass="n">user</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.spend_item_use"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.spend_item_use"title="Permalink to this definition">¶</a></dt>
<dd><p>Spends one use on an item with limited uses.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>item</strong> (<em>obj</em>) – Item being used</p></li>
<li><p><strong>user</strong> (<em>obj</em>) – Character using the item</p></li>
</ul>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>If item.db.item_consumable is ‘True’, the item is destroyed if it
runs out of uses - if it’s a string instead of ‘True’, it will also
spawn a new object as residue, using the value of item.db.item_consumable
<codeclass="sig-name descname">use_item</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">user</span></em>, <emclass="sig-param"><spanclass="n">item</span></em>, <emclass="sig-param"><spanclass="n">target</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.use_item"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.use_item"title="Permalink to this definition">¶</a></dt>
<dd><p>Performs the action of using an item.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>user</strong> (<em>obj</em>) – Character using the item</p></li>
<li><p><strong>item</strong> (<em>obj</em>) – Item being used</p></li>
<li><p><strong>target</strong> (<em>obj</em>) – Target of the item use</p></li>
<codeclass="sig-name descname">condition_tickdown</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">character</span></em>, <emclass="sig-param"><spanclass="n">turnchar</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.condition_tickdown"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.condition_tickdown"title="Permalink to this definition">¶</a></dt>
<dd><p>Ticks down the duration of conditions on a character at the start of a given character’s
turn.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>character</strong> (<em>obj</em>) – Character to tick down the conditions of</p></li>
<li><p><strong>turnchar</strong> (<em>obj</em>) – Character whose turn it currently is</p></li>
</ul>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>In combat, this is called on every fighter at the start of every character’s turn. Out
of combat, it’s instead called when a character’s at_update() hook is called, which is
<codeclass="sig-name descname">add_condition</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">character</span></em>, <emclass="sig-param"><spanclass="n">turnchar</span></em>, <emclass="sig-param"><spanclass="n">condition</span></em>, <emclass="sig-param"><spanclass="n">duration</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.add_condition"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.add_condition"title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a condition to a fighter.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>character</strong> (<em>obj</em>) – Character to give the condition to</p></li>
<li><p><strong>turnchar</strong> (<em>obj</em>) – Character whose turn to tick down the condition on in combat</p></li>
<li><p><strong>condition</strong> (<em>str</em>) – Name of the condition</p></li>
<li><p><strong>duration</strong> (<em>int</em><em> or </em><em>True</em>) – Number of turns the condition lasts, or True for indefinite</p></li>
<codeclass="sig-name descname">itemfunc_heal</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">item</span></em>, <emclass="sig-param"><spanclass="n">user</span></em>, <emclass="sig-param"><spanclass="n">target</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.itemfunc_heal"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.itemfunc_heal"title="Permalink to this definition">¶</a></dt>
<dd><p>Item function that heals HP.</p>
<dlclass="simple">
<dt>kwargs:</dt><dd><p>min_healing(int): Minimum amount of HP recovered
max_healing(int): Maximum amount of HP recovered</p>
<codeclass="sig-name descname">itemfunc_add_condition</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">item</span></em>, <emclass="sig-param"><spanclass="n">user</span></em>, <emclass="sig-param"><spanclass="n">target</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.itemfunc_add_condition"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.itemfunc_add_condition"title="Permalink to this definition">¶</a></dt>
<dd><p>Item function that gives the target one or more conditions.</p>
<dlclass="simple">
<dt>kwargs:</dt><dd><dlclass="simple">
<dt>conditions (list): Conditions added by the item</dt><dd><p>formatted as a list of tuples: (condition (str), duration (int or True))</p>
</dd>
</dl>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>Should mostly be used for beneficial conditions - use itemfunc_attack
for an item that can give an enemy a harmful condition.</p>
<codeclass="sig-name descname">itemfunc_cure_condition</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">item</span></em>, <emclass="sig-param"><spanclass="n">user</span></em>, <emclass="sig-param"><spanclass="n">target</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.itemfunc_cure_condition"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.itemfunc_cure_condition"title="Permalink to this definition">¶</a></dt>
<dd><p>Item function that’ll remove given conditions from a target.</p>
<dlclass="simple">
<dt>kwargs:</dt><dd><p>to_cure(list): List of conditions (str) that the item cures when used</p>
<codeclass="sig-name descname">itemfunc_attack</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">item</span></em>, <emclass="sig-param"><spanclass="n">user</span></em>, <emclass="sig-param"><spanclass="n">target</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#ItemCombatRules.itemfunc_attack"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules.itemfunc_attack"title="Permalink to this definition">¶</a></dt>
<dd><p>Item function that attacks a target.</p>
<dl>
<dt>kwargs:</dt><dd><p>min_damage(int): Minimum damage dealt by the attack
max_damage(int): Maximum damage dealth by the attack
accuracy(int): Bonus / penalty to attack accuracy roll
inflict_condition(list): List of conditions inflicted on hit,</p>
<blockquote>
<div><p>formatted as a (str, int) tuple containing condition name
<codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">ITEMFUNCS</code><emclass="property"> = {'add_condition': <bound method ItemCombatRules.itemfunc_add_condition of <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object>>, 'attack': <bound method ItemCombatRules.itemfunc_attack of <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object>>, 'cure_condition': <bound method ItemCombatRules.itemfunc_cure_condition of <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object>>, 'heal': <bound method ItemCombatRules.itemfunc_heal of <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object>>}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.ITEMFUNCS"title="Permalink to this definition">¶</a></dt>
<dd><p>You can paste these prototypes into your game’s prototypes.py module in your
/world/ folder, and use the spawner to create them - they serve as examples
of items you can make and a handy way to demonstrate the system for
conditions as well.</p>
<p>Items don’t have any particular typeclass - any object with a db entry
“item_func” that references one of the functions given above can be used as
an item with the ‘use’ command.</p>
<p>Only “item_func” is required, but item behavior can be further modified by
specifying any of the following:</p>
<blockquote>
<div><p>item_uses (int): If defined, item has a limited number of uses</p>
<p>item_selfonly (bool): If True, user can only use the item on themself</p>
<dlclass="simple">
<dt>item_consumable(True or str): If True, item is destroyed when it runs</dt><dd><p>out of uses. If a string is given, the item will spawn a new
object as it’s destroyed, with the string specifying what prototype
to spawn.</p>
</dd>
<dt>item_kwargs (dict): Keyword arguments to pass to the function defined in</dt><dd><p>item_func. Unique to each function, and can be used to make multiple
items using the same function work differently.</p>
<codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">AMULET_OF_WEAKNESS</code><emclass="property"> = {'desc': "The one who holds this amulet can call upon its power to gain great weakness. It's not a terribly useful artifact.", 'item_func': 'add_condition', 'item_kwargs': {'conditions': [('Damage Down', 3), ('Accuracy Down', 3), ('Defense Down', 3)]}, 'item_selfonly': True, 'key': 'The Amulet of Weakness'}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.AMULET_OF_WEAKNESS"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">TBItemsCharacter</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsCharacter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_object_creation</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsCharacter.at_object_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.at_object_creation"title="Permalink to this definition">¶</a></dt>
<dd><p>Called once, when this object is first created. This is the
normal hook to overload for most object types.</p>
<codeclass="sig-name descname">at_turn_start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsCharacter.at_turn_start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.at_turn_start"title="Permalink to this definition">¶</a></dt>
<dd><p>Hook called at the beginning of this character’s turn in combat.</p>
<codeclass="sig-name descname">apply_turn_conditions</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsCharacter.apply_turn_conditions"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.apply_turn_conditions"title="Permalink to this definition">¶</a></dt>
<dd><p>Applies the effect of conditions that occur at the start of each
turn in combat, or every 30 seconds out of combat.</p>
<codeclass="sig-name descname">at_update</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsCharacter.at_update"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.at_update"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'TBItemsCharacter'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacter.typename"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">TBItemsCharacterTest</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsCharacterTest"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacterTest"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_object_creation</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsCharacterTest.at_object_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacterTest.at_object_creation"title="Permalink to this definition">¶</a></dt>
<dd><p>Called once, when this object is first created. This is the
normal hook to overload for most object types.</p>
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacterTest.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacterTest.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacterTest'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacterTest.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'TBItemsCharacterTest'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsCharacterTest.typename"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">TBItemsTurnHandler</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsTurnHandler"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">next_turn</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#TBItemsTurnHandler.next_turn"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler.next_turn"title="Permalink to this definition">¶</a></dt>
<dd><p>Advances to the next character in the turn order.</p>
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'TBItemsTurnHandler'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler.typename"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">CmdFight</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdFight"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'fight'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'combat'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">combat_handler_class</code><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight.combat_handler_class"title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <aclass="reference internal"href="#evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler"title="evennia.contrib.game_systems.turnbattle.tb_items.TBItemsTurnHandler"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">TBItemsTurnHandler</span></code></a></p>
<codeclass="sig-name descname">aliases</code><emclass="property"> = []</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '', 'category': 'combat', 'key': 'fight', 'no_prefix': ' ', 'tags': '', 'text': "\n Starts a fight with everyone in the same room as you.\n\n Usage:\n fight\n\n When you start a fight, everyone in the room who is able to\n fight is added to combat, and a turn order is randomly rolled.\n When it's your turn, you can attack other characters.\n "}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdFight.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">CmdAttack</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdAttack"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdAttack"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'attack'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdAttack.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'combat'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdAttack.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdAttack.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = []</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdAttack.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdAttack.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '', 'category': 'combat', 'key': 'attack', 'no_prefix': ' ', 'tags': '', 'text': '\n Attacks another character.\n\n Usage:\n attack <target>\n\n When in a fight, you may attack another character. The attack has\n a chance to hit, and if successful, will deal damage.\n '}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdAttack.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">CmdPass</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdPass"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'pass'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = ['wait', 'hold']</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'combat'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'no_prefix': ' wait hold', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdPass.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">CmdDisengage</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdDisengage"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdDisengage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'disengage'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdDisengage.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = ['spare']</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdDisengage.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'combat'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdDisengage.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdDisengage.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdDisengage.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': 'spare', 'category': 'combat', 'key': 'disengage', 'no_prefix': ' spare', 'tags': '', 'text': "\n Passes your turn and attempts to end combat.\n\n Usage:\n disengage\n\n Ends your turn early and signals that you're trying to end\n the fight. If all participants in a fight disengage, the\n fight ends.\n "}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdDisengage.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">CmdRest</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdRest"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdRest"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'rest'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdRest.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'combat'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdRest.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdRest.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = []</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdRest.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdRest.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '', 'category': 'combat', 'key': 'rest', 'no_prefix': ' ', 'tags': '', 'text': "\n Recovers damage.\n\n Usage:\n rest\n\n Resting recovers your HP to its maximum, but you can only\n rest if you're not in a fight.\n "}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdRest.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">CmdCombatHelp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdCombatHelp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">combat_help_text</code><emclass="property"> = "Available combat commands:|/|wAttack:|n Attack a target, attempting to deal damage.|/|wPass:|n Pass your turn without further action.|/|wDisengage:|n End your turn and attempt to end combat.|/|wUse:|n Use an item you're carrying."</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp.combat_help_text"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = ['?']</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'general'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'help'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all()'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'no_prefix': ' ?', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help <topic or command>\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdCombatHelp.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">CmdUse</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdUse"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'use'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">help_category</code><emclass="property"> = 'combat'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse.help_category"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">rules</code><emclass="property"> = <evennia.contrib.game_systems.turnbattle.tb_items.ItemCombatRules object></em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse.rules"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">func</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#CmdUse.func"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse.func"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">aliases</code><emclass="property"> = []</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse.aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">lock_storage</code><emclass="property"> = 'cmd:all();'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse.lock_storage"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">search_index_entry</code><emclass="property"> = {'aliases': '', 'category': 'combat', 'key': 'use', 'no_prefix': ' ', 'tags': '', 'text': '\n Use an item.\n\n Usage:\n use <item> [= target]\n\n An item can have various function - looking at the item may\n provide information as to its effects. Some items can be used\n to attack others, and as such can only be used in combat.\n '}</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.CmdUse.search_index_entry"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.game_systems.turnbattle.tb_items.</code><codeclass="sig-name descname">BattleCmdSet</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cmdsetobj</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">key</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#BattleCmdSet"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.BattleCmdSet"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.contrib.game_systems.turnbattle.tb_items.BattleCmdSet'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.BattleCmdSet.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">key</code><emclass="property"> = 'DefaultCharacter'</em><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.BattleCmdSet.key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_cmdset_creation</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/game_systems/turnbattle/tb_items.html#BattleCmdSet.at_cmdset_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.game_systems.turnbattle.tb_items.BattleCmdSet.at_cmdset_creation"title="Permalink to this definition">¶</a></dt>