m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/dice.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/dice.js')
-rw-r--r--src/dice.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dice.js b/src/dice.js
index 828a772..abe3c4b 100644
--- a/src/dice.js
+++ b/src/dice.js
@@ -44,6 +44,12 @@ const subtract = (die1, die2) => {
}
}
+const multiply = (die1, die2) => {
+ return () => {
+ return [() => roll(die1) * roll(die2)]
+ }
+}
+
const bonusAdd = (die1, die2) => {
return () => {
return die1().map(die => {
@@ -187,6 +193,7 @@ exports.constant = constant
exports.d = d
exports.add = add
exports.subtract = subtract
+exports.multiply = multiply
exports.bonusAdd = bonusAdd
exports.bonusSubtract = bonusSubtract
exports.negative = negative