Merge branch 'v1.4-xp' into 'v1.4'
Fix: expérience de nouveau appliquée See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!255
This commit is contained in:
commit
46642d31a9
174
module/actor.js
174
module/actor.js
@ -57,10 +57,10 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static remoteActorCall(data) {
|
static remoteActorCall(data) {
|
||||||
if (Misc.isElectedUser()){
|
if (Misc.isElectedUser()) {
|
||||||
RdDActor.onRemoteActorCall(data);
|
RdDActor.onRemoteActorCall(data);
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_remote_actor_call", data: data });
|
game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_remote_actor_call", data: data });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -833,14 +833,14 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async updateCompetenceXP(compName, compValue) {
|
async updateCompetenceXP(compName, newXp) {
|
||||||
let comp = this.getCompetence(compName);
|
let comp = this.getCompetence(compName);
|
||||||
if (comp) {
|
if (comp) {
|
||||||
compValue = compValue ?? 0;
|
newXp = newXp ?? 0;
|
||||||
this.checkCompetenceXP(compName, compValue);
|
this.checkCompetenceXP(compName, newXp);
|
||||||
const update = { _id: comp.id, 'data.xp': compValue };
|
const update = { _id: comp.id, 'data.xp': newXp };
|
||||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||||
this.updateExperienceLog("XP Compétence", compValue, "XP attribués en " + compName);
|
this.updateExperienceLog("XP", newXp, "XP modifié en " + compName);
|
||||||
} else {
|
} else {
|
||||||
console.log("Competence not found", compName);
|
console.log("Competence not found", compName);
|
||||||
}
|
}
|
||||||
@ -854,7 +854,7 @@ export class RdDActor extends Actor {
|
|||||||
compValue = compValue ?? 0;
|
compValue = compValue ?? 0;
|
||||||
const update = { _id: comp.id, 'data.xp_sort': compValue };
|
const update = { _id: comp.id, 'data.xp_sort': compValue };
|
||||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||||
this.updateExperienceLog("XP Sort", compValue, "XP attribués en " + compName);
|
this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + compName);
|
||||||
} else {
|
} else {
|
||||||
console.log("Competence not found", compName);
|
console.log("Competence not found", compName);
|
||||||
}
|
}
|
||||||
@ -873,20 +873,22 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async updateExperienceLog( modeXP, valeurXP, raisonXP = 'Inconnue') {
|
async updateExperienceLog(modeXP, valeurXP, raisonXP = 'Inconnue') {
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
console.log( modeXP, valeurXP, raisonXP);
|
console.log(modeXP, valeurXP, raisonXP);
|
||||||
let expLog = duplicate( (Misc.templateData(this)).experiencelog );
|
let expLog = duplicate((Misc.templateData(this)).experiencelog);
|
||||||
expLog.push( { mode: Misc.upperFirst(modeXP), valeur: valeurXP, raison: Misc.upperFirst(raisonXP),
|
expLog.push({
|
||||||
daterdd : game.system.rdd.calendrier.getDateFromIndex(), datereel: `${d.getDate()}/${d.getMonth()+1}/${d.getFullYear()}` } );
|
mode: Misc.upperFirst(modeXP), valeur: valeurXP, raison: Misc.upperFirst(raisonXP),
|
||||||
await this.update({ [`data.experiencelog`]: expLog } );
|
daterdd: game.system.rdd.calendrier.getDateFromIndex(), datereel: `${d.getDate()}/${d.getMonth() + 1}/${d.getFullYear()}`
|
||||||
|
});
|
||||||
|
await this.update({ [`data.experiencelog`]: expLog });
|
||||||
console.log("Add XP log", expLog);
|
console.log("Add XP log", expLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async updateCompteurValue(fieldName, fieldValue, raison = 'Inconnue') {
|
async updateCompteurValue(fieldName, fieldValue, raison = 'Inconnue') {
|
||||||
await this.update({ [`data.compteurs.${fieldName}.value`]: fieldValue });
|
await this.update({ [`data.compteurs.${fieldName}.value`]: fieldValue });
|
||||||
if ( fieldName == 'stress') {
|
if (fieldName == 'stress') {
|
||||||
await this.updateExperienceLog('stress', fieldValue, raison);
|
await this.updateExperienceLog('stress', fieldValue, raison);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -894,9 +896,9 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async addCompteurValue(fieldName, fieldValue, raison = 'Inconnue') {
|
async addCompteurValue(fieldName, fieldValue, raison = 'Inconnue') {
|
||||||
let oldValue = (Misc.templateData(this)).compteurs[fieldName].value;
|
let oldValue = (Misc.templateData(this)).compteurs[fieldName].value;
|
||||||
await this.update({ [`data.compteurs.${fieldName}.value`]: Number(oldValue) + Number(fieldValue) } );
|
await this.update({ [`data.compteurs.${fieldName}.value`]: Number(oldValue) + Number(fieldValue) });
|
||||||
if ( fieldName == 'stress') {
|
if (fieldName == 'stress') {
|
||||||
await this.updateExperienceLog('stress', fieldValue, raison );
|
await this.updateExperienceLog('stress', fieldValue, raison);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1939,7 +1941,7 @@ export class RdDActor extends Actor {
|
|||||||
compteurs.exaltation.value = 0;
|
compteurs.exaltation.value = 0;
|
||||||
await this.update({ "data.compteurs": compteurs });
|
await this.update({ "data.compteurs": compteurs });
|
||||||
|
|
||||||
this.updateExperienceLog( 'XP', stressRollData.xp, "Transformation du stress");
|
this.updateExperienceLog('XP', stressRollData.xp, "Transformation du stress");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1974,7 +1976,7 @@ export class RdDActor extends Actor {
|
|||||||
createCallbackExperience() {
|
createCallbackExperience() {
|
||||||
return {
|
return {
|
||||||
condition: r => r.rolled.isPart && r.finalLevel < 0 && game.settings.get("core", "rollMode") != 'selfroll',
|
condition: r => r.rolled.isPart && r.finalLevel < 0 && game.settings.get("core", "rollMode") != 'selfroll',
|
||||||
action: r => this._appliquerAjoutExperience(r, game.settings.get("core", "rollMode") != 'blindroll')
|
action: r => this.appliquerAjoutExperience(r, game.settings.get("core", "rollMode") != 'blindroll')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1987,29 +1989,33 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async checkCaracXP(caracName) {
|
async checkCaracXP(caracName, display = true) {
|
||||||
let carac = Misc.templateData(this).carac[caracName];
|
let carac = RdDActor._findCaracByName(Misc.templateData(this).carac, caracName);
|
||||||
if (carac && carac.xp > 0) {
|
if (carac && carac.xp > 0) {
|
||||||
let xpNeeded = RdDCarac.getCaracNextXp(carac.value + 1);
|
const niveauSuivant = Number(carac.value) + 1;
|
||||||
|
let xpNeeded = RdDCarac.getCaracNextXp(niveauSuivant);
|
||||||
if (carac.xp >= xpNeeded) {
|
if (carac.xp >= xpNeeded) {
|
||||||
carac = duplicate(carac);
|
carac = duplicate(carac);
|
||||||
carac.value = Number(carac.value) + 1;
|
carac.value = niveauSuivant;
|
||||||
|
|
||||||
let xpData = {
|
let checkXp = {
|
||||||
alias: this.name,
|
alias: this.name,
|
||||||
carac: caracName,
|
carac: caracName,
|
||||||
value: carac.value,
|
value: niveauSuivant,
|
||||||
xp: carac.xp
|
xp: carac.xp
|
||||||
}
|
}
|
||||||
|
if (display){
|
||||||
ChatUtility.createChatMessage(this.name, "default", {
|
ChatUtility.createChatMessage(this.name, "default", {
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.html`, xpData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.html`, checkXp)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return checkXp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async checkCompetenceXP(compName, newXP = undefined) {
|
async checkCompetenceXP(compName, newXP, display = true) {
|
||||||
let compData = Misc.data(this.getCompetence(compName));
|
let compData = Misc.data(this.getCompetence(compName));
|
||||||
if (compData && newXP && newXP == compData.data.xp) { // Si édition, mais sans changement XP
|
if (compData && newXP && newXP == compData.data.xp) { // Si édition, mais sans changement XP
|
||||||
return;
|
return;
|
||||||
@ -2021,8 +2027,7 @@ export class RdDActor extends Actor {
|
|||||||
let newCompData = duplicate(compData);
|
let newCompData = duplicate(compData);
|
||||||
newCompData.data.niveau += 1;
|
newCompData.data.niveau += 1;
|
||||||
newCompData.data.xp = newXP;
|
newCompData.data.xp = newXP;
|
||||||
|
let checkXp = {
|
||||||
let xpData = {
|
|
||||||
alias: this.name,
|
alias: this.name,
|
||||||
competence: newCompData.name,
|
competence: newCompData.name,
|
||||||
niveau: newCompData.data.niveau,
|
niveau: newCompData.data.niveau,
|
||||||
@ -2030,33 +2035,30 @@ export class RdDActor extends Actor {
|
|||||||
archetype: newCompData.data.niveau_archetype,
|
archetype: newCompData.data.niveau_archetype,
|
||||||
archetypeWarning: newCompData.data.niveau > compData.data.niveau_archetype
|
archetypeWarning: newCompData.data.niveau > compData.data.niveau_archetype
|
||||||
}
|
}
|
||||||
|
if (display) {
|
||||||
ChatUtility.createChatMessage(this.name, "default", {
|
ChatUtility.createChatMessage(this.name, "default", {
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-competence-xp.html`, xpData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-competence-xp.html`, checkXp)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return checkXp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _appliquerAjoutExperience(rollData, display = true) {
|
async appliquerAjoutExperience(rollData, display) {
|
||||||
if (!this.isPersonnage()) return;
|
if (!this.isPersonnage()) return;
|
||||||
let xpResult = this.appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence);
|
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence);
|
||||||
if (display && xpResult.result) {
|
if (!xpData) {
|
||||||
let xpmsg = "<br>Points d'expérience gagnés ! Carac: " + xpResult.xpCarac + ", Comp: " + xpResult.xpCompetence;
|
return;
|
||||||
|
}
|
||||||
|
if (display) {
|
||||||
let message = {
|
let message = {
|
||||||
whisher: ChatMessage.getWhisperRecipients(["GM", this.name]),
|
whisher: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||||
content: "<strong>" + rollData.selectedCarac.label + "</strong>" + xpmsg,
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, xpData)
|
||||||
}
|
}
|
||||||
ChatMessage.create(message);
|
ChatMessage.create(message);
|
||||||
}
|
}
|
||||||
if (xpResult && xpResult.xpComp > 0 && rollData.competence) {
|
|
||||||
this.checkCompetenceXP(rollData.competence.name);
|
|
||||||
this.updateExperienceLog("XP", xpResult.xpComp,"XP en compétence "+rollData.competence.name);
|
|
||||||
}
|
|
||||||
if (xpResult && xpResult.xpCarac > 0 && rollData.selectedCarac) {
|
|
||||||
this.checkCaracXP(rollData.selectedCarac.name);
|
|
||||||
this.updateExperienceLog("XP", xpResult.xpCarac,"XP en carac "+rollData.selectedCarac.name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -2780,47 +2782,64 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async appliquerExperience(rolled, caracName, competence = undefined) {
|
async _appliquerExperience(rolled, caracName, competence) {
|
||||||
if (!this.isPersonnage()) return;
|
if (!this.isPersonnage()) return;
|
||||||
if (rolled.isPart && rolled.finalLevel < 0) {
|
// Pas d'XP
|
||||||
// Cas de désir lancinant, pas d'expérience sur particulière
|
if (!rolled.isPart || rolled.finalLevel >= 0) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
if (this.checkDesirLancinant()) {
|
if (this.checkDesirLancinant()) {
|
||||||
|
// Cas de désir lancinant, pas d'expérience sur particulière
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
content: `Vous souffrez au moins d'un Désir Lancinant, vous ne pouvez pas gagner d'expérience sur une Particulière tant que le désir n'est pas assouvi`,
|
content: `Vous souffrez au moins d'un Désir Lancinant, vous ne pouvez pas gagner d'expérience sur une Particulière tant que le désir n'est pas assouvi`,
|
||||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||||
});
|
});
|
||||||
return { result: false, xpcarac: 0, xpCompetence: 0 };
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caracName == 'Vie') caracName = 'constitution';
|
if (caracName == 'Vie') caracName = 'constitution';
|
||||||
if (caracName == 'derobee') caracName = 'agilite';
|
if (caracName == 'derobee') caracName = 'agilite';
|
||||||
if (caracName == 'reve-actuel') caracName = 'reve';
|
if (caracName == 'reve-actuel') caracName = 'reve';
|
||||||
|
|
||||||
let xp = Math.abs(rolled.finalLevel);
|
let xp = Math.abs(rolled.finalLevel);
|
||||||
let xpCarac = Math.floor(xp / 2); // impair: arrondi inférieur en carac
|
// impair: arrondi inférieur en carac
|
||||||
let xpComp = 0;
|
let xpCarac = competence ? Math.floor(xp / 2) : Math.max(Math.floor(xp / 2), 1);
|
||||||
if (competence) {
|
|
||||||
xpComp = xp - xpCarac;
|
let xpData = {
|
||||||
let update = { _id: competence.id, 'data.xp': Misc.toInt(competence.data.xp) + xpComp };
|
alias: this.name,
|
||||||
|
caracName: caracName, xpCarac: xpCarac,
|
||||||
|
competence: competence, xpCompetence: competence ? xp - xpCarac : 0
|
||||||
|
};
|
||||||
|
|
||||||
|
await this._xpCompetence(xpData);
|
||||||
|
await this._xpCarac(xpData);
|
||||||
|
return xpData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async _xpCompetence(xpData) {
|
||||||
|
if (xpData.competence) {
|
||||||
|
const newXp = Misc.toInt(xpData.competence.data.xp) + xpData.xpCompetence;
|
||||||
|
let update = { _id: xpData.competence._id, 'data.xp': newXp };
|
||||||
await this.updateEmbeddedDocuments('Item', [update]);
|
await this.updateEmbeddedDocuments('Item', [update]);
|
||||||
} else {
|
xpData.checkComp = await this.checkCompetenceXP(xpData.competence.name, undefined, false);
|
||||||
xpCarac = Math.max(xpCarac, 1);
|
this.updateExperienceLog("XP", xpData.xp, "XP gagné en " + xpData.competence.name);
|
||||||
}
|
}
|
||||||
if (xpCarac > 0) {
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async _xpCarac(xpData) {
|
||||||
|
if (xpData.xpCarac > 0) {
|
||||||
let carac = duplicate(Misc.templateData(this).carac);
|
let carac = duplicate(Misc.templateData(this).carac);
|
||||||
let selectedCarac = RdDActor._findCaracByName(carac, caracName);
|
let selectedCarac = RdDActor._findCaracByName(carac, xpData.caracName);
|
||||||
if (!selectedCarac.derivee) {
|
if (!selectedCarac.derivee) {
|
||||||
selectedCarac.xp = Misc.toInt(selectedCarac.xp) + xpCarac;
|
selectedCarac.xp = Misc.toInt(selectedCarac.xp) + xpData.xpCarac;
|
||||||
await this.update({ "data.carac": carac });
|
await this.update({ "data.carac": carac });
|
||||||
|
xpData.checkCarac = await this.checkCaracXP(selectedCarac.label, false);
|
||||||
|
this.updateExperienceLog("XP", xpData.xpCarac, "XP gagné en " + xpData.caracName);
|
||||||
} else {
|
} else {
|
||||||
ChatMessage.create({
|
xpData.caracRepartitionManuelle = true;
|
||||||
content: `Vous avez ${xpCarac} à répartir pour la caractéristique dérivée ${caracName}. Vous devez le faire manuellement.`,
|
|
||||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return { result: true, xpCarac: xpCarac, xpCompetence: xpComp }; //XP
|
|
||||||
}
|
|
||||||
return { result: false, xpCarac: 0, xpCompetence: 0 }; // Pas d'XP
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -2828,7 +2847,7 @@ export class RdDActor extends Actor {
|
|||||||
// Gestion expérience (si existante)
|
// Gestion expérience (si existante)
|
||||||
data.competence = Misc.data(this.getCompetence("astrologie"));
|
data.competence = Misc.data(this.getCompetence("astrologie"));
|
||||||
data.selectedCarac = Misc.templateData(this).carac["vue"];
|
data.selectedCarac = Misc.templateData(this).carac["vue"];
|
||||||
this._appliquerAjoutExperience(data);
|
this.appliquerAjoutExperience(data, false);
|
||||||
|
|
||||||
// Ajout du nombre astral
|
// Ajout du nombre astral
|
||||||
const item = {
|
const item = {
|
||||||
@ -2855,14 +2874,14 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getCaracByName(caracName) {
|
getCaracByName(caracName) {
|
||||||
switch (caracName) {
|
switch (Grammar.toLowerCaseNoAccent(caracName)) {
|
||||||
case 'reve-actuel': case 'Rêve actuel':
|
case 'reve-actuel': case 'reve actuel':
|
||||||
return {
|
return {
|
||||||
label: 'Rêve actuel',
|
label: 'Rêve actuel',
|
||||||
value: this.getReveActuel(),
|
value: this.getReveActuel(),
|
||||||
type: "number"
|
type: "number"
|
||||||
};
|
};
|
||||||
case 'chance-actuelle': case 'Chance actuelle':
|
case 'chance-actuelle': case 'chance-actuelle':
|
||||||
return {
|
return {
|
||||||
label: 'Chance actuelle',
|
label: 'Chance actuelle',
|
||||||
value: this.getChanceActuel(),
|
value: this.getChanceActuel(),
|
||||||
@ -2891,11 +2910,6 @@ export class RdDActor extends Actor {
|
|||||||
if (keys.length > 0) {
|
if (keys.length > 0) {
|
||||||
return carac[keys[0]];
|
return carac[keys[0]];
|
||||||
}
|
}
|
||||||
// for (const [key, value] of Object.entries(carac)) {
|
|
||||||
// if (key.includes(name) || Grammar.toLowerCaseNoAccent(value.label).includes('name')) {
|
|
||||||
// return carac[key];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return undefined; // Per default
|
return undefined; // Per default
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2925,8 +2939,8 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async displayTMR(mode = "normal") {
|
async displayTMR(mode = "normal") {
|
||||||
let demiReve = this.listeEffets( it => it.label == "Demi-rêve");
|
let demiReve = this.listeEffets(it => it.label == "Demi-rêve");
|
||||||
if ( mode != 'visu' && demiReve.length > 0 ) {
|
if (mode != 'visu' && demiReve.length > 0) {
|
||||||
ui.notifications.warn("Le joueur ou le MJ est déja dans les Terres Médianes avec ce personnage ! Visualisation uniquement");
|
ui.notifications.warn("Le joueur ou le MJ est déja dans les Terres Médianes avec ce personnage ! Visualisation uniquement");
|
||||||
mode = "visu"; // bascule le mode en visu automatiquement
|
mode = "visu"; // bascule le mode en visu automatiquement
|
||||||
}
|
}
|
||||||
@ -3280,7 +3294,7 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-accorder-cauchemar.html');
|
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-accorder-cauchemar.html');
|
||||||
if (rolled.isPart) {
|
if (rolled.isPart) {
|
||||||
await this._appliquerAjoutExperience(rollData, true);
|
await this.appliquerAjoutExperience(rollData, true);
|
||||||
}
|
}
|
||||||
return rolled.isSuccess;
|
return rolled.isSuccess;
|
||||||
}
|
}
|
||||||
@ -3928,7 +3942,7 @@ export class RdDActor extends Actor {
|
|||||||
//effet.flags.core.statusId = effet.id;
|
//effet.flags.core.statusId = effet.id;
|
||||||
let effectArray = await this.createEmbeddedDocuments('ActiveEffect', [effet]);
|
let effectArray = await this.createEmbeddedDocuments('ActiveEffect', [effet]);
|
||||||
if (effectArray[0]) {
|
if (effectArray[0]) {
|
||||||
await effectArray[0].setFlag( 'core', 'statusId', effet.id);
|
await effectArray[0].setFlag('core', 'statusId', effet.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export class De7 extends Die {
|
|||||||
return this.values.filter(it => it != 8).reduce(Misc.sum(), 0);
|
return this.values.filter(it => it != 8).reduce(Misc.sum(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getResultLabel(result) {
|
getResultLabel(result) {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case 7: return imgSigneDragon;
|
case 7: return imgSigneDragon;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ export class DeHeure extends Die {
|
|||||||
super(termData);
|
super(termData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getResultLabel(result) {
|
getResultLabel(result) {
|
||||||
return img(imagesHeures[result - 1]);
|
return img(imagesHeures[result - 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -386,6 +386,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
rencontre: this.currentRencontre,
|
rencontre: this.currentRencontre,
|
||||||
nbRounds: 1,
|
nbRounds: 1,
|
||||||
canClose: false,
|
canClose: false,
|
||||||
|
selectedCarac: {label: "reve-actuel"},
|
||||||
tmr: TMRUtility.getTMR(this._getActorCoord())
|
tmr: TMRUtility.getTMR(this._getActorCoord())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,7 +394,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _tentativeMaitrise(rencData, presentCite) {
|
async _tentativeMaitrise(rencData) {
|
||||||
console.log("-> matriser", rencData);
|
console.log("-> matriser", rencData);
|
||||||
|
|
||||||
rencData.reve = this.actor.getReveActuel();
|
rencData.reve = this.actor.getReveActuel();
|
||||||
|
@ -473,7 +473,7 @@ export class TMRRencontres {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async onPostSuccessReveDeDragon(tmrDialog, tmrData) {
|
static async onPostSuccessReveDeDragon(tmrDialog, tmrData) {
|
||||||
if (tmrData.rolled.isPart) {
|
if (tmrData.rolled.isPart) {
|
||||||
await tmrData.actor.appliquerExperience(tmrData.rolled, 'reve', tmrData.competence);
|
await tmrData.actor.appliquerAjoutExperience(tmrData, true);
|
||||||
}
|
}
|
||||||
await tmrData.actor.resultCombatReveDeDragon(tmrData);
|
await tmrData.actor.resultCombatReveDeDragon(tmrData);
|
||||||
}
|
}
|
||||||
|
@ -736,11 +736,10 @@
|
|||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.experiencelog as |xp key|}}
|
{{#each data.experiencelog as |xp key|}}
|
||||||
<li class="item flexrow list-item">
|
<li class="item flexrow list-item">
|
||||||
<label class="description-label competence-label">{{xp.mode}} </label>
|
<label class="flex-shrink">{{xp.mode}} </label>
|
||||||
<label class="description-label competence-label">{{xp.valeur}} </label>
|
<label class="flex-grow">{{xp.valeur}} {{xp.raison}} </label>
|
||||||
<label class="description-label competence-label">{{xp.raison}} </label>
|
<label class="flex-shrink">{{xp.daterdd}} </label>
|
||||||
<label class="description-label competence-label">{{xp.daterdd}} </label>
|
<label class="flex-shrink">{{xp.datereel}} </label>
|
||||||
<label class="description-label competence-label">{{xp.datereel}} </label>
|
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
26
templates/chat-actor-gain-xp.html
Normal file
26
templates/chat-actor-gain-xp.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<h4>{{alias}} a gagné de l'expérience en {{caracName}}{{#if competence}} / {{competence.name}}{{/if}}!</h4>
|
||||||
|
{{#if (gt xpCarac 0)}}
|
||||||
|
<hr>
|
||||||
|
{{xpCarac}} point{{#if (gt xpCarac 1)}}s{{/if}}
|
||||||
|
{{#if caracRepartitionManuelle}}à répartir manuellement dans la caractéristique dérivée{{else}}en{{/if}}
|
||||||
|
{{caracName}}.
|
||||||
|
{{#if checkCarac}}
|
||||||
|
L'expérience dans cette caractéristique est de {{checkCarac.xp}}, elle peut progresser!
|
||||||
|
<br>Vous devez ouvrir votre fiche de personnage et appliquer (ou pas) l'augmentation manuellement.
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (gt xpCompetence 0)}}
|
||||||
|
<hr>
|
||||||
|
{{xpCompetence}} point{{#if (gt xpCompetence 1)}}s{{/if}} en {{competence.name}}.
|
||||||
|
{{#if checkComp}}
|
||||||
|
L'expérience dans cette compétence est de {{checkComp.xp}}, elle peut progresser jusqu'à {{checkComp.niveau}}!
|
||||||
|
Vous devez ouvrir votre fiche de personnage et appliquer l'augmentation manuellement.
|
||||||
|
{{#if (gt checkComp.niveau checkComp.archetype)}}<br>Le niveau d'archétype est de {{checkComp.archetype}}.
|
||||||
|
{{#if checkComp.archetypeWarning}}
|
||||||
|
<br><strong>ATTENTION !!</strong> Si vous appliquez cette augmentation, votre compétence dépassera l'archétype.
|
||||||
|
Veuillez contrôler que votre archétype est à jour, ou bien ne pas augmenter le niveau de cette compétence.
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
Loading…
Reference in New Issue
Block a user