@@ -117,7 +117,7 @@ class RollTable extends Map {
117
117
throw new TypeError ( `RollTableError[${ this . name } ]: Reference "${ reference } " Not A Number!` ) ;
118
118
}
119
119
if ( reference > this . max ) {
120
- return this . get ( this . max ) ;
120
+ return super . get ( this . max ) ;
121
121
}
122
122
for ( const [ key ] of this ) {
123
123
if ( reference <= key ) {
@@ -197,14 +197,28 @@ class RollTable extends Map {
197
197
/** @type {RandFunction } */
198
198
let fn ;
199
199
200
- if ( hasSameDigits ( max ) ) {
200
+ if ( max === 66 ) {
201
+ fn = ( ) => {
202
+ let result = mod ;
203
+ for ( let i = 0 ; i < qty ; i ++ ) result += rand ( 1 , 6 ) * 10 + rand ( 1 , 6 ) ;
204
+ return result ;
205
+ } ;
206
+ }
207
+ else if ( max === 666 ) {
208
+ fn = ( ) => {
209
+ let result = mod ;
210
+ for ( let i = 0 ; i < qty ; i ++ ) result += rand ( 1 , 6 ) * 100 + rand ( 1 , 6 ) * 10 + rand ( 1 , 6 ) ;
211
+ return result ;
212
+ } ;
213
+ }
214
+ else if ( max > 66 && hasSameDigits ( max ) ) {
201
215
// Gets the actual Base. D66 = 6; D88 = 8;
202
216
const digit = max % 10 ;
203
217
// Creates sequence for the Base <digit>
204
218
const seq = Array ( digit ) . fill ( ) . map ( ( x , n ) => n + 1 ) . join ( '' ) ;
205
219
206
220
fn = ( ) => {
207
- let result = 0 ;
221
+ let result = mod ;
208
222
for ( let i = 0 ; i < qty ; i ++ ) {
209
223
let seed = rand ( 1 , max ) ;
210
224
// Adjusts the seed.
@@ -213,14 +227,14 @@ class RollTable extends Map {
213
227
// Converts the seed into a valid reference.
214
228
result += + convertToBijective ( seed , seq ) ;
215
229
}
216
- return result + mod ;
230
+ return result ;
217
231
} ;
218
232
}
219
233
else if ( max > 0 ) {
220
234
fn = ( ) => {
221
- let result = 0 ;
235
+ let result = mod ;
222
236
for ( let i = 0 ; i < qty ; i ++ ) result += rand ( 1 , max ) ;
223
- return result + mod ;
237
+ return result ;
224
238
} ;
225
239
}
226
240
else {
0 commit comments