Fix review comments.

This commit is contained in:
Oliver Rümpelein 2021-01-08 23:46:28 +01:00
parent 25119fd9e3
commit 42868e4a83
2 changed files with 2 additions and 9 deletions

View file

@ -12,7 +12,7 @@ interface TermData {
* Implements DS4 Checks as an emulated "dice throw". * Implements DS4 Checks as an emulated "dice throw".
* *
* @notes * @notes
* Be aware that, even though this behaves like one roll, it actually throws several iones internally * Be aware that, even though this behaves like one roll, it actually throws several ones internally
* *
* @example * @example
* - Roll a check against a Check Target Number (CTV) of 18: `/r dsv18` * - Roll a check against a Check Target Number (CTV) of 18: `/r dsv18`
@ -29,7 +29,6 @@ export class DS4Check extends DiceTerm {
modifiers: termData.modifiers ?? [], modifiers: termData.modifiers ?? [],
options: termData.options ?? {}, options: termData.options ?? {},
}); });
console.log("This @ constructor: ", termData);
// Store and parse target value. // Store and parse target value.
const targetValueModifier = this.modifiers.filter((m) => m[0] === "v")[0]; const targetValueModifier = this.modifiers.filter((m) => m[0] === "v")[0];
@ -65,12 +64,8 @@ export class DS4Check extends DiceTerm {
/** /**
* @override * @override
* @param param0
*
* @private_notes This gets only called once for the first roll.
*/ */
roll({ minimize = false, maximize = false } = {}): RollResult { roll({ minimize = false, maximize = false } = {}): RollResult {
console.log(`This targetValue @ roll: ${this.targetValue}`);
const rollResult = this.rollWithDifferentBorders({ minimize, maximize }); const rollResult = this.rollWithDifferentBorders({ minimize, maximize });
this.results.push(rollResult); this.results.push(rollResult);
if (rollResult.status == RollResultStatus.CRITICAL_SUCCESS) { if (rollResult.status == RollResultStatus.CRITICAL_SUCCESS) {

View file

@ -40,10 +40,8 @@ export function rollCheckSingleDie(
): RollResult { ): RollResult {
const usedOptions = new DefaultRollOptions().mergeWith(rollOptions); const usedOptions = new DefaultRollOptions().mergeWith(rollOptions);
if (dice == null || dice.length != 1) { if (dice?.length != 1) {
console.error(`Rolled a dice. Target: ${checkTargetValue}`);
dice = [new DS4RollProvider().getNextRoll()]; dice = [new DS4RollProvider().getNextRoll()];
console.log(dice);
} }
const usedDice = dice; const usedDice = dice;
const rolledDie = usedDice[0]; const rolledDie = usedDice[0];