From 5f68d8399b771da0f3500a5d037315607e25c78d Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 26 Apr 2020 16:31:31 +0200 Subject: Add support for OnEachValue compare method. --- HelpMe.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 5 deletions(-) (limited to 'HelpMe.md') diff --git a/HelpMe.md b/HelpMe.md index c3588b4..3f6c76f 100644 --- a/HelpMe.md +++ b/HelpMe.md @@ -397,11 +397,12 @@ There is also 2 optional parameters #### Compare method -There are 3 different methods. -* **On Each (default)**: the condition is tested on each die from the previous part of the command. \[Default method\] -* **All Of Them (`*`)**: All dice must fit the condition to trigger the true instruction. If all dice do not fit the condition the false instruction is run. -* **One Of Them (`.`)**: at least one die must fit the condition to trigger the true instruction. If no dices fit the condition the false instruction is run. -* **On Scalar (`:`)**: the condition is evaluated on the scalar result of the dice roll. +There are 4 different methods. +* **On Each**: the condition is tested on each die from the previous part of the command. \[Default method\] +* **On Each value** `?`: the condition is tested on each final value of die from the previous part of the command. +* **All Of Them** `*`: All dice must fit the condition to trigger the true instruction. If all dice do not fit the condition the false instruction is run. +* **One Of Them** `.`: at least one die must fit the condition to trigger the true instruction. If no dices fit the condition the false instruction is run. +* **On Scalar** `:`: the condition is evaluated on the scalar result of the dice roll. #### Examples: @@ -675,6 +676,59 @@ The Rolisteam Dice Parser allows you to use several logic operator: * Greater: `>` * Different: `!=` + +#### Compare methods + +As the `if` operator, you can specify the compare method. + +* **On Each**: the condition is tested on each die from the previous part of the command. \[Default method\] +* **On Each value** `?`: the condition is tested on each final value of die from the previous part of the command. +* **All Of Them** `*`: All dice must fit the condition to trigger the true instruction. If all dice do not fit the condition the false instruction is run. +* **One Of Them** `.`: at least one die must fit the condition to trigger the true instruction. If no dices fit the condition the false instruction is run. +* **On Scalar** `:`: the condition is evaluated on the scalar result of the dice roll. + +##### Examples: + +> 1L[7,8,9]c[>6] + +This command will return 0 because, no die has been rolled, so the result of `1L[7,8,9]` is a final value. + +> 1L[7,8,9]c[?>6] + +Output: 1 + +> 5d6e6sc[>=8] + +Output: +``` +0 +details: [8 [6,2] 2 1 1 1] +``` + +> 5d6e6f[?>=16] + +Output: +As the final sum is equal to 11. It's less than 16 so the filter is filtering everything. +``` +0 +details: [2 4 1 3 1] +``` + + +The final sum is higher than 16 so the whole result is accepted by the filter operator. +``` +23 +details: [3 6 3 5 6] +``` + +> 5d6e6sc[:>=8] + +Output: +``` +1 +details: [8 [6,2] 2 1 1 1] +``` + ### Operation Condition This validator offers modulo as operation and a Boolean Condition to validate the value: -- cgit v1.2.3-70-g09d2