swade-mb-helpers/packs/module-docs/_source/API_Documentation_Q4iS1LIiyy7acuaF.json
Mike Bloy 6ed989c4bc several changes that were not properly split up
- Macro: Request fear check specialization macro
- Macro: Fear Table to call the new fearTable api endpoint
- API: rulesVersion property
- API: fearTable(actor) calls the relevant premium core rules module's fear
  table
- API: added requestFearRollFromTokens special helper
- Trait roll hooks for:
    - Glow/Shroud
    - Range modifiers
- added a summary chat message for the roll results to requested rolls.
- added a target number option to requested rolls.
2023-12-23 22:50:15 -06:00

236 lines
10 KiB
JSON

{
"name": "API Documentation",
"pages": [
{
"sort": 100000,
"name": "Accessing the API",
"type": "text",
"_id": "Q4WPDTxUW6te0td1",
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<p>The swade-mb-helpers API can be accessed in a macro with the following line of code:</p><p></p><pre><code>const api = game.modules.get('swade-mb-helpers').api</code></pre><p></p><p>The name 'api' will be used for all examples but the variable name within your macro doesn't matter.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"system": {},
"ownership": {
"default": -1,
"R9ZgY0IvWl8ovIuT": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.2",
"coreVersion": "11.315",
"createdTime": 1700438788646,
"modifiedTime": 1700438788646,
"lastModifiedBy": "R9ZgY0IvWl8ovIuT"
},
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.Q4WPDTxUW6te0td1"
},
{
"sort": 200000,
"name": "api.powerEffects",
"type": "text",
"_id": "X0rGr7qO1SRHwy9q",
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<pre><code>async function powerEffects (options = {})</code></pre><p></p><p>powerEffects is the dispatcher behind all of the power effects in swade-mb-helpers. It will parse the options to handle power dialogs and effects for every currently handled power effect within this module.</p><p></p><h2>Parameters</h2><p>The only parameter is the options parameter detailed below</p><h2><br />Options</h2><p>the options object has the following fields:</p><ul><li><p>token: a single token, the token that is initiating the power</p></li><li><p>targets: if appropriate to the power, a list of zero or more targets of the power</p></li><li><p>item: (optional) especially handy when used as an item macro effect, this is the item (power object) representing the power to find and handle</p></li><li><p>name: (optional) the name of the power to find and handle.</p></li></ul><p>One of 'item' or 'name' must be set.</p><p></p><h2>Returns</h2><p>There is no return value for this function.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"system": {},
"ownership": {
"default": -1,
"R9ZgY0IvWl8ovIuT": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.2",
"coreVersion": "11.315",
"createdTime": 1700439000261,
"modifiedTime": 1700439000261,
"lastModifiedBy": "R9ZgY0IvWl8ovIuT"
},
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.X0rGr7qO1SRHwy9q"
},
{
"sort": 300000,
"name": "api.requestRollFromTokens",
"type": "text",
"_id": "zvPWCYx402kk2hsE",
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<pre><code>async function requestRollFromTokens (tokens, rollType, rollDesc, options = {})</code></pre><p></p><p>This will request a roll from the tokens given using socketlib to request the roll from the currently logged on owner of the token.</p><p></p><h2>Parameters</h2><ul><li><p>tokens: The list of tokens to request from</p></li><li><p>rollType: one of the strings 'attribute' or 'skill'</p></li><li><p>rollDesc: the name of the trait being requested</p></li><li><p>options: detailed below</p></li></ul><p></p><h2>Options</h2><p>The options object can be completely empty, but can have any or all of the following optional fields:</p><ul><li><p>title: The title for the roll dialog, if the default is not required. For the aid of those rolling for multiple tokens, the token's name will be appended to the title</p></li><li><p>flavour: flavour text for the roll chat card. If unspecified, the title text will be used. (it's spelled flavour to match the SWADE system. \"flavor\" is also accepted.</p></li><li><p>targetNumber: a target number. Defaults to 4, should be an integer</p></li><li><p>mods: a list of roll modifiers represented as objects of the following fields:</p><ul><li><p>label: Label for the modifier</p></li><li><p>value: a positive or negative number, the value of the roll modifier</p></li><li><p>ignore: an optional boolean which, if true, means that the modifier's ignore checkbox will be checked by default</p></li></ul></li><li><p>modCallback: a function that takes a token as parameter, and returns an array of modifiers as listed above. This will be run for each token and the individual token's mod list will have the resulting list of modifiers appended to the list from 'mods' above.</p></li></ul><h2>Returns</h2><p>The return value is a list of promises which, if fulfilled, are the resulting roll objects from the token's rolls.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"system": {},
"ownership": {
"default": -1,
"R9ZgY0IvWl8ovIuT": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.5",
"coreVersion": "11.315",
"createdTime": 1700439709611,
"modifiedTime": 1703375940967,
"lastModifiedBy": "sVoCvBU1knmXzoYe"
},
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.zvPWCYx402kk2hsE"
},
{
"sort": 150000,
"name": "api.rulesVersion",
"type": "text",
"_id": "QdATvoUe4VuZrl7B",
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<p>(property) <code>rulesVersion</code></p><p>This API property gives the premium rules version that is active, preferring Savage Pathfinder over SWADE if both are active. It returns the following key depending on the active premium module, if any.</p><p></p><table><thead><tr><th><p>Active Module</p></th><th><p>Key</p></th></tr></thead><tbody><tr><td><p>Savage Pathfinder (SWPF)</p></td><td><p><code>swpf</code></p></td></tr><tr><td><p>Savage Worlds Adventure Edition (SWADE)</p></td><td><p><code>swade</code></p></td></tr><tr><td><p>None of the above (SWADE System only)</p></td><td><p><code>system</code></p></td></tr></tbody></table>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"system": {},
"ownership": {
"default": -1,
"sVoCvBU1knmXzoYe": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.5",
"coreVersion": "11.315",
"createdTime": 1703097132367,
"modifiedTime": 1703097639786,
"lastModifiedBy": "sVoCvBU1knmXzoYe"
},
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.QdATvoUe4VuZrl7B"
},
{
"sort": 500000,
"name": "api.fearTable(actor)",
"type": "text",
"_id": "oOCgnw1eVGu6Uj4U",
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<pre><code>async function fearTable (actor)</code></pre><p>The fear table API property is the fear table macro helper from whichever premium module is currently installed and active. If only the system is active and no core rules premium module is active, this will throw an exception.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"system": {},
"ownership": {
"default": -1,
"sVoCvBU1knmXzoYe": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.5",
"coreVersion": "11.315",
"createdTime": 1703097422432,
"modifiedTime": 1703097574374,
"lastModifiedBy": "sVoCvBU1knmXzoYe"
},
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.oOCgnw1eVGu6Uj4U"
},
{
"sort": 300000,
"name": "api.requestFearRollFromTokens",
"type": "text",
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<pre><code>async function requestFearRollFromTokens (tokens, options = {})</code></pre><p></p><p>This will request a fear roll from the tokens given using socketlib to request the roll from the currently logged on owner of the token. This is a special case of requestRollFromTokens.</p><p></p><h2>Parameters</h2><ul><li><p>tokens: The list of tokens to request from</p></li><li><p>options: detailed below</p></li></ul><h2>Options</h2><p>The options object can be completely empty, but can have any or all of the following optional fields:</p><ul><li><p>title: The title for the roll dialog, if the default is not required. For the aid of those rolling for multiple tokens, the token's name will be appended to the title</p></li><li><p>flavour: flavor text for the roll chat card. If unspecified, the title text will be used (it's spelled flavour because that's how the SWADE system spells it. \"flavor\" is also accepted)</p></li><li><p>fear: the fear penalty. It will do the right thing if this is positive or negative.</p></li></ul><h2>Returns</h2><p>The return value is a list of promises which, if fulfilled, are the resulting roll objects from the token's rolls.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"system": {},
"ownership": {
"default": -1,
"R9ZgY0IvWl8ovIuT": 3,
"sVoCvBU1knmXzoYe": 3
},
"flags": {},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.5",
"coreVersion": "11.315",
"createdTime": 1700439709611,
"modifiedTime": 1703375850704,
"lastModifiedBy": "sVoCvBU1knmXzoYe"
},
"_id": "J0HiPqdHqM27gwUw",
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.J0HiPqdHqM27gwUw"
}
],
"folder": null,
"ownership": {
"default": 0,
"R9ZgY0IvWl8ovIuT": 3
},
"flags": {
"core": {}
},
"_stats": {
"systemId": "swade",
"systemVersion": "3.2.5",
"coreVersion": "11.315",
"createdTime": 1700438778794,
"modifiedTime": 1703375940967,
"lastModifiedBy": "sVoCvBU1knmXzoYe"
},
"_id": "Q4iS1LIiyy7acuaF",
"sort": 100000,
"_key": "!journal!Q4iS1LIiyy7acuaF"
}