forked from public/foundryvtt-reve-de-dragon
Corrections v10
Il y en avait partout dans des dialogues, des options, le drag&drop d'acteur sur acteur, l'empilage d'objet...
This commit is contained in:
@ -39,7 +39,6 @@ export class RdDActorSheet extends ActorSheet {
|
||||
const objectData = this.object.system
|
||||
this.timerRecherche = undefined;
|
||||
|
||||
console.log("New actor", objectData)
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: this.object.id,
|
||||
@ -76,15 +75,12 @@ export class RdDActorSheet extends ActorSheet {
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement()
|
||||
};
|
||||
|
||||
/* TODO - TO FIX for v10
|
||||
formData.competences.forEach(item => {
|
||||
console.log("ITEM1", item)
|
||||
item.visible = this.options.recherche
|
||||
item.system.isVisible = this.options.recherche
|
||||
? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
|
||||
: (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
|
||||
RdDItemCompetence.levelUp(item, formData.data.compteurs.experience.value);
|
||||
});*/
|
||||
|
||||
});
|
||||
Object.values(formData.data.carac).forEach(c => {
|
||||
RdDCarac.levelUp(c);
|
||||
});
|
||||
@ -94,7 +90,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
formData.combat = duplicate(formData.armes ?? []);
|
||||
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
||||
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.data.carac);
|
||||
formData.esquives = this.actor.getCompetences("Esquive").map(i => foundry.utils.deepClone(i.system));
|
||||
formData.esquives = this.actor.getCompetences("Esquive");
|
||||
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.data.carac);
|
||||
|
||||
this.armesList = formData.combat;
|
||||
@ -132,9 +128,9 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDropActor(event, dragData) {
|
||||
console.log("_onDropActor", this.actor.id, dragData)
|
||||
this.actor.addSubActeur(dragData.id || dragData.data._id)
|
||||
super._onDropActor(event, dragData)
|
||||
const dropActor = fromUuidSync(dragData.uuid);
|
||||
this.actor.addSubActeur(dropActor);
|
||||
super._onDropActor(event, dragData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -385,13 +381,11 @@ export class RdDActorSheet extends ActorSheet {
|
||||
if (this.options.editCaracComp) {
|
||||
// On carac change
|
||||
html.find('.carac-value').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
|
||||
//console.log("Value changed :", event, caracName);
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("data.carac.", "");
|
||||
this.actor.updateCarac(caracName, parseInt(event.target.value));
|
||||
});
|
||||
html.find('.carac-xp').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "");
|
||||
//console.log("Value changed :", event, caracName);
|
||||
html.find('input.carac-xp').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("data.carac.", "");
|
||||
this.actor.updateCaracXP(caracName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence change
|
||||
@ -401,12 +395,12 @@ export class RdDActorSheet extends ActorSheet {
|
||||
this.actor.updateCompetence(compName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence xp change
|
||||
html.find('.competence-xp').change(async event => {
|
||||
html.find('input.competence-xp').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXP(compName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence xp change
|
||||
html.find('.competence-xp-sort').change(async event => {
|
||||
html.find('input.competence-xp-sort').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value));
|
||||
});
|
||||
@ -583,9 +577,9 @@ export class RdDActorSheet extends ActorSheet {
|
||||
}
|
||||
|
||||
async _onSplitItem(item, split) {
|
||||
if (split >= 1 && split < Misc.data(item).data.quantite) {
|
||||
if (split >= 1 && split < item.system.quantite) {
|
||||
await item.diminuerQuantite(split);
|
||||
const itemData = duplicate(Misc.data(item));
|
||||
const itemData = duplicate(item.system);
|
||||
itemData.data.quantite = split;
|
||||
await this.actor.createEmbeddedDocuments('Item', [itemData])
|
||||
}
|
||||
|
@ -609,7 +609,6 @@ export class RdDActor extends Actor {
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: "Remise à neuf de " + this.name
|
||||
};
|
||||
const actorData = Misc.data(this);
|
||||
if (this.isEntite([ENTITE_NONINCARNE])) {
|
||||
return;
|
||||
}
|
||||
@ -1041,7 +1040,6 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async updateExperienceLog(modeXP, valeurXP, raisonXP = 'Inconnue') {
|
||||
let d = new Date();
|
||||
console.log(modeXP, valeurXP, raisonXP);
|
||||
let expLog = duplicate(this.system.experiencelog);
|
||||
expLog.push({
|
||||
mode: Misc.upperFirst(modeXP), valeur: valeurXP, raison: Misc.upperFirst(raisonXP),
|
||||
@ -2170,7 +2168,7 @@ export class RdDActor extends Actor {
|
||||
createCallbackExperience() {
|
||||
return {
|
||||
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' && !game.user.isGM))
|
||||
action: r => this.appliquerAjoutExperience(r)
|
||||
};
|
||||
}
|
||||
|
||||
@ -2242,10 +2240,11 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async appliquerAjoutExperience(rollData, display) {
|
||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
||||
if (!this.isPersonnage()) return;
|
||||
hideChatMessage = hideChatMessage == 'hide' || (game.settings.get("core", "rollMode") != 'blindroll' && !game.user.isGM)
|
||||
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence);
|
||||
if (xpData && display) {
|
||||
if (xpData && !hideChatMessage) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, xpData)
|
||||
@ -3036,7 +3035,7 @@ export class RdDActor extends Actor {
|
||||
let update = { _id: xpData.competence._id, 'system.xp': newXp };
|
||||
await this.updateEmbeddedDocuments('Item', [update]);
|
||||
xpData.checkComp = await this.checkCompetenceXP(xpData.competence.name, undefined, false);
|
||||
this.updateExperienceLog("XP", xpData.xp, "XP gagné en " + xpData.competence.name);
|
||||
this.updateExperienceLog("XP", xpData.xpCompetence, "XP gagné en " + xpData.competence.name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3068,7 +3067,7 @@ export class RdDActor extends Actor {
|
||||
// Gestion expérience (si existante)
|
||||
data.competence = this.getCompetence("astrologie")
|
||||
data.selectedCarac = this.system.carac["vue"];
|
||||
this.appliquerAjoutExperience(data, false);
|
||||
this.appliquerAjoutExperience(data, 'hide');
|
||||
|
||||
// Ajout du nombre astral
|
||||
const item = {
|
||||
@ -3891,19 +3890,21 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addSubActeur(subActorId) {
|
||||
let subActor = game.actors.get(subActorId);
|
||||
//console.log("Ajout acteur : ", actor, this);
|
||||
if (subActor && !subActor.owner) {
|
||||
if (subActortype == 'vehicule') {
|
||||
addSubActeur(subActor) {
|
||||
if(subActor?.id == this.id){
|
||||
ui.notifications.warn("Vous ne pouvez pas attacher un acteur à lui même")
|
||||
}
|
||||
else if (!subActor?.isOwner) {
|
||||
ui.notifications.warn("Vous n'avez pas les droits sur l'acteur que vous attachez.")
|
||||
}
|
||||
else {
|
||||
if (subActor.type == 'vehicule') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.vehicules, 'system.subacteurs.vehicules', 'Ce Véhicule');
|
||||
} else if (subActor.type == 'creature') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.montures, 'system.subacteurs.montures', 'Cette Monture');
|
||||
} else if (subActor.type == 'personnage') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.suivants, 'system.subacteurs.suivants', 'Ce Suivant');
|
||||
}
|
||||
} else {
|
||||
ui.notifications.warn("Vous n'avez pas les droits sur l'acteur que vous attachez.")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ export class ChatUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getUsers(filter) {
|
||||
return Misc.getUsers().filter(filter).map(user => user.data._id);
|
||||
return Misc.getUsers().filter(filter).map(user => user.id);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -9,7 +9,7 @@ export class DialogFabriquerPotion extends Dialog {
|
||||
let potionData = DialogFabriquerPotion.prepareData(actor, item);
|
||||
|
||||
let conf = {
|
||||
title: `Fabriquer une potion de ${potionData.data.categorie}`,
|
||||
title: `Fabriquer une potion de ${potionData.system.categorie}`,
|
||||
content: await renderTemplate(dialogConfig.html, potionData),
|
||||
default: potionData.buttonName,
|
||||
};
|
||||
@ -25,8 +25,8 @@ export class DialogFabriquerPotion extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
static prepareData(actor, item) {
|
||||
let potionData = duplicate(item)
|
||||
potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.data.quantite);
|
||||
potionData.nbBrins = Math.min(potionData.data.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData));
|
||||
potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.system.quantite);
|
||||
potionData.nbBrins = Math.min(potionData.system.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData));
|
||||
potionData.buttonName = "Fabriquer";
|
||||
return potionData;
|
||||
}
|
||||
@ -46,9 +46,9 @@ export class DialogFabriquerPotion extends Dialog {
|
||||
}
|
||||
|
||||
static getNombreBrinOptimal(herbeData) {
|
||||
switch (herbeData.data.categorie ?? '') {
|
||||
case "Soin": return 12 - herbeData.data.niveau;
|
||||
case "Repos": return 7 - herbeData.data.niveau;
|
||||
switch (herbeData.system.categorie ?? '') {
|
||||
case "Soin": return 12 - herbeData.system.niveau;
|
||||
case "Repos": return 7 - herbeData.system.niveau;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ export class DialogSplitItem extends Dialog {
|
||||
const itemData = item
|
||||
const splitData = {
|
||||
item: itemData,
|
||||
choix: { quantite: 1, max: itemData.data.quantite - 1 }
|
||||
choix: { quantite: 1, max: itemData.system.quantite - 1 }
|
||||
};
|
||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-split.html`, splitData);
|
||||
return new DialogSplitItem(item, splitData, html, callback)
|
||||
|
@ -183,14 +183,14 @@ export class RdDItemCompetence extends Item {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static levelUp(itemData, stressTransforme) {
|
||||
itemData.system.xpNext = RdDItemCompetence.getCompetenceNextXp(itemData.system.niveau);
|
||||
const xpManquant = itemData.system.xpNext - itemData.system.xp;
|
||||
itemData.system.isLevelUp = xpManquant <= 0;
|
||||
itemData.system.isStressLevelUp = (xpManquant > 0 && stressTransforme >= xpManquant && itemData.system.niveau < itemData.system.niveau_archetype);
|
||||
itemData.system.stressXpMax = 0;
|
||||
if (xpManquant > 0 && stressTransforme > 0 && itemData.system.niveau < itemData.system.niveau_archetype) {
|
||||
itemData.system.stressXpMax = Math.min(xpManquant , stressTransforme);
|
||||
static levelUp(item, stressTransforme) {
|
||||
item.system.xpNext = RdDItemCompetence.getCompetenceNextXp(item.system.niveau);
|
||||
const xpManquant = item.system.xpNext - item.system.xp;
|
||||
item.system.isLevelUp = xpManquant <= 0;
|
||||
item.system.isStressLevelUp = (xpManquant > 0 && stressTransforme >= xpManquant && item.system.niveau < item.system.niveau_archetype);
|
||||
item.system.stressXpMax = 0;
|
||||
if (xpManquant > 0 && stressTransforme > 0 && item.system.niveau < item.system.niveau_archetype) {
|
||||
item.system.stressXpMax = Math.min(xpManquant , stressTransforme);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,22 +4,22 @@ const monnaiesData = [
|
||||
{
|
||||
name: "Etain (1 denier)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp",
|
||||
data: { quantite: 0, valeur_deniers: 1, encombrement: 0.001, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 1, encombrement: 0.001, description: "" }
|
||||
},
|
||||
{
|
||||
name: "Bronze (10 deniers)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_bronze_epees.webp",
|
||||
data: { quantite: 0, valeur_deniers: 10, encombrement: 0.002, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 10, encombrement: 0.002, description: "" }
|
||||
},
|
||||
{
|
||||
name: "Argent (1 sol)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_argent_sol.webp",
|
||||
data: { quantite: 0, valeur_deniers: 100, encombrement: 0.003, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 100, encombrement: 0.003, description: "" }
|
||||
},
|
||||
{
|
||||
name: "Or (10 sols)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_or_sol.webp",
|
||||
data: { quantite: 0, valeur_deniers: 1000, encombrement: 0.004, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 1000, encombrement: 0.004, description: "" }
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -105,7 +105,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
}
|
||||
RdDHerbes.updatePotionData(formData);
|
||||
}
|
||||
if (formData.isOwned && formData.type == 'herbe' && (formData.data.categorie == 'Soin' || formData.data.categorie == 'Repos')) {
|
||||
if (formData.isOwned && formData.type == 'herbe' && (formData.system.categorie == 'Soin' || formData.system.categorie == 'Repos')) {
|
||||
formData.isIngredientPotionBase = true;
|
||||
}
|
||||
formData.bonusCaseList = RdDItemSort.getBonusCaseList(formData, true);
|
||||
|
@ -117,7 +117,7 @@ export class RdDItem extends Item {
|
||||
if (this.isPotion()) {
|
||||
this.prepareDataPotion()
|
||||
}
|
||||
this.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
|
||||
this.system.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,22 +192,28 @@ export class RdDItem extends Item {
|
||||
/* -------------------------------------------- */
|
||||
// détermine si deux équipements sont similaires: de même type, et avec les même champs hormis la quantité
|
||||
isEquipementSimilaire(other) {
|
||||
const itemData = this
|
||||
const otherData = other
|
||||
const tplData = this
|
||||
const otherTplData = other
|
||||
if (!this.isEquipement()) return false;
|
||||
if (itemData.type != otherData.type) return false;
|
||||
if (itemData.name != otherData.name) return false;
|
||||
if (tplData.quantite == undefined) return false;
|
||||
|
||||
const differences = Object.entries(tplData).filter(([key, value]) => !['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key))
|
||||
.filter(([key, value]) => value != otherTplData[key]);
|
||||
if (differences.length > 0) {
|
||||
let message = `Impossible de regrouper les ${itemData.type} ${itemData.name}: `;
|
||||
for (const [key, value] of differences) {
|
||||
message += `<br>${key}: ${value} vs ${otherTplData[key]}`;
|
||||
let message = undefined;
|
||||
if (this.type != other.type) {
|
||||
message = `Impossible de regrouper ${this.type} avec ${other.type}`;
|
||||
}
|
||||
else if (this.name != other.name) {
|
||||
message = `Impossible de regrouper ${this.name} avec ${other.name}`;
|
||||
}
|
||||
else if (this.system.quantite == undefined) {
|
||||
message = `Impossible de regrouper des ${this.type}, ils ne sont pas empilables`;
|
||||
}
|
||||
else {
|
||||
const differences = Object.entries(this.system)
|
||||
.filter(([key, value]) => !['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key) && value != other.system[key]);
|
||||
if (differences.length > 0) {
|
||||
message = `Impossible de regrouper les ${this.type} ${this.name}: `;
|
||||
for (const [key, value] of differences) {
|
||||
message += `<br>${key}: ${value} vs ${other.system[key]}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (message){
|
||||
ui.notifications.info(message)
|
||||
return false;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ export class RdDCombatManager extends Combat {
|
||||
if (competence) {
|
||||
const carac = combatant.actor.system.carac[competence.system.defaut_carac].value;
|
||||
const niveau = competence.system.niveau;
|
||||
const bonusEcaille = (armeCombat?.data.magique) ? armeCombat.system.ecaille_efficacite : 0;
|
||||
const bonusEcaille = (armeCombat?.system.magique) ? armeCombat.system.ecaille_efficacite : 0;
|
||||
rollFormula = RdDCombatManager.formuleInitiative(2, carac, niveau, bonusEcaille);
|
||||
}
|
||||
}
|
||||
@ -204,7 +204,7 @@ export class RdDCombatManager extends Combat {
|
||||
action: 'conjurer',
|
||||
data: {
|
||||
competence: p.name,
|
||||
possessionid: p.data.data.possessionid,
|
||||
possessionid: p.system.possessionid,
|
||||
}
|
||||
}
|
||||
}));
|
||||
@ -228,9 +228,9 @@ export class RdDCombatManager extends Combat {
|
||||
.concat(RdDItemArme.mainsNues());
|
||||
|
||||
let competences = items.filter(it => it.type == 'competence');
|
||||
actions = actions.concat(RdDCombatManager.listActionsArmes(armes, competences, actor.data.data.carac));
|
||||
actions = actions.concat(RdDCombatManager.listActionsArmes(armes, competences, actor.system.carac));
|
||||
|
||||
if (actor.data.data.attributs.hautrevant.value) {
|
||||
if (actor.system.attributs.hautrevant.value) {
|
||||
actions.push({ name: "Draconic", action: 'haut-reve', data: { initOnly: true, competence: "Draconic" } });
|
||||
}
|
||||
}
|
||||
@ -256,7 +256,7 @@ export class RdDCombatManager extends Combat {
|
||||
//console.log("Parsed !!!", combatant, initDone, game.combat.current, arme);
|
||||
if (action && action.type == "arme") {
|
||||
for (let initData of premierRoundInit) {
|
||||
if (Grammar.toLowerCaseNoAccentNoSpace(action.data.initpremierround).includes(initData.pattern)) {
|
||||
if (Grammar.toLowerCaseNoAccentNoSpace(action.system.initpremierround).includes(initData.pattern)) {
|
||||
let msg = `<h4>L'initiative de ${combatant.actor.name} a été modifiée !</h4>
|
||||
<hr>
|
||||
<div>
|
||||
@ -329,10 +329,10 @@ export class RdDCombatManager extends Combat {
|
||||
} else {
|
||||
compData = RdDItemCompetence.findCompetence(combatant.actor.items, arme.system.competence);
|
||||
compNiveau = compData.system.niveau;
|
||||
initInfo = action.name + " / " + action.data.competence;
|
||||
initInfo = action.name + " / " + action.system.competence;
|
||||
|
||||
if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') {
|
||||
caracForInit = compData.data.carac_value;
|
||||
caracForInit = compData.system.carac_value;
|
||||
if (compData.system.categorie == "lancer") {
|
||||
initOffset = 7;
|
||||
}
|
||||
@ -361,7 +361,7 @@ export class RdDCombatManager extends Combat {
|
||||
return 7;
|
||||
}
|
||||
// Offset de principe pour les armes de jet
|
||||
switch (arme.data.cac) {
|
||||
switch (arme.system.cac) {
|
||||
case "empoignade": return 3;
|
||||
case "pugilat": return 4;
|
||||
}
|
||||
@ -384,7 +384,7 @@ export class RdDCombatManager extends Combat {
|
||||
let menuItems = [];
|
||||
for (let action of actions) {
|
||||
menuItems.push({
|
||||
name: action.data.competence,
|
||||
name: action.system.competence,
|
||||
icon: "<i class='fas fa-dice-d6'></i>",
|
||||
callback: target => { RdDCombatManager.rollInitiativeAction(combatantId, action) }
|
||||
});
|
||||
|
@ -77,8 +77,10 @@ export class RdDHotbar {
|
||||
if (speaker.token) actor = game.actors.tokens[speaker.token];
|
||||
if (!actor) actor = game.actors.get(speaker.actor);
|
||||
|
||||
let item = Misc.data(actor?.items.find(it => it.name === itemName && it.type == itemType));
|
||||
if (!item) return ui.notifications.warn(`Impossible de trouver l'objet de cette macro`);
|
||||
let item = actor?.items.find(it => it.name === itemName && it.type == itemType) ?? undefined;
|
||||
if (!item){
|
||||
return ui.notifications.warn(`Impossible de trouver l'objet de cette macro`);
|
||||
}
|
||||
|
||||
// Trigger the item roll
|
||||
switch (item.type) {
|
||||
|
@ -165,7 +165,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
function onLoad() {
|
||||
let rollData = dialog.rollData;
|
||||
console.log(rollData);
|
||||
console.log('Ouverture RdDRoll', rollData);
|
||||
// Update html, according to data
|
||||
if (rollData.competence) {
|
||||
const defaut_carac = rollData.competence.system.defaut_carac
|
||||
@ -294,7 +294,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
async setSelectedSigneDraconique(signe){
|
||||
this.rollData.signe = signe;
|
||||
this.rollData.diffLibre = Misc.data(signe).data.difficulte,
|
||||
this.rollData.diffLibre = signe.system.difficulte,
|
||||
$(".signe-difficulte").text(Misc.toSignedString(this.rollData.diffLibre));
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ export class RdDSheetUtility {
|
||||
destId: destItemId,
|
||||
targetActorId: actorId,
|
||||
itemId: itemId,
|
||||
sourceActorId: dragData.actorId,
|
||||
sourceActorId: item.actor.id,
|
||||
srcId: objetVersConteneur[itemId],
|
||||
onEnleverConteneur: () => { delete objetVersConteneur[itemId]; },
|
||||
onAjouterDansConteneur: (itemId, conteneurId) => { objetVersConteneur[itemId] = conteneurId; }
|
||||
|
@ -239,7 +239,7 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord));
|
||||
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
|
||||
|
||||
Handlebars.registerHelper('filtreTriCompetences', competences => competences.filter(it => it.visible)
|
||||
Handlebars.registerHelper('filtreTriCompetences', competences => competences.filter(it => it.system.isVisible)
|
||||
.sort((a, b) => {
|
||||
if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) {
|
||||
if (a.name.includes("Cité")) return -1;
|
||||
@ -831,7 +831,7 @@ export class RdDUtility {
|
||||
static confirmerSuppressionSubacteur(actorSheet, li) {
|
||||
let actorId = li.data("actor-id");
|
||||
let actor = game.actors.get(actorId);
|
||||
let msgTxt = "<p>Etes vous certain de vouloir supprimer le lien vers ce véhicule/monture/suivant : " + actor.data.name + " ?</p>";
|
||||
let msgTxt = "<p>Etes vous certain de vouloir supprimer le lien vers ce véhicule/monture/suivant : " + actor.name + " ?</p>";
|
||||
let d = new Dialog({
|
||||
title: "Confirmer la suppression du lien",
|
||||
content: msgTxt,
|
||||
@ -881,8 +881,7 @@ export class RdDUtility {
|
||||
label: "Annuler"
|
||||
}
|
||||
}
|
||||
const docData = objet
|
||||
if (docData.type == 'conteneur' && docData.data.contenu.length > 0) {
|
||||
if (objet.type == 'conteneur' && objet.system.contenu.length > 0) {
|
||||
msgTxt += "<br>Ce conteneur n'est pas vide. Choisissez l'option de suppression";
|
||||
buttons['deleteall'] = {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
|
@ -486,7 +486,7 @@ export class TMRRencontres {
|
||||
/* -------------------------------------------- */
|
||||
static async onPostSuccessReveDeDragon(tmrDialog, tmrData) {
|
||||
if (tmrData.rolled.isPart) {
|
||||
await tmrData.actor.appliquerAjoutExperience(tmrData, true);
|
||||
await tmrData.actor.appliquerAjoutExperience(tmrData);
|
||||
}
|
||||
await tmrData.actor.resultCombatReveDeDragon(tmrData);
|
||||
}
|
||||
|
Reference in New Issue
Block a user