mirror of
https://github.com/evennia/evennia.git
synced 2026-03-18 22:06:30 +01:00
1121 lines
No EOL
95 KiB
HTML
1121 lines
No EOL
95 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||
|
||
<title>evennia.contrib.rpg.buffs.buff — Evennia 2.x documentation</title>
|
||
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||
<script src="../_static/jquery.js"></script>
|
||
<script src="../_static/underscore.js"></script>
|
||
<script src="../_static/doctools.js"></script>
|
||
<script src="../_static/language_data.js"></script>
|
||
<link rel="shortcut icon" href="../_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
<link rel="next" title="evennia.contrib.rpg.buffs.samplebuffs" href="evennia.contrib.rpg.buffs.samplebuffs.html" />
|
||
<link rel="prev" title="evennia.contrib.rpg.buffs" href="evennia.contrib.rpg.buffs.html" />
|
||
</head><body>
|
||
|
||
|
||
|
||
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="evennia.contrib.rpg.buffs.samplebuffs.html" title="evennia.contrib.rpg.buffs.samplebuffs"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="evennia.contrib.rpg.buffs.html" title="evennia.contrib.rpg.buffs"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 2.x</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> »</li>
|
||
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> »</li>
|
||
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" >evennia.contrib.rpg</a> »</li>
|
||
<li class="nav-item nav-item-6"><a href="evennia.contrib.rpg.buffs.html" accesskey="U">evennia.contrib.rpg.buffs</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.buff</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="document">
|
||
|
||
<div class="documentwrapper">
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<p class="logo"><a href="../index.html">
|
||
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
|
||
</a></p>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="../search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>$('#searchbox').show(0);</script>
|
||
<h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">evennia.contrib.rpg.buffs.buff</a><ul>
|
||
<li><a class="reference internal" href="#installation">Installation</a></li>
|
||
<li><a class="reference internal" href="#using-the-handler">Using the Handler</a><ul>
|
||
<li><a class="reference internal" href="#applying-a-buff">Applying a Buff</a></li>
|
||
<li><a class="reference internal" href="#modify">Modify</a></li>
|
||
<li><a class="reference internal" href="#trigger">Trigger</a></li>
|
||
<li><a class="reference internal" href="#tick">Tick</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#buffs">Buffs</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="evennia.contrib.rpg.buffs.html"
|
||
title="previous chapter">evennia.contrib.rpg.buffs</a></p>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="evennia.contrib.rpg.buffs.samplebuffs.html"
|
||
title="next chapter">evennia.contrib.rpg.buffs.samplebuffs</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/api/evennia.contrib.rpg.buffs.buff.md.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div><h3>Links</h3>
|
||
<ul>
|
||
<li><a href="https://www.evennia.com/docs/latest/index.html">Documentation Top</a> </li>
|
||
<li><a href="https://www.evennia.com">Evennia Home</a> </li>
|
||
<li><a href="https://github.com/evennia/evennia">Github</a> </li>
|
||
<li><a href="http://games.evennia.com">Game Index</a> </li>
|
||
<li>
|
||
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
|
||
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
|
||
<a href="https://evennia.blogspot.com/">Blog</a>
|
||
</li>
|
||
</ul>
|
||
<h3>Doc Versions</h3>
|
||
<ul>
|
||
|
||
<li><a href="evennia.contrib.rpg.buffs.buff.html">2.x (main branch)</a></li>
|
||
<ul>
|
||
<li><a href="../1.3.0/index.html">1.3.0 (v1.3.0 branch)</a></li>
|
||
|
||
<li><a href="../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
|
||
|
||
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section id="module-evennia.contrib.rpg.buffs.buff">
|
||
<span id="evennia-contrib-rpg-buffs-buff"></span><h1>evennia.contrib.rpg.buffs.buff<a class="headerlink" href="#module-evennia.contrib.rpg.buffs.buff" title="Permalink to this headline">¶</a></h1>
|
||
<p>Buffs - Tegiminis 2022</p>
|
||
<p>A buff is a timed object, attached to a game entity, that modifies values, triggers
|
||
code, or both. It is a common design pattern in RPGs, particularly action games.</p>
|
||
<p>This contrib gives you a buff handler to apply to your objects, a buff class to extend them,
|
||
a sample property class to show how to automatically check modifiers, some sample buffs to learn from,
|
||
and a command which applies buffs.</p>
|
||
<section id="installation">
|
||
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
|
||
<p>Assign the handler to a property on the object, like so.</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@lazy_property</span>
|
||
<span class="k">def</span> <span class="nf">buffs</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">BuffHandler</span><span class="p">:</span>
|
||
<span class="k">return</span> <span class="n">BuffHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="using-the-handler">
|
||
<h2>Using the Handler<a class="headerlink" href="#using-the-handler" title="Permalink to this headline">¶</a></h2>
|
||
<p>To make use of the handler, you will need:</p>
|
||
<ul class="simple">
|
||
<li><p>Some buffs to add. You can create these by extending the <strong>BaseBuff</strong> class from this module. You can see some examples in <strong>samplebuffs.py</strong>.</p></li>
|
||
<li><p>A way to add buffs to the handler. You can see a basic example of this in the <strong>CmdBuff</strong> command in this module.</p></li>
|
||
</ul>
|
||
<section id="applying-a-buff">
|
||
<h3>Applying a Buff<a class="headerlink" href="#applying-a-buff" title="Permalink to this headline">¶</a></h3>
|
||
<p>Call the handler <strong>add(BuffClass)</strong> method. This requires a class reference, and also contains a number of
|
||
optional arguments to customize the buff’s duration, stacks, and so on.</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StrengthBuff</span><span class="p">)</span> <span class="c1"># A single stack of StrengthBuff with normal duration</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">DexBuff</span><span class="p">,</span> <span class="n">stacks</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">duration</span><span class="o">=</span><span class="mi">60</span><span class="p">)</span> <span class="c1"># Three stacks of DexBuff, with a duration of 60 seconds</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ReflectBuff</span><span class="p">,</span> <span class="n">to_cache</span><span class="o">=</span><span class="p">{</span><span class="s1">'reflect'</span><span class="p">:</span> <span class="mf">0.5</span><span class="p">})</span> <span class="c1"># A single stack of ReflectBuff, with an extra cache value</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="modify">
|
||
<h3>Modify<a class="headerlink" href="#modify" title="Permalink to this headline">¶</a></h3>
|
||
<p>Call the handler <strong>check(value, stat)</strong> method wherever you want to see the modified value.
|
||
This will return the value, modified by and relevant buffs on the handler’s owner (identified by
|
||
the <strong>stat</strong> string). For example:</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># The method we call to damage ourselves</span>
|
||
<span class="k">def</span> <span class="nf">take_damage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source</span><span class="p">,</span> <span class="n">damage</span><span class="p">):</span>
|
||
<span class="n">_damage</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">damage</span><span class="p">,</span> <span class="s1">'taken_damage'</span><span class="p">)</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">health</span> <span class="o">-=</span> <span class="n">_damage</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="trigger">
|
||
<h3>Trigger<a class="headerlink" href="#trigger" title="Permalink to this headline">¶</a></h3>
|
||
<p>Call the handler <strong>trigger(triggerstring)</strong> method wherever you want an event call. This
|
||
will call the <strong>at_trigger</strong> hook method on all buffs with the relevant trigger.</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">Detonate</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
|
||
<span class="o">...</span>
|
||
<span class="n">triggers</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'take_damage'</span><span class="p">]</span>
|
||
<span class="k">def</span> <span class="nf">at_trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">take_damage</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
|
||
|
||
<span class="k">def</span> <span class="nf">Character</span><span class="p">(</span><span class="n">Character</span><span class="p">):</span>
|
||
<span class="o">...</span>
|
||
<span class="k">def</span> <span class="nf">take_damage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source</span><span class="p">,</span> <span class="n">damage</span><span class="p">):</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">buffs</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="s1">'take_damage'</span><span class="p">)</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">health</span> <span class="o">-=</span> <span class="n">_damage</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="tick">
|
||
<h3>Tick<a class="headerlink" href="#tick" title="Permalink to this headline">¶</a></h3>
|
||
<p>Ticking a buff happens automatically once applied, as long as the buff’s <strong>tickrate</strong> is more than 0.</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">Poison</span><span class="p">(</span><span class="n">BaseBuff</span><span class="p">):</span>
|
||
<span class="o">...</span>
|
||
<span class="n">tickrate</span> <span class="o">=</span> <span class="mi">5</span>
|
||
<span class="k">def</span> <span class="nf">at_tick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">initial</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||
<span class="n">_dmg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">dmg</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">stacks</span>
|
||
<span class="k">if</span> <span class="ow">not</span> <span class="n">initial</span><span class="p">:</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">msg_contents</span><span class="p">(</span>
|
||
<span class="s2">"Poison courses through </span><span class="si">{actor}</span><span class="s2">'s body, dealing </span><span class="si">{damage}</span><span class="s2"> damage."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
|
||
<span class="n">actor</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">.</span><span class="n">named</span><span class="p">,</span> <span class="n">damage</span><span class="o">=</span><span class="n">_dmg</span>
|
||
<span class="p">)</span>
|
||
<span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
<section id="buffs">
|
||
<h2>Buffs<a class="headerlink" href="#buffs" title="Permalink to this headline">¶</a></h2>
|
||
<p>A buff is a class which contains a bunch of immutable data about itself - such as tickrate, triggers, refresh rules, and
|
||
so on - and which merges mutable data in from the cache when called.</p>
|
||
<p>Buffs are always instanced when they are called for a method. To access a buff’s properties and methods, you should do so through
|
||
this instance, rather than directly manipulating the buff cache on the object. You can modify a buff’s cache through various handler
|
||
methods instead.</p>
|
||
<p>You can see all the features of the <strong>BaseBuff</strong> class below, or browse <strong>samplebuffs.py</strong> to see how to create some common buffs. Buffs have
|
||
many attributes and hook methods you can overload to create complex, interrelated buffs.</p>
|
||
<dl class="py function">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.random">
|
||
<code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">random</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → x in the interval [0, 1).<a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.random" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">BaseBuff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff" 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>
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = 'template'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.name">
|
||
<code class="sig-name descname">name</code><em class="property"> = 'Template'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.name" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.flavor">
|
||
<code class="sig-name descname">flavor</code><em class="property"> = 'Template'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.flavor" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.visible">
|
||
<code class="sig-name descname">visible</code><em class="property"> = True</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.visible" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.triggers">
|
||
<code class="sig-name descname">triggers</code><em class="property"> = []</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.triggers" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.handler">
|
||
<code class="sig-name descname">handler</code><em class="property"> = None</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.handler" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.start">
|
||
<code class="sig-name descname">start</code><em class="property"> = 0</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.start" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.duration">
|
||
<code class="sig-name descname">duration</code><em class="property"> = -1</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.duration" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.playtime">
|
||
<code class="sig-name descname">playtime</code><em class="property"> = False</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.playtime" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.refresh">
|
||
<code class="sig-name descname">refresh</code><em class="property"> = True</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.refresh" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.unique">
|
||
<code class="sig-name descname">unique</code><em class="property"> = True</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.unique" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.maxstacks">
|
||
<code class="sig-name descname">maxstacks</code><em class="property"> = 1</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.maxstacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.stacks">
|
||
<code class="sig-name descname">stacks</code><em class="property"> = 1</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.stacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.tickrate">
|
||
<code class="sig-name descname">tickrate</code><em class="property"> = 0</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.tickrate" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.mods">
|
||
<code class="sig-name descname">mods</code><em class="property"> = []</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.mods" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.cache">
|
||
<code class="sig-name descname">cache</code><em class="property"> = {}</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.cache" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.ticknum">
|
||
<em class="property">property </em><code class="sig-name descname">ticknum</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.ticknum" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns how many ticks this buff has gone through as an integer.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.owner">
|
||
<em class="property">property </em><code class="sig-name descname">owner</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.owner" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return this buff’s owner (the object its handler is attached to)</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.timeleft">
|
||
<em class="property">property </em><code class="sig-name descname">timeleft</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.timeleft" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns how much time this buff has left. If -1, it is permanent.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.ticking">
|
||
<em class="property">property </em><code class="sig-name descname">ticking</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.ticking" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns if this buff ticks or not (tickrate => 1)</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.stacking">
|
||
<em class="property">property </em><code class="sig-name descname">stacking</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.stacking" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns if this buff stacks or not (maxstacks > 1)</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.__init__">
|
||
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span></em>, <em class="sig-param"><span class="n">buffkey</span></em>, <em class="sig-param"><span class="n">cache</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.__init__" title="Permalink to this definition">¶</a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handler</strong> – The handler this buff is attached to</p></li>
|
||
<li><p><strong>buffkey</strong> – The key this buff uses on the cache</p></li>
|
||
<li><p><strong>cache</strong> – The cache dictionary (what you get if you use <strong>handler.buffcache.get(key)</strong>)</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.conditional">
|
||
<code class="sig-name descname">conditional</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.conditional"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.conditional" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function for conditional evaluation.</p>
|
||
<p>This must return True for a buff to apply modifiers, trigger effects, or tick.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.remove">
|
||
<code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BaseBuff.remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.remove" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Helper method which removes this buff from its handler. Use dispel if you are dispelling it instead.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>loud</strong> – (optional) Whether to call at_remove or not (default: True)</p></li>
|
||
<li><p><strong>expire</strong> – (optional) Whether to call at_expire or not (default: False)</p></li>
|
||
<li><p><strong>delay</strong> – (optional) How long you want to delay the remove call for</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_expire method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.dispel">
|
||
<code class="sig-name descname">dispel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">delay</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BaseBuff.dispel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.dispel" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Helper method which dispels this buff (removes and calls at_dispel).</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>loud</strong> – (optional) Whether to call at_remove or not (default: True)</p></li>
|
||
<li><p><strong>delay</strong> – (optional) How long you want to delay the remove call for</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_dispel method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.pause">
|
||
<code class="sig-name descname">pause</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BaseBuff.pause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.pause" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Helper method which pauses this buff on its handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_pause method as kwargs</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.unpause">
|
||
<code class="sig-name descname">unpause</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BaseBuff.unpause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.unpause" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Helper method which unpauses this buff on its handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_unpause method as kwargs</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.reset">
|
||
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.reset" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Resets the buff start time as though it were just applied; functionally identical to a refresh</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.update_cache">
|
||
<code class="sig-name descname">update_cache</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">to_cache</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.update_cache"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.update_cache" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Updates this buff’s cache using the given values, both internally (this instance) and on the handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>to_cache</strong> – The dictionary of values you want to add to the cache</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_init">
|
||
<code class="sig-name descname">at_init</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_init" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function called when this buff object is initialized.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_apply">
|
||
<code class="sig-name descname">at_apply</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_apply"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_apply" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function to run when this buff is applied to an object.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_remove">
|
||
<code class="sig-name descname">at_remove</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_remove" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function to run when this buff is removed from an object.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_dispel">
|
||
<code class="sig-name descname">at_dispel</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_dispel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_dispel" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function to run when this buff is dispelled from an object (removed by someone other than the buff holder).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_expire">
|
||
<code class="sig-name descname">at_expire</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_expire"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_expire" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function to run when this buff expires from an object.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_pre_check">
|
||
<code class="sig-name descname">at_pre_check</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_pre_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_pre_check" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function to run before this buff’s modifiers are checked.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_post_check">
|
||
<code class="sig-name descname">at_post_check</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_post_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_post_check" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook function to run after this buff’s mods are checked.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_trigger">
|
||
<code class="sig-name descname">at_trigger</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trigger</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_trigger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_trigger" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook for the code you want to run whenever the effect is triggered.
|
||
Passes the trigger string to the function, so you can have multiple
|
||
triggers on one buff.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_tick">
|
||
<code class="sig-name descname">at_tick</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">initial</span><span class="p">:</span> <span class="n">bool</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_tick"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_tick" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook for actions that occur per-tick, a designer-set sub-duration.
|
||
<strong>initial</strong> tells you if it’s the first tick that happens (when a buff is applied).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_pause">
|
||
<code class="sig-name descname">at_pause</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_pause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_pause" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook for when this buff is paused</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BaseBuff.at_unpause">
|
||
<code class="sig-name descname">at_unpause</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BaseBuff.at_unpause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BaseBuff.at_unpause" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook for when this buff is unpaused.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.Mod">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">Mod</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">stat</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">modifier</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">value</span></em>, <em class="sig-param"><span class="n">perstack</span><span class="o">=</span><span class="default_value">0.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#Mod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.Mod" 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>A single stat mod object. One buff or trait can hold multiple mods, for the same or different stats.</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.Mod.__init__">
|
||
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">stat</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">modifier</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">value</span></em>, <em class="sig-param"><span class="n">perstack</span><span class="o">=</span><span class="default_value">0.0</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#Mod.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.Mod.__init__" title="Permalink to this definition">¶</a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>stat</strong> – The stat the buff affects. Normally matches the object attribute name</p></li>
|
||
<li><p><strong>mod</strong> – The modifier the buff applies. “add” for add/sub or “mult” for mult/div</p></li>
|
||
<li><p><strong>value</strong> – The value of the modifier</p></li>
|
||
<li><p><strong>perstack</strong> – How much is added to the base, per stack (including first).</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.Mod.stat">
|
||
<code class="sig-name descname">stat</code><em class="property"> = 'null'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.Mod.stat" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.Mod.modifier">
|
||
<code class="sig-name descname">modifier</code><em class="property"> = 'add'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.Mod.modifier" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.Mod.value">
|
||
<code class="sig-name descname">value</code><em class="property"> = 0</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.Mod.value" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.Mod.perstack">
|
||
<code class="sig-name descname">perstack</code><em class="property"> = 0</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.Mod.perstack" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">BuffHandler</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">owner</span></em>, <em class="sig-param"><span class="n">dbkey</span><span class="o">=</span><span class="default_value">'buffs'</span></em>, <em class="sig-param"><span class="n">autopause</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler" 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>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.__init__">
|
||
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">owner</span></em>, <em class="sig-param"><span class="n">dbkey</span><span class="o">=</span><span class="default_value">'buffs'</span></em>, <em class="sig-param"><span class="n">autopause</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.__init__" title="Permalink to this definition">¶</a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>owner</strong> – The object this handler is attached to</p></li>
|
||
<li><p><strong>dbkey</strong> – (optional) The string key of the db attribute to use for the buff cache</p></li>
|
||
<li><p><strong>autopause</strong> – (optional) Whether this handler autopauses playtime buffs on owning object’s unpuppet</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.ownerref">
|
||
<code class="sig-name descname">ownerref</code><em class="property"> = None</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.ownerref" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.dbkey">
|
||
<code class="sig-name descname">dbkey</code><em class="property"> = 'buffs'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.dbkey" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.autopause">
|
||
<code class="sig-name descname">autopause</code><em class="property"> = False</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.autopause" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.owner">
|
||
<em class="property">property </em><code class="sig-name descname">owner</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.owner" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The object this handler is attached to.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.buffcache">
|
||
<em class="property">property </em><code class="sig-name descname">buffcache</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.buffcache" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The object attribute we use for the buff cache. Auto-creates if not present.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.traits">
|
||
<em class="property">property </em><code class="sig-name descname">traits</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.traits" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>All buffs on this handler that modify a stat.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.effects">
|
||
<em class="property">property </em><code class="sig-name descname">effects</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.effects" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>All buffs on this handler that trigger off an event.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.playtime">
|
||
<em class="property">property </em><code class="sig-name descname">playtime</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.playtime" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>All buffs on this handler that only count down during active playtime.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.paused">
|
||
<em class="property">property </em><code class="sig-name descname">paused</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.paused" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>All buffs on this handler that are paused.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.expired">
|
||
<em class="property">property </em><code class="sig-name descname">expired</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.expired" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>All buffs on this handler that have expired (no duration or no stacks).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.visible">
|
||
<em class="property">property </em><code class="sig-name descname">visible</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.visible" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>All buffs on this handler that are visible.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.all">
|
||
<em class="property">property </em><code class="sig-name descname">all</code><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.all" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns dictionary of instanced buffs equivalent to ALL buffs on this handler,
|
||
regardless of state, type, or anything else.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.add">
|
||
<code class="sig-name descname">add</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">buff</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff">evennia.contrib.rpg.buffs.buff.BaseBuff</a></span></em>, <em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">stacks</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">duration</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">source</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">to_cache</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">context</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.add"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.add" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Add a buff to this object, respecting all stacking/refresh/reapplication rules. Takes
|
||
a number of optional parameters to allow for customization.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>buff</strong> – The buff class type you wish to add</p></li>
|
||
<li><p><strong>key</strong> – (optional) The key you wish to use for this buff; overrides defaults</p></li>
|
||
<li><p><strong>stacks</strong> – (optional) The number of stacks you want to add, if the buff is stacking</p></li>
|
||
<li><p><strong>duration</strong> – (optional) The amount of time, in seconds, you want the buff to last; overrides defaults</p></li>
|
||
<li><p><strong>source</strong> – (optional) The source of this buff. (default: None)</p></li>
|
||
<li><p><strong>to_cache</strong> – (optional) A dictionary to store in the buff’s cache; does not overwrite default cache keys</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_apply method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.remove">
|
||
<code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">stacks</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">dispel</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.remove" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Remove a buff or effect with matching key from this object. Normally calls at_remove,
|
||
calls at_expire if the buff expired naturally, and optionally calls at_dispel. Can also
|
||
remove stacks instead of the entire buff (still calls at_remove). Typically called via a helper method
|
||
on the buff instance, or other methods on the handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> – The buff key</p></li>
|
||
<li><p><strong>loud</strong> – (optional) Calls at_remove when True. (default: True)</p></li>
|
||
<li><p><strong>dispel</strong> – (optional) Calls at_dispel when True. (default: False)</p></li>
|
||
<li><p><strong>expire</strong> – (optional) Calls at_expire when True. (default: False)</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_dispel/at_expire method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_type">
|
||
<code class="sig-name descname">remove_by_type</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bufftype</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff">evennia.contrib.rpg.buffs.buff.BaseBuff</a></span></em>, <em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">dispel</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.remove_by_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_type" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Removes all buffs of a specified type from this object. Functionally similar to remove, but takes a type instead.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>bufftype</strong> – The buff class to remove</p></li>
|
||
<li><p><strong>loud</strong> – (optional) Calls at_remove when True. (default: True)</p></li>
|
||
<li><p><strong>dispel</strong> – (optional) Calls at_dispel when True. (default: False)</p></li>
|
||
<li><p><strong>expire</strong> – (optional) Calls at_expire when True. (default: False)</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_dispel/at_expire method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_stat">
|
||
<code class="sig-name descname">remove_by_stat</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">stat</span></em>, <em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">dispel</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.remove_by_stat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_stat" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Removes all buffs modifying the specified stat from this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>stat</strong> – The stat string to search for</p></li>
|
||
<li><p><strong>loud</strong> – (optional) Calls at_remove when True. (default: True)</p></li>
|
||
<li><p><strong>dispel</strong> – (optional) Calls at_dispel when True. (default: False)</p></li>
|
||
<li><p><strong>expire</strong> – (optional) Calls at_expire when True. (default: False)</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_dispel/at_expire method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_trigger">
|
||
<code class="sig-name descname">remove_by_trigger</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trigger</span></em>, <em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">dispel</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.remove_by_trigger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_trigger" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Removes all buffs with the specified trigger from this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>trigger</strong> – The stat string to search for</p></li>
|
||
<li><p><strong>loud</strong> – (optional) Calls at_remove when True. (default: True)</p></li>
|
||
<li><p><strong>dispel</strong> – (optional) Calls at_dispel when True. (default: False)</p></li>
|
||
<li><p><strong>expire</strong> – (optional) Calls at_expire when True. (default: False)</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_dispel/at_expire method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_source">
|
||
<code class="sig-name descname">remove_by_source</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source</span></em>, <em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">dispel</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.remove_by_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_source" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Removes all buffs from the specified source from this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>source</strong> – The source to search for</p></li>
|
||
<li><p><strong>loud</strong> – (optional) Calls at_remove when True. (default: True)</p></li>
|
||
<li><p><strong>dispel</strong> – (optional) Calls at_dispel when True. (default: False)</p></li>
|
||
<li><p><strong>expire</strong> – (optional) Calls at_expire when True. (default: False)</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_dispel/at_expire method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_cachevalue">
|
||
<code class="sig-name descname">remove_by_cachevalue</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><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">dispel</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.remove_by_cachevalue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.remove_by_cachevalue" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Removes all buffs with the cachevalue from this object. Functionally similar to remove, but checks the buff’s cache values instead.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> – The key of the cache value to check</p></li>
|
||
<li><p><strong>value</strong> – (optional) The value to match to. If None, merely checks to see if the value exists</p></li>
|
||
<li><p><strong>loud</strong> – (optional) Calls at_remove when True. (default: True)</p></li>
|
||
<li><p><strong>dispel</strong> – (optional) Calls at_dispel when True. (default: False)</p></li>
|
||
<li><p><strong>expire</strong> – (optional) Calls at_expire when True. (default: False)</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_remove/at_dispel/at_expire method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.clear">
|
||
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">dispel</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">expire</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.clear"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.clear" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Removes all buffs on this handler</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.get">
|
||
<code class="sig-name descname">get</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.get" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>If the specified key is on this handler, return the instanced buff. Otherwise return None.
|
||
You should delete this when you’re done with it, so that garbage collection doesn’t have to.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>key</strong> – The key for the buff you wish to get</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.get_all">
|
||
<code class="sig-name descname">get_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.get_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.get_all" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns a dictionary of instanced buffs (all of them) on this handler in the format {buffkey: instance}</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_type">
|
||
<code class="sig-name descname">get_by_type</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">buff</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#evennia.contrib.rpg.buffs.buff.BaseBuff" title="evennia.contrib.rpg.buffs.buff.BaseBuff">evennia.contrib.rpg.buffs.buff.BaseBuff</a></span></em>, <em class="sig-param"><span class="n">to_filter</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/rpg/buffs/buff.html#BuffHandler.get_by_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_type" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Finds all buffs matching the given type.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>buff</strong> – The buff class to search for</p></li>
|
||
<li><p><strong>to_filter</strong> – (optional) A dictionary you wish to slice. If not provided, uses the whole buffcache.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns a dictionary of instanced buffs of the specified type in the format {buffkey: instance}.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_stat">
|
||
<code class="sig-name descname">get_by_stat</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">stat</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">to_filter</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/rpg/buffs/buff.html#BuffHandler.get_by_stat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_stat" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Finds all buffs which contain a Mod object that modifies the specified stat.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>stat</strong> – The string identifier to find relevant mods</p></li>
|
||
<li><p><strong>to_filter</strong> – (optional) A dictionary you wish to slice. If not provided, uses the whole buffcache.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns a dictionary of instanced buffs which modify the specified stat in the format {buffkey: instance}.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_trigger">
|
||
<code class="sig-name descname">get_by_trigger</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trigger</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">to_filter</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/rpg/buffs/buff.html#BuffHandler.get_by_trigger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_trigger" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Finds all buffs with the matching string in their triggers.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>trigger</strong> – The string identifier to find relevant buffs</p></li>
|
||
<li><p><strong>to_filter</strong> – (optional) A dictionary you wish to slice. If not provided, uses the whole buffcache.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns a dictionary of instanced buffs which fire off the designated trigger, in the format {buffkey: instance}.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_source">
|
||
<code class="sig-name descname">get_by_source</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source</span></em>, <em class="sig-param"><span class="n">to_filter</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/rpg/buffs/buff.html#BuffHandler.get_by_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_source" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Find all buffs with the matching source.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>source</strong> – The source you want to filter buffs by</p></li>
|
||
<li><p><strong>to_filter</strong> – (optional) A dictionary you wish to slice. If not provided, uses the whole buffcache.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns a dictionary of instanced buffs which came from the provided source, in the format {buffkey: instance}.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_cachevalue">
|
||
<code class="sig-name descname">get_by_cachevalue</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><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">to_filter</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/rpg/buffs/buff.html#BuffHandler.get_by_cachevalue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.get_by_cachevalue" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Find all buffs with a matching {key: value} pair in its cache. Allows you to search buffs by arbitrary cache values</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> – The key of the cache value to check</p></li>
|
||
<li><p><strong>value</strong> – (optional) The value to match to. If None, merely checks to see if the value exists</p></li>
|
||
<li><p><strong>to_filter</strong> – (optional) A dictionary you wish to slice. If not provided, uses the whole buffcache.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns a dictionary of instanced buffs with cache values matching the specified value, in the format {buffkey: instance}.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.has">
|
||
<code class="sig-name descname">has</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">buff</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span> → bool<a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.has"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.has" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Checks if the specified buff type or key exists on the handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>buff</strong> – The buff to search for. This can be a string (the key) or a class reference (the buff type)</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns a bool. If no buff and no key is specified, returns False.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.check">
|
||
<code class="sig-name descname">check</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">value</span><span class="p">:</span> <span class="n">float</span></em>, <em class="sig-param"><span class="n">stat</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">loud</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">context</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">trigger</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">strongest</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.check" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Finds all buffs and perks related to a stat and applies their effects.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>value</strong> – The value you intend to modify</p></li>
|
||
<li><p><strong>stat</strong> – The string that designates which stat buffs you want</p></li>
|
||
<li><p><strong>loud</strong> – (optional) Call the buff’s at_post_check method after checking (default: True)</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_pre_check/at_post_check and conditional methods as kwargs</p></li>
|
||
<li><p><strong>trigger</strong> – (optional) Trigger buffs with the <strong>stat</strong> string as well. (default: False)</p></li>
|
||
<li><p><strong>strongest</strong> – (optional) Applies only the strongest mods of the corresponding stat value (default: False)</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns the value modified by relevant buffs.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.trigger">
|
||
<code class="sig-name descname">trigger</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trigger</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">context</span><span class="p">:</span> <span class="n">dict</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/rpg/buffs/buff.html#BuffHandler.trigger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.trigger" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Calls the at_trigger method on all buffs with the matching trigger.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>trigger</strong> – The string identifier to find relevant buffs. Passed to the at_trigger method.</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_trigger method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.pause">
|
||
<code class="sig-name descname">pause</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.pause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.pause" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Pauses the buff. This excludes it from being checked for mods, triggered, or cleaned up. Used to make buffs ‘playtime’ instead of ‘realtime’.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> – The key for the buff you wish to pause</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_pause method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.unpause">
|
||
<code class="sig-name descname">unpause</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.unpause"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.unpause" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Unpauses a buff. This makes it visible to the various buff systems again.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> – The key for the buff you wish to pause</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_unpause method as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.view">
|
||
<code class="sig-name descname">view</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">to_filter</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span> → dict<a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.view"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.view" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns a buff flavor text as a dictionary of tuples in the format {key: (name, flavor)}. Common use for this is a buff readout of some kind.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>to_filter</strong> – (optional) The dictionary of buffs to iterate over. If none is provided, returns all buffs (default: None)</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.view_modifiers">
|
||
<code class="sig-name descname">view_modifiers</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">stat</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">context</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/rpg/buffs/buff.html#BuffHandler.view_modifiers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.view_modifiers" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Checks all modifiers of the specified stat without actually applying them. Hits the conditional hook for relevant buffs.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>stat</strong> – The mod identifier string to search for</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the conditional hooks as kwargs</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Returns a nested dictionary. The first layer’s keys represent the type of modifier (‘add’ and ‘mult’),
|
||
and the second layer’s keys represent the type of value (‘total’ and ‘strongest’).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffHandler.cleanup">
|
||
<code class="sig-name descname">cleanup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffHandler.cleanup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffHandler.cleanup" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Removes expired buffs, ensures pause state is respected.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffableProperty">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">BuffableProperty</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">default</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">category</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">strattr</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">lockstring</span><span class="o">=</span><span class="default_value">''</span></em>, <em class="sig-param"><span class="n">autocreate</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffableProperty"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffableProperty" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.typeclasses.attributes.html#evennia.typeclasses.attributes.AttributeProperty" title="evennia.typeclasses.attributes.AttributeProperty"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.typeclasses.attributes.AttributeProperty</span></code></a></p>
|
||
<p>An example of a way you can extend AttributeProperty to create properties that automatically check buffs for you.</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.BuffableProperty.at_get">
|
||
<code class="sig-name descname">at_get</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">value</span></em>, <em class="sig-param"><span class="n">obj</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#BuffableProperty.at_get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.BuffableProperty.at_get" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The value returned from the Attribute is passed through this method. It can be used
|
||
to react to the retrieval or modify the result in some way.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>value</strong> (<em>any</em>) – Value returned from the Attribute.</p></li>
|
||
<li><p><strong>obj</strong> (<em>object</em>) – Object the attribute is attached to</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p><em>any</em> – The value to return to the caller.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This is will only fire if you actually get the Attribute via this <strong>AttributeProperty</strong>.
|
||
That is, if you instead get it via the <strong>AttributeHandler</strong> (or via <strong>.db</strong>), you are
|
||
bypassing this <strong>AttributeProperty</strong> entirely and this method is never reached.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">CmdBuff</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/rpg/buffs/buff.html#CmdBuff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff" 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>Buff a target.</p>
|
||
<dl class="simple">
|
||
<dt>Usage:</dt><dd><p>buff <target> <buff></p>
|
||
</dd>
|
||
</dl>
|
||
<p>Applies the specified buff to the target. All buffs are defined in the bufflist dictionary on this command.</p>
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = 'buff'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff.aliases">
|
||
<code class="sig-name descname">aliases</code><em class="property"> = []</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.aliases" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff.lock_storage">
|
||
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.lock_storage" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff.search_index_entry">
|
||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'builder', 'key': 'buff', 'no_prefix': ' ', 'tags': '', 'text': '\n Buff a target.\n\n Usage:\n buff <target> <buff>\n\n Applies the specified buff to the target. All buffs are defined in the bufflist dictionary on this command.\n '}</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff.help_category">
|
||
<code class="sig-name descname">help_category</code><em class="property"> = 'builder'</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.help_category" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff.bufflist">
|
||
<code class="sig-name descname">bufflist</code><em class="property"> = {'foo': <class 'evennia.contrib.rpg.buffs.buff.BaseBuff'>}</em><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.bufflist" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.CmdBuff.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/rpg/buffs/buff.html#CmdBuff.parse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.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.rpg.buffs.buff.CmdBuff.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/rpg/buffs/buff.html#CmdBuff.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.CmdBuff.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>
|
||
|
||
<dl class="py function">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.cleanup_buffs">
|
||
<code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">cleanup_buffs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#evennia.contrib.rpg.buffs.buff.BuffHandler" title="evennia.contrib.rpg.buffs.buff.BuffHandler">evennia.contrib.rpg.buffs.buff.BuffHandler</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#cleanup_buffs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.cleanup_buffs" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Cleans up all expired buffs from a handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt id="evennia.contrib.rpg.buffs.buff.tick_buff">
|
||
<code class="sig-prename descclassname">evennia.contrib.rpg.buffs.buff.</code><code class="sig-name descname">tick_buff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">handler</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#evennia.contrib.rpg.buffs.buff.BuffHandler" title="evennia.contrib.rpg.buffs.buff.BuffHandler">evennia.contrib.rpg.buffs.buff.BuffHandler</a></span></em>, <em class="sig-param"><span class="n">buffkey</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">context</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">initial</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/rpg/buffs/buff.html#tick_buff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.rpg.buffs.buff.tick_buff" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Ticks a buff. If a buff’s tickrate is 1 or larger, this is called when the buff is applied, and then once per tick cycle.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handler</strong> – The handler managing the ticking buff</p></li>
|
||
<li><p><strong>buffkey</strong> – The key of the ticking buff</p></li>
|
||
<li><p><strong>context</strong> – (optional) A dictionary you wish to pass to the at_tick method as kwargs</p></li>
|
||
<li><p><strong>initial</strong> – (optional) Whether this tick_buff call is the first one. Starts True, changes to False for future ticks</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
>index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="evennia.contrib.rpg.buffs.samplebuffs.html" title="evennia.contrib.rpg.buffs.samplebuffs"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="evennia.contrib.rpg.buffs.html" title="evennia.contrib.rpg.buffs"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 2.x</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> »</li>
|
||
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-4"><a href="evennia.contrib.html" >evennia.contrib</a> »</li>
|
||
<li class="nav-item nav-item-5"><a href="evennia.contrib.rpg.html" >evennia.contrib.rpg</a> »</li>
|
||
<li class="nav-item nav-item-6"><a href="evennia.contrib.rpg.buffs.html" >evennia.contrib.rpg.buffs</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">evennia.contrib.rpg.buffs.buff</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2023, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |