Merge branch 'v1.4-dialog-competence' into 'v1.4'
V1.4 dialog competence See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!209
This commit is contained in:
commit
3c793296a6
@ -167,7 +167,7 @@ export class RdDActor extends Actor {
|
|||||||
// Initialize empty items
|
// Initialize empty items
|
||||||
RdDCarac.computeCarac(actorData.data);
|
RdDCarac.computeCarac(actorData.data);
|
||||||
this.computeIsHautRevant();
|
this.computeIsHautRevant();
|
||||||
this.computeEncombrementTotalEtMalusArmure();
|
await this.computeEncombrementTotalEtMalusArmure();
|
||||||
this.computePrixTotalEquipement();
|
this.computePrixTotalEquipement();
|
||||||
this.computeEtatGeneral();
|
this.computeEtatGeneral();
|
||||||
// Sanity check
|
// Sanity check
|
||||||
@ -786,7 +786,7 @@ export class RdDActor extends Actor {
|
|||||||
let comp = this.getCompetence(compName);
|
let comp = this.getCompetence(compName);
|
||||||
if (comp) {
|
if (comp) {
|
||||||
let troncList = RdDItemCompetence.isTronc(compName);
|
let troncList = RdDItemCompetence.isTronc(compName);
|
||||||
let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(comp.data.categorie);
|
let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(Misc.data(comp).data.categorie);
|
||||||
if (troncList) {
|
if (troncList) {
|
||||||
let message = "Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : ";
|
let message = "Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : ";
|
||||||
for (let troncName of troncList) {
|
for (let troncName of troncList) {
|
||||||
@ -1068,7 +1068,7 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async computeIsHautRevant() {
|
computeIsHautRevant() {
|
||||||
const tplData = Misc.templateData(this);
|
const tplData = Misc.templateData(this);
|
||||||
tplData.attributs.hautrevant.value = this.listItemsData('tete').find(it => Grammar.toLowerCaseNoAccent(it.name) == 'don de haut-reve')
|
tplData.attributs.hautrevant.value = this.listItemsData('tete').find(it => Grammar.toLowerCaseNoAccent(it.name) == 'don de haut-reve')
|
||||||
? "Haut rêvant"
|
? "Haut rêvant"
|
||||||
@ -1083,11 +1083,10 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
computeEncombrement() {
|
computeEncombrement() {
|
||||||
const tplData = Misc.templateData(this);
|
this.encTotal = this.filterItemsData(it => it.data.encombrement != undefined)
|
||||||
tplData.encTotal = this.filterItemsData(it => it.data.encombrement != undefined)
|
|
||||||
.map(it => it.data.encTotal)
|
.map(it => it.data.encTotal)
|
||||||
.reduce(Misc.sum(), 0);
|
.reduce(Misc.sum(), 0);
|
||||||
return tplData.encTotal;
|
return this.encTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1104,12 +1103,11 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
computePrixTotalEquipement() {
|
computePrixTotalEquipement() {
|
||||||
const tplData = Misc.templateData(this);
|
this.prixTotalEquipement = this.filterItemsData(it => it.data.prixTotal)
|
||||||
tplData.prixTotalEquipement = this.filterItemsData(it => it.data.prixTotal)
|
|
||||||
.map(it => it.data.prixTotal ?? 0)
|
.map(it => it.data.prixTotal ?? 0)
|
||||||
.reduce(Misc.sum(), 0);
|
.reduce(Misc.sum(), 0);
|
||||||
// Mise à jour valeur totale de l'équipement
|
// Mise à jour valeur totale de l'équipement
|
||||||
return tplData.prixTotalEquipement;
|
return this.prixTotalEquipement;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1849,12 +1847,6 @@ export class RdDActor extends Actor {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
appliquerExperience(rollData) {
|
|
||||||
const callback = this.createCallbackExperience();
|
|
||||||
if (callback.condition(rollData)) { callback.action(rollData); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
createCallbackExperience() {
|
createCallbackExperience() {
|
||||||
return {
|
return {
|
||||||
@ -1895,25 +1887,25 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async checkCompetenceXP(compName, newXP = undefined) {
|
async checkCompetenceXP(compName, newXP = undefined) {
|
||||||
let competence = this.getCompetence(compName);
|
let compData = Misc.data(this.getCompetence(compName));
|
||||||
if (competence && newXP && newXP == competence.data.xp) { // Si édition, mais sans changement XP
|
if (compData && newXP && newXP == compData.data.xp) { // Si édition, mais sans changement XP
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
newXP = (newXP) ? newXP : competence.data.xp;
|
newXP = (newXP) ? newXP : compData.data.xp;
|
||||||
if (competence && newXP > 0) {
|
if (compData && newXP > 0) {
|
||||||
let xpNeeded = RdDItemCompetence.getCompetenceNextXp(competence.data.niveau + 1);
|
let xpNeeded = RdDItemCompetence.getCompetenceNextXp(compData.data.niveau + 1);
|
||||||
if (newXP >= xpNeeded) {
|
if (newXP >= xpNeeded) {
|
||||||
let newCompetence = duplicate(competence);
|
let newCompData = duplicate(compData);
|
||||||
newCompetence.data.niveau += 1;
|
newCompData.data.niveau += 1;
|
||||||
newCompetence.data.xp = newXP;
|
newCompData.data.xp = newXP;
|
||||||
|
|
||||||
let xpData = {
|
let xpData = {
|
||||||
alias: this.name,
|
alias: this.name,
|
||||||
competence: newCompetence.name,
|
competence: newCompData.name,
|
||||||
niveau: newCompetence.data.niveau,
|
niveau: newCompData.data.niveau,
|
||||||
xp: newCompetence.data.xp,
|
xp: newCompData.data.xp,
|
||||||
archetype: newCompetence.data.niveau_archetype,
|
archetype: newCompData.data.niveau_archetype,
|
||||||
archetypeWarning: newCompetence.data.niveau > competence.data.niveau_archetype
|
archetypeWarning: newCompData.data.niveau > compData.data.niveau_archetype
|
||||||
}
|
}
|
||||||
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`, xpData)
|
||||||
@ -2198,7 +2190,7 @@ export class RdDActor extends Actor {
|
|||||||
ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`)
|
ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const competence = this.getCompetence(compName);
|
const competence = Misc.data(this.getCompetence(compName));
|
||||||
if (compName && !competence) {
|
if (compName && !competence) {
|
||||||
ui.notifications.warn(`${this.name} n'a pas de compétence correspondant à ${compName}`)
|
ui.notifications.warn(`${this.name} n'a pas de compétence correspondant à ${compName}`)
|
||||||
return;
|
return;
|
||||||
@ -2214,14 +2206,19 @@ export class RdDActor extends Actor {
|
|||||||
show: { title: options?.title ?? '' }
|
show: { title: options?.title ?? '' }
|
||||||
};
|
};
|
||||||
await RdDResolutionTable.rollData(rollData);
|
await RdDResolutionTable.rollData(rollData);
|
||||||
this.appliquerExperience(rollData);
|
this._appliquerExperienceRollData(rollData);
|
||||||
RdDResolutionTable.displayRollData(rollData, this)
|
RdDResolutionTable.displayRollData(rollData, this)
|
||||||
return rollData.rolled;
|
return rollData.rolled;
|
||||||
}
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
_appliquerExperienceRollData(rollData) {
|
||||||
|
const callback = this.createCallbackExperience();
|
||||||
|
if (callback.condition(rollData)) { callback.action(rollData); }
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollCompetence(name) {
|
async rollCompetence(name) {
|
||||||
let rollData = { competence: this.getCompetence(name) }
|
let rollData = { competence: Misc.data(this.getCompetence(name)) }
|
||||||
|
|
||||||
if (rollData.competence.type == 'competencecreature') {
|
if (rollData.competence.type == 'competencecreature') {
|
||||||
if (rollData.competence.data.iscombat) {
|
if (rollData.competence.data.iscombat) {
|
||||||
@ -2272,7 +2269,7 @@ export class RdDActor extends Actor {
|
|||||||
async rollTache(id) {
|
async rollTache(id) {
|
||||||
const actorData = Misc.data(this);
|
const actorData = Misc.data(this);
|
||||||
const tacheData = Misc.data(this.getTache(id));
|
const tacheData = Misc.data(this.getTache(id));
|
||||||
const compData = duplicate(Misc.data(this.getCompetence(tacheData.data.competence)));
|
const compData = Misc.data(this.getCompetence(tacheData.data.competence));
|
||||||
compData.data.defaut_carac = tacheData.data.carac; // Patch !
|
compData.data.defaut_carac = tacheData.data.carac; // Patch !
|
||||||
|
|
||||||
let rollData = {
|
let rollData = {
|
||||||
@ -2321,7 +2318,7 @@ export class RdDActor extends Actor {
|
|||||||
mergeObject(artData, {
|
mergeObject(artData, {
|
||||||
oeuvre: oeuvre,
|
oeuvre: oeuvre,
|
||||||
art: oeuvre.type,
|
art: oeuvre.type,
|
||||||
competence: duplicate(this.getCompetence(oeuvre.data.competence ?? artData.art)),
|
competence: Misc.data(this.getCompetence(oeuvre.data.competence ?? artData.art)),
|
||||||
diffLibre: - (oeuvre.data.niveau ?? 0),
|
diffLibre: - (oeuvre.data.niveau ?? 0),
|
||||||
diffConditions: 0,
|
diffConditions: 0,
|
||||||
use: { libre: false, conditions: true },
|
use: { libre: false, conditions: true },
|
||||||
@ -2383,14 +2380,14 @@ export class RdDActor extends Actor {
|
|||||||
_getCaracDanse(oeuvre) {
|
_getCaracDanse(oeuvre) {
|
||||||
if (oeuvre.data.agilite) { return "agilite"; }
|
if (oeuvre.data.agilite) { return "agilite"; }
|
||||||
else if (oeuvre.data.apparence) { return "apparence"; }
|
else if (oeuvre.data.apparence) { return "apparence"; }
|
||||||
const competence = this.getCompetence(oeuvre.data.competence);
|
const compData = Misc.data(this.getCompetence(oeuvre.data.competence));
|
||||||
return competence.data.defaut_carac;
|
return compData.data.defaut_carac;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollMusique(id) {
|
async rollMusique(id) {
|
||||||
const artData = { art: 'musique', verbe: 'Jouer' };
|
const artData = { art: 'musique', verbe: 'Jouer' };
|
||||||
const oeuvre = duplicate(this.getItemOfType(id, artData.art));
|
const oeuvre = Misc.data(this.getItemOfType(id, artData.art));
|
||||||
await this._rollArt(artData, "ouie", oeuvre);
|
await this._rollArt(artData, "ouie", oeuvre);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2402,7 +2399,7 @@ export class RdDActor extends Actor {
|
|||||||
proportions: 1,
|
proportions: 1,
|
||||||
ajouterEquipement: false
|
ajouterEquipement: false
|
||||||
};
|
};
|
||||||
const oeuvre = duplicate(this.getRecetteCuisine(id));
|
const oeuvre = Misc.data(this.getRecetteCuisine(id));
|
||||||
await this._rollArt(artData, 'odoratgout', oeuvre, r => this._resultRecetteCuisine(r));
|
await this._rollArt(artData, 'odoratgout', oeuvre, r => this._resultRecetteCuisine(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2453,8 +2450,8 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollMeditation(id) {
|
async rollMeditation(id) {
|
||||||
let meditation = duplicate(this.getMeditation(id));
|
let meditation = Misc.data(this.getMeditation(id));
|
||||||
let competence = duplicate(this.getCompetence(meditation.data.competence));
|
let competence = Misc.data(this.getCompetence(meditation.data.competence));
|
||||||
competence.data.defaut_carac = "intellect"; // Meditation = tjs avec intellect
|
competence.data.defaut_carac = "intellect"; // Meditation = tjs avec intellect
|
||||||
let meditationData = {
|
let meditationData = {
|
||||||
competence: competence,
|
competence: competence,
|
||||||
@ -2469,7 +2466,7 @@ export class RdDActor extends Actor {
|
|||||||
use: { libre: false, conditions: true, },
|
use: { libre: false, conditions: true, },
|
||||||
carac: {}
|
carac: {}
|
||||||
};
|
};
|
||||||
meditationData.carac["intellect"] = duplicate(Misc.templateData(this).carac["intellect"]);
|
meditationData.carac["intellect"] = Misc.templateData(this).carac["intellect"];
|
||||||
|
|
||||||
console.log("rollMeditation !!!", meditationData);
|
console.log("rollMeditation !!!", meditationData);
|
||||||
|
|
||||||
@ -2627,7 +2624,7 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async ajouteNombreAstral(data) {
|
async ajouteNombreAstral(data) {
|
||||||
// Gestion expérience (si existante)
|
// Gestion expérience (si existante)
|
||||||
data.competence = 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);
|
||||||
|
|
||||||
@ -2762,7 +2759,7 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
rollArme(compName, armeName = undefined) {
|
rollArme(compName, armeName = undefined) {
|
||||||
let arme = armeName ? this.data.items.find(it => Misc.data(it).name == armeName && RdDItemArme.isArme(it)) : undefined;
|
let arme = armeName ? this.data.items.find(it => Misc.data(it).name == armeName && RdDItemArme.isArme(it)) : undefined;
|
||||||
let competence = this.getCompetence(compName);
|
let competence = Misc.data(this.getCompetence(compName));
|
||||||
|
|
||||||
if (arme || armeName || (competence.type == 'competencecreature' && competence.data.iscombat)) {
|
if (arme || armeName || (competence.type == 'competencecreature' && competence.data.iscombat)) {
|
||||||
RdDCombat.createUsingTarget(this)?.attaque(competence, arme);
|
RdDCombat.createUsingTarget(this)?.attaque(competence, arme);
|
||||||
@ -3209,7 +3206,7 @@ export class RdDActor extends Actor {
|
|||||||
let recette = this.getItemOfType(recetteId, 'recettealchimique');
|
let recette = this.getItemOfType(recetteId, 'recettealchimique');
|
||||||
const actorData = Misc.data(this);
|
const actorData = Misc.data(this);
|
||||||
if (recette) {
|
if (recette) {
|
||||||
let competence = this.getCompetence("alchimie");
|
let competence = Misc.data(this.getCompetence("alchimie"));
|
||||||
let diffAlchimie = RdDAlchimie.getDifficulte(alchimieData);
|
let diffAlchimie = RdDAlchimie.getDifficulte(alchimieData);
|
||||||
let rollData = {
|
let rollData = {
|
||||||
recette: recette,
|
recette: recette,
|
||||||
|
@ -95,7 +95,7 @@ export class RdDCarac {
|
|||||||
* ainsi que de Perception active et volontaire.
|
* ainsi que de Perception active et volontaire.
|
||||||
*/
|
*/
|
||||||
static isActionPhysique(selectedCarac) {
|
static isActionPhysique(selectedCarac) {
|
||||||
return Grammar.toLowerCaseNoAccent(selectedCarac?.label).match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/);
|
return Grammar.toLowerCaseNoAccent(selectedCarac?.label)?.match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -796,11 +796,9 @@ export class RdDCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// # utilisation esquive
|
// # utilisation esquive
|
||||||
let esquiveUsage = 0;
|
const esquive = Misc.data(this.defender.getCompetence("esquive"));
|
||||||
let esquive = this.defender.getCompetence("esquive");
|
const corpsACorps = Misc.data(this.defender.getCompetence("Corps à corps"));
|
||||||
if (esquive) {
|
const esquiveUsage = esquive ? this.defender.getItemUse(esquive._id) : 0;
|
||||||
esquiveUsage = this.defender.getItemUse(esquive._id);
|
|
||||||
}
|
|
||||||
|
|
||||||
const paramChatDefense = {
|
const paramChatDefense = {
|
||||||
passeArme: attackerRoll.passeArme,
|
passeArme: attackerRoll.passeArme,
|
||||||
@ -810,7 +808,7 @@ export class RdDCombat {
|
|||||||
attackerId: this.attackerId,
|
attackerId: this.attackerId,
|
||||||
esquiveUsage: esquiveUsage,
|
esquiveUsage: esquiveUsage,
|
||||||
defenderTokenId: this.defenderTokenId,
|
defenderTokenId: this.defenderTokenId,
|
||||||
mainsNues: attackerRoll.dmg.mortalite != 'mortel' && this.defender.getCompetence("Corps à corps"),
|
mainsNues: attackerRoll.dmg.mortalite != 'mortel' && corpsACorps,
|
||||||
armes: this._filterArmesParade(this.defender, attackerRoll.competence, attackerRoll.arme),
|
armes: this._filterArmesParade(this.defender, attackerRoll.competence, attackerRoll.arme),
|
||||||
diffLibre: attackerRoll.ajustements?.diffLibre?.value ?? 0,
|
diffLibre: attackerRoll.ajustements?.diffLibre?.value ?? 0,
|
||||||
attaqueParticuliere: attackerRoll.particuliere,
|
attaqueParticuliere: attackerRoll.particuliere,
|
||||||
@ -955,12 +953,13 @@ export class RdDCombat {
|
|||||||
_prepareParade(attackerRoll, armeParade) {
|
_prepareParade(attackerRoll, armeParade) {
|
||||||
const compName = armeParade.data.competence;
|
const compName = armeParade.data.competence;
|
||||||
const armeAttaque = attackerRoll.arme;
|
const armeAttaque = attackerRoll.arme;
|
||||||
|
const parade = Misc.data(this.defender.getCompetence(compName));
|
||||||
|
|
||||||
let defenderRoll = {
|
let defenderRoll = {
|
||||||
passeArme: attackerRoll.passeArme,
|
passeArme: attackerRoll.passeArme,
|
||||||
diffLibre: attackerRoll.diffLibre,
|
diffLibre: attackerRoll.diffLibre,
|
||||||
attackerRoll: attackerRoll,
|
attackerRoll: attackerRoll,
|
||||||
competence: this.defender.getCompetence(compName),
|
competence: parade,
|
||||||
arme: armeParade,
|
arme: armeParade,
|
||||||
surprise: this.defender.getSurprise(true),
|
surprise: this.defender.getSurprise(true),
|
||||||
needParadeSignificative: ReglesOptionelles.isUsing('categorieParade') && RdDItemArme.needParadeSignificative(armeAttaque, armeParade),
|
needParadeSignificative: ReglesOptionelles.isUsing('categorieParade') && RdDItemArme.needParadeSignificative(armeAttaque, armeParade),
|
||||||
@ -1011,7 +1010,7 @@ export class RdDCombat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async esquive(attackerRoll) {
|
async esquive(attackerRoll) {
|
||||||
let esquive = this.defender.getCompetence("esquive");
|
const esquive = Misc.data(this.defender.getCompetence("esquive"));
|
||||||
if (esquive == undefined) {
|
if (esquive == undefined) {
|
||||||
ui.notifications.error(this.defender.name + " n'a pas de compétence 'esquive'");
|
ui.notifications.error(this.defender.name + " n'a pas de compétence 'esquive'");
|
||||||
return;
|
return;
|
||||||
|
@ -268,7 +268,7 @@ export class RdDRoll extends Dialog {
|
|||||||
let dmgText = Misc.toSignedString(rollData.dmg.total);
|
let dmgText = Misc.toSignedString(rollData.dmg.total);
|
||||||
|
|
||||||
if (rollData.coupsNonMortels) {
|
if (rollData.coupsNonMortels) {
|
||||||
dmgText = '(' + dmgText + ')';
|
dmgText = `(${dmgText}) non-mortel`
|
||||||
}
|
}
|
||||||
if (rollData.selectedSort) {
|
if (rollData.selectedSort) {
|
||||||
rollData.bonus = RdDItemSort.getCaseBonus(rollData.selectedSort, rollData.tmr.coord);
|
rollData.bonus = RdDItemSort.getCaseBonus(rollData.selectedSort, rollData.tmr.coord);
|
||||||
@ -287,7 +287,7 @@ export class RdDRoll extends Dialog {
|
|||||||
// Mise à jour valeurs
|
// Mise à jour valeurs
|
||||||
$("#compdialogTitle").text(this._getTitle(rollData));
|
$("#compdialogTitle").text(this._getTitle(rollData));
|
||||||
$('#coupsNonMortels').prop('checked', rollData.coupsNonMortels);
|
$('#coupsNonMortels').prop('checked', rollData.coupsNonMortels);
|
||||||
$("#dmg-arme-actor").text(dmgText);
|
$(".dmg-arme-actor").text(dmgText);
|
||||||
$('.table-ajustement').remove();
|
$('.table-ajustement').remove();
|
||||||
$(".table-resolution").remove();
|
$(".table-resolution").remove();
|
||||||
$(".table-proba-reussite").remove();
|
$(".table-proba-reussite").remove();
|
||||||
@ -353,9 +353,9 @@ export class RdDRoll extends Dialog {
|
|||||||
const niveau = Misc.toSignedString(rollData.competence.data.niveau);
|
const niveau = Misc.toSignedString(rollData.competence.data.niveau);
|
||||||
if (compName == carac) {
|
if (compName == carac) {
|
||||||
// cas des créatures
|
// cas des créatures
|
||||||
return carac + " " + niveau
|
return carac + " Niveau " + niveau
|
||||||
}
|
}
|
||||||
const armeTitle = (rollData.arme) ? " (" + rollData.arme.name + ") " : "";
|
const armeTitle = (rollData.arme) ? " (" + rollData.arme.name + ") " : "";
|
||||||
return carac + "/" + compName + armeTitle + " " + niveau
|
return carac + "/" + compName + armeTitle + " Niveau " + niveau
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ export const referenceAjustements = {
|
|||||||
getValue: (rollData, actor) => actor.getEtatGeneral()
|
getValue: (rollData, actor) => actor.getEtatGeneral()
|
||||||
},
|
},
|
||||||
malusArmure: {
|
malusArmure: {
|
||||||
isVisible: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.competence),
|
isVisible: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac),
|
||||||
isUsed: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac),
|
isUsed: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac),
|
||||||
getLabel: (rollData, actor) => 'Malus armure',
|
getLabel: (rollData, actor) => 'Malus armure',
|
||||||
getValue: (rollData, actor) => actor.getMalusArmure()
|
getValue: (rollData, actor) => actor.getMalusArmure()
|
||||||
@ -131,6 +131,7 @@ export class RollDataAjustements {
|
|||||||
for (var key in referenceAjustements) {
|
for (var key in referenceAjustements) {
|
||||||
const reference = referenceAjustements[key];
|
const reference = referenceAjustements[key];
|
||||||
rollData.ajustements[key] = {
|
rollData.ajustements[key] = {
|
||||||
|
visible: reference.isVisible && reference.isVisible(rollData, actor),
|
||||||
used: reference.isUsed(rollData, actor),
|
used: reference.isUsed(rollData, actor),
|
||||||
label: reference.getLabel && reference.getLabel(rollData, actor),
|
label: reference.getLabel && reference.getLabel(rollData, actor),
|
||||||
value: reference.getValue && reference.getValue(rollData, actor),
|
value: reference.getValue && reference.getValue(rollData, actor),
|
||||||
|
@ -855,8 +855,7 @@ ul, li {
|
|||||||
/* Position the tooltip text */
|
/* Position the tooltip text */
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
top: -10px;
|
left: 25px;
|
||||||
left: 18%;
|
|
||||||
|
|
||||||
/* Fade in tooltip */
|
/* Fade in tooltip */
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<form class="skill-roll-dialog">
|
<form class="skill-roll-dialog">
|
||||||
<h2 class="compdialog" id="compdialogTitle"></h2>
|
<h2 class="compdialog" id="compdialogTitle"></h2>
|
||||||
<div class="form-group">
|
|
||||||
|
<div class="grid grid-2col">
|
||||||
|
<div class="flex-group-left">
|
||||||
|
<div class="flexrow">
|
||||||
<label>Caractéristique </label>
|
<label>Caractéristique </label>
|
||||||
<select name="carac" id="carac" data-dtype="String">
|
<select name="carac" id="carac" data-dtype="String">
|
||||||
{{#select carac}}
|
{{#select carac}}
|
||||||
@ -9,14 +12,63 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
|
{{#if arme}}
|
||||||
|
{{#if attackerRoll}}
|
||||||
|
{{#if attackerRoll.tactique}}
|
||||||
|
<div class="flexrow">
|
||||||
|
<label>Tactique: </label><label>{{attackerRoll.tactique}}</label>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<div class="flexrow">
|
||||||
|
<label>Tactique:</label>
|
||||||
|
<span class="tooltip">
|
||||||
|
<select class="select-by-name" name="tactique" id="tactique-combat" data-dtype="String" {{#unless use.conditions}}disabled{{/unless}}>
|
||||||
|
<option value="Attaque normale">Attaque normale</option>
|
||||||
|
<option value="charge">Charge</option>
|
||||||
|
<option value="feinte">Feinte</option>
|
||||||
|
</select>
|
||||||
|
<div class="tooltiptext ttt-ajustements">
|
||||||
|
<div>
|
||||||
|
<strong>Charge</strong> : Les longueurs d'armes n'interviennent pas dans la charge, il faut gérer une initiative aléatoire dans ce cas.
|
||||||
|
<br><strong>Feinte</strong> : Vous devez avoir l'initative sur votre adversaire et y renoncer.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{#if ajustements.attaqueDefenseurSurpris.used}}
|
||||||
|
<div class="flexrow">
|
||||||
|
<label id="defenseur-surprise">{{ajustements.attaqueDefenseurSurpris.label}}</label>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<label class="diffMoral">Moral: {{#if (gt moral 0)}}+{{/if}}{{moral}}</label>
|
{{#if arme}}
|
||||||
<div class="tooltipAppelAuMoral divAppelAuMoral">
|
{{#unless attackerRoll}}
|
||||||
<img class="imgAppelAuMoral small-button-container" src="/systems/foundryvtt-reve-de-dragon/icons/moral-neutre.svg">
|
<div class="flexrow">
|
||||||
<span class="tooltipAppelAuMoralText">Sans appel au moral</span>
|
{{#if (eq arme.data.mortalite 'non-mortel')}}
|
||||||
|
<label>Dégats:</label><label class="dmg-arme-actor"></label>
|
||||||
|
{{else}}
|
||||||
|
<label>Dégats:
|
||||||
|
</label>
|
||||||
|
<span>
|
||||||
|
<input class="attribute-value" type="checkbox" id="coupsNonMortels" name="coupsNonMortels" {{#if coupsNonMortels}}checked{{/if}}/>
|
||||||
|
<label class="dmg-arme-actor">
|
||||||
|
</label>
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
{{/unless}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}}
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-enctotal.html"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
|
<div class="flex-group-left">
|
||||||
|
<div class="flexrow">
|
||||||
{{#if attackerRoll}}
|
{{#if attackerRoll}}
|
||||||
<label>Difficulté</label>
|
<label>Difficulté</label>
|
||||||
<label>{{diffLibre}}</label>
|
<label>{{diffLibre}}</label>
|
||||||
@ -30,7 +82,11 @@
|
|||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<label> Conditions</label>
|
</div>
|
||||||
|
<div class="flexrow">
|
||||||
|
</div>
|
||||||
|
<div class="flexrow">
|
||||||
|
<label>Conditions</label>
|
||||||
<select name="diffConditions" id="diffConditions" data-dtype="number" {{#unless use.conditions}}disabled{{/unless}}>
|
<select name="diffConditions" id="diffConditions" data-dtype="number" {{#unless use.conditions}}disabled{{/unless}}>
|
||||||
{{#select diffConditions}}
|
{{#select diffConditions}}
|
||||||
{{#each ajustementsConditions as |key|}}
|
{{#each ajustementsConditions as |key|}}
|
||||||
@ -39,44 +95,18 @@
|
|||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{{#if arme}}
|
<div class="flexrow">
|
||||||
<div class="form-group">
|
<label class="diffMoral">Moral: {{#if (gt moral 0)}}+{{/if}}{{moral}}</label>
|
||||||
{{#if attackerRoll}}
|
<div class="tooltipAppelAuMoral divAppelAuMoral">
|
||||||
{{#if attackerRoll.tactique}}
|
<img class="imgAppelAuMoral small-button-container" src="/systems/foundryvtt-reve-de-dragon/icons/moral-neutre.svg">
|
||||||
<label>Tactique: {{attackerRoll.tactique}}</label>
|
<span class="tooltipAppelAuMoralText">Sans appel au moral</span>
|
||||||
{{/if}}
|
</div>
|
||||||
<label>Dégats:</label><label id="dmg-arme-actor"></label>
|
</div>
|
||||||
<label></label>
|
<div id="tableAjustements" class="flexrow">
|
||||||
{{else}}
|
|
||||||
<span class="tooltip">
|
|
||||||
<label>Tactique:</label>
|
|
||||||
<select class="select-by-name" name="tactique" id="tactique-combat" data-dtype="String" {{#unless use.conditions}}disabled{{/unless}}>
|
|
||||||
<option value="Attaque normale">Attaque normale</option>
|
|
||||||
<option value="charge">Charge</option>
|
|
||||||
<option value="feinte">Feinte</option>
|
|
||||||
</select>
|
|
||||||
<div class="tooltiptext ttt-ajustements">
|
|
||||||
<div>
|
|
||||||
<strong>Charge</strong> : Les longueurs d'armes n'interviennent pas dans la charge, il faut gérer une initiative aléatoire dans ce cas.
|
|
||||||
<br><strong>Feinte</strong> : Vous devez avoir l'initative sur votre adversaire et y renoncer.
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
|
||||||
<label>Dégats:</label><label id="dmg-arme-actor"></label>
|
|
||||||
<label>Non Mortel</label>
|
|
||||||
<input class="attribute-value" type="checkbox" id="coupsNonMortels" name="coupsNonMortels" {{#if coupsNonMortels}}checked{{/if}}/>
|
|
||||||
{{/if}}
|
|
||||||
{{#if ajustements.attaqueDefenseurSurpris.used}}
|
|
||||||
<label id="defenseur-surprise">{{ajustements.attaqueDefenseurSurpris.label}}</label>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}}
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-enctotal.html"}}
|
|
||||||
|
|
||||||
<div id="tableAjustements">
|
|
||||||
</div>
|
|
||||||
<div id="tableResolution">
|
<div id="tableResolution">
|
||||||
</div>
|
</div>
|
||||||
<div id="tableProbaReussite">
|
<div id="tableProbaReussite">
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{{#if ajustements.encTotal.visible}}
|
{{#if ajustements.encTotal.visible}}
|
||||||
<div class="form-group">
|
<div class="flexrow">
|
||||||
<label>Appliquer l'encombrement total comme malus ({{encTotal}}) ? </label>
|
<label>
|
||||||
<input class="attribute-value checkbox-by-name" type="checkbox" name="useMalusEncTotal" {{#if useMalusEncTotal}}checked{{/if}}/>
|
<input class="attribute-value checkbox-by-name" type="checkbox" name="useMalusEncTotal" {{#if useMalusEncTotal}}checked{{/if}}/>
|
||||||
|
Appliquer l'encombrement comme malus ({{encTotal}}) ?
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{{#if surencMalusFlag}}
|
{{#if surencMalusFlag}}
|
||||||
<div class="form-group">
|
<div class="flexrow">
|
||||||
<label for="xp">Appliquer le malus de sur-encombrement ? </label>
|
<label>
|
||||||
<input class="attribute-value checkbox-by-name" type="checkbox" name="useMalusSurenc" {{#if useMalusSurenc}}checked{{/if}}/>
|
<input class="attribute-value checkbox-by-name" type="checkbox" name="useMalusSurenc" {{#if useMalusSurenc}}checked{{/if}}/>
|
||||||
|
Appliquer le sur-encombrement
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
Reference in New Issue
Block a user