Changes as per review.
Missing: - Open discussion on "test value" renames - docs - open discussion on last-die-handling
This commit is contained in:
parent
f98da0cd99
commit
c26e4bab9f
2 changed files with 20 additions and 4 deletions
|
@ -3,18 +3,18 @@ import { RollOptions } from "./roll-data";
|
|||
export function isDiceSwapNecessary(
|
||||
critSuccesses: Array<number>,
|
||||
otherRolls: Array<number>,
|
||||
finalRollValue: number,
|
||||
lastTestValue: number,
|
||||
): boolean {
|
||||
if (critSuccesses.length == 0 || otherRolls.length == 0) {
|
||||
return false;
|
||||
}
|
||||
const amountOfOtherRolls = otherRolls.length;
|
||||
const lastDice = otherRolls[amountOfOtherRolls - 1];
|
||||
if (lastDice <= finalRollValue) {
|
||||
if (lastDice <= lastTestValue) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return lastDice + finalRollValue > 20;
|
||||
return lastDice + lastTestValue > 20;
|
||||
}
|
||||
|
||||
export function isSlayingDiceRepetition(opts: RollOptions): boolean {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue