Merge branch 'v1.5-drag-drop-conteneur' into 'v1.5'
Ouvrir un conteneur permet de voir son contenu See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!302
This commit is contained in:
commit
d65e113e35
@ -33,8 +33,8 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
|
||||
caracTotal: RdDCarac.computeTotal(formData.data.carac),
|
||||
resumeBlessures: this.actor.computeResumeBlessure(formData.data.blessures),
|
||||
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement()
|
||||
}
|
||||
formData.calc.surEncombrementMessage = (formData.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : "";
|
||||
|
||||
RdDUtility.filterItemsPerTypeForSheet(formData);
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
|
||||
|
@ -14,6 +14,7 @@ import { RdDCarac } from "./rdd-carac.js";
|
||||
import { DialogSplitItem } from "./dialog-split-item.js";
|
||||
import { ReglesOptionelles } from "./regles-optionelles.js";
|
||||
import { DialogRepos } from "./dialog-repos.js";
|
||||
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDActorSheet extends ActorSheet {
|
||||
@ -25,7 +26,6 @@ export class RdDActorSheet extends ActorSheet {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html",
|
||||
width: 640,
|
||||
//height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
|
||||
editCaracComp: false,
|
||||
@ -74,8 +74,8 @@ export class RdDActorSheet extends ActorSheet {
|
||||
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
|
||||
fatigue: RdDUtility.calculFatigueHtml(formData.data.sante.fatigue.value, formData.data.sante.endurance.max),
|
||||
resumeBlessures: this.actor.computeResumeBlessure(formData.data.blessures),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement()
|
||||
};
|
||||
formData.calc.surEncombrementMessage = (formData.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : "";
|
||||
|
||||
formData.competences.forEach(item => {
|
||||
item.visible = this.options.cherchercompetence
|
||||
@ -131,14 +131,15 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDropActor(event, dragData) {
|
||||
console.log("DRAG", this.actor.id, dragData);
|
||||
console.log("_onDropActor", this.actor.id, dragData);
|
||||
this.actor.addSubacteur(dragData.id || dragData.data._id);
|
||||
super._onDropActor(event, dragData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDropItem(event, dragData) {
|
||||
const callSuper = await this.actor.processDropItem(event, dragData, this.objetVersConteneur);
|
||||
const destItemId = RdDSheetUtility.getItemId(event);
|
||||
const dropParams = RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor.id, dragData, this.objetVersConteneur);
|
||||
const callSuper = await this.actor.processDropItem(dropParams);
|
||||
if (callSuper) {
|
||||
await super._onDropItem(event, dragData)
|
||||
}
|
||||
@ -165,43 +166,34 @@ export class RdDActorSheet extends ActorSheet {
|
||||
if (!this.options.editable) return;
|
||||
|
||||
html.find('.item-split').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
this.splitItem(item);
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
RdDSheetUtility.splitItem(item, this.actor);
|
||||
});
|
||||
html.find('.item-edit').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
html.find('.display-label a').click(async event => {
|
||||
let myID = event.currentTarget.attributes['data-item-id'].value;
|
||||
const item = this.actor.getEmbeddedDocument('Item', myID);
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
html.find('.rencontre-delete').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const rencontreKey = li.data("item-id");
|
||||
this.actor.deleteTMRRencontre(rencontreKey);
|
||||
this.actor.deleteTMRRencontre(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.item-delete').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppression(this, li);
|
||||
});
|
||||
html.find('.item-vendre').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const itemId = li.data("item-id");
|
||||
const item = this.actor.getObjet(itemId);
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item?.proposerVente();
|
||||
});
|
||||
html.find('.item-action').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const itemId = li.data("item-id");
|
||||
const item = this.actor.getObjet(itemId);
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
this.actor.actionItem(item);
|
||||
});
|
||||
html.find('.subacteur-delete').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppressionSubacteur(this, li);
|
||||
});
|
||||
|
||||
@ -254,8 +246,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
// Equip Inventory Item
|
||||
html.find('.item-equip').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.equiperObjet(li.data("item-id"));
|
||||
this.actor.equiperObjet(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
|
||||
// Roll Carac
|
||||
@ -278,34 +269,34 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
// Roll Skill
|
||||
html.find('a.competence-label').click(async event => {
|
||||
this.actor.rollCompetence(this._getItemId(event));
|
||||
this.actor.rollCompetence(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.tache-label a').click(async event => {
|
||||
this.actor.rollTache(this._getItemId(event));
|
||||
this.actor.rollTache(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.meditation-label a').click(async event => {
|
||||
this.actor.rollMeditation(this._getItemId(event));
|
||||
this.actor.rollMeditation(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.chant-label a').click(async event => {
|
||||
this.actor.rollChant(this._getItemId(event));
|
||||
this.actor.rollChant(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.danse-label a').click(async event => {
|
||||
this.actor.rollDanse(this._getItemId(event));
|
||||
this.actor.rollDanse(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.musique-label a').click(async event => {
|
||||
this.actor.rollMusique(this._getItemId(event));
|
||||
this.actor.rollMusique(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.oeuvre-label a').click(async event => {
|
||||
this.actor.rollOeuvre(this._getItemId(event));
|
||||
this.actor.rollOeuvre(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.jeu-label a').click(async event => {
|
||||
this.actor.rollJeu(this._getItemId(event));
|
||||
this.actor.rollJeu(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.recettecuisine-label a').click(async event => {
|
||||
this.actor.rollRecetteCuisine(this._getItemId(event));
|
||||
this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.subacteur-label a').click(async event => {
|
||||
let actorId = this._getEventItemData(event, 'actor-id');
|
||||
let actorId = RdDSheetUtility.getEventItemData(event, 'actor-id');
|
||||
let actor = game.actors.get(actorId);
|
||||
if (actor) {
|
||||
actor.sheet.render(true);
|
||||
@ -366,7 +357,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
this.actor.enleverTousLesEffets();
|
||||
});
|
||||
html.find('.conteneur-name a').click(async event => {
|
||||
RdDUtility.toggleAfficheContenu(this._getItemId(event));
|
||||
RdDUtility.toggleAfficheContenu(RdDSheetUtility.getItemId(event));
|
||||
this.render(true);
|
||||
});
|
||||
html.find('.carac-xp-augmenter').click(async event => {
|
||||
@ -374,10 +365,10 @@ export class RdDActorSheet extends ActorSheet {
|
||||
this.actor.updateCaracXPAuto(caracName);
|
||||
});
|
||||
html.find('.competence-xp-augmenter').click(async event => {
|
||||
this.actor.updateCompetenceXPAuto(this._getItemId(event));
|
||||
this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
html.find('.competence-stress-augmenter').click(async event => {
|
||||
this.actor.updateCompetenceStress(this._getItemId(event));
|
||||
this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
|
||||
if (this.options.editCaracComp) {
|
||||
@ -482,12 +473,10 @@ export class RdDActorSheet extends ActorSheet {
|
||||
});
|
||||
|
||||
html.find('.monnaie-plus').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.monnaieIncDec(li.data("item-id"), 1);
|
||||
this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), 1);
|
||||
});
|
||||
html.find('.monnaie-moins').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.monnaieIncDec(li.data("item-id"), -1);
|
||||
this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), -1);
|
||||
});
|
||||
|
||||
html.find('.vie-plus').click(async event => {
|
||||
@ -516,15 +505,6 @@ export class RdDActorSheet extends ActorSheet {
|
||||
});
|
||||
}
|
||||
|
||||
_getItemId(event) {
|
||||
return this._getEventItemData(event, "item-id");
|
||||
}
|
||||
|
||||
_getEventItemData(event, property) {
|
||||
const li = $(event.currentTarget)?.parents(".item");
|
||||
return li?.data(property);
|
||||
}
|
||||
|
||||
_getEventArmeCombat(event) {
|
||||
const li = $(event.currentTarget)?.parents(".item");
|
||||
let armeName = li.data("arme-name");
|
||||
|
@ -6,6 +6,7 @@
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
import { HtmlUtility } from "./html-utility.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
@ -57,10 +58,10 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
|
||||
formData.options.isGM = game.user.isGM;
|
||||
|
||||
formData.calc ={
|
||||
formData.calc = {
|
||||
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement()
|
||||
}
|
||||
formData.calc.surEncombrementMessage = formData.calc.encTotal > formData.data.capacite_encombrement ? "Sur-Encombrement!" : "",
|
||||
|
||||
console.log("DATA", formData);
|
||||
|
||||
@ -69,7 +70,9 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDropItem(event, dragData) {
|
||||
const callSuper = await this.actor.processDropItem(event, dragData, this.objetVersConteneur);
|
||||
const destItemId = RdDSheetUtility.getItemId(event);
|
||||
const dropParams = RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor.id, dragData, this.objetVersConteneur);
|
||||
const callSuper = await this.actor.processDropItem(dropParams);
|
||||
if (callSuper) {
|
||||
await super._onDropItem(event, dragData)
|
||||
}
|
||||
@ -101,13 +104,12 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getEmbeddedDocument('Item', li.data("itemId"));
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppression(this, li);
|
||||
});
|
||||
|
||||
@ -119,18 +121,15 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
});
|
||||
|
||||
html.find('.monnaie-plus').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.monnaieIncDec(li.data("item-id"), 1);
|
||||
this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), 1);
|
||||
});
|
||||
html.find('.monnaie-moins').click(async event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.monnaieIncDec(li.data("item-id"), -1);
|
||||
this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), -1);
|
||||
});
|
||||
|
||||
// Display info about queue
|
||||
html.find('.conteneur-name a').click((event) => {
|
||||
let myID = event.currentTarget.attributes['data-item-id'].value;
|
||||
RdDUtility.toggleAfficheContenu(myID);
|
||||
RdDUtility.toggleAfficheContenu(RdDSheetUtility.getItemId(event));
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
|
145
module/actor.js
145
module/actor.js
@ -289,8 +289,8 @@ export class RdDActor extends Actor {
|
||||
return etatGeneral;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getActivePoisons( ) {
|
||||
return duplicate( this.data.items.filter( item => item.type == 'poison' && item.data.data.active) );
|
||||
getActivePoisons() {
|
||||
return duplicate(this.data.items.filter(item => item.type == 'poison' && item.data.data.active));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -309,11 +309,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getSurenc() {
|
||||
return Misc.templateData(this).compteurs.surenc?.value ?? 0;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getCompetence(idOrName, options={}) {
|
||||
getCompetence(idOrName, options = {}) {
|
||||
return RdDItemCompetence.findCompetence(this.data.items, idOrName, options);
|
||||
}
|
||||
|
||||
@ -338,7 +334,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
getItemOfType(idOrName, type) {
|
||||
return this.data.items.find(it => it.id == idOrName && it.type == type)
|
||||
?? Misc.findFirstLike(idOrName, this.data.items,{filter: it => it.type == type, description: type});
|
||||
?? Misc.findFirstLike(idOrName, this.data.items, { filter: it => it.type == type, description: type });
|
||||
}
|
||||
|
||||
getMonnaie(id) {
|
||||
@ -931,7 +927,7 @@ export class RdDActor extends Actor {
|
||||
const niveau = Number(compData.data.niveau);
|
||||
const stressTransforme = Misc.data(this).data.compteurs.experience.value;
|
||||
const xpRequis = RdDItemCompetence.getCompetenceNextXp(niveau) - compData.data.xp;
|
||||
if (stressTransforme <= 0 || niveau >= compData.data.niveau_archetype || xpRequis <=0) {
|
||||
if (stressTransforme <= 0 || niveau >= compData.data.niveau_archetype || xpRequis <= 0) {
|
||||
ui.notifications.info(`La compétence ne peut pas augmenter!
|
||||
stress disponible: ${stressTransforme}
|
||||
expérience requise: ${xpRequis}
|
||||
@ -941,7 +937,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
const xpUtilise = Math.min(stressTransforme, xpRequis);
|
||||
const stressTransformeRestant = Math.max(0, stressTransforme - xpUtilise);
|
||||
const gainNiveau = xpUtilise>=xpRequis ? 1 : 0;
|
||||
const gainNiveau = xpUtilise >= xpRequis ? 1 : 0;
|
||||
|
||||
await this.update({ "data.compteurs.experience.value": stressTransformeRestant });
|
||||
const nouveauNiveau = niveau + gainNiveau;
|
||||
@ -949,7 +945,7 @@ export class RdDActor extends Actor {
|
||||
"data.xp": Math.max(compData.data.xp - xpRequis, 0),
|
||||
"data.niveau": nouveauNiveau,
|
||||
});
|
||||
this.updateExperienceLog('Dépense stress', xpUtilise, `Stress en ${competence.name} ${gainNiveau? "pour passer à "+nouveauNiveau : ""}`);
|
||||
this.updateExperienceLog('Dépense stress', xpUtilise, `Stress en ${competence.name} ${gainNiveau ? "pour passer à " + nouveauNiveau : ""}`);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1046,7 +1042,7 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async updateCompteurValue(fieldName, fieldValue, raison = 'Inconnue') {
|
||||
await this.update({ [`data.compteurs.${fieldName}.value`]: fieldValue });
|
||||
await this.addStressExperienceLog(fieldName, fieldValue, 'forcé: '+raison);
|
||||
await this.addStressExperienceLog(fieldName, fieldValue, 'forcé: ' + raison);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1067,11 +1063,11 @@ export class RdDActor extends Actor {
|
||||
distribuerStress(compteur, stress, motif) {
|
||||
if (game.user.isGM && this.hasPlayerOwner && this.isPersonnage()) {
|
||||
switch (compteur) {
|
||||
case 'stress': case 'experience':
|
||||
const message = `${this.name} a reçu ${stress} points ${compteur == 'stress' ? "de stress" : "d'expérience"} (raison : ${motif})`;
|
||||
this.addCompteurValue(compteur, stress, motif);
|
||||
ui.notifications.info(message);
|
||||
game.users.players.filter(player => player.active && player.character?.id == this.id)
|
||||
case 'stress': case 'experience':
|
||||
const message = `${this.name} a reçu ${stress} points ${compteur == 'stress' ? "de stress" : "d'expérience"} (raison : ${motif})`;
|
||||
this.addCompteurValue(compteur, stress, motif);
|
||||
ui.notifications.info(message);
|
||||
game.users.players.filter(player => player.active && player.character?.id == this.id)
|
||||
.forEach(player => ChatUtility.notifyUser(player.id, 'info', message));
|
||||
}
|
||||
}
|
||||
@ -1139,7 +1135,7 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
/** Supprime un item d'un conteneur, sur la base
|
||||
* de leurs ID */
|
||||
async enleverDeConteneur(item, conteneur, objetVersConteneur) {
|
||||
async enleverDeConteneur(item, conteneur, onEnleverDeConteneur) {
|
||||
if (conteneur?.isConteneur()) {
|
||||
let data2use = duplicate(Misc.data(conteneur));
|
||||
let contenu = data2use.data.contenu;
|
||||
@ -1150,20 +1146,20 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
item.data.estContenu = false;
|
||||
await this.updateEmbeddedDocuments('Item', [data2use]);
|
||||
delete objetVersConteneur[item.id];
|
||||
onEnleverDeConteneur();
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** Ajoute un item dans un conteneur, sur la base
|
||||
* de leurs ID */
|
||||
async ajouterDansConteneur(item, conteneur, objetVersConteneur) {
|
||||
async ajouterDansConteneur(item, conteneur, onAjouterDansConteneur) {
|
||||
if (conteneur?.isConteneur()) {
|
||||
let data2use = duplicate(Misc.data(conteneur));
|
||||
data2use.data.contenu.push(item.id);
|
||||
item.data.estContenu = true;
|
||||
await this.updateEmbeddedDocuments('Item', [data2use]);
|
||||
objetVersConteneur[item.id] = conteneur.id;
|
||||
onAjouterDansConteneur(item.id, conteneur.id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1185,27 +1181,28 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
async processDropItem(event, dragData, objetVersConteneur) {
|
||||
console.log("DRAG", this.id, dragData);
|
||||
const itemId = dragData.id || dragData.data._id;
|
||||
if (dragData.actorId && dragData.actorId != this.id) {
|
||||
console.log("Moving objects", dragData);
|
||||
this.moveItemsBetweenActors(itemId, dragData.actorId);
|
||||
async processDropItem(params) {
|
||||
const targetActorId = this.id;
|
||||
const sourceActorId = params.sourceActorId;
|
||||
const itemId = params.itemId;
|
||||
const destId = params.destId;
|
||||
const srcId = params.srcId;
|
||||
if (sourceActorId && sourceActorId != targetActorId) {
|
||||
console.log("Moving objects", sourceActorId, targetActorId, itemId);
|
||||
this.moveItemsBetweenActors(itemId, sourceActorId);
|
||||
return false;
|
||||
}
|
||||
let result = true;
|
||||
const destId = $(event.target).parents(".item").attr("data-item-id");
|
||||
const item = this.getObjet(itemId);
|
||||
if (item?.isEquipement() && dragData.actorId == this.id) {
|
||||
if (item?.isEquipement() && sourceActorId == targetActorId) {
|
||||
// rangement
|
||||
const srcId = objetVersConteneur[itemId];
|
||||
if (srcId != destId && itemId != destId) { // déplacement de l'objet
|
||||
const dest = this.getObjet(destId);
|
||||
const src = this.getObjet(srcId);
|
||||
// changer de conteneur
|
||||
if (this.conteneurPeutContenir(dest, item)) {
|
||||
await this.enleverDeConteneur(item, src, objetVersConteneur);
|
||||
await this.ajouterDansConteneur(item, dest, objetVersConteneur);
|
||||
await this.enleverDeConteneur(item, src, params.onEnleverConteneur);
|
||||
await this.ajouterDansConteneur(item, dest, params.onAjouterDansConteneur);
|
||||
}
|
||||
else if (dest?.isEquipementSimilaire(item)) {
|
||||
await this.regrouperEquipementsSimilaires(item, dest);
|
||||
@ -1293,6 +1290,9 @@ export class RdDActor extends Actor {
|
||||
computeMalusSurEncombrement() {
|
||||
return Math.min(0, this.getEncombrementMax() - Math.ceil(Number(this.getEncTotal())));
|
||||
}
|
||||
getMessageSurEncombrement(){
|
||||
return this.computeMalusSurEncombrement() <0 ? "Sur-Encombrement!" : "";
|
||||
}
|
||||
|
||||
getEncombrementMax() {
|
||||
return (this.data.type == 'vehicule')
|
||||
@ -1572,7 +1572,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async finDeRound(options = {terminer:false}) {
|
||||
async finDeRound(options = { terminer: false }) {
|
||||
for (let effect of this.getActiveEffects()) {
|
||||
if (effect.duration.type !== 'none' && (effect.duration.remaining <= 0 || options.terminer)) {
|
||||
if (effect.data.origin) {
|
||||
@ -1584,11 +1584,11 @@ export class RdDActor extends Actor {
|
||||
ChatMessage.create({ content: `${this.name} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.data.label))} !` });
|
||||
}
|
||||
}
|
||||
if ( this.type == 'personnage') {
|
||||
if (this.type == 'personnage') {
|
||||
// Gestion blessure graves : -1 pt endurance
|
||||
let nbGraves = this.countBlessuresNonSoigneeByName( 'graves');
|
||||
if ( nbGraves > 0) {
|
||||
await this.santeIncDec("endurance", -1 );
|
||||
let nbGraves = this.countBlessuresNonSoigneeByName('graves');
|
||||
if (nbGraves > 0) {
|
||||
await this.santeIncDec("endurance", -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1598,7 +1598,7 @@ export class RdDActor extends Actor {
|
||||
if (this.isEntiteCauchemar()) {
|
||||
return;
|
||||
}
|
||||
if (!game.combat && sonne){
|
||||
if (!game.combat && sonne) {
|
||||
ui.notifications.info("Le personnage est hors combat, il ne reste donc pas sonné");
|
||||
return;
|
||||
}
|
||||
@ -1629,7 +1629,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
countBlessuresNonSoigneeByName(name) {
|
||||
let blessures = Misc.templateData(this).blessures[name].liste;
|
||||
return blessures.filter( b => b.active && !b.psdone).length;
|
||||
return blessures.filter(b => b.active && !b.psdone).length;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1809,7 +1809,7 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async jetDeMoral(situation, messageReussi = undefined, messageManque = undefined) {
|
||||
const jetMoral = await this._jetDeMoral(situation);
|
||||
const finMessage = (jetMoral.succes ? messageReussi : messageManque) ?? (jetMoral.ajustement == 0 ? "Vous gardez votre moral": jetMoral.ajustement > 0 ? "Vous gagnez du moral" : "Vous perdez du moral");
|
||||
const finMessage = (jetMoral.succes ? messageReussi : messageManque) ?? (jetMoral.ajustement == 0 ? "Vous gardez votre moral" : jetMoral.ajustement > 0 ? "Vous gagnez du moral" : "Vous perdez du moral");
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
content: `${finMessage} - jet ${jetMoral.succes ? "réussi" : "manqué"} en situation ${situation} (${jetMoral.jet}/${jetMoral.difficulte}).`
|
||||
@ -1893,23 +1893,27 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async actionItem(item) {
|
||||
async actionItem(item, onActionItem = async ()=>{}) {
|
||||
if (!item.getActionPrincipale()) return;
|
||||
switch (Misc.data(item).type) {
|
||||
case 'nourritureboisson': return await this.actionNourritureboisson(item);
|
||||
case 'potion': return await this.actionPotion(item);
|
||||
case 'nourritureboisson': return await this.actionNourritureboisson(item, onActionItem);
|
||||
case 'potion': return await this.consommerPotion(item, onActionItem);
|
||||
case 'livre': return await this.actionLire(item);
|
||||
case 'conteneur': return await item.sheet.render(true);
|
||||
case 'herbe': {
|
||||
if (item.isHerbeAPotion()){
|
||||
return this.dialogFabriquerPotion(item);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async actionNourritureboisson(item) {
|
||||
const dialog = await DialogConsommer.create(this, item);
|
||||
async actionNourritureboisson(item, onActionItem) {
|
||||
const dialog = await DialogConsommer.create(this, item, onActionItem);
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
async actionPotion(item) {
|
||||
return await this.consommerPotion(item)
|
||||
}
|
||||
async actionLire(item) {
|
||||
const tache = await this.creerTacheDepuisLivre(item, { renderSheet: false });
|
||||
if (tache) {
|
||||
@ -1979,7 +1983,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async manger(item, doses, options = { diminuerQuantite: true}) {
|
||||
async manger(item, doses, options = { diminuerQuantite: true }) {
|
||||
const sust = Misc.templateData(item).sust;
|
||||
if (sust > 0) {
|
||||
await this.updateCompteurValue('sust', Misc.keepDecimals(Misc.templateData(this).compteurs.sust.value + sust * doses, 1));
|
||||
@ -2478,14 +2482,14 @@ export class RdDActor extends Actor {
|
||||
RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-general.html');
|
||||
}
|
||||
|
||||
async rollCaracCompetence(caracName, compName, diff, options = { title: "", apprecier: false}) {
|
||||
async rollCaracCompetence(caracName, compName, diff, options = { title: "", apprecier: false }) {
|
||||
const carac = this.getCaracByName(caracName);
|
||||
if (!carac) {
|
||||
ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`)
|
||||
return;
|
||||
}
|
||||
const competence = Misc.data(this.getCompetence(compName));
|
||||
if (options.apprecier && competence){
|
||||
if (options.apprecier && competence) {
|
||||
const minQualite = Math.max(0, competence.data.niveau);
|
||||
if (diff <= minQualite) {
|
||||
ui.notifications.info(`${this.name} a un niveau ${competence.data.niveau} en ${competence.name}, trop élevé pour apprécier la qualité de ${diff}`)
|
||||
@ -2623,7 +2627,7 @@ export class RdDActor extends Actor {
|
||||
} else {
|
||||
rollData.tache.data.nb_jet_echec++;
|
||||
}
|
||||
rollData.tache.data.tentatives = rollData.tache.data.nb_jet_succes+rollData.tache.data.nb_jet_echec;
|
||||
rollData.tache.data.tentatives = rollData.tache.data.nb_jet_succes + rollData.tache.data.nb_jet_echec;
|
||||
|
||||
this.updateEmbeddedDocuments('Item', [rollData.tache]);
|
||||
this.santeIncDec("fatigue", rollData.tache.data.fatigue);
|
||||
@ -3107,8 +3111,8 @@ export class RdDActor extends Actor {
|
||||
case 'chance-actuelle': case 'chance actuelle':
|
||||
return carac.chance;
|
||||
}
|
||||
let entry = Misc.findFirstLike(name, Object.entries(carac), {mapper:it => it[1].label, description: 'caractéristique'});
|
||||
return entry.length>0 ? carac[entry[0]] : undefined;
|
||||
let entry = Misc.findFirstLike(name, Object.entries(carac), { mapper: it => it[1].label, description: 'caractéristique' });
|
||||
return entry.length > 0 ? carac[entry[0]] : undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3183,7 +3187,7 @@ export class RdDActor extends Actor {
|
||||
rollArme(arme) {
|
||||
let competence = Misc.data(this.getCompetence(arme.data.competence));
|
||||
if (arme || (competence.type == 'competencecreature' && competence.data.iscombat)) {
|
||||
if ( competence.data.ispossession ) {
|
||||
if (competence.data.ispossession) {
|
||||
RdDPossession.managePosession(this, competence);
|
||||
} else {
|
||||
RdDCombat.createUsingTarget(this)?.attaque(competence, arme);
|
||||
@ -3347,16 +3351,16 @@ export class RdDActor extends Actor {
|
||||
|
||||
// Chaque dé fait au minmum la difficulté libre
|
||||
if (ReglesOptionelles.isUsing('degat-minimum-malus-libre')) {
|
||||
if ( rollData.diffLibre < 0 ) {
|
||||
if (rollData.diffLibre < 0) {
|
||||
let valeurMin = Math.abs(rollData.diffLibre);
|
||||
formula += "min"+valeurMin;
|
||||
formula += "min" + valeurMin;
|
||||
}
|
||||
}
|
||||
// Chaque dé fait au minmum la difficulté libre
|
||||
if (ReglesOptionelles.isUsing('degat-ajout-malus-libre')) {
|
||||
if ( rollData.diffLibre < 0 ) {
|
||||
if (rollData.diffLibre < 0) {
|
||||
let valeurMin = Math.abs(rollData.diffLibre);
|
||||
formula += "+"+valeurMin;
|
||||
formula += "+" + valeurMin;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3364,9 +3368,9 @@ export class RdDActor extends Actor {
|
||||
|
||||
// 1 dé fait au minmum la difficulté libre
|
||||
if (ReglesOptionelles.isUsing('degat-minimum-malus-libre-simple')) {
|
||||
if ( rollData.diffLibre < 0 ) {
|
||||
if (rollData.diffLibre < 0) {
|
||||
let valeurMin = Math.abs(rollData.diffLibre);
|
||||
if ( roll.terms[0].results[0].result < valeurMin) {
|
||||
if (roll.terms[0].results[0].result < valeurMin) {
|
||||
roll.terms[0].results[0].result = valeurMin;
|
||||
} else if (roll.terms[0].results[1].result < valeurMin) {
|
||||
roll.terms[0].results[1].result = valeurMin;
|
||||
@ -3683,7 +3687,7 @@ export class RdDActor extends Actor {
|
||||
return;
|
||||
}
|
||||
if (!Misc.isUniqueConnectedGM()) {
|
||||
RdDActor.remoteActorCall({actorId: achat.vendeurId ?? achat.acheteurId, method: 'achatVente', args: [achat]});
|
||||
RdDActor.remoteActorCall({ actorId: achat.vendeurId ?? achat.acheteurId, method: 'achatVente', args: [achat] });
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3701,7 +3705,7 @@ export class RdDActor extends Actor {
|
||||
if (acheteur) {
|
||||
let resteAcheteur = await acheteur.depenser(coutDeniers);
|
||||
if (resteAcheteur < 0) {
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', `Vous n'avez pas assez d'argent pour payer ${Math.ceil(coutDeniers/100)} sols !`);
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', `Vous n'avez pas assez d'argent pour payer ${Math.ceil(coutDeniers / 100)} sols !`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -3726,9 +3730,9 @@ export class RdDActor extends Actor {
|
||||
type: vente.item.type,
|
||||
img: vente.item.img,
|
||||
name: vente.item.name,
|
||||
data: mergeObject(vente.item.data, {quantite: isItemEmpilable ? achat.quantiteTotal : undefined}),
|
||||
data: mergeObject(vente.item.data, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
|
||||
}
|
||||
let listeAchat = isItemEmpilable ? [achatData] : Array.from({length: achat.quantiteTotal}, (_, i) => achatData)
|
||||
let listeAchat = isItemEmpilable ? [achatData] : Array.from({ length: achat.quantiteTotal }, (_, i) => achatData)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat)
|
||||
if (achat.choix.consommer && vente.item.type == 'nourritureboisson') {
|
||||
achat.choix.doses = achat.choix.nombreLots;
|
||||
@ -3742,7 +3746,7 @@ export class RdDActor extends Actor {
|
||||
chatAchatItem.quantiteTotal = achat.quantiteTotal;
|
||||
ChatMessage.create({
|
||||
user: achat.userId,
|
||||
speaker: {alias: (acheteur ?? vendeur).name} ,
|
||||
speaker: { alias: (acheteur ?? vendeur).name },
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', chatAchatItem)
|
||||
});
|
||||
@ -4058,7 +4062,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async consommerPotion(potion) {
|
||||
async consommerPotion(potion, onActionItem = async () => {}) {
|
||||
const potionData = Misc.data(potion);
|
||||
|
||||
if (potionData.data.categorie.includes('Soin')) {
|
||||
@ -4068,7 +4072,8 @@ export class RdDActor extends Actor {
|
||||
} else {
|
||||
this.consommerPotionGenerique(potionData);
|
||||
}
|
||||
this.diminuerQuantiteObjet(potion.id, 1, { supprimerSiZero: potionData.supprimer });
|
||||
await this.diminuerQuantiteObjet(potion.id, 1, { supprimerSiZero: potionData.supprimer });
|
||||
await onActionItem()
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -4119,7 +4124,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
enleverActiveEffectById(id) {
|
||||
if (game.user.isGM){
|
||||
if (game.user.isGM) {
|
||||
const existing = this.getEffectById(id);
|
||||
if (existing) {
|
||||
existing.delete();
|
||||
@ -4128,7 +4133,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
enleverTousLesEffets() {
|
||||
if (game.user.isGM){
|
||||
if (game.user.isGM) {
|
||||
this.deleteEmbeddedDocuments('ActiveEffect', this.getActiveEffects().map(it => it.id));
|
||||
}
|
||||
}
|
||||
|
@ -2,22 +2,23 @@ import { Misc } from "./misc.js";
|
||||
|
||||
export class DialogConsommer extends Dialog {
|
||||
|
||||
static async create(actor, item, template = undefined, options = {}) {
|
||||
const consommerData = DialogConsommer.prepareData(actor, item, options);
|
||||
const html = await renderTemplate(template ?? `systems/foundryvtt-reve-de-dragon/templates/dialog-item-consommer.html`, consommerData);
|
||||
return new DialogConsommer(actor, item, consommerData, html, options)
|
||||
static async create(actor, item, onActionItem = async ()=>{}) {
|
||||
const consommerData = DialogConsommer.prepareData(actor, item);
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-item-consommer.html', consommerData);
|
||||
return new DialogConsommer(actor, item, consommerData, html, onActionItem)
|
||||
}
|
||||
|
||||
constructor(actor, item, consommerData, html, options = {}) {
|
||||
mergeObject(options, { classes: ["dialogconsommer"], width: 350, height: 450, 'z-index': 99999 }, { overwrite: false })
|
||||
|
||||
constructor(actor, item, consommerData, html, onActionItem = async ()=>{}) {
|
||||
const options = { classes: ["dialogconsommer"], width: 350, height: 450, 'z-index': 99999 };
|
||||
let conf = {
|
||||
title: consommerData.title,
|
||||
content: html,
|
||||
default: consommerData.buttonName,
|
||||
buttons: {
|
||||
[consommerData.buttonName]: {
|
||||
label: consommerData.buttonName, callback: it => this.onConsommer(it)
|
||||
label: consommerData.buttonName, callback: async it => {
|
||||
await this.onConsommer(it);
|
||||
await onActionItem();}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -32,18 +33,18 @@ export class DialogConsommer extends Dialog {
|
||||
async onConsommer(event) {
|
||||
await $(".se-forcer").change();
|
||||
await $(".consommer-doses").change();
|
||||
this.actor.consommer(this.item, this.consommerData.choix);
|
||||
await this.actor.consommer(this.item, this.consommerData.choix);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static prepareData(actor, item, options) {
|
||||
static prepareData(actor, item) {
|
||||
const itemData = duplicate(Misc.data(item));
|
||||
let consommerData = {
|
||||
item: itemData,
|
||||
cuisine: Misc.data(actor.getCompetence('cuisine')),
|
||||
choix: {
|
||||
doses: options.doses ?? 1,
|
||||
seForcer: options.seForcer ?? false,
|
||||
doses: 1,
|
||||
seForcer: false,
|
||||
}
|
||||
}
|
||||
switch (itemData.type) {
|
||||
|
@ -8,6 +8,7 @@ import { Misc } from "./misc.js";
|
||||
import { HtmlUtility } from "./html-utility.js";
|
||||
import { ReglesOptionelles } from "./regles-optionelles.js";
|
||||
import { SYSTEM_RDD } from "./constants.js";
|
||||
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
||||
|
||||
/**
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
@ -22,10 +23,10 @@ export class RdDItemSheet extends ItemSheet {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/item-sheet.html",
|
||||
width: 550,
|
||||
height: 550
|
||||
//tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_getHeaderButtons() {
|
||||
let buttons = super._getHeaderButtons();
|
||||
@ -63,15 +64,15 @@ export class RdDItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = Misc.data(this.object);
|
||||
|
||||
let formData = {
|
||||
id: this.object.id,
|
||||
title: objectData.name,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
data: objectData.data,
|
||||
isGM: game.user.isGM,
|
||||
actorId: this.actor?.id,
|
||||
owner: this.document.isOwner,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
@ -79,7 +80,9 @@ export class RdDItemSheet extends ItemSheet {
|
||||
}
|
||||
if (this.actor) {
|
||||
formData.isOwned = true;
|
||||
formData.actorId = this.actor.id;
|
||||
if (objectData.type == 'conteneur') {
|
||||
this.prepareConteneurData(formData);
|
||||
}
|
||||
}
|
||||
|
||||
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences();
|
||||
@ -96,7 +99,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
}
|
||||
if (formData.type == 'gemme') {
|
||||
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
||||
RdDGemme.calculDataDerivees( formData.data );
|
||||
RdDGemme.calculDataDerivees(formData.data);
|
||||
}
|
||||
if (formData.type == 'potion') {
|
||||
if (this.dateUpdated) {
|
||||
@ -113,11 +116,27 @@ export class RdDItemSheet extends ItemSheet {
|
||||
return formData;
|
||||
}
|
||||
|
||||
prepareConteneurData(formData) {
|
||||
formData.itemsByType = Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i.data)));
|
||||
RdDUtility.filterEquipementParType(formData);
|
||||
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
|
||||
formData.subItems = formData.conteneurs.find(it => it._id == this.object.id)?.subItems;
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
if (this.object.type == 'conteneur') {
|
||||
this.form.ondragstart = (event) => this._onDragStart(event);
|
||||
this.form.ondrop = (event) => this._onDrop(event);
|
||||
}
|
||||
|
||||
let itemSheetDialog = this;
|
||||
|
||||
HtmlUtility._showControlWhen($(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.object.isOwned);
|
||||
HtmlUtility._showControlWhen($(".item-magique"), this.object.isMagique());
|
||||
|
||||
@ -168,13 +187,37 @@ export class RdDItemSheet extends ItemSheet {
|
||||
}
|
||||
});
|
||||
|
||||
html.find('.item-split').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
await RdDSheetUtility.splitItem(item, this.actor, async () => itemSheetDialog.render(true));
|
||||
});
|
||||
html.find('.item-edit').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
html.find('.item-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppression(this, li);
|
||||
});
|
||||
html.find('.item-vendre').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item?.proposerVente();
|
||||
});
|
||||
html.find('.item-action').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
this.actor.actionItem(item, async () => itemSheetDialog.render(true));
|
||||
});
|
||||
html.find('.conteneur-name a').click(async event => {
|
||||
RdDUtility.toggleAfficheContenu(RdDSheetUtility.getItemId(event));
|
||||
this.render(true);
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onSelectCategorie(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (this.object.isCompetence()){
|
||||
if (this.object.isCompetence()) {
|
||||
let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value);
|
||||
Misc.templateData(this.object).base = level;
|
||||
$("#base").val(level);
|
||||
@ -183,7 +226,6 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
get template() {
|
||||
//console.log(this);
|
||||
let type = this.object.data.type;
|
||||
return `systems/foundryvtt-reve-de-dragon/templates/item-${type}-sheet.html`;
|
||||
}
|
||||
@ -192,10 +234,56 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
/** @override */
|
||||
_updateObject(event, formData) { // Deprecated en v0.8 à clarifier
|
||||
//console.log("UPDATE !", formData);
|
||||
// Données de bonus de cases ?
|
||||
formData = RdDItemSort.buildBonusCaseStringFromFormData(formData);
|
||||
|
||||
return this.object.update(formData);
|
||||
}
|
||||
|
||||
async _onDragStart(event) {
|
||||
console.log("_onDragStart", event);
|
||||
if ( event.target.classList.contains("entity-link") ) return;
|
||||
|
||||
const itemId = event.srcElement?.attributes["data-item-id"].value;
|
||||
const item = this.actor.items.get(itemId);
|
||||
// Create drag data
|
||||
const dragData = {
|
||||
actorId: this.actor.id,
|
||||
type: "Item",
|
||||
data: item.data
|
||||
};
|
||||
|
||||
event.dataTransfer.setData("text/plain", JSON.stringify(dragData));
|
||||
}
|
||||
|
||||
async _onDrop(event) {
|
||||
// Try to extract the data
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(event.dataTransfer.getData('text/plain'));
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const allowed = Hooks.call("dropActorSheetData", this.actor, this, data);
|
||||
if ( allowed === false ) return;
|
||||
|
||||
// Handle different data types
|
||||
switch ( data.type ) {
|
||||
case "Item":
|
||||
return this._onDropItem(event, data);
|
||||
}
|
||||
return super._onDrop(event);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDropItem(event, dragData) {
|
||||
if (this.actor) {
|
||||
const dropParams = RdDSheetUtility.prepareItemDropParameters(this.object.id, this.actor.id, dragData, this.objetVersConteneur);
|
||||
await this.actor.processDropItem(dropParams);
|
||||
await this.render(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -71,7 +71,10 @@ export class RdDItem extends Item {
|
||||
const itemData = Misc.data(this);
|
||||
return itemData.type == 'nourritureboisson' && itemData.data.boisson && itemData.data.alcoolise;
|
||||
}
|
||||
|
||||
isHerbeAPotion() {
|
||||
const itemData = Misc.data(this);
|
||||
return itemData.type == 'herbe' && (itemData.data.categorie == 'Soin' || itemData.data.categorie == 'Repos');
|
||||
}
|
||||
isPotion() {
|
||||
return Misc.data(this).type == 'potion';
|
||||
}
|
||||
@ -104,14 +107,15 @@ export class RdDItem extends Item {
|
||||
|
||||
prepareDerivedData() {
|
||||
super.prepareDerivedData();
|
||||
if (this.isEquipement(this)) {
|
||||
if (this.isEquipement()) {
|
||||
this._calculsEquipement();
|
||||
|
||||
if (this.isPotion()) {
|
||||
this.prepareDataPotion()
|
||||
}
|
||||
const itemData = Misc.data(this);
|
||||
itemData.data.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
|
||||
}
|
||||
if (this.isPotion()) {
|
||||
this.prepareDataPotion()
|
||||
}
|
||||
const itemData = Misc.data(this);
|
||||
itemData.data.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
|
||||
}
|
||||
|
||||
prepareDataPotion() {
|
||||
@ -139,7 +143,7 @@ export class RdDItem extends Item {
|
||||
|
||||
getActionPrincipale(options = { warnIfNot: true }) {
|
||||
const itemData = Misc.data(this);
|
||||
if ((itemData.data.quantite ?? 0) <= 0) {
|
||||
if (itemData.type != 'conteneur' && (itemData.data.quantite ?? 0) <= 0) {
|
||||
if (options.warnIfNot) {
|
||||
ui.notifications.warn(`Vous n'avez plus de ${itemData.name}.`);
|
||||
}
|
||||
@ -149,9 +153,11 @@ export class RdDItem extends Item {
|
||||
case 'nourritureboisson': return itemData.data.boisson ? 'Boire' : 'Manger';
|
||||
case 'potion': return 'Boire';
|
||||
case 'livre': return 'Lire';
|
||||
case 'conteneur': return 'Ouvrir';
|
||||
}
|
||||
if (this.isHerbeAPotion()) { return 'Décoction'; }
|
||||
if (options.warnIfNot) {
|
||||
ui.notifications.warn(`Impossible d'utilise un ${itemData.name}, aucune action associée définie.`);
|
||||
ui.notifications.warn(`Impossible d'utiliser un ${itemData.name}, aucune action associée définie.`);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
@ -200,7 +206,7 @@ export class RdDItem extends Item {
|
||||
.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){
|
||||
for (const [key, value] of differences) {
|
||||
message += `<br>${key}: ${value} vs ${otherTplData[key]}`;
|
||||
}
|
||||
ui.notifications.info(message)
|
||||
@ -236,7 +242,7 @@ export class RdDItem extends Item {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async postItem( modeOverride ) {
|
||||
async postItem(modeOverride) {
|
||||
console.log(this);
|
||||
let chatData = duplicate(Misc.data(this));
|
||||
const properties = this.getProprietes();
|
||||
@ -568,11 +574,11 @@ export class RdDItem extends Item {
|
||||
`<b>Dommages</b>: ${tplData.dommages}`
|
||||
]
|
||||
if (tplData.remedesconnus) {
|
||||
properties.push(`<b>Remedes</b>: ${tplData.remedes}` )
|
||||
properties.push(`<b>Remedes</b>: ${tplData.remedes}`)
|
||||
}
|
||||
} else {
|
||||
properties = [
|
||||
`<b>Inconnue</b>` ]
|
||||
`<b>Inconnue</b>`]
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ export class RdDRoll extends Dialog {
|
||||
diffLibre: rollData.competence?.data.default_diffLibre ?? 0,
|
||||
malusArmureValue: actor.getMalusArmure(),
|
||||
surencMalusFlag: actor.isPersonnage() ? (actorData.data.compteurs.surenc.value < 0) : false,
|
||||
surencMalusValue: actor.getSurenc(),
|
||||
surencMalusValue: actor.computeMalusSurEncombrement(),
|
||||
useMalusSurenc: false,
|
||||
useMoral: false, /* Est-ce que le joueur demande d'utiliser le moral ? Utile si le joueur change plusieurs fois de carac associée. */
|
||||
perteMoralEchec: false, /* Pour l'affichage dans le chat */
|
||||
|
53
module/rdd-sheet-utility.js
Normal file
53
module/rdd-sheet-utility.js
Normal file
@ -0,0 +1,53 @@
|
||||
import { DialogSplitItem } from "./dialog-split-item.js";
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
export class RdDSheetUtility {
|
||||
|
||||
static getItem(event, actor) {
|
||||
return actor.items.get(RdDSheetUtility.getItemId(event));
|
||||
}
|
||||
|
||||
static getItemId(event) {
|
||||
return RdDSheetUtility.getEventItemData(event, "item-id");
|
||||
}
|
||||
|
||||
static getEventItemData(event, property) {
|
||||
const node = RdDSheetUtility.getEventElement(event);
|
||||
return node?.data(property);
|
||||
}
|
||||
|
||||
static getEventElement(event) {
|
||||
return $(event.currentTarget)?.parents(".item");
|
||||
}
|
||||
|
||||
static prepareItemDropParameters(destItemId, actorId, dragData, objetVersConteneur) {
|
||||
const itemId = dragData.id || dragData.data._id;
|
||||
return {
|
||||
destId: destItemId,
|
||||
targetActorId: actorId,
|
||||
itemId: itemId,
|
||||
sourceActorId: dragData.actorId,
|
||||
srcId: objetVersConteneur[itemId],
|
||||
onEnleverConteneur: () => { delete objetVersConteneur[itemId]; },
|
||||
onAjouterDansConteneur: (itemId, conteneurId) => { objetVersConteneur[itemId] = conteneurId; }
|
||||
}
|
||||
}
|
||||
|
||||
static async splitItem(item, actor, onSplit = ()=>{}) {
|
||||
const dialog = await DialogSplitItem.create(item, async (item, split) => {
|
||||
await RdDSheetUtility._onSplitItem(item, split, actor);
|
||||
onSplit();
|
||||
});
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
static async _onSplitItem(item, split, actor) {
|
||||
if (split >= 1 && split < Misc.data(item).data.quantite) {
|
||||
await item.diminuerQuantite(split);
|
||||
const itemData = duplicate(Misc.data(item));
|
||||
// todo: ajouter dans le même conteneur?
|
||||
itemData.data.quantite = split;
|
||||
await actor.createEmbeddedDocuments('Item', [itemData])
|
||||
}
|
||||
}
|
||||
}
|
@ -224,7 +224,8 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('le', str => Grammar.articleDetermine(str));
|
||||
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str));
|
||||
Handlebars.registerHelper('accord', (genre, ...args) => Grammar.accord(genre, args));
|
||||
Handlebars.registerHelper('buildConteneur', (objet) => { return RdDUtility.buildConteneur(objet); });
|
||||
Handlebars.registerHelper('buildConteneur', (objet) => { return new Handlebars.SafeString(RdDUtility.buildConteneur(objet)); });
|
||||
Handlebars.registerHelper('buildContenu', (objet) => { return new Handlebars.SafeString(RdDUtility.buildContenu(objet, 1, true)); });
|
||||
Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord));
|
||||
Handlebars.registerHelper('caseTmr-type', coord => TMRUtility.getTMRType(coord));
|
||||
Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord));
|
||||
@ -271,7 +272,7 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async selectObjetType( actorSheet) {
|
||||
static async selectObjetType(actorSheet) {
|
||||
let typeObjets = RdDItem.getTypeObjetsEquipement();
|
||||
let options = `<span class="competence-label">Selectionnez le type d'équipement</span><select class="item-type">`;
|
||||
for (let typeName of typeObjets) {
|
||||
@ -290,10 +291,10 @@ export class RdDUtility {
|
||||
}
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async selectTypeOeuvre( actorSheet) {
|
||||
/* -------------------------------------------- */
|
||||
static async selectTypeOeuvre(actorSheet) {
|
||||
let typeObjets = RdDItem.getTypesOeuvres();
|
||||
let options = `<span class="competence-label">Selectionnez le type d'oeuvre</span><select class="item-type">`;
|
||||
for (let typeName of typeObjets) {
|
||||
@ -312,7 +313,7 @@ export class RdDUtility {
|
||||
}
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildListOptions(min, max) {
|
||||
@ -355,15 +356,9 @@ export class RdDUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static filterItemsPerTypeForSheet(formData) {
|
||||
formData.materiel = this.checkNull(formData.itemsByType['objet']);
|
||||
formData.conteneurs = this.checkNull(formData.itemsByType['conteneur']);
|
||||
formData.armes = this.checkNull(formData.itemsByType['arme']);
|
||||
formData.armures = this.checkNull(formData.itemsByType['armure']);
|
||||
formData.livres = this.checkNull(formData.itemsByType['livre']);
|
||||
formData.potions = this.checkNull(formData.itemsByType['potion']);
|
||||
formData.ingredients = this.checkNull(formData.itemsByType['ingredient']);
|
||||
formData.munitions = this.checkNull(formData.itemsByType['munition']);
|
||||
formData.herbes = this.checkNull(formData.itemsByType['herbe']);
|
||||
|
||||
RdDUtility.filterEquipementParType(formData);
|
||||
|
||||
formData.sorts = this.checkNull(formData.itemsByType['sort']);
|
||||
formData.signesdraconiques = this.checkNull(formData.itemsByType['signedraconique']);
|
||||
formData.queues = this.checkNull(formData.itemsByType['queue']);
|
||||
@ -371,34 +366,50 @@ export class RdDUtility {
|
||||
formData.ombres = this.checkNull(formData.itemsByType['ombre']);
|
||||
formData.tetes = this.checkNull(formData.itemsByType['tete']);
|
||||
formData.taches = this.checkNull(formData.itemsByType['tache']);
|
||||
formData.monnaie = this.checkNull(formData.itemsByType['monnaie']);
|
||||
formData.nourritureboissons = this.checkNull(formData.itemsByType['nourritureboisson']);
|
||||
formData.meditations = this.checkNull(formData.itemsByType['meditation']);
|
||||
formData.chants = this.checkNull(formData.itemsByType['chant']);
|
||||
formData.danses = this.checkNull(formData.itemsByType['danse']);
|
||||
formData.musiques = this.checkNull(formData.itemsByType['musique']);
|
||||
formData.oeuvres = this.checkNull(formData.itemsByType['oeuvre']);
|
||||
formData.jeux = this.checkNull(formData.itemsByType['jeu']);
|
||||
formData.gemmes = this.checkNull(formData.itemsByType['gemme']);
|
||||
|
||||
formData.recettescuisine = this.checkNull(formData.itemsByType['recettecuisine']);
|
||||
formData.recettesAlchimiques = this.checkNull(formData.itemsByType['recettealchimique']);
|
||||
formData.maladies = this.checkNull(formData.itemsByType['maladie']);
|
||||
formData.poisons = this.checkNull(formData.itemsByType['poison']);
|
||||
formData.possessions = this.checkNull(formData.itemsByType['possession']);
|
||||
formData.maladiesPoisons = formData.maladies.concat( formData.poisons);
|
||||
formData.objets = formData.conteneurs.concat(formData.materiel)
|
||||
formData.maladiesPoisons = formData.maladies.concat(formData.poisons);
|
||||
formData.competences = (formData.itemsByType.competence ?? []).concat(formData.itemsByType.competencecreature ?? []);
|
||||
}
|
||||
|
||||
static filterEquipementParType(formData) {
|
||||
formData.conteneurs = this.checkNull(formData.itemsByType['conteneur']);
|
||||
|
||||
formData.materiel = this.checkNull(formData.itemsByType['objet']);
|
||||
formData.armes = this.checkNull(formData.itemsByType['arme']);
|
||||
formData.armures = this.checkNull(formData.itemsByType['armure']);
|
||||
formData.munitions = this.checkNull(formData.itemsByType['munition']);
|
||||
formData.livres = this.checkNull(formData.itemsByType['livre']);
|
||||
formData.potions = this.checkNull(formData.itemsByType['potion']);
|
||||
formData.ingredients = this.checkNull(formData.itemsByType['ingredient']);
|
||||
formData.herbes = this.checkNull(formData.itemsByType['herbe']);
|
||||
formData.monnaie = this.checkNull(formData.itemsByType['monnaie']);
|
||||
formData.monnaie.sort(Monnaie.triValeurDenier());
|
||||
formData.nourritureboissons = this.checkNull(formData.itemsByType['nourritureboisson']);
|
||||
formData.gemmes = this.checkNull(formData.itemsByType['gemme']);
|
||||
|
||||
formData.objets = formData.conteneurs
|
||||
.concat(formData.materiel)
|
||||
.concat(formData.armes)
|
||||
.concat(formData.armures)
|
||||
.concat(formData.munitions)
|
||||
.concat(formData.livres)
|
||||
.concat(formData.potions)
|
||||
.concat(formData.herbes)
|
||||
.concat(formData.ingredients)
|
||||
.concat(formData.herbes)
|
||||
.concat(formData.monnaie)
|
||||
.concat(formData.nourritureboissons)
|
||||
.concat(formData.gemmes)
|
||||
.concat(formData.monnaie);
|
||||
formData.competences = (formData.itemsByType.competence ?? []).concat(formData.itemsByType.competencecreature ?? []);
|
||||
formData.monnaie.sort(Monnaie.triValeurDenier());
|
||||
.concat(formData.gemmes);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -429,11 +440,11 @@ export class RdDUtility {
|
||||
.map(id => Misc.data(objets.find(it => (id == it._id))))
|
||||
.filter(it => it);
|
||||
let enc = Number(itemData.data.encombrement ?? 0) * Number(itemData.data.quantite ?? 1);
|
||||
for (let itemData of contenuDatas){
|
||||
for (let itemData of contenuDatas) {
|
||||
if (itemData.type == 'conteneur') {
|
||||
enc += RdDUtility.calculEncContenu(itemData, objets);
|
||||
enc += RdDUtility.calculEncContenu(itemData, objets);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
enc += Number(itemData.data.encombrement ?? 0) * Number(itemData.data.quantite ?? 1);
|
||||
}
|
||||
}
|
||||
@ -456,18 +467,27 @@ export class RdDUtility {
|
||||
//console.log("OBJ:", objet);
|
||||
let str = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html']({ item: objet });
|
||||
if (objet.type == 'conteneur') {
|
||||
//console.log("ITEM DISPLAYED", objet );
|
||||
if (this.getAfficheContenu(objet._id)) {
|
||||
str = str + "<ul class='item-list alterne-list item-display-show list-item-margin" + niveau + "'>";
|
||||
} else {
|
||||
str = str + "<ul class='item-list alterne-list item-display-hide list-item-margin" + niveau + "'>";
|
||||
}
|
||||
for (let subItem of objet.subItems) {
|
||||
str = str + this.buildConteneur(subItem, niveau + 1);
|
||||
}
|
||||
str = str + "</ul>";
|
||||
const afficherContenu = this.getAfficheContenu(objet._id);
|
||||
str = str + RdDUtility.buildContenu(objet, niveau, afficherContenu);
|
||||
}
|
||||
return new Handlebars.SafeString(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
static buildContenu(objet, niveau, afficherContenu) {
|
||||
if (!niveau) niveau = 1;
|
||||
objet.niveau = niveau;
|
||||
let strContenu = "";
|
||||
//console.log("ITEM DISPLAYED", objet );
|
||||
if (afficherContenu) {
|
||||
strContenu = "<ul class='item-list alterne-list item-display-show list-item-margin" + niveau + "'>";
|
||||
} else {
|
||||
strContenu = "<ul class='item-list alterne-list item-display-hide list-item-margin" + niveau + "'>";
|
||||
}
|
||||
for (let subItem of objet.subItems) {
|
||||
strContenu = strContenu + this.buildConteneur(subItem, niveau + 1);
|
||||
}
|
||||
strContenu = strContenu + "</ul>";
|
||||
return strContenu;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -672,8 +692,8 @@ export class RdDUtility {
|
||||
|
||||
// gestion bouton tchat Acheter
|
||||
html.on("click", '.defense-possession', event => {
|
||||
let actorId = event.currentTarget.attributes['data-defenderId'].value;
|
||||
let possessionId = event.currentTarget.attributes['data-possessionId'].value;
|
||||
let actorId = event.currentTarget.attributes['data-defenderId'].value;
|
||||
let possessionId = event.currentTarget.attributes['data-possessionId'].value;
|
||||
RdDPossession.onDefensePossession(actorId, possessionId);
|
||||
});
|
||||
|
||||
@ -830,7 +850,7 @@ export class RdDUtility {
|
||||
let itemId = li.data("item-id");
|
||||
let objet = actorSheet.actor.getObjet(itemId);
|
||||
|
||||
if ( objet.type == 'monnaie' && Monnaie.isSystemMonnaie(objet) ) {
|
||||
if (objet.type == 'monnaie' && Monnaie.isSystemMonnaie(objet)) {
|
||||
ui.notifications.warn("Suppression des monnaies de base impossible");
|
||||
return;
|
||||
}
|
||||
@ -876,7 +896,7 @@ export class RdDUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static afficherHeuresChanceMalchance(heureNaissance) {
|
||||
if ( game.user.isGM) {
|
||||
if (game.user.isGM) {
|
||||
let heure = game.system.rdd.calendrier.findHeure(heureNaissance);
|
||||
if (heureNaissance && heure) {
|
||||
let ajustement = game.system.rdd.calendrier.getAjustementAstrologique(heureNaissance);
|
||||
@ -887,7 +907,7 @@ export class RdDUtility {
|
||||
});
|
||||
}
|
||||
else if (heureNaissance) {
|
||||
ui.notifications.warn(heureNaissance+" ne correspond pas à une heure de naissance");
|
||||
ui.notifications.warn(heureNaissance + " ne correspond pas à une heure de naissance");
|
||||
}
|
||||
else {
|
||||
ui.notifications.warn("Pas d'heure de naissance selectionnée");
|
||||
|
@ -71,7 +71,7 @@ export const referenceAjustements = {
|
||||
isVisible: (rollData, actor) => rollData.useMalusSurenc,
|
||||
isUsed: (rollData, actor) => rollData.useMalusSurenc,
|
||||
getLabel: (rollData, actor) => 'Sur-encombrement',
|
||||
getValue: (rollData, actor) => actor.getSurenc()
|
||||
getValue: (rollData, actor) => actor.computeMalusSurEncombrement()
|
||||
},
|
||||
moral: {
|
||||
isVisible: (rollData, actor) => actor.isPersonnage() && RdDCarac.isActionPhysique(rollData.selectedCarac) && rollData.useMoral,
|
||||
|
@ -10,7 +10,7 @@
|
||||
{"_id":"3mHSocNVPyWkmGBR","name":"Nartha","type":"ingredient","img":"systems/foundryvtt-reve-de-dragon/icons/objets/nartha.webp","data":{"description":"<p>Poudre noire obtenue par disruption alchimique du minerai appelé <em>narthalide</em>, sorte de marne.</p>\n<p>VUE/Alchimie à -3</p>","niveau":0,"encombrement":0.001,"base":0,"quantite":1,"milieu":"","rarete":"","categorie":"Alchimie","cout":0.4},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.3mHSocNVPyWkmGBR"}}}
|
||||
{"_id":"3t0NhMC0cFQyCZGH","name":"Soufflet","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/soufflet.webp","data":{"description":"","quantite":1,"encombrement":0.2,"equipe":false,"resistance":0,"qualite":0,"cout":0.4},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.3t0NhMC0cFQyCZGH"}}}
|
||||
{"_id":"3uWCDH1NOjHJpVo1","name":"Maillet","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/objets/maillet.webp","data":{"categorie_parade":"","description":"","quantite":1,"encombrement":0.1,"equipe":false,"dommages":"1","penetration":0,"force":"7","resistance":7,"competence":"Masse à 1 main","cout":0.05,"portee_courte":0,"magique":false,"ecaille_efficacite":0,"resistance_magique":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":false,"unemain":false,"initpremierround":"masse"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.3uWCDH1NOjHJpVo1"}}}
|
||||
{"_id":"4GeV81qoJrjHIgzR","name":"Tournegraisse","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/tournegraisse.webp","data":{"description":"<p>Crème sirupeuse blanchâtre.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.4GeV81qoJrjHIgzR"}}}
|
||||
{"_id":"4GeV81qoJrjHIgzR","name":"Tournegraisse","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/tournegraisse.webp","data":{"description":"<p>Crème sirupeuse blanchâtre.</p>","descriptionmj":"","quantite":1,"encombrement":0.1,"rarete":"","categorie":"AlchimieAutre","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.4GeV81qoJrjHIgzR"}}}
|
||||
{"_id":"4LFXefT0HFpaXQLx","name":"Briquet à silex","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/briquet.webp","data":{"description":"","quantite":1,"encombrement":0.08,"equipe":false,"resistance":0,"qualite":0,"cout":0.4},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.4LFXefT0HFpaXQLx"}}}
|
||||
{"_id":"4qPaCKONcrsK6JbQ","name":"Pichet de grès (1 litre)","type":"conteneur","img":"systems/foundryvtt-reve-de-dragon/icons/objets/pichet.webp","data":{"description":"","capacite":0.5,"encombrement":0.3,"equipe":false,"qualite":0,"contenu":[],"cout":0.3},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.4qPaCKONcrsK6JbQ"}}}
|
||||
{"_id":"4qoLpa4shvkgDZRy","name":"Culottes de velours","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/culottes_velours.webp","data":{"description":"","quantite":1,"encombrement":0.2,"equipe":false,"resistance":0,"qualite":0,"cout":6},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.4qoLpa4shvkgDZRy"}}}
|
||||
@ -26,7 +26,7 @@
|
||||
{"_id":"7u9yAlaFhKcVdEC6","name":"Matériel de chirurgie","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/materiel_chirurgie.webp","data":{"description":"<p>(pincettes, lancette, crin, aiguille)</p>","quantite":1,"encombrement":0.06,"equipe":false,"resistance":0,"qualite":0,"cout":1},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.7u9yAlaFhKcVdEC6"}}}
|
||||
{"_id":"8bwP6zncdFP0O9ew","name":"Corde (10 m)","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/corde.webp","data":{"description":"","quantite":1,"encombrement":1,"equipe":false,"resistance":0,"qualite":0,"cout":0.3},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.8bwP6zncdFP0O9ew"}}}
|
||||
{"_id":"92GDNmNVa2u0gzpx","name":"Massette","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/massette.webp","data":{"categorie_parade":"","description":"","quantite":1,"encombrement":1,"equipe":false,"dommages":"2","penetration":0,"force":"9","resistance":8,"competence":"Masse à 1 main","cout":2,"portee_courte":0,"magique":false,"ecaille_efficacite":0,"resistance_magique":0,"portee_moyenne":0,"portee_extreme":0,"rapide":true,"deuxmains":false,"unemain":true,"initpremierround":"masse"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.92GDNmNVa2u0gzpx"}}}
|
||||
{"_id":"9cLkTDugz84gpHUB","name":"Bitume de Camphre","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/bitume_de_camphre.webp","data":{"description":"<p>Crème sirupeuse grisâtre.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.9cLkTDugz84gpHUB"}}}
|
||||
{"_id":"9cLkTDugz84gpHUB","name":"Bitume de Camphre","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/bitume_de_camphre.webp","data":{"description":"<p>Crème sirupeuse grisâtre.</p>","descriptionmj":"","quantite":1,"encombrement":0.1,"rarete":"","categorie":"AlchimieAutre","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.9cLkTDugz84gpHUB"}}}
|
||||
{"_id":"A3jx5dPkk5IeXSXn","name":"Lait de lune","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/lait_de_lune.webp","data":{"description":"<p>Fluide.</p>\n<p>Lait de laie.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":1,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.A3jx5dPkk5IeXSXn"}}}
|
||||
{"name":"Bronze (10 deniers)","type":"monnaie","img":"systems/foundryvtt-reve-de-dragon/icons/objets/piece_bronze_epees.webp","data":{"quantite":1,"valeur_deniers":10,"encombrement":0.01,"description":"","data":{"quantite":0,"valeur_deniers":10,"encombrement":0.01}},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"jtRmvSuwkwMmIMf0":3},"flags":{"core":{"sourceId":"Item.hifMbbRrRdQxflsx"}},"_id":"A8UcYUIIlb6YfczN"}
|
||||
{"_id":"A9nMgTyEwYzdA0zT","name":"Manteau de velours","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/manteau_velours.webp","data":{"description":"","quantite":1,"encombrement":1,"equipe":false,"resistance":0,"qualite":0,"cout":10},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.A9nMgTyEwYzdA0zT"}}}
|
||||
@ -37,11 +37,11 @@
|
||||
{"_id":"CMtQM06J3BZsHHxH","name":"Sandales","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/sandales.webp","data":{"description":"","quantite":1,"encombrement":0.1,"equipe":false,"resistance":0,"qualite":0,"cout":0.3},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.CMtQM06J3BZsHHxH"}}}
|
||||
{"_id":"CQSxJv1mgmIeMCbM","name":"Grappin","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/grappin.webp","data":{"description":"","quantite":1,"encombrement":0.5,"equipe":false,"resistance":0,"qualite":0,"cout":2},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.CQSxJv1mgmIeMCbM"}}}
|
||||
{"_id":"D5Z3FaUv91B8eCOP","name":"Obyssum vert","type":"ingredient","img":"systems/foundryvtt-reve-de-dragon/icons/objets/l_obyssum_vert.webp","data":{"description":"<p>Poudre verdâtre apparaissant sur les tiges de certains roseaux.</p>\n<p>VUE/Alchimie à -2</p>","niveau":0,"encombrement":0.001,"base":0,"quantite":1,"milieu":"Lieux humides","rarete":"","categorie":"Alchimie","cout":0.05},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.D5Z3FaUv91B8eCOP"}}}
|
||||
{"_id":"ElweMV283IUpqaik","name":"Sable-Poudre","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/sable_poudre.webp","data":{"description":"<p>Granulés. Poudre blanche.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.ElweMV283IUpqaik"}}}
|
||||
{"_id":"ElweMV283IUpqaik","name":"Sable-Poudre","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/sable_poudre.webp","data":{"description":"<p>Granulés. Poudre blanche.</p>","descriptionmj":"","quantite":1,"encombrement":0.1,"rarete":"","categorie":"AlchimieAutre","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.ElweMV283IUpqaik"}}}
|
||||
{"_id":"Eospy1EFNlhgOyXc","name":"Lacet de cuir (1 m)","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/lacet.webp","data":{"description":"","quantite":1,"encombrement":0.01,"equipe":false,"resistance":0,"qualite":0,"cout":0.06},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.Eospy1EFNlhgOyXc"}}}
|
||||
{"_id":"F0hcXfGaaYKQ0229","name":"Narcos, voie des Sortilèges","type":"livre","img":"systems/foundryvtt-reve-de-dragon/icons/competence_narcos.webp","data":{"description":"<p>Ce tome imposant, ouvertement destiné aux haut-rêvants, révèle que la voie de Narcos ne possède pas que des rituels, mais également des sortilèges. En saisir le sens demande toutefois un minimum de +4 en voie de Narcos. Il permet de comprendre le principe des sorts de transformation et d’envisager la synthèse de <em>Flèche de feu</em>,<em> Dague de force</em>, <em>Dragonne lame</em> et <em>Gourdindragon</em>. Sans son assimilation préalable, la synthèse de ces sorts est totalement inenvisageable. Sa difficulté de lecture est de -6, son assimilation requiert 28 points de tâche, périodicité 1 heure.</p>","competence":"","auteur":"Segamor le Transformiste","quantite":1,"difficulte":-6,"points_de_tache":28,"encombrement":0,"xp":"","niveau_minimum":0,"niveau_maximum":0,"cout":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"jOzRscDxoXZWpGS6":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.F0hcXfGaaYKQ0229"}}}
|
||||
{"_id":"F6ZHJth4t0PA5PMB","name":"Alêne, poinçon","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/poincon_2.webp","data":{"description":"","quantite":1,"encombrement":0.05,"equipe":false,"resistance":0,"qualite":0,"cout":0.1},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.F6ZHJth4t0PA5PMB"}}}
|
||||
{"_id":"FH3mSvdebfhIL2Af","name":"Topazoïne","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/topazoine.webp","data":{"description":"<p>Granulés. Coquille d'oeuf de cane broyé.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.FH3mSvdebfhIL2Af"}}}
|
||||
{"_id":"FH3mSvdebfhIL2Af","name":"Topazoïne","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/topazoine.webp","data":{"description":"<p>Granulés. Coquille d'oeuf de cane broyé.</p>","descriptionmj":"","quantite":1,"encombrement":0.1,"rarete":"","categorie":"AlchimieAutre","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.FH3mSvdebfhIL2Af"}}}
|
||||
{"_id":"FaNRC7YQzibSdqZU","name":"Plume de fer","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/plume_de_fer.webp","data":{"description":"","quantite":1,"encombrement":0.01,"equipe":false,"resistance":0,"qualite":0,"cout":0.1},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.FaNRC7YQzibSdqZU"}}}
|
||||
{"_id":"Flx5inKGs1GQKoYq","name":"Tube à parchemins","type":"conteneur","img":"systems/foundryvtt-reve-de-dragon/icons/objets/tube_parchemin.webp","data":{"description":"","capacite":1.3,"encombrement":0.1,"equipe":false,"qualite":0,"contenu":[],"cout":0.5},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.Flx5inKGs1GQKoYq"}}}
|
||||
{"_id":"GAJIShPe7WugrIVO","name":"Manteau de fourrure","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/manteau_fourrure.webp","data":{"description":"<p>En fonction de la qualité de la fourrure, le prix d'un tel manteau peut varier de 1 à 20 sols.</p>","quantite":1,"encombrement":1,"equipe":false,"resistance":0,"qualite":0,"cout":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.GAJIShPe7WugrIVO"}}}
|
||||
@ -70,7 +70,7 @@
|
||||
{"_id":"NCp2kdTKmQGyAh1U","name":"Dague","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/dague.webp","data":{"categorie_parade":"dagues","description":"","quantite":1,"encombrement":0.5,"equipe":false,"dommages":"1","penetration":0,"force":"7","resistance":8,"competence":"Dague","cout":3,"portee_courte":0,"magique":false,"ecaille_efficacite":null,"resistance_magique":null,"portee_moyenne":0,"portee_extreme":0,"rapide":true,"deuxmains":false,"unemain":true,"initpremierround":"dague"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"flags":{"core":{"sheetClass":"","sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NCp2kdTKmQGyAh1U"}}}
|
||||
{"_id":"NNLhxjFsoJVdFuit","name":"Bouteille de verre (1 litre)","type":"conteneur","img":"systems/foundryvtt-reve-de-dragon/icons/objets/bouteille_verre.webp","data":{"description":"","capacite":0.5,"encombrement":0.2,"equipe":false,"qualite":0,"contenu":[],"cout":0.7},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NNLhxjFsoJVdFuit"}}}
|
||||
{"_id":"OXFFRZOqlhZDJas3","name":"Béret de velours","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/beret_velours.webp","data":{"description":"","quantite":1,"encombrement":0.05,"equipe":false,"resistance":0,"qualite":0,"cout":3},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.OXFFRZOqlhZDJas3"}}}
|
||||
{"_id":"OYWzXiQUFsjU5AF2","name":"Perles de Bjwal","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/perles_bjwal.webp","data":{"description":"<p>Petits granulés translucides.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":1,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.OYWzXiQUFsjU5AF2"}}}
|
||||
{"_id":"OYWzXiQUFsjU5AF2","name":"Perles de Bjwal","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/perles_bjwal.webp","data":{"description":"<p>Petits granulés translucides.</p>","descriptionmj":"","quantite":1,"encombrement":0.1,"rarete":"","categorie":"AlchimieAutre","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":1,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.OYWzXiQUFsjU5AF2"}}}
|
||||
{"_id":"P0yc6QfgKVmM0fpu","name":"Ecuelle de grès","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/ecuelle_gres.webp","data":{"description":"","quantite":1,"encombrement":0.1,"equipe":false,"resistance":0,"qualite":0,"cout":0.1},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.P0yc6QfgKVmM0fpu"}}}
|
||||
{"_id":"PAqV7Fj8AFEpfEpy","name":"Provisions non-cuites","type":"nourritureboisson","img":"systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp","data":{"description":"","sust":1,"boisson":false,"desaltere":0,"alcoolise":false,"force":0,"qualite":0,"exotisme":0,"encombrement":0.1,"quantite":1,"cout":0.01},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"wYnBx3HmLfGzsj7P":3},"flags":{"core":{"sourceId":"Item.2P30CKBRVIPiTf3Z"}}}
|
||||
{"_id":"PH2J4zR0hwXSg0vc","name":"Charbon de bois 1 kg","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/charbon.webp","data":{"description":"","quantite":1,"encombrement":0.04,"equipe":false,"resistance":0,"qualite":0,"cout":0.06},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.PH2J4zR0hwXSg0vc"}}}
|
||||
@ -157,7 +157,7 @@
|
||||
{"_id":"jZMfiBnBXwW91drM","name":"Sablier 15 minutes","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/sablier.webp","data":{"description":"","quantite":1,"encombrement":0.1,"equipe":false,"resistance":0,"qualite":0,"cout":2},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.jZMfiBnBXwW91drM"}}}
|
||||
{"_id":"jchAu828fr8TLtwi","name":"Lait","type":"nourritureboisson","img":"systems/foundryvtt-reve-de-dragon/icons/liquides/liquide_lait.webp","data":{"description":"","sust":0.2,"boisson":true,"desaltere":1,"alcoolise":false,"force":0,"qualite":0,"exotisme":0,"encombrement":0.1,"quantite":1,"cout":0.01,"equipe":false},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Item.6i90SWaq5Me0us8X"}}}
|
||||
{"_id":"jyBy6mDAGvJb9k0l","name":"1 m2 de lin","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/tissu_lin.webp","data":{"description":"","quantite":1,"encombrement":0,"equipe":false,"resistance":0,"qualite":0,"cout":0.15},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.jyBy6mDAGvJb9k0l"}}}
|
||||
{"_id":"kFUh4027jnAdqbyK","name":"Gelée royale","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/gelee_royale.webp","data":{"description":"<p>Crème sirupeuse.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":0.2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.kFUh4027jnAdqbyK"}}}
|
||||
{"_id":"kFUh4027jnAdqbyK","name":"Gelée royale","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/gelee_royale.webp","data":{"description":"<p>Crème sirupeuse.</p>","descriptionmj":"","quantite":1,"encombrement":0.1,"rarete":"","categorie":"AlchimieAutre","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":0.2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.kFUh4027jnAdqbyK"}}}
|
||||
{"_id":"keLCmhsbxHK39UIy","name":"Mirobolant","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/mirobolant.webp","data":{"description":"<p>Fluide.</p>\n<p>Liquide rougeâtre clair et sans dépot.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"cout":2,"soinherbe":"","soinherbebonus":0},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.keLCmhsbxHK39UIy"}}}
|
||||
{"_id":"lJMKVPB5zlG9UqMD","name":"Pourpoint de velours","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/pourpoint_velours.webp","data":{"description":"","quantite":1,"encombrement":0.2,"equipe":false,"resistance":0,"qualite":0,"cout":8},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.lJMKVPB5zlG9UqMD"}}}
|
||||
{"_id":"lKkYFkzWVs2TZDZP","name":"Petit pot de fard","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/fard.webp","data":{"description":"","quantite":1,"encombrement":0.04,"equipe":false,"resistance":0,"qualite":0,"cout":0.3},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"rYShh2P1DNavdoBD":3},"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.lKkYFkzWVs2TZDZP"}}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<li class="item flexrow list-item" data-item-id="{{item._id}}">
|
||||
<li class="item flexrow list-item" data-item-id="{{item._id}}" draggable="true">
|
||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||
|
||||
{{#if (eq item.type 'conteneur')}}
|
||||
|
@ -648,31 +648,31 @@
|
||||
<div>
|
||||
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
|
||||
<span class="item-name">Estimation de l'équipement : {{numberFormat calc.prixTotalEquipement decimals=2}} Sols</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
|
||||
{{#if options.isGM}}
|
||||
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow">
|
||||
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
|
||||
<span class="competence-title flex-grow">Nom</span>
|
||||
<span class="competence-title">Q.</span>
|
||||
<span class="competence-title">Enc.</span>
|
||||
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
|
||||
</li>
|
||||
{{#each objets as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item }}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#each conteneurs as |conteneur id|}}
|
||||
{{buildConteneur this}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow">
|
||||
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
|
||||
<span class="competence-title flex-grow">Nom</span>
|
||||
<span class="competence-title">Q.</span>
|
||||
<span class="competence-title">Enc.</span>
|
||||
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
|
||||
</li>
|
||||
{{#each objets as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item }}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#each conteneurs as |conteneur id|}}
|
||||
{{buildConteneur this}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<span class="item-name"><h4>Compagnons animaux</h4></span>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<option value=""></option>
|
||||
<option value="Alchimie">Potion d'Alchimie</option>
|
||||
<option value="AlchimieEnchante">Potion d'Alchimie Enchantée</option>
|
||||
<option value="AlchimieAutre">Composé alchimique</option>
|
||||
<option value="Cuisine">Potion de Cuisine</option>
|
||||
<option value="Repos">Potion de Repos</option>
|
||||
<option value="ReposEnchante">Potion de Repos Enchantée</option>
|
||||
|
@ -24,6 +24,22 @@
|
||||
<label for="xp">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="data.cout" value="{{data.cout}}" data-dtype="Number"/>
|
||||
</div>
|
||||
{{#if isOwned}}
|
||||
<div class="flexcol">
|
||||
<span><label>Contenu : </label></span>
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow">
|
||||
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
|
||||
<span class="competence-title flex-grow">Nom</span>
|
||||
<span class="competence-title">Q.</span>
|
||||
<span class="competence-title">Enc.</span>
|
||||
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
|
||||
</li>
|
||||
{{buildContenu this}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user