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:
parent
59613c3bf8
commit
67b0555b11
@ -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);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{#if visible}}
|
||||
{{#if system.isVisible}}
|
||||
<li class="item flexrow list-item {{#if system.isLevelUp}}xp-level-up tooltip{{/if}}" data-item-id="{{_id}}">
|
||||
<a class="competence-label" name="{{name}}">
|
||||
<img class="sheet-competence-img" src="{{img}}"/>
|
||||
|
@ -40,8 +40,8 @@
|
||||
<a class="item-vendre" title="Vendre ou donner"><i class="fas fa-comments-dollar"></i></a>
|
||||
{{/if}}
|
||||
<a class="item-montrer" title="Montrer"><i class="fas fa-comment"></i></a>
|
||||
{{#if item.system.actionPrincipale}}
|
||||
<a class="item-action">{{item.system.actionPrincipale}}</a>
|
||||
{{#if item.actionPrincipale}}
|
||||
<a class="item-action">{{item.actionPrincipale}}</a>
|
||||
{{/if}}
|
||||
</span>
|
||||
</li>
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
<!-- <span class="equipement-detail">
|
||||
<span class="flex-shrink"><a class="monnaie-moins"><i class="fas fa-minus-square"></i></a></span>
|
||||
<span>{{piece.data.quantite}}</span>
|
||||
<span>{{piece.system.quantite}}</span>
|
||||
<span class="flex-shrink"><a class="monnaie-plus"><i class="fas fa-plus-square"></i></a></span>
|
||||
</span> -->
|
||||
<span class="equipement-actions item-controls">
|
||||
|
@ -300,7 +300,7 @@
|
||||
</li>
|
||||
{{/each}}
|
||||
{{#each esquives as |esq key|}}
|
||||
<li class="item flexrow list-item">
|
||||
<li class="item flexrow list-item" data-item-id="{{esq._id}}">
|
||||
<span class="competence-label">
|
||||
<a class="competence-label" name="{{esq.name}}">
|
||||
<img class="sheet-competence-img" src="{{esq.img}}"/>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<hr>
|
||||
<span>
|
||||
<img class="chat-icon" src="{{platCuisine.img}}" alt="{{platCuisine.name}}" />
|
||||
<br>{{alias}} a préparé {{platCuisine.data.quantite}} portions de {{platCuisine.name}}
|
||||
<br>{{alias}} a préparé {{platCuisine.system.quantite}} portions de {{platCuisine.name}}
|
||||
{{~#if ajouterEquipement}}, qui ont été ajoutées à son équipement{{/if}}.
|
||||
{{#if rolled.isSuccess}}
|
||||
Il a réussi la recette, pour un plat de qualité {{qualiteFinale}}
|
||||
|
@ -15,7 +15,7 @@
|
||||
{{alias}} ne parvient pas à vaincre le Rêve de Dragon, et prend un violent coup de queue.
|
||||
Il subit {{#if rolled.isETotal}}deux queues{{else}}une queue{{/if}} de dragon!
|
||||
{{#each queues as | queue key|}}
|
||||
<br>{{queue.name}}: {{{queue.data.description}}}
|
||||
<br>{{queue.name}}: {{{queue.system.description}}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</span>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" />
|
||||
<h4>
|
||||
{{alias}} {{#if isSortReserve}}met en réserve{{else}}lance{{/if}}
|
||||
le {{#if selectedSort.data.isrituel}}rituel{{else}}sort{{/if}}
|
||||
le {{#if selectedSort.system.isrituel}}rituel{{else}}sort{{/if}}
|
||||
{{selectedSort.name}}
|
||||
</h4>
|
||||
<div>Pour {{selectedSort.data.ptreve_reel}} point{{~#if (gt selectedSort.data.ptreve_reel 1)}}s{{/if}} de rêve en {{tmr.label}} ({{tmr.coord}}).
|
||||
<div>Pour {{selectedSort.system.ptreve_reel}} point{{~#if (gt selectedSort.system.ptreve_reel 1)}}s{{/if}} de rêve en {{tmr.label}} ({{tmr.coord}}).
|
||||
{{#if show.reveInsuffisant}}
|
||||
<span>Pas assez de rêve!</span>
|
||||
{{/if}}
|
||||
|
@ -3,5 +3,5 @@
|
||||
</h4>
|
||||
<p>Pour le lire ce signe draconique, {{alias}} doit se rendre dans les
|
||||
Terres Médianes du Rêve et trouvez une case de résonnance.
|
||||
{{#if signe.data.ephemere}}C'est un signe éphémère, qui ne restera présent que pour {{signe.data.duree}}{{/if}}
|
||||
{{#if signe.system.ephemere}}C'est un signe éphémère, qui ne restera présent que pour {{signe.system.duree}}{{/if}}
|
||||
</p>
|
||||
|
@ -26,9 +26,9 @@
|
||||
</div>
|
||||
<div class="form-group flexrow">
|
||||
<label for="signe.system.ephemere">Ephémère</label>
|
||||
<input class="flex-shrink" type="checkbox" name="signe.system.ephemere" {{#if signe.data.ephemere}}checked{{/if}} />
|
||||
<input class="flex-shrink" type="checkbox" name="signe.system.ephemere" {{#if signe.system.ephemere}}checked{{/if}} />
|
||||
<span>
|
||||
<input type="text" name="signe.system.duree" value="{{signe.systemata.duree}}" data-dtype="String" />
|
||||
<input type="text" name="signe.system.duree" value="{{signe.system.duree}}" data-dtype="String" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="flexrow">
|
||||
<label class="flex-grow">Quantité à {{#if item.system.boisson}}boire{{else}}manger{{/if}}</label>
|
||||
<input class="attribute-value consommer-doses flex-shrink" type="number" name="doses" value="{{choix.doses}}"
|
||||
min="0" max="{{item.data.quantite}}" data-dtype="Number" />
|
||||
min="0" max="{{item.system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
{{#if item.system.sust}}
|
||||
<p>Cette {{#if item.system.boisson}}boisson{{else}}nourriture{{/if}} vous apportera <span
|
||||
|
@ -2,12 +2,12 @@
|
||||
<img class="rdd-hud-togglebutton" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd06.svg" width="36" height="36" title="Attaque"/>
|
||||
<div class="rdd-hud-list tokenhudext left">
|
||||
{{#each actions as |action key|}}
|
||||
{{#unless action.data.initOnly}}
|
||||
{{#unless action.system.initOnly}}
|
||||
<div class="control-icon tokenhudicon rdd-hud-menu rdd-attaque"
|
||||
data-combatant-id="{{../combatant.id}}"
|
||||
data-action-index="{{action.index}}"
|
||||
title="{{action.name}}">
|
||||
<label>{{action.name}} {{action.data.mainInfo}}</label>
|
||||
<label>{{action.name}} {{action.system.mainInfo}}</label>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
|
@ -6,7 +6,7 @@
|
||||
data-combatant-id="{{../combatant.id}}"
|
||||
data-action-index="{{action.index}}"
|
||||
title="{{action.name}}">
|
||||
<label>init: {{action.name}} {{action.data.mainInfo}}</label>
|
||||
<label>init: {{action.name}} {{action.system.mainInfo}}</label>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{#each commandes as |commande key|}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="flex-group-left details-sort">
|
||||
{{#if sort.system.cible}}<label><strong>Cible</strong>: {{sort.system.cible}} </label>{{/if}}
|
||||
{{#if sort.system.JR}}<label><strong>JR</strong>: {{sort.system.JR}} </label>{{/if}}
|
||||
{{#if sort.system.portee}}<label><strong>Portée</strong>: {{sort.system.portée}} </label>{{/if}}
|
||||
{{#if sort.system.portee}}<label><strong>Portée</strong>: {{sort.system.portee}} </label>{{/if}}
|
||||
{{#if sort.system.duree}}<label><strong>Durée</strong>: {{sort.system.duree}} </label>{{/if}}
|
||||
{{#if sort.system.coutseuil}}<label><strong>Coût de seuil</strong>: {{sort.system.coutseuil}}</label>{{/if}}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user