character can perform a given action; until a certain time has passed their
command can not be used again. This contrib provides a simple cooldown
handler that can be attached to any typeclass. A cooldown is a lightweight persistent
asynchronous timer that you can query to see if a certain time has yet passed.</p>
<p>Cooldowns are completely asynchronous and must be queried to know their
state. They do not fire callbacks, so are not a good fit for use cases
where something needs to happen on a specific schedule (use delay or
a TickerHandler for that instead).</p>
<p>See also the evennia documentation for command cooldowns
(<aclass="reference external"href="https://github.com/evennia/evennia/wiki/Command-Cooldown">https://github.com/evennia/evennia/wiki/Command-Cooldown</a>) for more information
about the concept.</p>
<sectionid="installation">
<h2>Installation<aclass="headerlink"href="#installation"title="Permalink to this headline">¶</a></h2>
<p>To use, simply add the following property to the typeclass definition of any
object type that you want to support cooldowns. It will expose a new <codeclass="docutils literal notranslate"><spanclass="pre">cooldowns</span></code>
property that persists data to the object’s attribute storage. You can set this
on your base <codeclass="docutils literal notranslate"><spanclass="pre">Object</span></code> typeclass to enable cooldown tracking on every kind of
object, or just put it on your <codeclass="docutils literal notranslate"><spanclass="pre">Character</span></code> typeclass.</p>
<p>By default the CooldownHandler will use the <codeclass="docutils literal notranslate"><spanclass="pre">cooldowns</span></code> property, but you can
customize this if desired by passing a different value for the <codeclass="docutils literal notranslate"><spanclass="pre">db_attribute</span></code>
<spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">caller</span><spanclass="o">.</span><spanclass="n">msg</span><spanclass="p">(</span><spanclass="s2">"That's not ready yet!"</span><spanclass="p">)</span>
</pre></div>
</div>
<hrclass="docutils"/>
<p><small>This document page is generated from <codeclass="docutils literal notranslate"><spanclass="pre">evennia/contrib/game_systems/cooldowns/README.md</span></code>. Changes to this
file will be overwritten, so edit that file rather than this one.</small></p>