|
1 | 1 | <template>
|
2 | 2 | <div :class="$style['content']">
|
3 | 3 | <section>
|
4 |
| - <h1>Introduction</h1> |
| 4 | + <h1>Introduction: Simple Roll API</h1> |
5 | 5 | <div>
|
6 | 6 | The WOD5E system has an API that modules and macros can use to integrate with the same functions the system itself uses. Though not every specific function is exposed, in particular probably the most useful is the diceroller code as the system uses custom dice and has its own formatting.
|
7 | 7 |
|
8 |
| - The macro on this page is a great example of that: Though it takes a little bit of constructing and calculations to get what the system needs, you can send a roll to the system's diceroller and get the outcome you need. This can be really powerful for setting up rolls that you use very often, and the roll function itself is extremely powerful too |
| 8 | + The macro on this page is a great example of that: Though it takes a little bit of constructing and calculations to get what the system needs, you can send a roll to the system's diceroller and get the outcome you need. This can be really nice for setting up rolls that you use very often, and the roll function itself is extremely powerful too, letting you do things like pre-set a difficulty, trigger other macros after the result is processed, modify things like whether hunger/rage dice effects are processed, and so on! |
| 9 | + |
| 10 | + Below, you'll find documentation about the current variables the roll function can accept. |
| 11 | + |
| 12 | +<pre class="language-javascript"><code class="language-javascript"> |
| 13 | +* basicDice (Optional, default 0) The number of 'basic' dice to roll, such as vampire, werewolf, and hunter dice |
| 14 | +* advancedDice (Optional, default 0) The number of 'advanced' dice to roll, such as hunger, rage and desperation dice |
| 15 | +* actor The actor that the roll is coming from |
| 16 | +* data Actor or item data to pass along with the roll |
| 17 | +* title Title of the roll for the dialog/chat message |
| 18 | +* disableBasicDice (Optional, default false) Whether to disable basic dice on this roll |
| 19 | +* disableAdvancedDice (Optional, default false) Whether to disable advanced dice on this roll |
| 20 | +* willpowerDamage (Optional, default 0) How much to damage willpower after the roll is complete |
| 21 | +* increaseHunger (Optional, default false) Whether to increase hunger on failures |
| 22 | +* decreaseRage (Optional, default false) Whether to reduce rage on failures |
| 23 | +* difficulty (Optional, default 0) The number that the roll must succeed to count as a success |
| 24 | +* flavor (Optional, default '') Text that appears in the description of the roll |
| 25 | +* callback (Optional) A callable function for determining the chat message flavor given parts and data |
| 26 | +* quickRoll (Optional, default false) Whether the roll was called to bypass the roll dialog or not |
| 27 | +* rollMode (Optional, default FVTT's current roll mode) Which roll mode the message should default as |
| 28 | +* rerollHunger (Optional, default false) Whether to reroll failed hunger dice |
| 29 | +* selectors (Optional, default []) Any selectors to use when compiling situational modifiers |
| 30 | +* macro (Optional, default '') A macro to run after the roll has been made |
| 31 | +* disableMessageOutput (optional, default false) Whether to display the message output of a roll |
| 32 | +* advancedCheckDice (optional, default 0) Any dice that, part of an 'advanced' diceset, is rolled separately but at the same time |
| 33 | +</code></pre> |
9 | 34 | </div>
|
10 | 35 | </section>
|
11 |
| - |
| 36 | + <section> |
| 37 | + <div class="collapsible-container"> |
| 38 | + <div class="collapsible-header" @click="toggleCollapse" ref="rollApiExample"> |
| 39 | + WOD5E.api.Roll Example |
| 40 | + </div> |
| 41 | + <div class="collapsible-content" ref="rollApiExample"> |
12 | 42 | <pre><code class="language-javascript">// This macro is an example of how you can access the WOD5E Roll API.
|
13 | 43 |
|
14 | 44 | // Define the actor
|
@@ -40,6 +70,9 @@ WOD5E.api.Roll({
|
40 | 70 | advancedDice
|
41 | 71 | })
|
42 | 72 | </code></pre>
|
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </section> |
43 | 76 | </div>
|
44 | 77 | </template>
|
45 | 78 |
|
|
0 commit comments