Add support for adventage, disadventage and emphasis rolls.

This commit is contained in:
Thomas Andres Gomez 2024-11-29 11:47:11 +01:00
parent 95122d2c99
commit 8884d047a6
3 changed files with 71 additions and 14 deletions

View file

@ -18,7 +18,14 @@ sealed class Instruction(
}
override fun toString(): String {
return "${sign.sign}${quantity}d${faces}"
return "${sign.sign}${
when (modifier) {
Modifier.ADVANTAGE -> "a"
Modifier.DISADVANTAGE -> "d"
Modifier.EMPHASIS -> "e"
null -> ""
}
}${quantity}d${faces}"
}
}