mirror of
https://github.com/evennia/evennia.git
synced 2026-03-19 06:16:31 +01:00
204 lines
No EOL
9.7 KiB
HTML
204 lines
No EOL
9.7 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>Clothing — Evennia 1.0-dev 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>
|
||
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "tex2jax_process|mathjax_process|math|output_area"}})</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" />
|
||
</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="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Clothing</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section class="tex2jax_ignore mathjax_ignore" id="clothing">
|
||
<h1>Clothing<a class="headerlink" href="#clothing" title="Permalink to this headline">¶</a></h1>
|
||
<p>Contribution by Tim Ashley Jenkins, 2017</p>
|
||
<p>Provides a typeclass and commands for wearable clothing. These
|
||
look of these clothes are appended to the character’s description when worn.</p>
|
||
<p>Clothing items, when worn, are added to the character’s description
|
||
in a list. For example, if wearing the following clothing items:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>a thin and delicate necklace
|
||
a pair of regular ol' shoes
|
||
one nice hat
|
||
a very pretty dress
|
||
</pre></div>
|
||
</div>
|
||
<p>Would result in this added description:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Tim is wearing one nice hat, a thin and delicate necklace,
|
||
a very pretty dress and a pair of regular ol' shoes.
|
||
</pre></div>
|
||
</div>
|
||
<section id="installation">
|
||
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
|
||
<p>To install, import this module and have your default character
|
||
inherit from ClothedCharacter in your game’s <a class="reference external" href="http://characters.py">characters.py</a> file:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>
|
||
<span class="kn">from</span> <span class="nn">evennia.contrib.game_systems.clothing</span> <span class="kn">import</span> <span class="n">ClothedCharacter</span>
|
||
|
||
<span class="k">class</span> <span class="nc">Character</span><span class="p">(</span><span class="n">ClothedCharacter</span><span class="p">):</span>
|
||
|
||
</pre></div>
|
||
</div>
|
||
<p>And then add <code class="docutils literal notranslate"><span class="pre">ClothedCharacterCmdSet</span></code> in your character set in
|
||
<code class="docutils literal notranslate"><span class="pre">mygame/commands/default_cmdsets.py</span></code>:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>
|
||
<span class="kn">from</span> <span class="nn">evennia.contrib.game_systems.clothing</span> <span class="kn">import</span> <span class="n">ClothedCharacterCmdSet</span> <span class="o"><--</span>
|
||
|
||
<span class="k">class</span> <span class="nc">CharacterCmdSet</span><span class="p">(</span><span class="n">default_cmds</span><span class="o">.</span><span class="n">CharacterCmdSet</span><span class="p">):</span>
|
||
<span class="c1"># ...</span>
|
||
<span class="n">at_cmdset_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
||
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">at_cmdset_creation</span><span class="p">()</span>
|
||
<span class="o">...</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ClothedCharacterCmdSet</span><span class="p">)</span> <span class="c1"># <--</span>
|
||
|
||
</pre></div>
|
||
</div>
|
||
<p>From here, you can use the default builder commands to create clothes
|
||
with which to test the system:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>create a pretty shirt : evennia.contrib.game_systems.clothing.Clothing
|
||
set shirt/clothing_type = 'top'
|
||
wear shirt
|
||
</pre></div>
|
||
</div>
|
||
<p>A character’s description may look like this:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Superuser(#1)
|
||
This is User #1.
|
||
|
||
Superuser is wearing one nice hat, a thin and delicate necklace,
|
||
a very pretty dress and a pair of regular ol' shoes.
|
||
</pre></div>
|
||
</div>
|
||
<p>Characters can also specify the style of wear for their clothing - I.E.
|
||
to wear a scarf ‘tied into a tight knot around the neck’ or ‘draped
|
||
loosely across the shoulders’ - to add an easy avenue of customization.
|
||
For example, after entering:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>wear scarf draped loosely across the shoulders
|
||
</pre></div>
|
||
</div>
|
||
<p>The garment appears like so in the description:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Superuser(#1)
|
||
This is User #1.
|
||
|
||
Superuser is wearing a fanciful-looking scarf draped loosely
|
||
across the shoulders.
|
||
</pre></div>
|
||
</div>
|
||
<p>Items of clothing can be used to cover other items, and many options
|
||
are provided to define your own clothing types and their limits and
|
||
behaviors. For example, to have undergarments automatically covered
|
||
by outerwear, or to put a limit on the number of each type of item
|
||
that can be worn. The system as-is is fairly freeform - you
|
||
can cover any garment with almost any other, for example - but it
|
||
can easily be made more restrictive, and can even be tied into a
|
||
system for armor or other equipment.</p>
|
||
<hr class="docutils" />
|
||
<p><small>This document page is generated from <code class="docutils literal notranslate"><span class="pre">evennia/contrib/game_systems/clothing/README.md</span></code>. Changes to this
|
||
file will be overwritten, so edit that file rather than this one.</small></p>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
<div class="clearer"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<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>
|
||
<p><h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">Clothing</a><ul>
|
||
<li><a class="reference internal" href="#installation">Installation</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/Contribs/Contrib-Clothing.md.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div><h3>Links</h3>
|
||
<ul>
|
||
<li><a href="https://www.evennia.com">Home page</a> </li>
|
||
<li><a href="https://github.com/evennia/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>Versions</h3>
|
||
<ul>
|
||
<li><a href="Contrib-Clothing.html">1.0-dev (develop branch)</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></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="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Clothing</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2020, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |