bakame-php / dice-roller

a dice roller generator in PHP
MIT License
16 stars 10 forks source link

Feature request : Count dice rolled over X or under Y #4

Closed deurk closed 4 years ago

deurk commented 4 years ago

Would it be possible to have the same syntax as the exploding conditions (<3, >5 etc) but instead of exploding the dice, just return the count of matching dice ?

/roll 4d6>3 would return { 3, 5, 1, 4 } and count = 2.

Thanks :)

nyamsprod commented 4 years ago

@deurk if you follow the Bakame\DiceRoller\Contract\Modifier nothing should prevent you from adding such modifier 😉

nyamsprod commented 4 years ago

@deurk maybe this can be also inferred from the last trace 🤔🤔 or added in the profiler 🤔🤔

nyamsprod commented 4 years ago

@deurk the package has been updated and the tracing has been re-written from scratch ... bottom line with the new tracing capability and the the Roll object what you want could be easily achieved without some simple logic.

And yes this package will NEVER be stable 😈

A better strategy is to fork it and release it for yourself 😉