Skip to content

[Feature request]: IF Condition Evaluation on Individual Die Result #312

Description

@dweyrick

Feature request and related problem

Allows defining conditional final dice value based upon the outcome of the initial die roll. Uses the colon (:) to separate the true and false results of the IF comparison.

Normal Example: 1d8! (Roll a d8, explode on a roll of an 8)

IF Example 1: 1d8!=8 {+[strengthmod] : 0} = (Roll a d8, explode on a roll of an 8 - If any roll is an 8 (including exploded roll) then add strengthmod to the individual roll result (true statement) : if roll is NOT an 8 add zero to the individual roll result)

IF Example 2: 1d8!=8 {+[strengthmod] : -[strengthmod]} = (Roll a d8, explode on a roll of an 8 - If any roll is an 8 (including an exploded roll) then add strengthmod to the individual roll result (true statement) : if roll is NOT an 8 subtract the strengthmod from the individual roll result)

IF Example 3: 1d8>=7{+[strengthmod] : -[strengthmod]} = (Roll higher than a 7, add strengthmod to the individual roll result (true statement) : if roll is less than 7 subtract the strengthmod from the individual roll result)

Exploding dice: the IF condition would be evaluated against each individual exploded dice result, adjusting the individual roll result based on the outcome of the IF evaluation. If four 8's are rolled, each individual 8 result would be evaluated against the IF condition and the dice roll result updated accordingly (true or false adjustment).

Possible notation = {true adjustment : false adjustment} = the if statement that applies to the dice roll (maybe something besides braces should be used. If they are used, the use of the colon makes it an IF condition).

Suggested solution

Update the die roll parser to accurately evaluation an IF condition and apply an adjustment to the die roll result based on the outcome of the IF evaluation (true adjustment or false adjustment). Applied to each individual die roll - including exploded dice.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions