Rolisteam / DiceParser

Powerful dice Roller is used as discord bot, irc bot, cli tool and inside Rolisteam : 1d20+4, 1L[head,arm,leg,belly,chest], 1d6+1d8, 8+5*3
http://www.rolisteam.org/
GNU General Public License v3.0
125 stars 31 forks source link

A Multiple Success/Failure Level Dice Roll? #55

Closed JoeGans closed 4 years ago

JoeGans commented 5 years ago

Hi Guys

I wonder if someone can help with this dice roll dilemma of multiple success/failure levels?

In our game of Trudvang Chronicles RPG, the d20 is rolled against the following ...

1 (or 2 Hwitalja) = Perfect success.
≤ SV = Success.
> SV = Failure.
20 = Fatal failure.

... so, I'd like to reflect this in my dice roll, with the SV being passed as a changing parameter number?

Any refs to this at all or suggestions? I'd like the dice roll to display the txt message result, eg "Perfect success" if a 1 or 2 is rolled.

Advice/pointers appreciated ... Walts

obiwankennedy commented 5 years ago

The command you want if SV = 12

!1d20;$1i:[<=2]{"Perfect Success: $1 "}{$1i:[<=12]{"Success $1 [%2]"}{$1i:[=20]{"Fatal Failure $1"}{"Failure: $1"}}}

The macro you want:

!macro vang([0-9]+) 1d20;$1i:[<=2]{"Perfect Success: $1 "}{$1i:[<=\1]{"Success $1 [%2]"}{$1i:[=20]{"Fatal Failure $1"}{"Failure: $1"}}} 1

To call it:

!vang12

JoeGans commented 5 years ago

Fantastic, works a treat! :o]

Minor tweak, to allow for 2, 3 or more d20's all being rolled together? eg, !macro vang([0-9]+) #d20 ... pass how many d20's get rolled?

Many thanks, Walts

obiwankennedy commented 5 years ago

you want to roll several d20s, but for each you want the result?

3d20...

Sucess, Perfect Success, Failure...

or do we sum up the 3 dice ?

JoeGans commented 5 years ago

Looking for the individual results for each, so three (or more) dice would produce three (or more) results, rather than a single total ... Thanks, Walts

obiwankennedy commented 5 years ago

I fixed the issue partially. Still working on it.

obiwankennedy commented 5 years ago

Ok

This command works like a charm:

2d20i[<10]{"low"}{i[<15]{"high"}{"very high"}}

I have to test the behaviour with instructions: 2d20;$1i:[<=2]{"Perfect Success: $1 "}{$1i:[<=\1]{"Success $1 [%2]"}{$1i:[=20]{"Fatal Failure $1"}{"Failure: $1"}}}

After that, I will deploy the solution, and the fix will be available in discord.

JoeGans commented 5 years ago

Thanks Obi, your effort is greatly appreciated! ... Walts

JoeGans commented 5 years ago

OPP's, sorry about that ... too early in the morning for me! ;) Walts