Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More functions similar to Roll20 #1

Open
DonaldTsang opened this issue Oct 6, 2018 · 1 comment
Open

More functions similar to Roll20 #1

DonaldTsang opened this issue Oct 6, 2018 · 1 comment

Comments

@DonaldTsang
Copy link

JS script that they use: https://ghostbin.com/paste/2n67m
Reference: https://wiki.roll20.net/Dice_Reference
It might be possible to remove their system from this script to make things lighter

@DonaldTsang
Copy link
Author

  • addition, subtraction, multiplication, division, modulo, exponentiation
  • floor, round, ceil, abs
    • Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).
      Macros are expanded, including nested macros up to 99 levels deep.
      Variables are substituted
      Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)
      All previous steps are repeated until there are no longer any unresolved abilities, macros, variables, or queries. This allows for nesting (e.g. putting an attribute in a macro).
      Inline rolls are executed, starting with the most deeply nested inline roll working upward. The overall result of the inline roll is substituted in place where it appeared in the formula.
      The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).

  • All Types Of Dice
    • Basic Roll of NdX
    • Fate/Fudge Roll NdF
    • Computed Dice Roll (N+Y)dX or Nd(X+Y)
  • All Roll Modifiers
    • Target Number / Successes (B,F) - CP
    • Failures (B,F) - fCP
    • Exploding Dice (B,F) !CP
    • Compounding Dice (B,F) !!CP
    • Penetrating Dice (B,F) !pCP
    • Dice Matching m and mt
    • Keep / Drop Dice (B,F) khN or klN or dhN dlN
    • Rerolling Dice (B,F) rCP
    • Sorting Dice (B,F) sa or sd
    • Order of Operations for Modifiers
      • Exploding, Compounding, Penetrating, Rerolls
        These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled
        Keep, Drop, Success, Failure, Sorting
        These are applied after all of the dice have "settled" and all of the result values are known.

  • Grouped Rolls
  • Grouped Roll Modifiers
    • Keep / Drop khN or klN or dhN or dlN
    • Target Number / Successes (B,F) CP
    • Failures (B,F) fCP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant