This repository has been archived by the owner on Nov 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.html
171 lines (164 loc) · 11.9 KB
/
api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>System API — WOD5E Docs 1.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=9869c777" />
<link rel="stylesheet" type="text/css" href="_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css?v=0a3b3ea7" />
<script src="_static/documentation_options.js?v=8d563738"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/design-tabs.js?v=36754332"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Bonuses & Modifiers" href="bonuses.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="bonuses.html" title="Bonuses & Modifiers"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">WOD5E Docs 1.0.0 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">System API</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="system-api">
<h1>System API<a class="headerlink" href="#system-api" title="Link to this heading">¶</a></h1>
<p>The World of Darkness 5e system has an API accessible to modules, macros, and the user’s own console which allows a great amount of control over how you can interact with the system and its functions.</p>
<section id="wod5e-api-roll-object">
<h2>WOD5E.api.Roll (<em>Object</em>)<a class="headerlink" href="#wod5e-api-roll-object" title="Link to this heading">¶</a></h2>
<p>A function that handles all rolls sent to the WOD5E system. WOD5E.api.Roll requires an object that can have any of the following parameters supplied to help construct and handle the ensuing roll.</p>
<p>All of the below parameters are technically optional, but for a roll to be made in the chat, you must at least include basicDice, advancedDice, or willpowerDamage.</p>
<ul class="simple">
<li><p><strong>basicDice</strong> (<em>Integer, optional, default 0</em>) The number of ‘basic’ dice to roll, such as v(ampire), w(erewolf), and h(unter) dice</p></li>
<li><p><strong>advancedDice</strong> (<em>Integer, optional, default 0</em>) The number of ‘advanced’ dice to roll, such as (hun)g(er), r(age) and (de)s(peration) dice</p></li>
<li><p><strong>actor</strong> (<em>Object, optional, default to speaker actor</em>) The actor that the roll is coming from</p></li>
<li><p><strong>data</strong> (<em>Object, optional, default actor.system</em>) Actor or item data to pass along with the roll</p></li>
<li><p><strong>title</strong> (<em>String, optional, default “Rolling”</em>) Title of the roll for the dialog/chat message</p></li>
<li><p><strong>disableBasicDice</strong> (<em>Boolean, optional, default false</em>) Whether to disable basic dice on this roll</p></li>
<li><p><strong>disableAdvancedDice</strong> (<em>Boolean, optional, default false</em>) Whether to disable advanced dice on this roll</p></li>
<li><p><strong>willpowerDamage</strong> (<em>Integer, optional, default 0</em>) How much to damage willpower after the roll is complete</p></li>
<li><p><strong>increaseHunger</strong> (<em>Boolean, optional, default false</em>) Whether to increase hunger on failures</p></li>
<li><p><strong>decreaseRage</strong> (<em>Boolean, optional, default false</em>) Whether to reduce rage on failures</p></li>
<li><p><strong>difficulty</strong> (<em>Integer, optional, default 0</em>) The number that the roll must succeed to count as a success</p></li>
<li><p><strong>flavor</strong> (<em>String, optional, default ‘’</em>) Text that appears in the description of the roll</p></li>
<li><p><strong>callback</strong> (<em>Function, optional</em>) A callable function for determining the chat message flavor given parts and data</p></li>
<li><p><strong>quickRoll</strong> (<em>Boolean, optional, default false</em>) Whether the roll was called to bypass the roll dialog or not</p></li>
<li><p><strong>rollMode</strong> (<em>String, optional, default FVTT’s current roll mode</em>) Which roll mode the message should default as</p></li>
<li><p><strong>rerollHunger</strong> (<em>Boolean, optional, default false</em>) Whether to reroll failed hunger dice</p></li>
<li><p><strong>selectors</strong> (<em>Array, optional, default []</em>) Any selectors to use when compiling situational modifiers</p></li>
<li><p><strong>macro</strong> (<em>String, optional, default ‘’</em>) A macro to run after the roll has been made</p></li>
</ul>
</section>
<section id="wod5e-api-getbasicdice-object">
<h2>WOD5E.api.getBasicDice (<em>Object</em>)<a class="headerlink" href="#wod5e-api-getbasicdice-object" title="Link to this heading">¶</a></h2>
<p>A function that handles getting the appropriate number of basic dice for a roll, by grabbing the values of any given paths and adding them up as the total number returned, plus an optional flat modifier. For example, if valuePaths is equal to [‘disciplines.animalism.value’, ‘skills.athletics.value’], it would total up the actor’s Animalism and Athletics and return them as an integer.</p>
<p>This is meant to be used to retrieve the value for the <strong>basicDice</strong> property on WOD5E.api.Roll. If advancedDice are used, it’s a good idea to retrieve the number of advancedDice first and then subtract the number of advancedDice from the total number of basicDice before providing it to the Roll function.</p>
<ul class="simple">
<li><p><strong>valuePaths</strong> (<em>Array, optional, default to []</em>) An array of paths to retrieve the modifiers from</p></li>
<li><p><strong>flatMod</strong> (<em>Integer, optional, default to 0</em>) The flat modifier to add to the total number of basicDice</p></li>
<li><p><strong>actor</strong> (<em>Object, optional, default to speaker actor</em>) The actor that is being looked up</p></li>
</ul>
</section>
<section id="wod5e-api-getadvanceddice-object">
<h2>WOD5E.api.getAdvancedDice (<em>Object</em>)<a class="headerlink" href="#wod5e-api-getadvanceddice-object" title="Link to this heading">¶</a></h2>
<p>A function to get what the advanced dice of the actor’s roll should be and total to based on the provided actor’s gamesystem.</p>
<p>This is meant to be used to retrieve the value for the <strong>advancedDice</strong> property on WOD5E.api.Roll.</p>
<ul class="simple">
<li><p><strong>actor</strong> (<em>Object, optional, default to speaker actor</em>) The actor that is being looked up</p></li>
</ul>
</section>
<section id="wod5e-api-getflavordescription-object">
<h2>WOD5E.api.getFlavorDescription (<em>Object</em>)<a class="headerlink" href="#wod5e-api-getflavordescription-object" title="Link to this heading">¶</a></h2>
<p>A function that handles getting the description of a roll by providing a path. For example, “disciplines.animalism.description” would pull the description for the Animalism discipline and add it to the roll.</p>
<p>This is meant to be used to retrieve the value for the <strong>flavor</strong> property on WOD5E.api.Roll.</p>
<ul class="simple">
<li><p><strong>valuePath</strong> (<em>String, optional, default ‘’</em>) The path to a description</p></li>
<li><p><strong>data</strong> (<em>Object, optional, default {}</em>) The data object to look through for the valuePath, such as an item.system or actor.system object</p></li>
</ul>
</section>
<section id="wod5e-api-generatelabelandlocalize-string">
<h2>WOD5E.api.generateLabelAndLocalize (<em>String</em>)<a class="headerlink" href="#wod5e-api-generatelabelandlocalize-string" title="Link to this heading">¶</a></h2>
<p>A function that takes a given string and returns the localized version of it. For example, doing WOD5E.api.generateLabelAndLocalize(‘auspex’) will automatically localize it into “Auspex” without having to supply it as “WOD5E.api.VTM.Auspex” or the like.</p>
<p>If you already know the string path to localization, it might be better to use Foundry’s in-built localization. However, getLabelAndLocalize is good if you <em>don’t</em> know the string path, such as if you have a combined list of skills and attributes, or are taking data that may include mixed lists.</p>
</section>
<section id="wod5e-api-migrateworld">
<h2>WOD5E.api.migrateWorld ()<a class="headerlink" href="#wod5e-api-migrateworld" title="Link to this heading">¶</a></h2>
<p>A function that can be used in order to manually re-migrate the world. Useful if some actors didn’t migrate properly or the migration didn’t go off at all.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">System API</a><ul>
<li><a class="reference internal" href="#wod5e-api-roll-object">WOD5E.api.Roll (<em>Object</em>)</a></li>
<li><a class="reference internal" href="#wod5e-api-getbasicdice-object">WOD5E.api.getBasicDice (<em>Object</em>)</a></li>
<li><a class="reference internal" href="#wod5e-api-getadvanceddice-object">WOD5E.api.getAdvancedDice (<em>Object</em>)</a></li>
<li><a class="reference internal" href="#wod5e-api-getflavordescription-object">WOD5E.api.getFlavorDescription (<em>Object</em>)</a></li>
<li><a class="reference internal" href="#wod5e-api-generatelabelandlocalize-string">WOD5E.api.generateLabelAndLocalize (<em>String</em>)</a></li>
<li><a class="reference internal" href="#wod5e-api-migrateworld">WOD5E.api.migrateWorld ()</a></li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="bonuses.html"
title="previous chapter">Bonuses & Modifiers</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/api.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<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" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</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="bonuses.html" title="Bonuses & Modifiers"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">WOD5E Docs 1.0.0 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">System API</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2024, Veilza.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
</div>
</body>
</html>