Latest version | 10.1 |
---|---|
Minimum Core | |
Compatible Core | |
Last updated | 1 year ago |
Created | 1 year ago |
Authors | |
Languages |
|
Systems | All systems |
Project source | Project URL |
Report bugs | Bug tracker URL |
This module adds logic functions to the roll formulas.
All functions operate based on the assumption that zero is false and non-zero is true. All functions return 1 for true and 0 for false. This is convenient for multiplication.
The functions include eq(a, b)
(equals) ne(a, b)
(not equal), not(a)
(negation), gt(a, b)
(a greater than b), gte(a, b)
(a greater than or equal to b), lt(a, b)
(a less than b), lte(a, b)
(a less than or equal to b), and(a, b, ...)
(all arguments are non-zero), or(a, b, ...)
some arguments are non-zero.
There is also an if function, but if is a reserved word in javascript so I had to pick something else so I settled on pick(condition, then, otherwise)
. The second and third parameter can be omitted, they will default to 1 and 0. The inverse is unless(condition, then, otherwise)
that inverts the condition, i.e. picks then
if the condition is false.
These can be used wherever rolls can be made/evaluated. If you give a dagger this damage formula 1d4 + @mod + pick(gt(@abilities.int.mod, 1), 1d12)
, the dagger will include an extra 1d12 in the damage if the user's intelligence modifier is greater than 1.
Note that the functions do not change dice rolled. All dice in the statement are always rolled, the conditionals just change which numbers are included in the final calculation. This limits their usefulness in some cases, while they are useful elsewhere.
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: logic-rolls or copy its manifest URL:
And paste it to the input box at the bottom of your window.
You can install this package directly to your Forge account.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to deliver visitors with customized advertisements based on the pages they visited before and analyze the effectiveness of the ad campaign.