modules/dice/pool.js
/**
   * Upgrade the dice pool's difficulty, converting any remaining difficulty dice
   * into challenge dice or adding an difficulty die if none remain.
   * @param times the number of times to perform this operation, defaults to 1
   */
Upgrade the dice pool's difficulty, converting any remaining difficulty dice
into challenge dice or adding an difficulty die if none remain.
@param times the number of times to perform this operation, defaults to 1
Upgrade the dice pool ' s difficulty converting any remaining difficulty dice into challenge dice or adding an difficulty die if none remain . @param times the number of times to perform this operation defaults to 1
upgradeDifficulty(times) {
    if (times === undefined) {
      times = 1;
    }
    let downgrade = false;
    if (times < 0) {
      downgrade = true;
      times = Math.abs(times);
    }
    for (let i = 0; i < times; i++) {
      if (downgrade) {
        if (this.challenge > 0) {
          this.challenge--;
          this.difficulty++;
        }
      } else {
        if (this.difficulty > 0) {
          this.difficulty--;
          this.challenge++;
        } else {
          this.difficulty++;
        }
      }
    }
  }
upgradeDifficulty ( times ) { if ( times === undefined ) { times = 1 ; } let downgrade = false ; if ( times < 0 ) { downgrade = true ; times = Math . abs ( times ) ; } for ( let i = 0 ; i < times ; i ++ ) { if ( downgrade ) { if ( this . challenge > 0 ) { this . challenge -- ; this . difficulty ++ ; } } else { if ( this . difficulty > 0 ) { this . difficulty -- ; this . challenge ++ ; } else { this . difficulty ++ ; } } } }
Upgrade the dice pool's difficulty, converting any remaining difficulty dice
 into challenge dice or adding an difficulty die if none remain.
Upgrade the dice pool ' s difficulty converting any remaining difficulty dice into challenge dice or adding an difficulty die if none remain .