Ajouter de "jet de dés" dans les descriptions,
On peut maintenant ajouter des liens dans les descriptions (acteurs, items) et autres champs similaires.
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { RdDTextEditor } from "../apps/rdd-text-roll.js";
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
@ -47,6 +48,7 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
|
||||
}
|
||||
}], { renderSheet: true })
|
||||
)
|
||||
this.html.find('.roll-carac-competence').click(async event => await RdDTextEditor.rollText(event, this.actor))
|
||||
|
||||
if (this.options.vueDetaillee) {
|
||||
// On carac change
|
||||
|
@ -22,6 +22,7 @@ import { RdDCombat } from "../rdd-combat.js";
|
||||
import { RdDEmpoignade } from "../rdd-empoignade.js";
|
||||
import { RdDPossession } from "../rdd-possession.js";
|
||||
import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, POSSESSION_SANS_DRACONIC } from "../item/base-items.js";
|
||||
import { RollDataAjustements } from "../rolldata-ajustements.js";
|
||||
|
||||
/**
|
||||
* Classe de base pour les acteurs disposant de rêve (donc, pas des objets)
|
||||
@ -293,6 +294,38 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
createCallbackAppelAuMoral() { return this.createEmptyCallback(); }
|
||||
async _onCloseRollDialog(html) { }
|
||||
|
||||
/**
|
||||
* Méthode pour faire un jet prédéterminer sans ouvrir la fenêtre de dialogue
|
||||
* @param {*} caracName code ou label de la caractéristique. On peut utiliser 'intel' pour Intellect.
|
||||
* @param {*} compName nom de compétence ou nom abrégé.
|
||||
* @param {*} diff difficulté (0 si undefined)
|
||||
* @param {*} options
|
||||
* @returns le jet effectué
|
||||
*/
|
||||
async doRollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||
const carac = this.getCaracByName(caracName);
|
||||
if (!carac) {
|
||||
ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`)
|
||||
return
|
||||
}
|
||||
const competence = this.getCompetence(compName);
|
||||
let rollData = {
|
||||
alias: this.getAlias(),
|
||||
caracValue: Number(carac.value),
|
||||
selectedCarac: carac,
|
||||
competence: competence,
|
||||
diffLibre: diff ?? 0,
|
||||
show: { title: options?.title ?? '' }
|
||||
}
|
||||
RollDataAjustements.calcul(rollData, this);
|
||||
await RdDResolutionTable.rollData(rollData);
|
||||
this.gererExperience(rollData);
|
||||
await RdDResolutionTable.displayRollData(rollData, this)
|
||||
return rollData.rolled;
|
||||
}
|
||||
|
||||
gererExperience(rollData) { }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async roll() {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
|
@ -5,6 +5,7 @@ import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
import { Monnaie } from "../item-monnaie.js";
|
||||
import { RdDItem, ITEM_TYPES } from "../item.js";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
import { RdDTextEditor } from "../apps/rdd-text-roll.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
@ -35,8 +36,8 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
img: this.actor.img,
|
||||
name: this.actor.name,
|
||||
system: this.actor.system,
|
||||
description: await TextEditor.enrichHTML(this.actor.system.description, { async: true }),
|
||||
notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }),
|
||||
description: await RdDTextEditor.enrichHTML(this.actor.system.description),
|
||||
notesmj: await RdDTextEditor.enrichHTML(this.actor.system.notesmj),
|
||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable),
|
||||
effects: this.actor.effects
|
||||
}
|
||||
|
Reference in New Issue
Block a user