v1.5 #2
@ -2838,20 +2838,19 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _meditationResult(meditationData) {
|
||||
async _meditationResult(meditationRoll) {
|
||||
this.santeIncDec("fatigue", 2);
|
||||
|
||||
const signeData = RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationData.meditation, meditationData.rolled)
|
||||
if (signeData) {
|
||||
await this.createEmbeddedDocuments("Item", [signeData]);
|
||||
if (meditationRoll.rolled.isSuccess) {
|
||||
await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]);
|
||||
}
|
||||
|
||||
await RdDResolutionTable.displayRollData(meditationData, this.name, 'chat-resultat-meditation.html');
|
||||
await RdDResolutionTable.displayRollData(meditationRoll, this.name, 'chat-resultat-meditation.html');
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_meditationEPart(meditationData) {
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: meditationData._id, 'data.malus': meditationData.meditation.data.malus - 1 }]);
|
||||
_meditationEPart(meditationRoll) {
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'data.malus': meditationRoll.meditation.data.malus - 1 }]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ export class RdDItemMeditation {
|
||||
static calculDifficulte(rollData) {
|
||||
if (rollData.meditation) {
|
||||
// Malus permanent éventuel
|
||||
let diff = -rollData.meditation.data.malus ?? 0;
|
||||
let diff = rollData.meditation.data.malus ?? 0;
|
||||
if (!rollData.conditionMeditation.isHeure) diff -= 2;
|
||||
if (!rollData.conditionMeditation.isVeture) diff -= 2;
|
||||
if (!rollData.conditionMeditation.isComportement) diff -= 2;
|
||||
|
@ -13,25 +13,24 @@ const tableSignesIndicatifs = [
|
||||
|
||||
]
|
||||
|
||||
const DIFFICULTE_LECTURE_SIGNE_MANQUE = +11;
|
||||
|
||||
export class RdDItemSigneDraconique {
|
||||
|
||||
static prepareSigneDraconiqueMeditation(meditation, rolled) {
|
||||
if (rolled.isSuccess != undefined) {
|
||||
meditation = Misc.data(meditation);
|
||||
return {
|
||||
name: "de la " + meditation.name,
|
||||
type: "signedraconique",
|
||||
img: meditation.img,
|
||||
data: {
|
||||
typesTMR: [TMRUtility.typeTmrName(meditation.data.tmr)],
|
||||
difficulte: RdDItemSigneDraconique.getDiffSigneMeditation(rolled.code),
|
||||
ephemere: true,
|
||||
duree: "1 round",
|
||||
valeur: { "norm": 3, "sign": 5, "part": 10 }
|
||||
}
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
meditation = Misc.data(meditation);
|
||||
return {
|
||||
name: "de la " + meditation.name,
|
||||
type: "signedraconique",
|
||||
img: meditation.img,
|
||||
data: {
|
||||
typesTMR: [TMRUtility.typeTmrName(meditation.data.tmr)],
|
||||
difficulte: rolled.isSuccess ? RdDItemSigneDraconique.getDiffSigneMeditation(rolled.code) : DIFFICULTE_LECTURE_SIGNE_MANQUE,
|
||||
ephemere: true,
|
||||
duree: "1 round",
|
||||
valeur: rolled.isSuccess ? { "norm": 3, "sign": 5, "part": 10 } : { "norm": 0, "sign": 0, "part": 0 }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static getDiffSigneMeditation(code) {
|
||||
|
Loading…
Reference in New Issue
Block a user