2023-01-01 22:10:03 +01:00
|
|
|
import { RdDBaseActor } from "./actor/base-actor.js";
|
2024-10-16 23:18:15 +02:00
|
|
|
import { ChatUtility } from "./chat-utility.js";
|
2021-02-10 15:25:14 +01:00
|
|
|
import { Misc } from "./misc.js";
|
2021-05-11 21:45:43 +02:00
|
|
|
import { RdDDice } from "./rdd-dice.js";
|
2021-02-10 15:25:14 +01:00
|
|
|
|
2022-07-22 01:31:21 +02:00
|
|
|
const words = ['pore', 'pre', 'flor', 'lane', 'turlu', 'pin', 'a', 'alph', 'i', 'onse', 'iane', 'ane', 'zach', 'arri', 'ba', 'bo', 'bi',
|
|
|
|
'alta', 'par', 'pir', 'zor', 'zir', 'de', 'pol', 'tran', 'no', 'la', 'al', 'pul', 'one', 'ner', 'nur', 'mac', 'mery',
|
|
|
|
'cat', 'do', 'di', 'der', 'er', 'el', 'far', 'fer', 'go', 'guer', 'hot', 'jor', 'jar', 'ji', 'kri', 'ket', 'lor', 'hur',
|
|
|
|
'lar', 'lir', 'lu', 'pot', 'pro', 'pra', 'pit', 'qua', 'qui', 're', 'ral', 'sal', 'sen', 'ted', 'to', 'ta', 'lars', 'ver',
|
|
|
|
'vin', 'ov', 'wal', 'ry', 'ly', ''];
|
2021-02-10 15:25:14 +01:00
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
export class RdDNameGen {
|
|
|
|
|
2024-10-02 00:46:11 +02:00
|
|
|
static async proposeName(msg, params) {
|
2022-07-22 01:31:21 +02:00
|
|
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-command-nom.html`, {
|
2024-10-02 00:46:11 +02:00
|
|
|
nom: await RdDNameGen.generate()
|
2022-07-22 01:31:21 +02:00
|
|
|
});
|
2024-10-16 23:18:15 +02:00
|
|
|
ChatMessage.create({ content: html, whisper: ChatUtility.getGMs() });
|
2021-02-10 15:25:14 +01:00
|
|
|
}
|
|
|
|
|
2024-10-02 00:46:11 +02:00
|
|
|
static async generate() {
|
|
|
|
return Misc.upperFirst(await RdDDice.rollOneOf(words) + await RdDDice.rollOneOf(words));
|
|
|
|
}
|
|
|
|
|
2022-07-22 01:31:21 +02:00
|
|
|
static async onCreerActeur(event) {
|
|
|
|
const button = event.currentTarget;
|
2023-01-01 22:10:03 +01:00
|
|
|
await RdDBaseActor.create({
|
2022-07-22 01:31:21 +02:00
|
|
|
name: button.attributes['data-nom'].value,
|
|
|
|
type: button.attributes['data-type'].value
|
|
|
|
},
|
|
|
|
{renderSheet: true});
|
|
|
|
}
|
2021-02-10 15:25:14 +01:00
|
|
|
}
|