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