syntruth/Dice-Bag

dice with target numbers need modifiers

Garonenur opened this issue · 2 comments

it is possible to have a string '1d20 t15' to simulate a for example simple dnd-roll with a target number. But usually the dnd-rolls and other systems that use d20 have modifiers to each roll. So it would be super cool if the string '1d20+5 t15' would work, which it right now does not.

That would be nice. I'm not sure how I'd handle that in the Parser/Transform pass, but I'll look into it when I get more time.

Move something to subclass, though. Something like D20.roll(dc: 15).

In lieu if building such things into the lib, here is a quick-and-dirty example of doing this outside of the lib in a custom class:

https://github.com/syntruth/Dice-Bag/blob/master/examples/dnd.rb

Gonna close this issue, but I've added it to my todo list, because I think it would be nice to somehow have this work within DiceBag.