Small cleanup
- extrait de méthode pour tirage dans un array - utilisation des operateur ?: / ??
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { Grammar } from "./grammar.js";
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
const words = [ 'pore', 'pre', 'flor', 'lane', 'turlu', 'pin', 'a', 'alph', 'i', 'onse', 'iane', 'ane', 'zach', 'arri', 'ba', 'bo', 'bi',
|
||||
@ -7,9 +8,7 @@ const words = [ 'pore', 'pre', 'flor', 'lane', 'turlu', 'pin', 'a', 'alph', 'i',
|
||||
export class RdDNameGen {
|
||||
|
||||
static getName( msg, params ) {
|
||||
let max = words.length;
|
||||
let name = words[new Roll("1d"+max+" -1").roll().total];
|
||||
name += words[new Roll("1d"+max+" -1").roll().total];
|
||||
let name = Misc.upperFirst( Misc.rollOneOf(words) + Misc.rollOneOf(words) )
|
||||
//console.log(name);
|
||||
ChatMessage.create( { content: `Nom : ${name}`, whisper: ChatMessage.getWhisperRecipients("GM") } );
|
||||
}
|
||||
|
Reference in New Issue
Block a user