File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6161 "moment" : " ^2.24.0" ,
6262 "mousetrap" : " ^1.6.5" ,
6363 "particles.js" : " ^2.0.0" ,
64+ "random-js" : " ^2.1.0" ,
6465 "typed.js" : " ^2.0.11"
6566 },
6667 "files" : [
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import './../node_modules/@fortawesome/fontawesome-free/js/all.js';
3232
3333export * from '@aegis-framework/artemis' ;
3434export * from 'typed.js' ;
35+ export * from 'random-js' ;
3536
3637import 'particles.js' ;
3738
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import mousetrap from 'mousetrap';
44import { FancyError } from './lib/FancyError' ;
55import merge from 'deeply' ;
66import * as package_json from './../package.json' ;
7+ import { Random , browserCrypto } from 'random-js' ;
78
89/**
910 * Every Monogatari Game is composed mainly of the following items:
@@ -2861,6 +2862,15 @@ class Monogatari {
28612862 } ) ;
28622863 } ) ;
28632864 }
2865+
2866+ static random ( min , max ) {
2867+ try {
2868+ return new Random ( browserCrypto ) . integer ( min , max ) ;
2869+ } catch ( e ) {
2870+ console . error ( e ) ;
2871+ return new Random ( ) . integer ( min , max ) ;
2872+ }
2873+ }
28642874}
28652875
28662876Monogatari . _events = {
Original file line number Diff line number Diff line change @@ -6482,6 +6482,11 @@ ramda@0.24.1:
64826482 resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857"
64836483 integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc=
64846484
6485+ random-js@^2.1.0 :
6486+ version "2.1.0"
6487+ resolved "https://registry.yarnpkg.com/random-js/-/random-js-2.1.0.tgz#0c03238b0a4f701f7a4c7303036ade3083d8ee14"
6488+ integrity sha512-CRUyWmnzmZBA7RZSVGq0xMqmgCyPPxbiKNLFA5ud7KenojVX2s7Gv+V7eB52beKTPGxWRnVZ7D/tCIgYJJ8vNQ==
6489+
64856490randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5 :
64866491 version "2.1.0"
64876492 resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
You can’t perform that action at this time.
0 commit comments