12.0.36 - L'alchimie d'Astrobazzarh #740
17
changelog.md
17
changelog.md
@ -1,4 +1,21 @@
|
|||||||
# 12.0
|
# 12.0
|
||||||
|
## 12.0.36 - L'alchimie d'Astrobazzarh
|
||||||
|
- Nouveautés
|
||||||
|
- ajout d'un bouton pour enchanter les potions
|
||||||
|
- standardisation des boutons d'actions sur les items
|
||||||
|
- utilisations d'icones pour les actions de l'inventaire
|
||||||
|
- Corrections:
|
||||||
|
- la commande /tmra sans paramètres fonctionne
|
||||||
|
- les jets d'encaissement depuis le tchat fonctionnent
|
||||||
|
- affichage de la vie/endurance en cas de blessures et remise à neuf
|
||||||
|
- les queues durant 12 heures ajoutées début Vaisseau ne durent plus 24 heures
|
||||||
|
- Compendiums
|
||||||
|
- Corrections des remedes enchantables
|
||||||
|
- Corrections de descriptions pour proposer les jet de dés
|
||||||
|
|
||||||
|
## 12.0.35 - La Solution d'Astrobazzarh
|
||||||
|
- Fix problème d'initialisation des feuilles d'items
|
||||||
|
|
||||||
## 12.0.34 - la tête d'Astrobazzarh
|
## 12.0.34 - la tête d'Astrobazzarh
|
||||||
- support de liens "jets de dés"
|
- support de liens "jets de dés"
|
||||||
- on peut ajouter des liens "jet de dés" dans les journaux, descriptions, notes, maladresses, ...
|
- on peut ajouter des liens "jet de dés" dans les journaux, descriptions, notes, maladresses, ...
|
||||||
|
@ -12,7 +12,8 @@ import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
|||||||
import { STATUSES } from "./settings/status-effects.js";
|
import { STATUSES } from "./settings/status-effects.js";
|
||||||
import { MAINS_DIRECTRICES } from "./actor.js";
|
import { MAINS_DIRECTRICES } from "./actor.js";
|
||||||
import { RdDBaseActorReveSheet } from "./actor/base-actor-reve-sheet.js";
|
import { RdDBaseActorReveSheet } from "./actor/base-actor-reve-sheet.js";
|
||||||
import { ITEM_TYPES, RdDItem } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
|
import { RdDItem } from "./item.js";
|
||||||
import { RdDItemBlessure } from "./item/blessure.js";
|
import { RdDItemBlessure } from "./item/blessure.js";
|
||||||
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
||||||
import { RdDBaseActorSangSheet } from "./actor/base-actor-sang-sheet.js";
|
import { RdDBaseActorSangSheet } from "./actor/base-actor-sang-sheet.js";
|
||||||
@ -184,22 +185,19 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
await blessure?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
await blessure?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
||||||
});
|
});
|
||||||
|
|
||||||
// Equip Inventory Item
|
|
||||||
this.html.find('.item-equip').click(async event => this.actor.equiperObjet(RdDSheetUtility.getItemId(event)))
|
|
||||||
this.html.find('.roll-chance-actuelle').click(async event => this.actor.rollCarac('chance-actuelle'))
|
this.html.find('.roll-chance-actuelle').click(async event => this.actor.rollCarac('chance-actuelle'))
|
||||||
|
|
||||||
this.html.find('.button-appel-chance').click(async event => this.actor.rollAppelChance())
|
this.html.find('.button-appel-chance').click(async event => this.actor.rollAppelChance())
|
||||||
|
|
||||||
this.html.find('[name="jet-astrologie"]').click(async event => this.actor.astrologieNombresAstraux())
|
this.html.find('[name="jet-astrologie"]').click(async event => this.actor.astrologieNombresAstraux())
|
||||||
this.html.find('.tache-label a').click(async event => this.actor.rollTache(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-tache').click(async event => this.actor.rollTache(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.meditation-label a').click(async event => this.actor.rollMeditation(RdDSheetUtility.getItemId(event)))
|
this.html.find('.meditation-label a').click(async event => this.actor.rollMeditation(RdDSheetUtility.getItemId(event)))
|
||||||
|
|
||||||
this.html.find('.chant-label a').click(async event => this.actor.rollChant(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-chant').click(async event => this.actor.rollChant(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.danse-label a').click(async event => this.actor.rollDanse(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-danse').click(async event => this.actor.rollDanse(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.musique-label a').click(async event => this.actor.rollMusique(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-musique').click(async event => this.actor.rollMusique(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.oeuvre-label a').click(async event => this.actor.rollOeuvre(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-oeuvre').click(async event => this.actor.rollOeuvre(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.jeu-label a').click(async event => this.actor.rollJeu(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-jeu').click(async event => this.actor.rollJeu(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.recettecuisine-label a').click(async event => this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-recettecuisine').click(async event => this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event)))
|
||||||
|
|
||||||
this.html.find('.description-aleatoire').click(async event => new AppPersonnageAleatoire(this.actor).render(true))
|
this.html.find('.description-aleatoire').click(async event => new AppPersonnageAleatoire(this.actor).render(true))
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
@ -217,13 +215,12 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
// Boutons spéciaux MJs
|
// Boutons spéciaux MJs
|
||||||
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
|
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
|
||||||
this.html.find('.don-de-haut-reve').click(async event => this.actor.addDonDeHautReve())
|
this.html.find('.don-de-haut-reve').click(async event => this.actor.addDonDeHautReve())
|
||||||
this.html.find('.sortreserve-add').click(async event => this.actor.addSortReserve(RdDSheetUtility.getItemId(event)))
|
|
||||||
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
|
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Points de reve actuel
|
// Points de reve actuel
|
||||||
this.html.find('.roll-reve-actuel').click(async event => this.actor.rollCarac('reve-actuel', {resistance:true}))
|
this.html.find('.roll-reve-actuel').click(async event => this.actor.rollCarac('reve-actuel', {resistance:true}))
|
||||||
this.html.find('.empoignade-label a').click(async event => RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
this.html.find('.action-empoignade').click(async event => RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||||
|
|
||||||
this.html.find('.roll-arme').click(async event => this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence'))
|
this.html.find('.roll-arme').click(async event => this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence'))
|
||||||
|
|
||||||
@ -327,7 +324,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async selectTypeOeuvreToCreate() {
|
async selectTypeOeuvreToCreate() {
|
||||||
let types = RdDItem.getTypesOeuvres();
|
let types = RdDItem.getTypesOeuvres();
|
||||||
let content = `<span class="competence-label">Selectionnez le type d'oeuvre</span><select class="item-type">`;
|
let content = `<span class="generic-label">Selectionnez le type d'oeuvre</span><select class="item-type">`;
|
||||||
for (let typeName of types) {
|
for (let typeName of types) {
|
||||||
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
||||||
}
|
}
|
||||||
|
107
module/actor.js
107
module/actor.js
@ -32,7 +32,7 @@ import { RdDItemBlessure } from "./item/blessure.js";
|
|||||||
import { AppAstrologie } from "./sommeil/app-astrologie.js";
|
import { AppAstrologie } from "./sommeil/app-astrologie.js";
|
||||||
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
||||||
import { ExperienceLog, XP_TOPIC } from "./actor/experience-log.js";
|
import { ExperienceLog, XP_TOPIC } from "./actor/experience-log.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { RdDBaseActorSang } from "./actor/base-actor-sang.js";
|
import { RdDBaseActorSang } from "./actor/base-actor-sang.js";
|
||||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||||
import { DialogChoixXpCarac } from "./dialog-choix-xp-carac.js";
|
import { DialogChoixXpCarac } from "./dialog-choix-xp-carac.js";
|
||||||
@ -167,29 +167,23 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $perteRevePotionsEnchantees() {
|
async $perteRevePotionsEnchantees() {
|
||||||
let potions = this.itemTypes[ITEM_TYPES.potion]
|
const potionUpdates = this.itemTypes[ITEM_TYPES.potion].map(it => it.perteRevePotion())
|
||||||
.filter(it => Grammar.includesLowerCaseNoAccent(it.system.categorie, 'enchanté') && !it.system.prpermanent)
|
.filter(it => it != undefined)
|
||||||
|
if (potionUpdates.length > 0) {
|
||||||
const potionUpdates = await Promise.all(potions.map(async it => {
|
console.log('perte rêve de potions', potionUpdates)
|
||||||
const nouveauReve = Math.max(it.system.pr - 1, 0)
|
const messageUpdates = await Promise.all(potionUpdates.map(async p => await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, {
|
||||||
|
pr: foundry.utils.getProperty(p, 'system.pr'),
|
||||||
|
alias: this.getAlias(),
|
||||||
|
potionName: p.name,
|
||||||
|
potionImg: p.img
|
||||||
|
})))
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, {
|
content: messageUpdates.reduce(Misc.joining('<br>'))
|
||||||
pr: nouveauReve,
|
|
||||||
alias: this.getAlias(),
|
|
||||||
potionName: it.name,
|
|
||||||
potionImg: it.img
|
|
||||||
})
|
})
|
||||||
})
|
|
||||||
return {
|
|
||||||
_id: it._id,
|
|
||||||
'system.pr': nouveauReve,
|
|
||||||
'system.quantite': nouveauReve > 0 ? it.system.quantite : 0
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
|
|
||||||
await this.updateEmbeddedDocuments('Item', potionUpdates);
|
await this.updateEmbeddedDocuments('Item', potionUpdates);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** --------------------------------------------
|
/** --------------------------------------------
|
||||||
* @returns true si l'acteur possède au moins 1 arme de mêlée équipée
|
* @returns true si l'acteur possède au moins 1 arme de mêlée équipée
|
||||||
@ -245,7 +239,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _recuperationSante(message) {
|
async _recuperationSante(message) {
|
||||||
const maladiesPoisons = this.getMaladiePoisons();
|
const maladiesPoisons = this.getMaladiesPoisons();
|
||||||
const isMaladeEmpoisonne = maladiesPoisons.length > 0;
|
const isMaladeEmpoisonne = maladiesPoisons.length > 0;
|
||||||
this._messageRecuperationMaladiePoisons(maladiesPoisons, message);
|
this._messageRecuperationMaladiePoisons(maladiesPoisons, message);
|
||||||
|
|
||||||
@ -253,7 +247,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await this._recupererVie(message, isMaladeEmpoisonne);
|
await this._recupererVie(message, isMaladeEmpoisonne);
|
||||||
}
|
}
|
||||||
|
|
||||||
getMaladiePoisons() {
|
getMaladiesPoisons() {
|
||||||
return this.items.filter(item => item.type == 'maladie' || (item.type == 'poison' && item.system.active));
|
return this.items.filter(item => item.type == 'maladie' || (item.type == 'poison' && item.system.active));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,19 +407,18 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async remiseANeuf() {
|
async remiseANeuf() {
|
||||||
ChatMessage.create({
|
await this.update({
|
||||||
whisper: ChatUtility.getOwners(this),
|
|
||||||
content: 'Remise à neuf de ' + this.name
|
|
||||||
});
|
|
||||||
await this.supprimerBlessures(it => true);
|
|
||||||
await this.removeEffects(e => e.id != STATUSES.StatusDemiReve);
|
|
||||||
const updates = {
|
|
||||||
'system.sante.endurance.value': this.system.sante.endurance.max,
|
'system.sante.endurance.value': this.system.sante.endurance.max,
|
||||||
'system.sante.vie.value': this.system.sante.vie.max,
|
'system.sante.vie.value': this.system.sante.vie.max,
|
||||||
'system.sante.fatigue.value': 0,
|
'system.sante.fatigue.value': 0,
|
||||||
'system.compteurs.ethylisme': { value: 1, nb_doses: 0, jet_moral: false }
|
'system.compteurs.ethylisme': { value: 1, nb_doses: 0, jet_moral: false }
|
||||||
};
|
})
|
||||||
await this.update(updates);
|
await this.removeEffects(e => e.id != STATUSES.StatusDemiReve);
|
||||||
|
await this.supprimerBlessures(it => true);
|
||||||
|
await ChatMessage.create({
|
||||||
|
whisper: ChatUtility.getOwners(this),
|
||||||
|
content: 'Remise à neuf de ' + this.name
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -529,7 +522,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
jet_moral: false,
|
jet_moral: false,
|
||||||
value: value
|
value: value
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -993,14 +986,11 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async addSortReserve(itemId) {
|
async addSortReserve(item) {
|
||||||
if (itemId) {
|
if (item?.type == ITEM_TYPES.sort && !item.system.isrituel) {
|
||||||
const item = this.items.get(itemId)
|
|
||||||
if (item.type == ITEM_TYPES.sort && !item.system.isrituel) {
|
|
||||||
this.$createSortReserve(item)
|
this.$createSortReserve(item)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
const selectSortReserve = {
|
const selectSortReserve = {
|
||||||
title: "Créer un sort en réserve",
|
title: "Créer un sort en réserve",
|
||||||
label: "Choisir un sort",
|
label: "Choisir un sort",
|
||||||
@ -1203,42 +1193,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
new RdDRollDialogEthylisme(html, rollData, this, r => this.saouler(r.forceAlcool)).render(true);
|
new RdDRollDialogEthylisme(html, rollData, this, r => this.saouler(r.forceAlcool)).render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
async actionPrincipale(item, onActionItem = async () => { }) {
|
|
||||||
let result = await super.actionPrincipale(item, onActionItem)
|
|
||||||
if (result) { return result }
|
|
||||||
|
|
||||||
result = await this.actionNourritureboisson(item, onActionItem)
|
|
||||||
if (result) { return result }
|
|
||||||
|
|
||||||
switch (item.type) {
|
|
||||||
case ITEM_TYPES.potion: return await this.consommerPotion(item, onActionItem);
|
|
||||||
case ITEM_TYPES.livre: return await this.actionLire(item);
|
|
||||||
case ITEM_TYPES.conteneur: return await item.sheet.render(true);
|
|
||||||
case ITEM_TYPES.herbe: return await this.actionHerbe(item, onActionItem);
|
|
||||||
case ITEM_TYPES.queue: case ITEM_TYPES.ombre: return await this.actionRefoulement(item);
|
|
||||||
}
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
async actionNourritureboisson(item, onActionItem) {
|
|
||||||
switch (item.getUtilisationCuisine()) {
|
|
||||||
case 'brut': {
|
|
||||||
const utilisation = new Dialog({
|
|
||||||
title: "Nourriture brute",
|
|
||||||
content: `Que faire de votre ${item.name}`,
|
|
||||||
buttons: {
|
|
||||||
'cuisiner': { icon: '<i class="fa-solid fa-utensils"></i>', label: 'Cuisiner', callback: async () => await this.preparerNourriture(item) },
|
|
||||||
'manger': { icon: '<i class="fa-solid fa-drumstick-bite"></i>', label: 'Manger cru', callback: async () => await this.mangerNourriture(item, onActionItem) }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return utilisation.render(true);
|
|
||||||
}
|
|
||||||
case 'pret':
|
|
||||||
return await this.mangerNourriture(item, onActionItem);
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async mangerNourriture(item, onActionItem) {
|
async mangerNourriture(item, onActionItem) {
|
||||||
return (await DialogConsommer.create(this, item, onActionItem)).render(true);
|
return (await DialogConsommer.create(this, item, onActionItem)).render(true);
|
||||||
}
|
}
|
||||||
@ -1891,8 +1845,8 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
rollData.tache.system.tentatives = rollData.tache.system.nb_jet_succes + rollData.tache.system.nb_jet_echec;
|
rollData.tache.system.tentatives = rollData.tache.system.nb_jet_succes + rollData.tache.system.nb_jet_echec;
|
||||||
|
|
||||||
this.updateEmbeddedDocuments('Item', [rollData.tache]);
|
await this.updateEmbeddedDocuments('Item', [rollData.tache]);
|
||||||
this.santeIncDec("fatigue", rollData.tache.system.fatigue);
|
await this.santeIncDec("fatigue", rollData.tache.system.fatigue);
|
||||||
|
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-tache.html');
|
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-tache.html');
|
||||||
if (options?.onRollAutomate) {
|
if (options?.onRollAutomate) {
|
||||||
@ -2570,8 +2524,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async equiperObjet(itemID) {
|
async equiperObjet(item) {
|
||||||
let item = this.getEmbeddedDocument('Item', itemID);
|
|
||||||
if (item?.isEquipable()) {
|
if (item?.isEquipable()) {
|
||||||
const isEquipe = !item.system.equipe;
|
const isEquipe = !item.system.equipe;
|
||||||
await item.update({ "system.equipe": isEquipe });
|
await item.update({ "system.equipe": isEquipe });
|
||||||
@ -2590,7 +2543,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
for (const armure of armures) {
|
for (const armure of armures) {
|
||||||
protection += await RdDDice.rollTotal(armure.system.protection.toString());
|
protection += await RdDDice.rollTotal(armure.system.protection.toString());
|
||||||
if (dmg > 0 && attackerRoll.dmg.encaisserSpecial != "noarmure") {
|
if (dmg > 0 && attackerRoll.dmg.encaisserSpecial != "noarmure") {
|
||||||
armure.deteriorerArmure(dmg);
|
await armure.deteriorerArmure(dmg)
|
||||||
dmg = 0;
|
dmg = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js";
|
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js";
|
||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import { RdDRoll } from "../rdd-roll.js";
|
|||||||
import { RdDUtility } from "../rdd-utility.js";
|
import { RdDUtility } from "../rdd-utility.js";
|
||||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||||
import { RdDBaseActor } from "./base-actor.js";
|
import { RdDBaseActor } from "./base-actor.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { RdDItemCompetence } from "../item-competence.js";
|
import { RdDItemCompetence } from "../item-competence.js";
|
||||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||||
import { RdDItemArme } from "../item-arme.js";
|
import { RdDItemArme } from "../item-arme.js";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RdDUtility } from "../rdd-utility.js";
|
import { RdDUtility } from "../rdd-utility.js";
|
||||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||||
import { STATUSES } from "../settings/status-effects.js";
|
import { STATUSES } from "../settings/status-effects.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
||||||
import { RdDDice } from "../rdd-dice.js";
|
import { RdDDice } from "../rdd-dice.js";
|
||||||
import { RdDItemBlessure } from "../item/blessure.js";
|
import { RdDItemBlessure } from "../item/blessure.js";
|
||||||
|
@ -3,9 +3,11 @@ import { Misc } from "../misc.js";
|
|||||||
import { DialogSplitItem } from "../dialog-split-item.js";
|
import { DialogSplitItem } from "../dialog-split-item.js";
|
||||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||||
import { Monnaie } from "../item-monnaie.js";
|
import { Monnaie } from "../item-monnaie.js";
|
||||||
import { RdDItem, ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { RdDItem } from "../item.js";
|
||||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||||
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js";
|
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js";
|
||||||
|
import { ItemAction } from "../item/item-actions.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/**
|
/**
|
||||||
@ -26,7 +28,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async getData() {
|
async getData() {
|
||||||
Monnaie.validerMonnaies(this.actor.itemTypes['monnaie']);
|
Monnaie.validerMonnaies(this.actor)
|
||||||
|
|
||||||
this.actor.computeEtatGeneral();
|
this.actor.computeEtatGeneral();
|
||||||
let formData = {
|
let formData = {
|
||||||
@ -42,7 +44,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
effects: this.actor.effects
|
effects: this.actor.effects
|
||||||
}
|
}
|
||||||
|
|
||||||
RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||||
formData.calc = {
|
formData.calc = {
|
||||||
fortune: Monnaie.toSolsDeniers(this.actor.getFortune()),
|
fortune: Monnaie.toSolsDeniers(this.actor.getFortune()),
|
||||||
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
|
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
|
||||||
@ -54,6 +56,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
||||||
formData.competences.filter(it => it.type == ITEM_TYPES.competencecreature)
|
formData.competences.filter(it => it.type == ITEM_TYPES.competencecreature)
|
||||||
.forEach(it => it.isdommages = RdDItemCompetenceCreature.isDommages(it))
|
.forEach(it => it.isdommages = RdDItemCompetenceCreature.isDommages(it))
|
||||||
|
|
||||||
return formData;
|
return formData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,95 +80,37 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static filterItemsPerTypeForSheet(formData, itemTypes) {
|
|
||||||
formData.blessures = Misc.arrayOrEmpty(itemTypes['blessure']);
|
|
||||||
formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']);
|
|
||||||
formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']);
|
|
||||||
formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']);
|
|
||||||
formData.poisons = Misc.arrayOrEmpty(itemTypes['poison']);
|
|
||||||
formData.possessions = Misc.arrayOrEmpty(itemTypes['possession']);
|
|
||||||
formData.maladiesPoisons = formData.maladies.concat(formData.poisons);
|
|
||||||
formData.competences = (itemTypes['competence'] ?? []).concat(itemTypes['competencecreature'] ?? []);
|
|
||||||
formData.sortsReserve = Misc.arrayOrEmpty(itemTypes['sortreserve']);
|
|
||||||
|
|
||||||
formData.sorts = Misc.arrayOrEmpty(itemTypes['sort']);
|
|
||||||
formData.rencontres = Misc.arrayOrEmpty(itemTypes['rencontre']);
|
|
||||||
formData.casestmr = Misc.arrayOrEmpty(itemTypes['casetmr']);
|
|
||||||
formData.signesdraconiques = Misc.arrayOrEmpty(itemTypes['signedraconique']);
|
|
||||||
formData.queues = Misc.arrayOrEmpty(itemTypes['queue']);
|
|
||||||
formData.souffles = Misc.arrayOrEmpty(itemTypes['souffle']);
|
|
||||||
formData.ombres = Misc.arrayOrEmpty(itemTypes['ombre']);
|
|
||||||
formData.tetes = Misc.arrayOrEmpty(itemTypes['tete']);
|
|
||||||
formData.taches = Misc.arrayOrEmpty(itemTypes['tache']);
|
|
||||||
formData.meditations = Misc.arrayOrEmpty(itemTypes['meditation']);
|
|
||||||
formData.chants = Misc.arrayOrEmpty(itemTypes['chant']);
|
|
||||||
formData.danses = Misc.arrayOrEmpty(itemTypes['danse']);
|
|
||||||
formData.musiques = Misc.arrayOrEmpty(itemTypes['musique']);
|
|
||||||
formData.oeuvres = Misc.arrayOrEmpty(itemTypes['oeuvre']);
|
|
||||||
formData.jeux = Misc.arrayOrEmpty(itemTypes['jeu']);
|
|
||||||
|
|
||||||
formData.services = Misc.arrayOrEmpty(itemTypes['service']);
|
|
||||||
formData.conteneurs = Misc.arrayOrEmpty(itemTypes['conteneur']);
|
|
||||||
formData.materiel = Misc.arrayOrEmpty(itemTypes['objet']);
|
|
||||||
formData.armes = Misc.arrayOrEmpty(itemTypes['arme']);
|
|
||||||
formData.armures = Misc.arrayOrEmpty(itemTypes['armure']);
|
|
||||||
formData.munitions = Misc.arrayOrEmpty(itemTypes['munition']);
|
|
||||||
formData.livres = Misc.arrayOrEmpty(itemTypes['livre']);
|
|
||||||
formData.potions = Misc.arrayOrEmpty(itemTypes['potion']);
|
|
||||||
formData.plantes = Misc.arrayOrEmpty(itemTypes['plante']);
|
|
||||||
formData.ingredients = Misc.arrayOrEmpty(itemTypes['ingredient']);
|
|
||||||
formData.faunes = Misc.arrayOrEmpty(itemTypes['faune']);
|
|
||||||
formData.herbes = Misc.arrayOrEmpty(itemTypes['herbe']);
|
|
||||||
formData.nourritureboissons = Misc.arrayOrEmpty(itemTypes['nourritureboisson']);
|
|
||||||
formData.gemmes = Misc.arrayOrEmpty(itemTypes['gemme']);
|
|
||||||
formData.monnaies = Misc.arrayOrEmpty(itemTypes['monnaie']).sort(Monnaie.triValeurEntiere());
|
|
||||||
formData.objets = Misc.arrayOrEmpty(itemTypes['objet'])
|
|
||||||
|
|
||||||
formData.inventaires = RdDItem.getItemTypesInventaire('all')
|
|
||||||
.map(t => Misc.arrayOrEmpty(itemTypes[t]))
|
|
||||||
.reduce((a, b) => a.concat(b), [])
|
|
||||||
.sort(Misc.ascending(it => it.name));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */ /** @override */
|
/* -------------------------------------------- */ /** @override */
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
this.html = html;
|
this.html = html;
|
||||||
|
|
||||||
|
this.html.find('.actionItem').click(event => ItemAction.onActionItem(event, this.actor, this.options))
|
||||||
|
this.html.find('.item-edit').click(async event => this.itemActionEdit(event))
|
||||||
this.html.find('.conteneur-name a').click(async event => {
|
this.html.find('.conteneur-name a').click(async event => {
|
||||||
RdDUtility.toggleAfficheContenu(this.getItemId(event));
|
RdDUtility.toggleAfficheContenu(this.getItemId(event))
|
||||||
this.render(true);
|
this.render(true)
|
||||||
});
|
})
|
||||||
|
|
||||||
this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat());
|
this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat());
|
||||||
this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true))
|
|
||||||
this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat());
|
|
||||||
|
|
||||||
this.html.find('.recherche')
|
this.html.find('.recherche')
|
||||||
.each((index, field) => {
|
.each((index, field) => {
|
||||||
this._rechercheSelectArea(field);
|
this._rechercheSelectArea(field);
|
||||||
})
|
})
|
||||||
.keyup(async event => this._rechercherKeyup(event))
|
.keyup(async event => this._rechercherKeyup(event))
|
||||||
.change(async event => this._rechercherKeyup(event));
|
.change(async event => this._rechercherKeyup(event))
|
||||||
this.html.find('.recherche').prop("disabled", false);
|
|
||||||
|
this.html.find('.recherche').prop("disabled", false)
|
||||||
|
|
||||||
// Everything below here is only needed if the sheet is editable
|
// Everything below here is only needed if the sheet is editable
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
this.html.find('.item-action').click(async event => {
|
this.html.find('.item-equip-armure').click(async event => this.actor.equiperObjet(this.getItem(event)))
|
||||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
this.html.find('.item-delete').click(async event => RdDUtility.confirmActorItemDelete(this.getItem(event), this.actor));
|
||||||
item?.actionPrincipale(this.actor, async () => this.render())
|
this.html.find('.item-split').click(async event => RdDSheetUtility.splitItem(this.getItem(event), this.actor))
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
this.html.find('.item-split').click(async event => {
|
|
||||||
const item = this.getItem(event);
|
|
||||||
RdDSheetUtility.splitItem(item, this.actor);
|
|
||||||
});
|
|
||||||
this.html.find('.item-quantite-plus').click(async event => this.actor.itemQuantiteIncDec(this.getItemId(event), 1));
|
this.html.find('.item-quantite-plus').click(async event => this.actor.itemQuantiteIncDec(this.getItemId(event), 1));
|
||||||
this.html.find('.item-quantite-moins').click(async event => this.actor.itemQuantiteIncDec(this.getItemId(event), -1));
|
this.html.find('.item-quantite-moins').click(async event => this.actor.itemQuantiteIncDec(this.getItemId(event), -1));
|
||||||
this.html.find('.item-delete').click(async event => RdDUtility.confirmActorItemDelete(this, this.getItem(event)));
|
|
||||||
this.html.find('.item-vendre').click(async event => this.vendre(this.getItem(event)));
|
|
||||||
|
|
||||||
this.html.find('.creer-un-objet').click(async event => {
|
this.html.find('.creer-un-objet').click(async event => {
|
||||||
this.selectObjetTypeToCreate();
|
this.selectObjetTypeToCreate();
|
||||||
@ -180,6 +125,11 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemActionEdit(event) {
|
||||||
|
const item = this.getItem(event);
|
||||||
|
return item?.sheet.render(true);
|
||||||
|
}
|
||||||
|
|
||||||
_rechercherKeyup(event) {
|
_rechercherKeyup(event) {
|
||||||
const currentTarget = event.currentTarget;
|
const currentTarget = event.currentTarget;
|
||||||
const nouvelleRecherche = this._optionRecherche(currentTarget);
|
const nouvelleRecherche = this._optionRecherche(currentTarget);
|
||||||
@ -246,7 +196,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async selectObjetTypeToCreate() {
|
async selectObjetTypeToCreate() {
|
||||||
let types = this.getTypesInventaire().sort(Misc.ascending(type => Misc.typeName('Item', type)));
|
let types = this.getTypesInventaire().sort(Misc.ascending(type => Misc.typeName('Item', type)));
|
||||||
let content = `<span class="competence-label">Selectionnez le type d'équipement</span><select class="item-type">`;
|
let content = `<span class="generic-label">Selectionnez le type d'équipement</span><select class="item-type">`;
|
||||||
for (let typeName of types) {
|
for (let typeName of types) {
|
||||||
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import { ChatUtility } from "../chat-utility.js";
|
|||||||
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
import { Monnaie } from "../item-monnaie.js";
|
import { Monnaie } from "../item-monnaie.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { Misc } from "../misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { RdDAudio } from "../rdd-audio.js";
|
import { RdDAudio } from "../rdd-audio.js";
|
||||||
import { RdDConfirm } from "../rdd-confirm.js";
|
import { RdDConfirm } from "../rdd-confirm.js";
|
||||||
@ -737,25 +737,20 @@ export class RdDBaseActor extends Actor {
|
|||||||
|
|
||||||
actionImpossible(action) {
|
actionImpossible(action) {
|
||||||
ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`)
|
ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||||
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
||||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||||
|
|
||||||
async actionPrincipale(item, onActionItem = async () => { }) {
|
|
||||||
switch (item.type) {
|
|
||||||
case ITEM_TYPES.conteneur: return await item.sheet.render(true);
|
|
||||||
}
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
async resetItemUse() { }
|
async resetItemUse() { }
|
||||||
async incDecItemUse(itemId, inc = 1) { }
|
async incDecItemUse(itemId, inc = 1) { }
|
||||||
getItemUse(itemId) { return 0; }
|
getItemUse(itemId) { return 0; }
|
||||||
|
|
||||||
async finDeRound(options = { terminer: false }) { }
|
async finDeRound(options = { terminer: false }) { }
|
||||||
isActorCombat() { return false }
|
isActorCombat() { return false }
|
||||||
getCaracInit(competence) { return 0 }
|
getCaracInit(competence) { return 0 }
|
||||||
|
|
||||||
listActionsCombat() { return [] }
|
listActionsCombat() { return [] }
|
||||||
listActionsPossessions() {
|
listActionsPossessions() {
|
||||||
return this.itemTypes[ITEM_TYPES.possession]
|
return this.itemTypes[ITEM_TYPES.possession]
|
||||||
|
@ -45,6 +45,7 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
|||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
|
|
||||||
this.html.find('a.item-acheter').click(async event => await this.vente(this.getItem(event)));
|
this.html.find('a.item-acheter').click(async event => await this.vente(this.getItem(event)));
|
||||||
|
this.html.find('.service-acheter').click(async event => await this.vente(this.getItem(event)));
|
||||||
|
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { LIST_CARAC_AUTRES } from "../rdd-carac.js";
|
import { LIST_CARAC_AUTRES } from "../rdd-carac.js";
|
||||||
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { Misc } from "../misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { RdDCarac } from "../rdd-carac.js";
|
import { RdDCarac } from "../rdd-carac.js";
|
||||||
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ACTOR_TYPES } from "../../item.js"
|
import { ACTOR_TYPES } from "../../constants.js"
|
||||||
import { Misc } from "../../misc.js"
|
import { Misc } from "../../misc.js"
|
||||||
import { EXPORT_CSV_SCRIPTARIUM, OptionsAvancees } from "../../settings/options-avancees.js"
|
import { EXPORT_CSV_SCRIPTARIUM, OptionsAvancees } from "../../settings/options-avancees.js"
|
||||||
import { Mapping } from "./mapping.js"
|
import { Mapping } from "./mapping.js"
|
||||||
|
@ -2,7 +2,7 @@ import { Grammar } from "../../grammar.js"
|
|||||||
import { RdDItemArme } from "../../item-arme.js"
|
import { RdDItemArme } from "../../item-arme.js"
|
||||||
import { RdDItemCompetence } from "../../item-competence.js"
|
import { RdDItemCompetence } from "../../item-competence.js"
|
||||||
import { RdDItemSort } from "../../item-sort.js"
|
import { RdDItemSort } from "../../item-sort.js"
|
||||||
import { ITEM_TYPES } from "../../item.js"
|
import { ITEM_TYPES } from "../../constants.js"
|
||||||
import { Misc } from "../../misc.js"
|
import { Misc } from "../../misc.js"
|
||||||
import { RdDTimestamp } from "../../time/rdd-timestamp.js"
|
import { RdDTimestamp } from "../../time/rdd-timestamp.js"
|
||||||
import { RdDBonus } from "../../rdd-bonus.js"
|
import { RdDBonus } from "../../rdd-bonus.js"
|
||||||
|
@ -6,7 +6,7 @@ import { Grammar } from "../grammar.js";
|
|||||||
import { Misc } from "../misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
||||||
import { RdDItemTete } from "../item/tete.js";
|
import { RdDItemTete } from "../item/tete.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
|
||||||
const WHITESPACES = "\\s+"
|
const WHITESPACES = "\\s+"
|
||||||
const NUMERIC = "[\\+\\-]?\\d+"
|
const NUMERIC = "[\\+\\-]?\\d+"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import "./xregexp-all.js";
|
import "./xregexp-all.js";
|
||||||
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
||||||
import { ACTOR_TYPES } from "../item.js";
|
import { ACTOR_TYPES } from "../constants.js";
|
||||||
import { TextRollAlchimie } from "./textroll/text-roll-alchimie.js";
|
import { TextRollAlchimie } from "./textroll/text-roll-alchimie.js";
|
||||||
import { TextRollCaracCompetence } from "./textroll/text-roll-carac-competence.js";
|
import { TextRollCaracCompetence } from "./textroll/text-roll-carac-competence.js";
|
||||||
import { TextRollFormula } from "./textroll/text-roll-formula.js";
|
import { TextRollFormula } from "./textroll/text-roll-formula.js";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import "../xregexp-all.js";
|
import "../xregexp-all.js";
|
||||||
import { ACTOR_TYPES, ITEM_TYPES } from "../../item.js";
|
import { ACTOR_TYPES, ITEM_TYPES } from "../../constants.js";
|
||||||
import { RdDCarac } from "../../rdd-carac.js";
|
import { RdDCarac } from "../../rdd-carac.js";
|
||||||
import { RdDUtility } from "../../rdd-utility.js";
|
import { RdDUtility } from "../../rdd-utility.js";
|
||||||
import { RdDAlchimie } from "../../rdd-alchimie.js";
|
import { RdDAlchimie } from "../../rdd-alchimie.js";
|
||||||
|
@ -18,7 +18,7 @@ export class TextRollFormula {
|
|||||||
|
|
||||||
async onRollText(event, actor) {
|
async onRollText(event, actor) {
|
||||||
const node = TextRollManager.getNode(event)
|
const node = TextRollManager.getNode(event)
|
||||||
const rollFormula = node.data('roll-formula')
|
const rollFormula = node.data('formula')
|
||||||
if (rollFormula) {
|
if (rollFormula) {
|
||||||
const roll = new Roll(rollFormula)
|
const roll = new Roll(rollFormula)
|
||||||
await roll.evaluate()
|
await roll.evaluate()
|
||||||
|
@ -51,3 +51,58 @@ export const RDD_CONFIG = {
|
|||||||
{value: "Rarissime", label: "Rarissime"}
|
{value: "Rarissime", label: "Rarissime"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ACTOR_TYPES = {
|
||||||
|
personnage: 'personnage',
|
||||||
|
creature: 'creature',
|
||||||
|
entite: 'entite',
|
||||||
|
commerce: 'commerce',
|
||||||
|
vehicule: 'vehicule'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ITEM_TYPES = {
|
||||||
|
competence: 'competence',
|
||||||
|
competencecreature: 'competencecreature',
|
||||||
|
empoignade: 'empoignade',
|
||||||
|
possession: 'possession',
|
||||||
|
blessure: 'blessure',
|
||||||
|
maladie: 'maladie',
|
||||||
|
poison: 'poison',
|
||||||
|
arme: 'arme',
|
||||||
|
armure: 'armure',
|
||||||
|
conteneur: 'conteneur',
|
||||||
|
objet: 'objet',
|
||||||
|
monnaie: 'monnaie',
|
||||||
|
gemme: 'gemme',
|
||||||
|
munition: 'munition',
|
||||||
|
nourritureboisson: 'nourritureboisson',
|
||||||
|
herbe: 'herbe',
|
||||||
|
plante: 'plante',
|
||||||
|
ingredient: 'ingredient',
|
||||||
|
faune: 'faune',
|
||||||
|
livre: 'livre',
|
||||||
|
potion: 'potion',
|
||||||
|
service: 'service',
|
||||||
|
musique: 'musique',
|
||||||
|
danse: 'danse',
|
||||||
|
chant: 'chant',
|
||||||
|
jeu: 'jeu',
|
||||||
|
race: 'race',
|
||||||
|
recettecuisine: 'recettecuisine',
|
||||||
|
oeuvre: 'oeuvre',
|
||||||
|
recettealchimique: 'recettealchimique',
|
||||||
|
tache: 'tache',
|
||||||
|
sort: 'sort',
|
||||||
|
sortreserve: 'sortreserve',
|
||||||
|
rencontre: 'rencontre',
|
||||||
|
queue: 'queue',
|
||||||
|
ombre: 'ombre',
|
||||||
|
souffle: 'souffle',
|
||||||
|
tete: 'tete',
|
||||||
|
casetmr: 'casetmr',
|
||||||
|
meditation: 'meditation',
|
||||||
|
signedraconique: 'signedraconique',
|
||||||
|
tarot: 'tarot',
|
||||||
|
nombreastral: 'nombreastral',
|
||||||
|
extraitpoetique: 'extraitpoetique',
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js"
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js"
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { BASE_CORPS_A_CORPS } from "./item/base-items.js";
|
import { BASE_CORPS_A_CORPS } from "./item/base-items.js";
|
||||||
import { RdDCombatManager } from "./rdd-combat.js";
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { RdDCombatManager } from "./rdd-combat.js";
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
|
||||||
export const CATEGORIES_COMPETENCES_CREATURES = {
|
export const CATEGORIES_COMPETENCES_CREATURES = {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { LOG_HEAD } from "./constants.js";
|
import { ITEM_TYPES, LOG_HEAD } from "./constants.js";
|
||||||
|
|
||||||
const MONNAIE_ETAIN = {
|
const MONNAIE_ETAIN = {
|
||||||
name: "Denier (étain)", type: 'monnaie',
|
name: "Denier (étain)", type: 'monnaie',
|
||||||
@ -76,12 +76,11 @@ export class Monnaie {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async optimiserFortune(actor, fortune) {
|
static async optimiserFortune(actor, fortune) {
|
||||||
|
Monnaie.validerMonnaies(actor)
|
||||||
let resteEnDeniers = Math.round(fortune * 100);
|
let resteEnDeniers = Math.round(fortune * 100);
|
||||||
let monnaies = actor.itemTypes['monnaie'];
|
const updates = []
|
||||||
let updates = [];
|
|
||||||
Monnaie.validerMonnaies(monnaies, actor);
|
|
||||||
|
|
||||||
let parValeur = Misc.classifyFirst(monnaies, it => VALEUR_DENIERS(it.system.cout));
|
const parValeur = Misc.classifyFirst(actor.itemTypes[ITEM_TYPES.monnaie], it => VALEUR_DENIERS(it.system.cout));
|
||||||
for (let valeurDeniers of [1000, 100, 10, 1]) {
|
for (let valeurDeniers of [1000, 100, 10, 1]) {
|
||||||
const itemPiece = parValeur[valeurDeniers];
|
const itemPiece = parValeur[valeurDeniers];
|
||||||
if (itemPiece) {
|
if (itemPiece) {
|
||||||
@ -102,8 +101,11 @@ export class Monnaie {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static validerMonnaies(monnaies, actor = undefined) {
|
static validerMonnaies(actor) {
|
||||||
monnaies.filter(it => VALEUR_DENIERS(it.system.cout) == 0)
|
if (!actor) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
actor.itemTypes[ITEM_TYPES.monnaie]?.filter(it => VALEUR_DENIERS(it.system.cout) == 0)
|
||||||
.map(it => `La monnaie ${it.name} de l'acteur ${actor?.name ?? 'sélectionné'} a une valeur de 0!`)
|
.map(it => `La monnaie ${it.name} de l'acteur ${actor?.name ?? 'sélectionné'} a une valeur de 0!`)
|
||||||
.forEach(message => {
|
.forEach(message => {
|
||||||
ui.notifications.warn(message);
|
ui.notifications.warn(message);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
import { ACTOR_TYPES, ITEM_TYPES } from "./constants.js";
|
||||||
import { RdDItemSort } from "./item-sort.js";
|
import { RdDItemSort } from "./item-sort.js";
|
||||||
import { RdDUtility } from "./rdd-utility.js";
|
import { RdDUtility } from "./rdd-utility.js";
|
||||||
import { RdDItemCompetence } from "./item-competence.js";
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
import { RdDHerbes } from "./rdd-herbes.js";
|
|
||||||
import { RdDGemme } from "./rdd-gemme.js";
|
import { RdDGemme } from "./rdd-gemme.js";
|
||||||
import { HtmlUtility } from "./html-utility.js";
|
import { HtmlUtility } from "./html-utility.js";
|
||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||||
@ -11,9 +11,10 @@ import { SystemCompendiums } from "./settings/system-compendiums.js";
|
|||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { ACTOR_TYPES, ITEM_TYPES, RdDItem } from "./item.js";
|
import { RdDItem } from "./item.js";
|
||||||
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
||||||
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
||||||
|
import { ItemAction } from "./item/item-actions.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the basic ItemSheet for RdD specific items
|
* Extend the basic ItemSheet for RdD specific items
|
||||||
@ -26,8 +27,8 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
|
|
||||||
static defaultTemplate(type) {
|
static defaultTemplate(type) {
|
||||||
return type ?
|
return type ?
|
||||||
`systems/foundryvtt-reve-de-dragon/templates/item-${type}-sheet.html` :
|
`systems/foundryvtt-reve-de-dragon/templates/item/${type}-sheet.hbs` :
|
||||||
"systems/foundryvtt-reve-de-dragon/templates/item-sheet.html";
|
"systems/foundryvtt-reve-de-dragon/templates/item/item-sheet.hbs";
|
||||||
}
|
}
|
||||||
|
|
||||||
static register(sheetClass) {
|
static register(sheetClass) {
|
||||||
@ -136,9 +137,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
||||||
RdDGemme.calculDataDerivees(this.item)
|
RdDGemme.calculDataDerivees(this.item)
|
||||||
}
|
}
|
||||||
if (this.item.type == ITEM_TYPES.potion) {
|
|
||||||
RdDHerbes.calculFormData(formData, this.item)
|
|
||||||
}
|
|
||||||
if (this.item.type == ITEM_TYPES.herbe) {
|
if (this.item.type == ITEM_TYPES.herbe) {
|
||||||
if (formData.options.isOwned && ['Soin', 'Repos'].includes(formData.system.categorie)) {
|
if (formData.options.isOwned && ['Soin', 'Repos'].includes(formData.system.categorie)) {
|
||||||
formData.isIngredientPotionBase = true;
|
formData.isIngredientPotionBase = true;
|
||||||
@ -193,16 +192,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
this.supprimerBonusCase(event.currentTarget.attributes['data-deleteCoord'].value)
|
this.supprimerBonusCase(event.currentTarget.attributes['data-deleteCoord'].value)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.html.find('.date-enchantement').change((event) => {
|
|
||||||
const jour = Number(this.html.find('input.date-enchantement[name="enchantement.jour"]').val());
|
|
||||||
const mois = RdDTimestamp.definition(this.html.find('select.date-enchantement[name="enchantement.mois"]').val());
|
|
||||||
const indexDate = game.system.rdd.calendrier.getIndexFromDate(jour, mois.heure);
|
|
||||||
this.item.update({ 'system.prdate': indexDate });
|
|
||||||
console.warn(`Date d'enchantement modifiée ${jour}/${mois.heure}: ${indexDate}`)
|
|
||||||
});
|
|
||||||
|
|
||||||
this.html.find('.creer-tache-livre').click((event) => this._getEventActor(event).creerTacheDepuisLivre(this.item));
|
this.html.find('.creer-tache-livre').click((event) => this._getEventActor(event).creerTacheDepuisLivre(this.item));
|
||||||
this.html.find('.consommer-potion').click((event) => this._getEventActor(event).consommerPotion(this.item, this.getActionRenderItem()));
|
|
||||||
this.html.find('.creer-potion-base').click((event) => this._getEventActor(event).actionHerbe(this.item));
|
this.html.find('.creer-potion-base').click((event) => this._getEventActor(event).actionHerbe(this.item));
|
||||||
this.html.find('input[name="system.cacher_points_de_tache"]').change(async event => await this.item.update({ 'system.cacher_points_de_tache': event.currentTarget.checked }));
|
this.html.find('input[name="system.cacher_points_de_tache"]').change(async event => await this.item.update({ 'system.cacher_points_de_tache': event.currentTarget.checked }));
|
||||||
|
|
||||||
@ -210,12 +200,14 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
this.html.find('.chat-roll-text').click(async event => await RdDTextEditor.chatRollText(event))
|
this.html.find('.chat-roll-text').click(async event => await RdDTextEditor.chatRollText(event))
|
||||||
|
|
||||||
if (this.actor) {
|
if (this.actor) {
|
||||||
this.html.find('.item-split').click(async event => RdDSheetUtility.splitItem(RdDSheetUtility.getItem(event, this.actor), this.actor, this.getActionRenderItem()));
|
// TODO
|
||||||
|
this.html.find('.actionItem').click(event => ItemAction.onActionItem(event, this.actor, this.options))
|
||||||
|
|
||||||
|
this.html.find('.item-potion-consommer').click(event => this.itemActionConsommer(event))
|
||||||
|
|
||||||
|
this.html.find('.item-split').click( event => this.itemActionSplit(event))
|
||||||
this.html.find('.item-edit').click(async event => RdDSheetUtility.getItem(event, this.actor)?.sheet.render(true));
|
this.html.find('.item-edit').click(async event => RdDSheetUtility.getItem(event, this.actor)?.sheet.render(true));
|
||||||
this.html.find('.item-delete').click(async event => RdDUtility.confirmActorItemDelete(this, RdDSheetUtility.getItem(event, this.actor)));
|
this.html.find('.item-delete').click(async event => this.itemActionDelete(event));
|
||||||
this.html.find('.item-vendre').click(async event => RdDSheetUtility.getItem(event, this.actor)?.proposerVente());
|
|
||||||
this.html.find('.item-montrer').click(async event => RdDSheetUtility.getItem(event, this.actor)?.postItemToChat());
|
|
||||||
this.html.find('.item-action').click(async event => RdDSheetUtility.getItem(event, this.actor)?.actionPrincipale(this.actor, this.getActionRenderItem()));
|
|
||||||
|
|
||||||
this.html.find('.item-quantite-plus').click(async event => {
|
this.html.find('.item-quantite-plus').click(async event => {
|
||||||
await this.actor.itemQuantiteIncDec(RdDSheetUtility.getItemId(event), 1)
|
await this.actor.itemQuantiteIncDec(RdDSheetUtility.getItemId(event), 1)
|
||||||
@ -233,13 +225,24 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
RdDTimestamp.handleTimestampEditor(this.html, 'system.temporel.fin', updateItemTimestamp);
|
RdDTimestamp.handleTimestampEditor(this.html, 'system.temporel.fin', updateItemTimestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
getActionRenderItem() {
|
itemActionDelete(event) {
|
||||||
return async () => {
|
const item = RdDSheetUtility.getItem(event, this.actor)
|
||||||
let item = this.item;
|
return RdDUtility.confirmActorItemDelete(item, this.actor)
|
||||||
while (item) {
|
|
||||||
await item.sheet?.render()
|
|
||||||
item = this.actor.getContenant(item)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async itemActionConsommer(event) {
|
||||||
|
const item = RdDSheetUtility.getItem(event, this.actor)
|
||||||
|
if (item) {
|
||||||
|
await actor.consommerPotion(item)
|
||||||
|
await RdDSheetUtility.renderItemBranch(this.actor, item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async itemActionSplit(event) {
|
||||||
|
const item = RdDSheetUtility.getItem(event, this.actor)
|
||||||
|
if (item) {
|
||||||
|
await RdDSheetUtility.splitItem(item, this.actor)
|
||||||
|
await RdDSheetUtility.renderItemBranch(this.actor, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { RdDItemCompetence } from "./item-competence.js";
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
||||||
|
|
||||||
|
200
module/item.js
200
module/item.js
@ -1,7 +1,7 @@
|
|||||||
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { DialogItemVente } from "./achat-vente/dialog-item-vente.js";
|
import { DialogItemVente } from "./achat-vente/dialog-item-vente.js";
|
||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDHerbes } from "./rdd-herbes.js";
|
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { RdDUtility } from "./rdd-utility.js";
|
import { RdDUtility } from "./rdd-utility.js";
|
||||||
import { SystemCompendiums } from "./settings/system-compendiums.js";
|
import { SystemCompendiums } from "./settings/system-compendiums.js";
|
||||||
@ -9,61 +9,7 @@ import { RdDRaretes } from "./item/raretes.js";
|
|||||||
import { CATEGORIES_COMPETENCES } from "./item-competence.js";
|
import { CATEGORIES_COMPETENCES } from "./item-competence.js";
|
||||||
import { CATEGORIES_COMPETENCES_CREATURES } from "./item-competencecreature.js";
|
import { CATEGORIES_COMPETENCES_CREATURES } from "./item-competencecreature.js";
|
||||||
import { BASE_CORPS_A_CORPS, BASE_ESQUIVE } from "./item/base-items.js";
|
import { BASE_CORPS_A_CORPS, BASE_ESQUIVE } from "./item/base-items.js";
|
||||||
|
import { ITEM_ACTIONS, DEFAULT_ACTIONS, COMMON_ACTIONS } from "./item/item-actions.js";
|
||||||
export const ACTOR_TYPES = {
|
|
||||||
personnage: 'personnage',
|
|
||||||
creature: 'creature',
|
|
||||||
entite: 'entite',
|
|
||||||
commerce: 'commerce',
|
|
||||||
vehicule: 'vehicule'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ITEM_TYPES = {
|
|
||||||
competence: 'competence',
|
|
||||||
competencecreature: 'competencecreature',
|
|
||||||
empoignade: 'empoignade',
|
|
||||||
possession: 'possession',
|
|
||||||
blessure: 'blessure',
|
|
||||||
maladie: 'maladie',
|
|
||||||
poison: 'poison',
|
|
||||||
arme: 'arme',
|
|
||||||
armure: 'armure',
|
|
||||||
conteneur: 'conteneur',
|
|
||||||
objet: 'objet',
|
|
||||||
monnaie: 'monnaie',
|
|
||||||
gemme: 'gemme',
|
|
||||||
munition: 'munition',
|
|
||||||
nourritureboisson: 'nourritureboisson',
|
|
||||||
herbe: 'herbe',
|
|
||||||
plante: 'plante',
|
|
||||||
ingredient: 'ingredient',
|
|
||||||
faune: 'faune',
|
|
||||||
livre: 'livre',
|
|
||||||
potion: 'potion',
|
|
||||||
service: 'service',
|
|
||||||
musique: 'musique',
|
|
||||||
danse: 'danse',
|
|
||||||
chant: 'chant',
|
|
||||||
jeu: 'jeu',
|
|
||||||
race: 'race',
|
|
||||||
recettecuisine: 'recettecuisine',
|
|
||||||
oeuvre: 'oeuvre',
|
|
||||||
recettealchimique: 'recettealchimique',
|
|
||||||
tache: 'tache',
|
|
||||||
sort: 'sort',
|
|
||||||
sortreserve: 'sortreserve',
|
|
||||||
rencontre: 'rencontre',
|
|
||||||
queue: 'queue',
|
|
||||||
ombre: 'ombre',
|
|
||||||
souffle: 'souffle',
|
|
||||||
tete: 'tete',
|
|
||||||
casetmr: 'casetmr',
|
|
||||||
meditation: 'meditation',
|
|
||||||
signedraconique: 'signedraconique',
|
|
||||||
tarot: 'tarot',
|
|
||||||
nombreastral: 'nombreastral',
|
|
||||||
extraitpoetique: 'extraitpoetique',
|
|
||||||
}
|
|
||||||
|
|
||||||
const typesInventaireMateriel = [
|
const typesInventaireMateriel = [
|
||||||
ITEM_TYPES.arme,
|
ITEM_TYPES.arme,
|
||||||
@ -100,41 +46,41 @@ densité 3.5 (~2.3 à 4, parfois plus) -- https://www.juwelo.fr/guide-des-pierre
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const defaultItemImg = {
|
export const defaultItemImg = {
|
||||||
competence: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
|
|
||||||
competencecreature: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
|
|
||||||
arme: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_gnome.webp",
|
arme: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_gnome.webp",
|
||||||
armure: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp",
|
armure: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp",
|
||||||
conteneur: "systems/foundryvtt-reve-de-dragon/icons/objets/sac_a_dos.webp",
|
|
||||||
sort: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp",
|
|
||||||
herbe: "systems/foundryvtt-reve-de-dragon/icons/botanique/Endorlotte.webp",
|
|
||||||
faune: "systems/foundryvtt-reve-de-dragon/icons/faune/rongeur.webp",
|
|
||||||
ingredient: "systems/foundryvtt-reve-de-dragon/icons/objets/sable_poudre.webp",
|
|
||||||
livre: "systems/foundryvtt-reve-de-dragon/icons/objets/livre.webp",
|
|
||||||
potion: "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp",
|
|
||||||
rencontre: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
|
|
||||||
queue: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
|
|
||||||
ombre: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
|
|
||||||
souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp",
|
|
||||||
tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
|
|
||||||
meditation: "systems/foundryvtt-reve-de-dragon/icons/meditations_ecrits/meditation_alchimie.webp",
|
|
||||||
recettealchimique: "systems/foundryvtt-reve-de-dragon/icons/competence_alchimie.webp",
|
|
||||||
chant: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
|
chant: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
|
||||||
|
competence: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
|
||||||
|
competencecreature: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
|
||||||
|
conteneur: "systems/foundryvtt-reve-de-dragon/icons/objets/sac_a_dos.webp",
|
||||||
danse: "systems/foundryvtt-reve-de-dragon/icons/arts/danse_0.webp",
|
danse: "systems/foundryvtt-reve-de-dragon/icons/arts/danse_0.webp",
|
||||||
|
empoignade: "systems/foundryvtt-reve-de-dragon/icons/empoignade.webp",
|
||||||
|
extraitpoetique: "systems/foundryvtt-reve-de-dragon/icons/competence_ecriture.webp",
|
||||||
|
faune: "systems/foundryvtt-reve-de-dragon/icons/faune/rongeur.webp",
|
||||||
|
gemme: "systems/foundryvtt-reve-de-dragon/icons/gemmes/almaze.webp",
|
||||||
|
herbe: "systems/foundryvtt-reve-de-dragon/icons/botanique/Endorlotte.webp",
|
||||||
|
ingredient: "systems/foundryvtt-reve-de-dragon/icons/objets/sable_poudre.webp",
|
||||||
jeu: "systems/foundryvtt-reve-de-dragon/icons/arts/jeux_petasse.webp",
|
jeu: "systems/foundryvtt-reve-de-dragon/icons/arts/jeux_petasse.webp",
|
||||||
recettecuisine: "systems/foundryvtt-reve-de-dragon/icons/arts/recette_cuisine_1.webp",
|
livre: "systems/foundryvtt-reve-de-dragon/icons/objets/livre.webp",
|
||||||
musique: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
|
|
||||||
maladie: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/maladie.webp",
|
maladie: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/maladie.webp",
|
||||||
poison: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/venin.webp",
|
meditation: "systems/foundryvtt-reve-de-dragon/icons/meditations_ecrits/meditation_alchimie.webp",
|
||||||
oeuvre: "systems/foundryvtt-reve-de-dragon/icons/competence_comedie.webp",
|
musique: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
|
||||||
nourritureboisson: "systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp",
|
nourritureboisson: "systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp",
|
||||||
|
oeuvre: "systems/foundryvtt-reve-de-dragon/icons/competence_comedie.webp",
|
||||||
|
ombre: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
|
||||||
|
poison: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/venin.webp",
|
||||||
|
possession: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
|
||||||
|
potion: "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp",
|
||||||
|
queue: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
|
||||||
|
recettealchimique: "systems/foundryvtt-reve-de-dragon/icons/competence_alchimie.webp",
|
||||||
|
recettecuisine: "systems/foundryvtt-reve-de-dragon/icons/arts/recette_cuisine_1.webp",
|
||||||
|
rencontre: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
|
||||||
service: "systems/foundryvtt-reve-de-dragon/icons/services/lit.webp",
|
service: "systems/foundryvtt-reve-de-dragon/icons/services/lit.webp",
|
||||||
signedraconique: "systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp",
|
signedraconique: "systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp",
|
||||||
gemme: "systems/foundryvtt-reve-de-dragon/icons/gemmes/almaze.webp",
|
sort: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp",
|
||||||
possession: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
|
|
||||||
sortreserve: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp",
|
sortreserve: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp",
|
||||||
extraitpoetique: "systems/foundryvtt-reve-de-dragon/icons/competence_ecriture.webp",
|
souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp",
|
||||||
tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp",
|
tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp",
|
||||||
empoignade: "systems/foundryvtt-reve-de-dragon/icons/competence_corps_a_corps.webp"
|
tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -356,13 +302,6 @@ export class RdDItem extends Item {
|
|||||||
|
|
||||||
getUtilisation() {
|
getUtilisation() {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case ITEM_TYPES.potion:
|
|
||||||
switch (this.system.categorie) {
|
|
||||||
case 'Alchimie': case 'AlchimieEnchante': case 'AlchimieAutre': return 'alchimie'
|
|
||||||
case 'Cuisine': return 'cuisine'
|
|
||||||
case 'Remede': case 'Repos': case 'ReposEnchante': case 'Soin': case 'SoinEnchante': return 'soins'
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
case ITEM_TYPES.nourritureboisson: return 'cuisine';
|
case ITEM_TYPES.nourritureboisson: return 'cuisine';
|
||||||
case ITEM_TYPES.herbe: case ITEM_TYPES.faune: case ITEM_TYPES.ingredient: case ITEM_TYPES.plante:
|
case ITEM_TYPES.herbe: case ITEM_TYPES.faune: case ITEM_TYPES.ingredient: case ITEM_TYPES.plante:
|
||||||
switch (this.system.categorie) {
|
switch (this.system.categorie) {
|
||||||
@ -471,68 +410,51 @@ export class RdDItem extends Item {
|
|||||||
// appliquer le pourcentage
|
// appliquer le pourcentage
|
||||||
return this.parent.calculerPrix(this);
|
return this.parent.calculerPrix(this);
|
||||||
}
|
}
|
||||||
return this.system.cout;
|
return this.system.cout
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
super.prepareDerivedData();
|
super.prepareDerivedData();
|
||||||
if (this.isInventaire()) {
|
if (this.isInventaire()) {
|
||||||
this.system.encTotal = this.getEncTotal();
|
this.system.encTotal = this.getEncTotal()
|
||||||
if (this.isPotion()) {
|
|
||||||
this.prepareDataPotion()
|
|
||||||
}
|
}
|
||||||
this.system.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
|
this.equipable = this.isEquipable()
|
||||||
}
|
|
||||||
this.equipable = this.isEquipable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareDataPotion() {
|
itemActions() {
|
||||||
const categorie = Grammar.toLowerCaseNoAccent(this.system.categorie);
|
return COMMON_ACTIONS.concat(this.itemSpecificActions()).concat(DEFAULT_ACTIONS)
|
||||||
this.system.magique = categorie.includes('enchante');
|
|
||||||
if (this.system.magique) {
|
|
||||||
if (categorie.includes('soin') || categorie.includes('repos')) {
|
|
||||||
// TODO: utiliser calculPointsRepos / calculPointsGuerison
|
|
||||||
this.system.puissance = RdDHerbes.calculPuissancePotion(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getActionPrincipale(options = { warnIfNot: true }) {
|
itemSpecificActions() {
|
||||||
|
const actions = ITEM_ACTIONS[this.type] ?? []
|
||||||
|
// const actorTypes = actions.actorTypes ?? [ACTOR_TYPES.personnage]
|
||||||
|
// if (!actorTypes.includes(this.actor?.type)) {
|
||||||
|
// return []
|
||||||
|
// }
|
||||||
|
return actions
|
||||||
|
}
|
||||||
|
|
||||||
|
isActionAllowed(code) {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case ITEM_TYPES.conteneur: return 'Ouvrir';
|
case ITEM_TYPES.possession:
|
||||||
|
case ITEM_TYPES.empoignade:
|
||||||
|
case ITEM_TYPES.rencontre:
|
||||||
|
case ITEM_TYPES.signedraconique:
|
||||||
|
switch (code) {
|
||||||
|
case 'item-edit':
|
||||||
|
case 'item-delete':
|
||||||
|
return game.user.isGM
|
||||||
}
|
}
|
||||||
if (this.actor?.isPersonnage()) {
|
case ITEM_TYPES.maladie:
|
||||||
const warn = options.warnIfNot;
|
case ITEM_TYPES.poison:
|
||||||
if (this.getUtilisationCuisine() == 'brut') {
|
return game.user.isGM
|
||||||
return 'Cuisiner';
|
case ITEM_TYPES.casetmr:
|
||||||
}
|
switch (code) {
|
||||||
switch (this.type) {
|
case 'item-delete':
|
||||||
case ITEM_TYPES.nourritureboisson: return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn);
|
return game.user.isGM
|
||||||
case ITEM_TYPES.potion: return this._actionOrWarnQuantiteZero('Consommer', warn);
|
|
||||||
case ITEM_TYPES.livre: return this._actionOrWarnQuantiteZero('Lire', warn);
|
|
||||||
case ITEM_TYPES.herbe: return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
|
|
||||||
case ITEM_TYPES.queue: case ITEM_TYPES.ombre: return this.system.refoulement > 0 ? 'Refouler' : undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return undefined;
|
return true
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
async actionPrincipale(actor, onActionItem = async () => { }) {
|
|
||||||
if (!this.getActionPrincipale()) { return }
|
|
||||||
await actor?.actionPrincipale(this, onActionItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
_actionOrWarnQuantiteZero(actionName, warn) {
|
|
||||||
if ((this.system.quantite ?? 0) <= 0) {
|
|
||||||
if (warn) {
|
|
||||||
ui.notifications.warn(`Vous n'avez plus de ${this.name}.`);
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return actionName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async diminuerQuantite(nombre, options = { diminuerQuantite: true, supprimerSiZero: false }) {
|
async diminuerQuantite(nombre, options = { diminuerQuantite: true, supprimerSiZero: false }) {
|
||||||
@ -805,14 +727,6 @@ export class RdDItem extends Item {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_potionChatData() {
|
|
||||||
return [
|
|
||||||
`<b>Rareté</b>: ${this.system.rarete}`,
|
|
||||||
`<b>Catégorie</b>: ${this.system.categorie}`,
|
|
||||||
...this._inventaireTemplateChatData()
|
|
||||||
]
|
|
||||||
}
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
_queueChatData() {
|
_queueChatData() {
|
||||||
function label(categorie) {
|
function label(categorie) {
|
||||||
switch (categorie) {
|
switch (categorie) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { ITEM_TYPES, RdDItem } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { RdDItem } from "../item.js";
|
||||||
import { Misc } from "../misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||||
|
|
||||||
@ -10,7 +11,7 @@ export class RdDItemArmure extends RdDItem {
|
|||||||
return "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp";
|
return "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp";
|
||||||
}
|
}
|
||||||
|
|
||||||
deteriorerArmure(dmg) {
|
async deteriorerArmure(dmg) {
|
||||||
if (!ReglesOptionnelles.isUsing('deteriorationArmure') || this.system.protection == '0') {
|
if (!ReglesOptionnelles.isUsing('deteriorationArmure') || this.system.protection == '0') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -22,12 +23,10 @@ export class RdDItemArmure extends RdDItem {
|
|||||||
protection = this.calculProtectionDeterioree();
|
protection = this.calculProtectionDeterioree();
|
||||||
ChatMessage.create({ content: `Votre armure ${this.name} s'est détériorée, elle protège maintenant de ${protection}` });
|
ChatMessage.create({ content: `Votre armure ${this.name} s'est détériorée, elle protège maintenant de ${protection}` });
|
||||||
}
|
}
|
||||||
this.update({
|
await this.update({
|
||||||
system: {
|
'system.deterioration': deterioration,
|
||||||
deterioration: deterioration,
|
'system.protection': protection
|
||||||
protection: protection
|
})
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
calculProtectionDeterioree() {
|
calculProtectionDeterioree() {
|
||||||
|
@ -30,7 +30,7 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
|
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
super.prepareDerivedData();
|
super.prepareDerivedData();
|
||||||
this.system.label = this.getLabelGravite()
|
this.system.label = RdDItemBlessure.getLabelGravite(this.system.gravite)
|
||||||
}
|
}
|
||||||
|
|
||||||
static prepareTacheSoin(gravite) {
|
static prepareTacheSoin(gravite) {
|
||||||
@ -43,29 +43,32 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async applyFullBlessure(actor, gravite) {
|
static async applyFullBlessure(actor, gravite) {
|
||||||
const definition = RdDItemBlessure.getDefinition(gravite)
|
const definition = foundry.utils.duplicate(RdDItemBlessure.getDefinition(gravite))
|
||||||
|
|
||||||
let lostEndurance = 0
|
|
||||||
let lostVie = 0
|
|
||||||
if (definition.endurance) {
|
|
||||||
lostEndurance = new Roll(definition.endurance)
|
|
||||||
await lostEndurance.roll();
|
|
||||||
actor.santeIncDec("endurance", -Number(lostEndurance.total));
|
|
||||||
}
|
|
||||||
if (definition.vie) {
|
if (definition.vie) {
|
||||||
lostVie = definition.vie
|
await actor.santeIncDec("vie", definition.vie)
|
||||||
actor.santeIncDec("vie", definition.vie)
|
}
|
||||||
|
const lostEndurance = await RdDItemBlessure.rollLostEndurance(definition.endurance)
|
||||||
|
if (lostEndurance) {
|
||||||
|
await actor.santeIncDec("endurance", -Number(lostEndurance));
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.createBlessure(actor, gravite)
|
await this.createBlessure(actor, gravite)
|
||||||
|
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
content: `Blessure ${definition.label} appliquée à ${actor.name}`+
|
//TODO: hbs
|
||||||
`<br>Perte d'endurance : ${lostEndurance}`+
|
content: `Blessure ${definition.label} appliquée à ${actor.name}<br>Perte d'endurance : ${lostEndurance} (${definition.endurance})<br>Perte de Vie : ${definition.vie}`,
|
||||||
`<br>Perte de Vie : ${lostVie}`,
|
|
||||||
whisper: ChatUtility.getOwners(actor)
|
whisper: ChatUtility.getOwners(actor)
|
||||||
});
|
});
|
||||||
|
actor.sheet?.render()
|
||||||
|
}
|
||||||
|
|
||||||
|
static async rollLostEndurance(formula) {
|
||||||
|
if (formula) {
|
||||||
|
const roll = new Roll(formula)
|
||||||
|
await roll.evaluate()
|
||||||
|
return roll.total
|
||||||
|
}
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
static async createBlessure(actor, gravite, localisation = '', attackerToken) {
|
static async createBlessure(actor, gravite, localisation = '', attackerToken) {
|
||||||
@ -125,10 +128,10 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
}
|
}
|
||||||
if (this.system.gravite > 0) {
|
if (this.system.gravite > 0) {
|
||||||
const update = { system: { premierssoins: { bonus: 0 }, soinscomplets: { bonus: 0 } } }
|
const update = { system: { premierssoins: { bonus: 0 }, soinscomplets: { bonus: 0 } } }
|
||||||
const gravite = this.system.gravite;
|
const gravite = this.system.gravite
|
||||||
const graviteMoindre = gravite - 2;
|
const graviteMoindre = gravite - 2
|
||||||
const moindres = blessures.filter(it => it.system.gravite == graviteMoindre, 'blessures').length
|
const moindres = blessures.filter(it => it.system.gravite == graviteMoindre, 'blessures').length
|
||||||
const label = this.getLabelGravite();
|
const label = RdDItemBlessure.getLabelGravite(this.system.gravite)
|
||||||
|
|
||||||
let rolled = await actor.jetRecuperationConstitution(this.system.soinscomplets.bonus, message);
|
let rolled = await actor.jetRecuperationConstitution(this.system.soinscomplets.bonus, message);
|
||||||
|
|
||||||
@ -158,11 +161,11 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
peutRetrograder(graviteMoindre, moindres) {
|
peutRetrograder(graviteMoindre, moindres) {
|
||||||
return moindres < RdDItemBlessure.getDefinition(graviteMoindre).max
|
return moindres < RdDItemBlessure.maxBlessures(graviteMoindre)
|
||||||
}
|
}
|
||||||
|
|
||||||
async calculerFinPeriodeTemporel(debut) {
|
async calculerFinPeriodeTemporel(debut) {
|
||||||
return await debut.nouveauJour().addJours(this.system.gravite);
|
return debut.nouveauJour().addJours(this.system.gravite);
|
||||||
}
|
}
|
||||||
|
|
||||||
async onFinPeriode(oldTimestamp, newTimestamp) {
|
async onFinPeriode(oldTimestamp, newTimestamp) {
|
||||||
@ -182,16 +185,16 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
return `systems/foundryvtt-reve-de-dragon/icons/sante/${soins ? 'blessure-soins' : img}.webp`
|
return `systems/foundryvtt-reve-de-dragon/icons/sante/${soins ? 'blessure-soins' : img}.webp`
|
||||||
}
|
}
|
||||||
|
|
||||||
getLabelGravite() {
|
static getLabelGravite(gravite) {
|
||||||
return RdDItemBlessure.getDefinition(this.system.gravite).label
|
return definitionsBlessures.find(it => it.gravite >= gravite).label
|
||||||
}
|
}
|
||||||
|
|
||||||
static getDefinition(gravite) {
|
static getDefinition(gravite) {
|
||||||
return definitionsBlessures.sort(Misc.ascending(it => it.gravite))
|
return definitionsBlessures.find(it => it.gravite >= gravite)
|
||||||
.find(it => it.gravite >= gravite);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static maxBlessures(gravite) {
|
static maxBlessures(gravite) {
|
||||||
return RdDItemBlessure.getDefinition(gravite).max
|
return definitionsBlessures.find(it => it.gravite >= gravite).max
|
||||||
}
|
}
|
||||||
|
|
||||||
isContusion() {
|
isContusion() {
|
||||||
@ -216,7 +219,7 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
`<b>Heure et Date</b>: ${new RdDTimestamp(this.system.temporel.debut).formatDateHeure()}`,
|
`<b>Heure et Date</b>: ${new RdDTimestamp(this.system.temporel.debut).formatDateHeure()}`,
|
||||||
RdDItem.propertyIfDefined('Blessé', this.parent?.name, this.parent),
|
RdDItem.propertyIfDefined('Blessé', this.parent?.name, this.parent),
|
||||||
`<b>Localisation</b>: ${this.system.localisation}`,
|
`<b>Localisation</b>: ${this.system.localisation}`,
|
||||||
`<b>Gravité</b>: ${RdDItemBlessure.getDefinition(this.system.gravite).label}`,
|
`<b>Gravité</b>: ${this.system.label}`,
|
||||||
`<b>Difficulté des soins</b>: ${this.system.difficulte}`,
|
`<b>Difficulté des soins</b>: ${this.system.difficulte}`,
|
||||||
(this.system.soinscomplets.done ?
|
(this.system.soinscomplets.done ?
|
||||||
`<b>Bonus soins complets</b>: ${this.system.soinscomplets.bonus}` :
|
`<b>Bonus soins complets</b>: ${this.system.soinscomplets.bonus}` :
|
||||||
|
154
module/item/item-actions.js
Normal file
154
module/item/item-actions.js
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
import { Misc } from "../misc.js"
|
||||||
|
import { RdDSheetUtility } from "../rdd-sheet-utility.js"
|
||||||
|
import { RdDUtility } from "../rdd-utility.js"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO:
|
||||||
|
* options.editable ?
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const _SPACEHOLDER = { placeholder: true }
|
||||||
|
|
||||||
|
const _VENDRE = {
|
||||||
|
code: 'item-vendre', label: 'Vendre ou donner', icon: it => 'fa-solid fa-comments-dollar',
|
||||||
|
filter: it => Misc.toInt(it.system.quantite) > 0,
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => item.proposerVente()
|
||||||
|
}
|
||||||
|
const _ACHAT_SERVICE = {
|
||||||
|
code: 'item-service-acheter', label: 'Acheter', icon: it => 'fa-regular fa-coins',
|
||||||
|
//filter: it => Misc.toInt(it.system.quantite) > 0,
|
||||||
|
//optionsFilter: options => options.editable,
|
||||||
|
//action: (item, actor) => item.proposerVente()
|
||||||
|
}
|
||||||
|
const _MONTRER = {
|
||||||
|
code: 'item-montrer', label: 'Montrer', icon: it => 'fa-solid fa-comment',
|
||||||
|
action: (item, actor) => item.postItemToChat()
|
||||||
|
}
|
||||||
|
const _EDIT = {
|
||||||
|
code: 'item-edit', label: 'Editer', icon: it => 'fa-solid fa-edit',
|
||||||
|
action: (item, actor) => item.sheet.render(true)
|
||||||
|
}
|
||||||
|
const _DELETE = {
|
||||||
|
code: 'item-delete', label: 'Supprimer', icon: it => 'fa-solid fa-trash',
|
||||||
|
optionsFilter: options => options.editable && options.isOwner,
|
||||||
|
action: (item, actor) => RdDUtility.confirmActorItemDelete(item, actor)
|
||||||
|
}
|
||||||
|
const _EQUIPER = {
|
||||||
|
code: 'item-equip', label: 'Equiper', icon: it => it.system.equipe ? 'fa-solid fa-hand-rock' : 'fa-regular fa-hand-paper',
|
||||||
|
filter: it => !it.estContenu && it.isEquipable(),
|
||||||
|
action: (item, actor) => actor.equiperObjet(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const _CUISINER = {
|
||||||
|
code: 'item-cuisiner', label: 'Cuisiner', icon: it => 'fa-solid fa-utensils',
|
||||||
|
filter: it => it.getUtilisation() == 'cuisine' && it.system.sust > 0,
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.preparerNourriture(item)
|
||||||
|
}
|
||||||
|
const _MANGER_CRU = {
|
||||||
|
code: 'item-manger-cru', label: 'Manger cru', icon: it => 'fa-solid fa-drumstick-bite',
|
||||||
|
filter: it => it.getUtilisation() == 'cuisine' && it.system.sust > 0,
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.mangerNourriture(item)
|
||||||
|
}
|
||||||
|
const _MANGER = {
|
||||||
|
code: 'item-manger', label: 'Manger', icon: it => 'fa-solid fa-utensils',
|
||||||
|
filter: it => !(it.system.boisson),
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.mangerNourriture(item)
|
||||||
|
}
|
||||||
|
const _BOIRE = {
|
||||||
|
code: 'item-boire', label: 'Boire', icon: it => 'fa-solid fa-glass-water',
|
||||||
|
filter: it => it.system.boisson,
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.mangerNourriture(item)
|
||||||
|
}
|
||||||
|
const _DECOCTION = {
|
||||||
|
code: 'item-decoction', label: 'Décoction', icon: it => 'fa-solid fa-flask-vial',
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.actionHerbe(item)
|
||||||
|
}
|
||||||
|
const _OUVRIR = {
|
||||||
|
code: 'item-edit', label: 'Ouvrir', icon: it => 'fa-solid fa-eye',
|
||||||
|
action: (item, actor) => item.sheet.render(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
const _LIRE = {
|
||||||
|
code: 'item-lire', label: 'Lire', icon: it => 'fa-solid fa-book-open',
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.actionLire(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const _REFOULER = {
|
||||||
|
code: 'item-refouler', label: 'Refouler', icon: it => 'fa-solid fa-burst',
|
||||||
|
filter: it => it.system.refoulement > 0,
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.actionRefoulement(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const _CONSOMMER_POTION = {
|
||||||
|
code: 'item-potion-consommer', label: 'Consommer', icon: it => 'fa-solid fa-vial',
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => actor.consommerPotion(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const _ENCHANTER = {
|
||||||
|
code: 'item-enchanter', label: 'Enchanter', icon: it => 'fa-solid fa-sparkles',
|
||||||
|
filter: it => it.isEnchantable(),
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => item.enchanterPotion()
|
||||||
|
}
|
||||||
|
|
||||||
|
const _SORT_RESERVE = {
|
||||||
|
code: 'item-sortreserve-add', label: 'Ajouter en réserve', icon: it => 'fa-solid fa-sparkles',
|
||||||
|
filter: it => game.user.isGM && !it.system.isrituel,
|
||||||
|
action: (item, actor) => actor.addSortReserve(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const COMMON_ACTIONS = [_EQUIPER]
|
||||||
|
export const DEFAULT_ACTIONS = [_SPACEHOLDER, _VENDRE, _MONTRER, _EDIT, _DELETE]
|
||||||
|
|
||||||
|
export const ITEM_ACTIONS = {
|
||||||
|
faune: [_CUISINER, _MANGER_CRU],
|
||||||
|
ingredient: [_CUISINER, _MANGER_CRU],
|
||||||
|
conteneur: [_OUVRIR],
|
||||||
|
herbe: [_DECOCTION, _CUISINER, _MANGER_CRU],
|
||||||
|
livre: [_LIRE],
|
||||||
|
nourritureboisson: [_MANGER, _BOIRE],
|
||||||
|
ombre: [_REFOULER],
|
||||||
|
plante: [_CUISINER, _MANGER_CRU],
|
||||||
|
potion: [_CONSOMMER_POTION, _ENCHANTER],
|
||||||
|
queue: [_REFOULER],
|
||||||
|
sort: [_SORT_RESERVE],
|
||||||
|
service: [_ACHAT_SERVICE]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class ItemAction {
|
||||||
|
|
||||||
|
static applies(action, item, options) {
|
||||||
|
return action
|
||||||
|
&& item.isActionAllowed(action.code)
|
||||||
|
&& (!action.filter || action.filter(item))
|
||||||
|
&& (!action.optionsFilter || action.optionsFilter(options))
|
||||||
|
}
|
||||||
|
|
||||||
|
static icon(action, item) {
|
||||||
|
if (action && action.icon) {
|
||||||
|
return action.icon(item)
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
static onActionItem(event, actor, options) {
|
||||||
|
const item = RdDSheetUtility.getItem(event, actor)
|
||||||
|
const code = $(event.currentTarget).data('code')
|
||||||
|
const action = item.itemActions().find(it => it.code == code)
|
||||||
|
if (action && (!action.optionsFilter || action.optionsFilter(options))) {
|
||||||
|
action.action(item, actor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@ export class RdDItemMaladie extends RdDItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async calculerFinPeriodeTemporel(debut) {
|
async calculerFinPeriodeTemporel(debut) {
|
||||||
return await debut.addPeriode(this.system.periode.nombre, this.system.periode.unite);
|
return debut.addPeriode(this.system.periode.nombre, this.system.periode.unite);
|
||||||
}
|
}
|
||||||
|
|
||||||
async onFinPeriode(oldTimestamp, newTimestamp) {
|
async onFinPeriode(oldTimestamp, newTimestamp) {
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import { RdDItem } from "../item.js";
|
import { RdDItemQueue } from "./queue.js";
|
||||||
|
|
||||||
|
export class RdDItemOmbre extends RdDItemQueue {
|
||||||
|
|
||||||
export class RdDItemOmbre extends RdDItem {
|
|
||||||
static get defaultIcon() {
|
static get defaultIcon() {
|
||||||
return "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp";
|
return "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp";
|
||||||
}
|
}
|
||||||
|
|
||||||
async calculerFinPeriodeTemporel(debut) {
|
|
||||||
return await debut.appliquerDuree(this.system.duree, this.parent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ export class RdDItemPoison extends RdDItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async calculerFinPeriodeTemporel(debut) {
|
async calculerFinPeriodeTemporel(debut) {
|
||||||
return await debut.addPeriode(this.system.periode.nombre, this.system.periode.unite) ;
|
return debut.addPeriode(this.system.periode.nombre, this.system.periode.unite) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
async onFinPeriode(oldTimestamp, newTimestamp) {
|
async onFinPeriode(oldTimestamp, newTimestamp) {
|
||||||
|
154
module/item/potion.js
Normal file
154
module/item/potion.js
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { Grammar } from "../grammar.js";
|
||||||
|
import { RdDItem } from "../item.js";
|
||||||
|
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
||||||
|
import { ITEM_ACTIONS } from "./item-actions.js";
|
||||||
|
import { DialogEnchanter } from "./potion/dialog-enchanter.js";
|
||||||
|
|
||||||
|
const POTION_MAGIQUE = ['AlchimieEnchante', 'ReposEnchante', 'SoinEnchante', 'AutreEnchante']
|
||||||
|
const POTION_ENCHANTABLE = ['Alchimie', 'Repos', 'Soin', 'Autre']
|
||||||
|
.concat(POTION_MAGIQUE)
|
||||||
|
|
||||||
|
const MAP_CATEGORIE_ENCHANTEMENT = [
|
||||||
|
{ basique: 'Alchimie', enchante: 'AlchimieEnchante' },
|
||||||
|
{ basique: 'Repos', enchante: 'ReposEnchante' },
|
||||||
|
{ basique: 'Soin', enchante: 'SoinEnchante' },
|
||||||
|
{ basique: 'Autre', enchante: 'AutreEnchante' }]
|
||||||
|
|
||||||
|
export class RdDItemPotion extends RdDItem {
|
||||||
|
|
||||||
|
static async herbesSoins() {
|
||||||
|
return await RdDItemPotion.$listHerbes(it => Grammar.equalsInsensitive(it.system.categorie, 'Soin') && it.system.niveau > 0)
|
||||||
|
}
|
||||||
|
static async herbesRepos() {
|
||||||
|
return await RdDItemPotion.$listHerbes(it => Grammar.equalsInsensitive(it.system.categorie, 'Repos') && it.system.niveau > 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
static async $listHerbes(filter) {
|
||||||
|
const herbes = await SystemCompendiums.getWorldOrCompendiumItems('herbe', 'faune-flore-mineraux');
|
||||||
|
return herbes.filter(filter)
|
||||||
|
}
|
||||||
|
|
||||||
|
static get defaultIcon() {
|
||||||
|
return "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp"
|
||||||
|
}
|
||||||
|
|
||||||
|
prepareDerivedData() {
|
||||||
|
super.prepareDerivedData()
|
||||||
|
this.system.puissance = this.system.magique ? this.calculPuissance() : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
isPotion() { return true }
|
||||||
|
isEnchantable() { return POTION_ENCHANTABLE.includes(this.system.categorie) }
|
||||||
|
isMagique() { return POTION_MAGIQUE.includes(this.system.categorie) }
|
||||||
|
|
||||||
|
itemSpecificActions() {
|
||||||
|
return ITEM_ACTIONS[ITEM_TYPES.potion]
|
||||||
|
}
|
||||||
|
|
||||||
|
getActions(options = { warnIfNot: true }) {
|
||||||
|
const actionConsommer = this.prepareAction('Consommer', options.warnIfNot);
|
||||||
|
if (this.isEnchantable()) {
|
||||||
|
return [
|
||||||
|
actionConsommer,
|
||||||
|
this.prepareAction('Enchanter', options.warnIfNot)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
actionConsommer
|
||||||
|
]
|
||||||
|
}
|
||||||
|
// TDOD: purifier?
|
||||||
|
getUtilisation() {
|
||||||
|
switch (this.system.categorie) {
|
||||||
|
case 'Alchimie': case 'AlchimieEnchante':
|
||||||
|
case 'AlchimieAutre':
|
||||||
|
return 'alchimie'
|
||||||
|
case 'Cuisine': return 'cuisine'
|
||||||
|
case 'Remede': case 'Repos': case 'ReposEnchante': case 'Soin': case 'SoinEnchante':
|
||||||
|
return 'soins'
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
_potionChatData() {
|
||||||
|
return [
|
||||||
|
`<b>Rareté</b>: ${this.system.rarete}`,
|
||||||
|
`<b>Catégorie</b>: ${this.system.categorie}`,
|
||||||
|
...this._inventaireTemplateChatData()
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
async enchanterPotion() {
|
||||||
|
const actor = this.parent;
|
||||||
|
if (actor && (!actor.isPersonnage() || !actor.isHautRevant())) {
|
||||||
|
ui.notifications.info('Seul un haut rêvant peut enchanter une potion')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const dailog = await DialogEnchanter.create(this, actor, (updates) => this.$onEnchanterPotion(updates));
|
||||||
|
dailog.render(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
perteRevePotion() {
|
||||||
|
if (this.system.magique && !this.system.prpermanent && this.system.pr > 0) {
|
||||||
|
const nouveauReve = Math.max(this.system.pr - 1, 0)
|
||||||
|
return {
|
||||||
|
_id: this.id,
|
||||||
|
name: this.name,
|
||||||
|
img: this.img,
|
||||||
|
'system.pr': nouveauReve,
|
||||||
|
'system.quantite': nouveauReve > 0 ? this.system.quantite : 0,
|
||||||
|
'system.magique': nouveauReve > 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
async $onEnchanterPotion(enchanter) {
|
||||||
|
if (enchanter.nouveaupr == 0) {
|
||||||
|
await this.update({
|
||||||
|
'system.pr': 0,
|
||||||
|
'system.purifie': false,
|
||||||
|
'system.magique': false,
|
||||||
|
'system.categorie': this.categorieEnchantement().basique,
|
||||||
|
'system.prpermanent': false,
|
||||||
|
'system.prdate': 0,
|
||||||
|
'system.quantite': this.parent ? 0 : this.system.quantite
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
await this.update({
|
||||||
|
'system.pr': enchanter.nouveaupr,
|
||||||
|
'system.purifie': enchanter.purifier,
|
||||||
|
'system.magique': true,
|
||||||
|
'system.categorie': this.categorieEnchantement().enchante,
|
||||||
|
'system.prpermanent': enchanter.prpermanent,
|
||||||
|
'system.prdate': RdDItemPotion.dateEnchantement()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.sheet?.render(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
calculPuissance() { return this.system.herbebonus * this.system.pr }
|
||||||
|
|
||||||
|
categorieEnchantement() {
|
||||||
|
const categorie = this.system.categorie
|
||||||
|
const categorieEnchantement = MAP_CATEGORIE_ENCHANTEMENT.find(it => [it.basique, it.enchante].includes(categorie))
|
||||||
|
return categorieEnchantement ?? { basique: categorie, enchante: categorie }
|
||||||
|
}
|
||||||
|
|
||||||
|
static dateEnchantement() {
|
||||||
|
return game.system.rdd.calendrier.getTimestamp().debutJournee().indexDate
|
||||||
|
}
|
||||||
|
|
||||||
|
static buildHerbesList(listeHerbes, max) {
|
||||||
|
let list = {}
|
||||||
|
for (let herbe of listeHerbes) {
|
||||||
|
let brins = max - herbe.system.niveau;
|
||||||
|
list[herbe.name] = `${herbe.name} (Bonus: ${herbe.system.niveau}, Brins: ${brins})`;
|
||||||
|
}
|
||||||
|
list['Autre'] = 'Autre (Bonus: variable, Brins: variable)'
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
46
module/item/potion/dialog-enchanter.js
Normal file
46
module/item/potion/dialog-enchanter.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
export class DialogEnchanter extends Dialog {
|
||||||
|
|
||||||
|
static async create(item, actor, callback) {
|
||||||
|
const enchanter = {
|
||||||
|
actor: actor,
|
||||||
|
item: item,
|
||||||
|
nouveaupr: item.system.pr,
|
||||||
|
prpermanent: item.system.prpermanent,
|
||||||
|
purifier: false
|
||||||
|
}
|
||||||
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/item/potion/dialog-enchanter.hbs`, enchanter)
|
||||||
|
return new DialogEnchanter(enchanter, html, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(enchanter, html, callback) {
|
||||||
|
let options = { classes: ["dialog-enchanter"], width: 400, height: 'fit-content', 'z-index': 99999 }
|
||||||
|
let conf = {
|
||||||
|
title: "Enchanter une potion",
|
||||||
|
content: html,
|
||||||
|
default: "enchanter",
|
||||||
|
buttons: {
|
||||||
|
"enchanter": { label: "Enchanter", callback: it => this.onEnchanter() }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
super(conf, options)
|
||||||
|
|
||||||
|
this.callback = callback
|
||||||
|
this.enchanter = enchanter
|
||||||
|
}
|
||||||
|
|
||||||
|
activateListeners(html) {
|
||||||
|
super.activateListeners(html)
|
||||||
|
this.html = html
|
||||||
|
this.html.find("input.nouveaupr").change(event => this.enchanter.nouveaupr = Number(event.currentTarget.value))
|
||||||
|
this.html.find("input.purifier").change(event => this.enchanter.purifier = event.currentTarget.checked)
|
||||||
|
this.html.find("input.prpermanent").change(event => this.enchanter.prpermanent = event.currentTarget.checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async onEnchanter() {
|
||||||
|
await this.html.find(".nouveaupr").change()
|
||||||
|
this.callback(this.enchanter);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -6,8 +6,9 @@ export class RdDItemQueue extends RdDItem {
|
|||||||
return "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp";
|
return "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp";
|
||||||
}
|
}
|
||||||
|
|
||||||
async calculerFinPeriodeTemporel(debut) {
|
async calculerFinPeriodeTemporel(timestamp) {
|
||||||
|
// décaller le début pour calcul correct si la queue dure 12h
|
||||||
|
const debut = timestamp.addMinutes(timestamp.indexMinute == 0 ? -1 : 0);
|
||||||
return await debut.appliquerDuree(this.system.duree, this.parent);
|
return await debut.appliquerDuree(this.system.duree, this.parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import { ITEM_TYPES, RdDItem } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { RdDItem } from "../item.js";
|
||||||
import { Misc } from "../misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { LIST_CARAC_PERSONNAGE, RdDCarac } from "../rdd-carac.js";
|
import { LIST_CARAC_PERSONNAGE, RdDCarac } from "../rdd-carac.js";
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ export class RdDRencontre extends RdDItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async calculerFinPeriodeTemporel(debut) {
|
async calculerFinPeriodeTemporel(debut) {
|
||||||
return await debut.nouvelleHeure().addHeures(12);
|
return debut.nouvelleHeure().addHeures(12);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { RdDBaseActorSheet } from "../actor/base-actor-sheet.js";
|
import { RdDBaseActorSheet } from "../actor/base-actor-sheet.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||||
import { RdDUtility } from "../rdd-utility.js";
|
import { RdDUtility } from "../rdd-utility.js";
|
||||||
import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js";
|
import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js";
|
||||||
@ -29,9 +29,10 @@ export class RdDConteneurItemSheet extends RdDItemInventaireSheet {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
prepareConteneurData(formData) {
|
prepareConteneurData(formData) {
|
||||||
RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires);
|
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires);
|
||||||
formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems;
|
const subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems;
|
||||||
|
formData.subItems = subItems
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onDragStart(event) {
|
async _onDragStart(event) {
|
||||||
|
58
module/item/sheet-potion.js
Normal file
58
module/item/sheet-potion.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { RdDTimestamp } from "../time/rdd-timestamp.js";
|
||||||
|
import { RdDItemPotion } from "./potion.js";
|
||||||
|
import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js";
|
||||||
|
|
||||||
|
|
||||||
|
export class RdDPotionItemSheet extends RdDItemInventaireSheet {
|
||||||
|
|
||||||
|
static get ITEM_TYPE() { return ITEM_TYPES.potion };
|
||||||
|
|
||||||
|
static $calculBonusHerbe(formData, herbesList, max) {
|
||||||
|
if (Number(formData.system.herbebrins)) {
|
||||||
|
let herbe = herbesList.find(h => h.name.toLowerCase() == formData.system.herbe.toLowerCase());
|
||||||
|
if (herbe) {
|
||||||
|
const brinsRequis = max - herbe.system.niveau;
|
||||||
|
const brinsManquants = Math.max(brinsRequis - formData.system.herbebrins, 0);
|
||||||
|
formData.system.herbebonus = Math.max(herbe.system.niveau - brinsManquants, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get potion(){ return this.item }
|
||||||
|
|
||||||
|
async getData() {
|
||||||
|
const formData = await super.getData()
|
||||||
|
formData.enchantable = this.potion.isEnchantable()
|
||||||
|
const enchantement = this.potion.categorieEnchantement()
|
||||||
|
formData.isSoins = enchantement.basique == 'Soin'
|
||||||
|
formData.isRepos = enchantement.basique == 'Repos'
|
||||||
|
if (formData.isSoins) {
|
||||||
|
const herbesSoins = await RdDItemPotion.herbesSoins()
|
||||||
|
RdDPotionItemSheet.$calculBonusHerbe(formData, herbesSoins, 12);
|
||||||
|
formData.herbesSoins = RdDItemPotion.buildHerbesList(herbesSoins, 12)
|
||||||
|
}
|
||||||
|
if (formData.isRepos) {
|
||||||
|
const herbesRepos = await RdDItemPotion.herbesRepos()
|
||||||
|
RdDPotionItemSheet.$calculBonusHerbe(formData, herbesRepos, 7);
|
||||||
|
formData.herbesRepos = RdDItemPotion.buildHerbesList(herbesRepos, 7)
|
||||||
|
}
|
||||||
|
formData.dateActuelle = game.system.rdd.calendrier.dateCourante()
|
||||||
|
formData.enchantement = RdDTimestamp.splitIndexDate(this.potion.system.prdate)
|
||||||
|
return formData
|
||||||
|
}
|
||||||
|
|
||||||
|
activateListeners(html) {
|
||||||
|
super.activateListeners(html);
|
||||||
|
|
||||||
|
this.html.find('.item-enchanter').click((event) => this.potion.enchanterPotion())
|
||||||
|
|
||||||
|
this.html.find('.date-enchantement').change((event) => {
|
||||||
|
const jour = Number(this.html.find('input.date-enchantement[name="enchantement.jour"]').val())
|
||||||
|
const mois = RdDTimestamp.definition(this.html.find('select.date-enchantement[name="enchantement.mois"]').val())
|
||||||
|
const indexDate = game.system.rdd.calendrier.getIndexFromDate(jour, mois.heure)
|
||||||
|
this.potion.update({ 'system.prdate': indexDate })
|
||||||
|
console.warn(`Date d'enchantement modifiée ${jour}/${mois.heure}: ${indexDate}`)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { RdDItem } from "../item.js";
|
||||||
import { Grammar } from "../grammar.js"
|
import { Grammar } from "../grammar.js"
|
||||||
import { ITEM_TYPES, RdDItem } from "../item.js"
|
|
||||||
import { SystemCompendiums } from "../settings/system-compendiums.js"
|
import { SystemCompendiums } from "../settings/system-compendiums.js"
|
||||||
|
|
||||||
const DON_HAUT_REVE = "Don de Haut-Rêve"
|
const DON_HAUT_REVE = "Don de Haut-Rêve"
|
||||||
|
@ -2,7 +2,8 @@ import { RdDBaseActor } from "./actor/base-actor.js";
|
|||||||
import { LOG_HEAD, SYSTEM_RDD } from "./constants.js";
|
import { LOG_HEAD, SYSTEM_RDD } from "./constants.js";
|
||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { Monnaie } from "./item-monnaie.js";
|
import { Monnaie } from "./item-monnaie.js";
|
||||||
import { RdDItem, ITEM_TYPES, ACTOR_TYPES } from "./item.js";
|
import { ITEM_TYPES, ACTOR_TYPES } from "./constants.js";
|
||||||
|
import { RdDItem } from "./item.js";
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { RdDRaretes } from "./item/raretes.js";
|
import { RdDRaretes } from "./item/raretes.js";
|
||||||
import { VOIES_DRACONIC } from "./item-sort.js";
|
import { VOIES_DRACONIC } from "./item-sort.js";
|
||||||
|
@ -542,7 +542,7 @@ export class RdDCombat {
|
|||||||
case '.particuliere-attaque': return await this.choixParticuliere(attackerRoll, event.currentTarget.attributes['data-mode'].value);
|
case '.particuliere-attaque': return await this.choixParticuliere(attackerRoll, event.currentTarget.attributes['data-mode'].value);
|
||||||
case '.parer-button': return this.parade(attackerRoll, armeParadeId);
|
case '.parer-button': return this.parade(attackerRoll, armeParadeId);
|
||||||
case '.esquiver-button': return this.esquive(attackerRoll, compId, competence);
|
case '.esquiver-button': return this.esquive(attackerRoll, compId, competence);
|
||||||
case '0encaisser-button': return this.encaisser(attackerRoll, defenderRoll);
|
case '.encaisser-button': return this.encaisser(attackerRoll, defenderRoll);
|
||||||
case '.echec-total-attaque': return this._onEchecTotal(attackerRoll);
|
case '.echec-total-attaque': return this._onEchecTotal(attackerRoll);
|
||||||
|
|
||||||
case '.appel-chance-attaque': return this.attacker.rollAppelChance(
|
case '.appel-chance-attaque': return this.attacker.rollAppelChance(
|
||||||
|
@ -361,13 +361,14 @@ export class RdDCommands {
|
|||||||
async getTMRAleatoire(msg, params) {
|
async getTMRAleatoire(msg, params) {
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
let type = params[0]
|
let type = params[0]
|
||||||
const solvedTerrain = TMRUtility.findTMRLike(type)?.type
|
const solvedTerrain = type ? TMRUtility.findTMRLike(type)?.type : undefined
|
||||||
if (solvedTerrain){
|
const filter = solvedTerrain ? (it => it.type == solvedTerrain) : (it => true)
|
||||||
const tmr = await TMRUtility.getTMRAleatoire(type ? (it => it.type == solvedTerrain) : (it => true))
|
if (type == undefined || solvedTerrain != undefined) {
|
||||||
|
const tmr = await TMRUtility.getTMRAleatoire(filter)
|
||||||
return RdDCommands._chatAnswer(msg, `Case aléatoire: ${tmr.coord} - ${tmr.label}`)
|
return RdDCommands._chatAnswer(msg, `Case aléatoire: ${tmr.coord} - ${tmr.label}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
async findTMR(msg, params) {
|
async findTMR(msg, params) {
|
||||||
|
@ -4,8 +4,7 @@ import { RdDRoll } from "./rdd-roll.js";
|
|||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { ChatUtility } from "./chat-utility.js";
|
import { ChatUtility } from "./chat-utility.js";
|
||||||
import { STATUSES } from "./settings/status-effects.js";
|
import { STATUSES } from "./settings/status-effects.js";
|
||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
@ -429,7 +428,6 @@ export class RdDEmpoignade {
|
|||||||
return await Item.create({
|
return await Item.create({
|
||||||
name: "Empoignade en cours de " + attacker.name + ' sur ' + defender.name,
|
name: "Empoignade en cours de " + attacker.name + ' sur ' + defender.name,
|
||||||
type: 'empoignade',
|
type: 'empoignade',
|
||||||
img: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
|
|
||||||
system: { description: "", empoignadeid: foundry.utils.randomID(16), compteempoigne: 0, empoigneurid: attacker.id, empoigneid: defender.id, ptsemp: 0, empoigneurname: attacker.name, empoignename: defender.name }
|
system: { description: "", empoignadeid: foundry.utils.randomID(16), compteempoigne: 0, empoigneurid: attacker.id, empoigneid: defender.id, ptsemp: 0, empoigneurname: attacker.name, empoignename: defender.name }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
import { Grammar } from "./grammar.js";
|
|
||||||
import { SystemCompendiums } from "./settings/system-compendiums.js";
|
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
export class RdDHerbes extends Item {
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static async onReady() {
|
|
||||||
this.herbesSoins = await RdDHerbes.listCategorieHerbes('Soin');
|
|
||||||
this.herbesRepos = await RdDHerbes.listCategorieHerbes('Repos');
|
|
||||||
}
|
|
||||||
|
|
||||||
static async listCategorieHerbes(categorie) {
|
|
||||||
const herbes = await SystemCompendiums.getWorldOrCompendiumItems('herbe', 'faune-flore-mineraux');
|
|
||||||
return herbes.filter(it => Grammar.equalsInsensitive(it.system.categorie, categorie));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static buildHerbesList(listeHerbes, max) {
|
|
||||||
let list = {}
|
|
||||||
for (let herbe of listeHerbes) {
|
|
||||||
let brins = max - herbe.system.niveau;
|
|
||||||
list[herbe.name] = `${herbe.name} (Bonus: ${herbe.system.niveau}, Brins: ${brins})`;
|
|
||||||
}
|
|
||||||
list['Autre'] = 'Autre (Bonus: variable, Brins: variable)'
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static calculFormData(formData, item) {
|
|
||||||
formData.isSoins = item.system.categorie.includes('Soin');
|
|
||||||
formData.isRepos = item.system.categorie.includes('Repos');
|
|
||||||
if (formData.isSoins) {
|
|
||||||
RdDHerbes.calculBonusHerbe(formData, this.herbesSoins, 12);
|
|
||||||
}
|
|
||||||
if (formData.isRepos) {
|
|
||||||
RdDHerbes.calculBonusHerbe(formData, this.herbesRepos, 7);
|
|
||||||
}
|
|
||||||
formData.herbesSoins = RdDHerbes.buildHerbesList(this.herbesSoins, 12);
|
|
||||||
formData.herbesRepos = RdDHerbes.buildHerbesList(this.herbesRepos, 7);
|
|
||||||
formData.dateActuelle = game.system.rdd.calendrier.dateCourante();
|
|
||||||
formData.enchantement = RdDTimestamp.splitIndexDate(item.system.prdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static calculPuissancePotion(potion) {
|
|
||||||
return potion.system.herbebonus * potion.system.pr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static calculPointsRepos(potion) {
|
|
||||||
return potion.system.herbebonus * potion.system.pr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static calculPointsGuerison(potion) {
|
|
||||||
return potion.system.herbebonus * potion.system.pr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static calculBonusHerbe(formData, herbesList, max) {
|
|
||||||
if (Number(formData.system.herbebrins)) {
|
|
||||||
let herbe = herbesList.find(item => item.name.toLowerCase() == formData.system.herbe.toLowerCase());
|
|
||||||
if (herbe) {
|
|
||||||
const brinsRequis = max - herbe.system.niveau;
|
|
||||||
const brinsManquants = Math.max(brinsRequis - formData.system.herbebrins, 0);
|
|
||||||
formData.system.herbebonus = Math.max(herbe.system.niveau - brinsManquants, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
import { RdDItemArme } from "./item-arme.js";
|
import { RdDItemArme } from "./item-arme.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
|
|
||||||
export class RdDHotbar {
|
export class RdDHotbar {
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ import { RdDCompendiumOrganiser } from "./rdd-compendium-organiser.js"
|
|||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"
|
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"
|
||||||
import { RdDHotbar } from "./rdd-hotbar-drop.js"
|
import { RdDHotbar } from "./rdd-hotbar-drop.js"
|
||||||
import { EffetsDraconiques } from "./tmr/effets-draconiques.js"
|
import { EffetsDraconiques } from "./tmr/effets-draconiques.js"
|
||||||
import { RdDHerbes } from "./rdd-herbes.js"
|
|
||||||
import { RdDDice } from "./rdd-dice.js"
|
import { RdDDice } from "./rdd-dice.js"
|
||||||
import { RdDPossession } from "./rdd-possession.js"
|
import { RdDPossession } from "./rdd-possession.js"
|
||||||
import { Misc } from "./misc.js"
|
import { Misc } from "./misc.js"
|
||||||
@ -76,7 +75,8 @@ import { AppPersonnageAleatoire } from "./actor/random/app-personnage-aleatoire.
|
|||||||
import { RdDActorExportSheet } from "./actor/export-scriptarium/actor-encart-sheet.js"
|
import { RdDActorExportSheet } from "./actor/export-scriptarium/actor-encart-sheet.js"
|
||||||
import { RdDStatBlockParser } from "./apps/rdd-import-stats.js"
|
import { RdDStatBlockParser } from "./apps/rdd-import-stats.js"
|
||||||
import { RdDJournalSheet } from "./journal/journal-sheet.js"
|
import { RdDJournalSheet } from "./journal/journal-sheet.js"
|
||||||
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js"
|
import { RdDPotionItemSheet } from "./item/sheet-potion.js"
|
||||||
|
import { RdDItemPotion } from "./item/potion.js"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RdD system
|
* RdD system
|
||||||
@ -105,6 +105,7 @@ export class SystemReveDeDragon {
|
|||||||
poison: RdDItemPoison,
|
poison: RdDItemPoison,
|
||||||
queue: RdDItemQueue,
|
queue: RdDItemQueue,
|
||||||
tete: RdDItemTete,
|
tete: RdDItemTete,
|
||||||
|
potion: RdDItemPotion,
|
||||||
race: RdDItemRace,
|
race: RdDItemRace,
|
||||||
rencontre: RdDRencontre,
|
rencontre: RdDRencontre,
|
||||||
service: RdDItemService,
|
service: RdDItemService,
|
||||||
@ -195,6 +196,7 @@ export class SystemReveDeDragon {
|
|||||||
RdDItemSheet.register(RdDHerbeItemSheet)
|
RdDItemSheet.register(RdDHerbeItemSheet)
|
||||||
RdDItemSheet.register(RdDFauneItemSheet)
|
RdDItemSheet.register(RdDFauneItemSheet)
|
||||||
RdDItemSheet.register(RdDPlanteItemSheet)
|
RdDItemSheet.register(RdDPlanteItemSheet)
|
||||||
|
RdDItemSheet.register(RdDPotionItemSheet)
|
||||||
RdDItemSheet.register(RdDIngredientItemSheet)
|
RdDItemSheet.register(RdDIngredientItemSheet)
|
||||||
RdDItemSheet.register(RdDServiceItemSheet)
|
RdDItemSheet.register(RdDServiceItemSheet)
|
||||||
RdDItemSheet.register(RdDBlessureItemSheet)
|
RdDItemSheet.register(RdDBlessureItemSheet)
|
||||||
@ -202,9 +204,10 @@ export class SystemReveDeDragon {
|
|||||||
|
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||||
types: [
|
types: [
|
||||||
"objet", "arme", "armure", "livre", "potion", "munition",
|
"objet", "arme", "armure", "livre", "munition",
|
||||||
"monnaie", "nourritureboisson", "gemme",
|
"monnaie", "nourritureboisson", "gemme",
|
||||||
], makeDefault: true
|
],
|
||||||
|
makeDefault: true
|
||||||
})
|
})
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemSheet, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemSheet, {
|
||||||
types: [
|
types: [
|
||||||
@ -214,7 +217,8 @@ export class SystemReveDeDragon {
|
|||||||
"queue", "ombre", "souffle", "tete", "casetmr", "sort", "sortreserve",
|
"queue", "ombre", "souffle", "tete", "casetmr", "sort", "sortreserve",
|
||||||
"nombreastral", "tache", "maladie", "poison", "possession",
|
"nombreastral", "tache", "maladie", "poison", "possession",
|
||||||
"tarot", "extraitpoetique", "empoignade"
|
"tarot", "extraitpoetique", "empoignade"
|
||||||
], makeDefault: true
|
],
|
||||||
|
makeDefault: true
|
||||||
})
|
})
|
||||||
|
|
||||||
// préparation des différents modules
|
// préparation des différents modules
|
||||||
@ -316,7 +320,6 @@ export class SystemReveDeDragon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StatusEffects.onReady()
|
StatusEffects.onReady()
|
||||||
RdDHerbes.onReady()
|
|
||||||
RdDDice.onReady()
|
RdDDice.onReady()
|
||||||
|
|
||||||
RdDStatBlockParser.parseStatBlock()
|
RdDStatBlockParser.parseStatBlock()
|
||||||
|
@ -3,7 +3,7 @@ import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
|||||||
import { RdDRoll } from "./rdd-roll.js";
|
import { RdDRoll } from "./rdd-roll.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { Targets } from "./targets.js";
|
import { Targets } from "./targets.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* On part du principe qu'une entité démarre tjs
|
/* On part du principe qu'une entité démarre tjs
|
||||||
@ -174,7 +174,7 @@ export class RdDPossession {
|
|||||||
await RdDResolutionTable.displayRollData(rollData, rollData.attacker, 'chat-resultat-possession.html')
|
await RdDResolutionTable.displayRollData(rollData, rollData.attacker, 'chat-resultat-possession.html')
|
||||||
if (rollData.possession.isPosseder || rollData.possession.isConjurer) {
|
if (rollData.possession.isPosseder || rollData.possession.isConjurer) {
|
||||||
// conjuration
|
// conjuration
|
||||||
victime.deleteEmbeddedDocuments("Item", [rollData.possession._id])
|
await victime.deleteEmbeddedDocuments("Item", [rollData.possession._id])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import { RdDCarac } from "./rdd-carac.js";
|
|||||||
import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { ACTOR_TYPES } from "./item.js";
|
import { ACTOR_TYPES } from "./constants.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the base Dialog entity to select roll parameters
|
* Extend the base Dialog entity to select roll parameters
|
||||||
@ -137,7 +137,11 @@ export class RdDRoll extends Dialog {
|
|||||||
this.rollData.selectedCarac = this.rollData.carac[this.actor.mapCarac(this.rollData.competence.system.defaut_carac)]
|
this.rollData.selectedCarac = this.rollData.carac[this.actor.mapCarac(this.rollData.competence.system.defaut_carac)]
|
||||||
}
|
}
|
||||||
if (this.rollData.selectedCarac) {
|
if (this.rollData.selectedCarac) {
|
||||||
this.html.find("[name='carac']").val(RdDCarac.caracDetails(this.rollData.selectedCarac.label).code)
|
this.html.find("[name='carac']").val(
|
||||||
|
this.actor?.type == ACTOR_TYPES.personnage
|
||||||
|
? RdDCarac.caracDetails(this.rollData.selectedCarac.label).code
|
||||||
|
: this.rollData.selectedCarac.label
|
||||||
|
)
|
||||||
}
|
}
|
||||||
if (this.rollData.selectedSort) {
|
if (this.rollData.selectedSort) {
|
||||||
this.setSelectedSort(this.rollData.selectedSort);
|
this.setSelectedSort(this.rollData.selectedSort);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
|
||||||
import { CompendiumTable, CompendiumTableHelpers, SystemCompendiums } from "./settings/system-compendiums.js";
|
import { CompendiumTable, CompendiumTableHelpers, SystemCompendiums } from "./settings/system-compendiums.js";
|
||||||
|
|
||||||
export class RdDRollTables {
|
export class RdDRollTables {
|
||||||
|
@ -70,7 +70,7 @@ export class RdDSheetUtility {
|
|||||||
await RdDSheetUtility._onSplitItem(item, split, actor);
|
await RdDSheetUtility._onSplitItem(item, split, actor);
|
||||||
onSplit();
|
onSplit();
|
||||||
});
|
});
|
||||||
dialog.render(true);
|
dialog.render(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
static async _onSplitItem(item, split, actor) {
|
static async _onSplitItem(item, split, actor) {
|
||||||
@ -82,4 +82,11 @@ export class RdDSheetUtility {
|
|||||||
await actor.createEmbeddedDocuments('Item', [splitItem])
|
await actor.createEmbeddedDocuments('Item', [splitItem])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async renderItemBranch(actor, item) {
|
||||||
|
while (item) {
|
||||||
|
await item.sheet?.render()
|
||||||
|
item = actor.getContenant(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -16,7 +16,7 @@ import { RdDDice } from "./rdd-dice.js";
|
|||||||
import { STATUSES } from "./settings/status-effects.js";
|
import { STATUSES } from "./settings/status-effects.js";
|
||||||
import { RdDRencontre } from "./item/rencontre.js";
|
import { RdDRencontre } from "./item/rencontre.js";
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
|
|
||||||
const TMR_DISPLAY_SIZE = {
|
const TMR_DISPLAY_SIZE = {
|
||||||
@ -212,7 +212,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSortsReserve(coord) {
|
getSortsReserve(coord) {
|
||||||
return this.actor.itemTypes[ITEM_TYPES.sortreserve].filter(// Reserve sur une case fleuve ou normale
|
return this.sortsReserve.filter(// Reserve sur une case fleuve ou normale
|
||||||
TMRUtility.getTMR(coord).type == 'fleuve'
|
TMRUtility.getTMR(coord).type == 'fleuve'
|
||||||
? it => TMRUtility.getTMR(it.system.coord).type == 'fleuve'
|
? it => TMRUtility.getTMR(it.system.coord).type == 'fleuve'
|
||||||
: it => it.system.coord == coord
|
: it => it.system.coord == coord
|
||||||
@ -271,8 +271,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getTokensSortsReserve() {
|
_getTokensSortsReserve() {
|
||||||
const sortsReserve = this.actor.itemTypes[ITEM_TYPES.sortreserve];
|
return Misc.concat(this.sortsReserve.map(sortReserve =>
|
||||||
return Misc.concat(sortsReserve.map(sortReserve =>
|
|
||||||
EffetsDraconiques.sortReserve.tokens(this.pixiTMR, sortReserve, () => sortReserve.system.coord)))
|
EffetsDraconiques.sortReserve.tokens(this.pixiTMR, sortReserve, () => sortReserve.system.coord)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -908,8 +907,8 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
lancerSortEnReserve(coord, sortId) {
|
lancerSortEnReserve(coord, sortId) {
|
||||||
let sorts = this.getSortsReserve(coord);
|
const sort = this.getSortsReserve(coord)
|
||||||
let sort = sorts.find(it => it.id == sortId);
|
.find(it => it.id == sortId);
|
||||||
if (sort) {
|
if (sort) {
|
||||||
this.processSortReserve(sort);
|
this.processSortReserve(sort);
|
||||||
} else {
|
} else {
|
||||||
|
@ -19,10 +19,12 @@ import { RdDEmpoignade } from "./rdd-empoignade.js";
|
|||||||
import { ExperienceLog } from "./actor/experience-log.js";
|
import { ExperienceLog } from "./actor/experience-log.js";
|
||||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||||
import { APP_ASTROLOGIE_REFRESH } from "./sommeil/app-astrologie.js";
|
import { APP_ASTROLOGIE_REFRESH } from "./sommeil/app-astrologie.js";
|
||||||
import { RDD_CONFIG } from "./constants.js";
|
import { ITEM_TYPES, RDD_CONFIG } from "./constants.js";
|
||||||
import { RdDBaseActor } from "./actor/base-actor.js";
|
import { RdDBaseActor } from "./actor/base-actor.js";
|
||||||
import { RdDCarac } from "./rdd-carac.js";
|
import { RdDCarac } from "./rdd-carac.js";
|
||||||
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
||||||
|
import { Monnaie } from "./item-monnaie.js";
|
||||||
|
import { ItemAction } from "./item/item-actions.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// This table starts at 0 -> niveau -10
|
// This table starts at 0 -> niveau -10
|
||||||
@ -115,6 +117,7 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html',
|
||||||
// sous-parties de feuilles de personnages
|
// sous-parties de feuilles de personnages
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.html',
|
||||||
@ -129,48 +132,47 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/competence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/competence.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/resonances.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/resonances.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/jeux.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.html',
|
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/non-haut-revant.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/non-haut-revant.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/haut-revant.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/haut-revant.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queues.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queues.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queue.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queue.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-souffles.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-souffles.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-tetes.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-tetes.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-signes-draconiques.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-signes-draconiques.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-rencontres.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-rencontres.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-sorts.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-sorts.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-sorts-reserve.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-sorts-reserve.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-meditations.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-meditations.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-casestmr.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-casetmrs.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-journal.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-journal.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.hbs',
|
||||||
"systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.html",
|
"systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.hbs",
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-animaux.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-animaux.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-suivants.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-suivants.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.hbs',
|
||||||
//Items
|
//Items
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete-script.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete-script.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete.hbs',
|
||||||
@ -180,8 +182,9 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item-queue-sheet.html',
|
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/header-item.html',
|
'systems/foundryvtt-reve-de-dragon/templates/header-item.html',
|
||||||
|
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/item/queue-sheet.hbs',
|
||||||
// partial enums
|
// partial enums
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-base-competence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-base-competence.html',
|
||||||
@ -189,7 +192,7 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categories.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categories.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-potion.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/potion-enum-categorie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-queue.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-queue.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-competence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-competence.html',
|
||||||
@ -334,6 +337,8 @@ export class RdDUtility {
|
|||||||
Handlebars.registerHelper('isFieldInventaireModifiable', (type, field) => RdDItem.isFieldInventaireModifiable(type, field));
|
Handlebars.registerHelper('isFieldInventaireModifiable', (type, field) => RdDItem.isFieldInventaireModifiable(type, field));
|
||||||
// Items
|
// Items
|
||||||
Handlebars.registerHelper('rarete-getChamp', (rarete, field) => RdDRaretes.getChamp(rarete, field));
|
Handlebars.registerHelper('rarete-getChamp', (rarete, field) => RdDRaretes.getChamp(rarete, field));
|
||||||
|
Handlebars.registerHelper('item-action-applies', (action, item, options) => ItemAction.applies(action, item, options))
|
||||||
|
Handlebars.registerHelper('item-action-icon', (action, item) => ItemAction.icon(action, item))
|
||||||
|
|
||||||
// TMRs
|
// TMRs
|
||||||
Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord));
|
Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord));
|
||||||
@ -435,8 +440,8 @@ export class RdDUtility {
|
|||||||
};
|
};
|
||||||
if (!optionsArbre.templateItem) {
|
if (!optionsArbre.templateItem) {
|
||||||
optionsArbre.templateItem = item.parent?.type == 'commerce'
|
optionsArbre.templateItem = item.parent?.type == 'commerce'
|
||||||
? "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.html"
|
? "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.hbs"
|
||||||
: "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.html";
|
: "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.hbs";
|
||||||
}
|
}
|
||||||
item.niveau = optionsArbre.profondeur;
|
item.niveau = optionsArbre.profondeur;
|
||||||
}
|
}
|
||||||
@ -464,13 +469,38 @@ export class RdDUtility {
|
|||||||
return ligneObjet;
|
return ligneObjet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static filterItemsPerTypeForSheet(formData, itemTypes) {
|
||||||
|
Object.values(ITEM_TYPES).forEach(t => {
|
||||||
|
formData[t + 's'] = Misc.arrayOrEmpty(itemTypes[t])
|
||||||
|
itemTypes[t].forEach(item => item.actions = item.itemActions())
|
||||||
|
})
|
||||||
|
|
||||||
|
formData.maladiesPoisons = formData.maladies.concat(formData.poisons)
|
||||||
|
formData.competences = formData.competences.concat(formData.competencecreatures)
|
||||||
|
formData.monnaies = formData.monnaies.sort(Monnaie.triValeurEntiere())
|
||||||
|
|
||||||
|
formData.inventaires = RdDUtility.prepareInventaire(itemTypes)
|
||||||
|
}
|
||||||
|
|
||||||
static buildInventaireConteneur(actorId, itemId, options) {
|
static buildInventaireConteneur(actorId, itemId, options) {
|
||||||
const actor = game.actors.get(actorId)
|
const actor = game.actors.get(actorId)
|
||||||
const item = actor?.items.get(itemId)
|
const item = actor?.items.get(itemId)
|
||||||
if (item) {
|
if (item?.type == ITEM_TYPES.conteneur) {
|
||||||
return RdDUtility.buildContenuConteneur(item, options, { ouvert: true, profondeur: 1 });
|
const formData = {}
|
||||||
|
RdDUtility.filterItemsPerTypeForSheet(formData, actor.itemTypes);
|
||||||
|
RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires);
|
||||||
|
item.subItems = formData.conteneurs.find(it => it._id == itemId)?.subItems;
|
||||||
|
|
||||||
|
return RdDUtility.buildContenuConteneur(item, options, { ouvert: true, profondeur: 1 })
|
||||||
}
|
}
|
||||||
return '';
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
static prepareInventaire(itemTypes) {
|
||||||
|
return RdDItem.getItemTypesInventaire('all')
|
||||||
|
.map(t => Misc.arrayOrEmpty(itemTypes[t]))
|
||||||
|
.reduce((a, b) => a.concat(b), [])
|
||||||
|
.sort(Misc.ascending(it => it.name))
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -872,7 +902,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async confirmActorItemDelete(sheet, item, htmlToDelete) {
|
static async confirmActorItemDelete(item, actor) {
|
||||||
const itemId = item.id;
|
const itemId = item.id;
|
||||||
const confirmationSuppression = {
|
const confirmationSuppression = {
|
||||||
settingConfirmer: "confirmation-supprimer-" + item.getItemGroup(),
|
settingConfirmer: "confirmation-supprimer-" + item.getItemGroup(),
|
||||||
@ -881,8 +911,7 @@ export class RdDUtility {
|
|||||||
buttonLabel: "Supprimer",
|
buttonLabel: "Supprimer",
|
||||||
onAction: () => {
|
onAction: () => {
|
||||||
console.log('Delete : ', itemId);
|
console.log('Delete : ', itemId);
|
||||||
sheet.actor.deleteEmbeddedDocuments('Item', [itemId], { renderSheet: false });
|
actor.deleteEmbeddedDocuments('Item', [itemId], { renderSheet: false });
|
||||||
RdDUtility.slideOnDelete(sheet, htmlToDelete);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (item.isConteneurNonVide()) {
|
if (item.isConteneurNonVide()) {
|
||||||
@ -895,8 +924,7 @@ export class RdDUtility {
|
|||||||
label: "Supprimer conteneur et contenu",
|
label: "Supprimer conteneur et contenu",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
console.log("Delete : ", itemId);
|
console.log("Delete : ", itemId);
|
||||||
sheet.actor.deleteAllConteneur(itemId, { renderSheet: false });
|
actor.deleteAllConteneur(itemId, { renderSheet: false });
|
||||||
RdDUtility.slideOnDelete(sheet, htmlToDelete);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -334,6 +334,10 @@ export class RdDTimestamp {
|
|||||||
return this.nouvelleHeure().addHeures((12 + heure - this.heure) % 12);
|
return this.nouvelleHeure().addHeures((12 + heure - this.heure) % 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debutJournee() {
|
||||||
|
return RdDTimestamp.timestamp(this.annee, this.mois, this.jour)
|
||||||
|
}
|
||||||
|
|
||||||
async appliquerDuree(duree, actor) {
|
async appliquerDuree(duree, actor) {
|
||||||
const formule = FORMULES_DUREE.find(it => it.code == duree) ?? FORMULES_DUREE.find(it => it.code == "");
|
const formule = FORMULES_DUREE.find(it => it.code == duree) ?? FORMULES_DUREE.find(it => it.code == "");
|
||||||
return await formule.calcul(this, actor);
|
return await formule.calcul(this, actor);
|
||||||
|
@ -26,7 +26,7 @@ export class TMRRencontres {
|
|||||||
* @param {*} forcedRoll
|
* @param {*} forcedRoll
|
||||||
*/
|
*/
|
||||||
async rollRencontre(terrain, forcedRoll) {
|
async rollRencontre(terrain, forcedRoll) {
|
||||||
const tmrType = TMRUtility.findTMRLike(terrain)?.type
|
const tmrType = TMRUtility.findTMRLike(terrain, { inclusMauvaise: true })?.type
|
||||||
if (tmrType == undefined) {
|
if (tmrType == undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export const TMRType = {
|
|||||||
export const FLEUVE_COORD = 'Fleuve'
|
export const FLEUVE_COORD = 'Fleuve'
|
||||||
|
|
||||||
const TMRMapping = {
|
const TMRMapping = {
|
||||||
Fleuve: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
Fleuve: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli", generique: 'fleuve' },
|
||||||
A1: { type: TMRType.cite.type, label: "Cité Vide" },
|
A1: { type: TMRType.cite.type, label: "Cité Vide" },
|
||||||
B1: { type: TMRType.plaines.type, label: "Plaines d’Assorh" },
|
B1: { type: TMRType.plaines.type, label: "Plaines d’Assorh" },
|
||||||
C1: { type: TMRType.necropole.type, label: "Nécropole de Kroak" },
|
C1: { type: TMRType.necropole.type, label: "Nécropole de Kroak" },
|
||||||
@ -281,18 +281,18 @@ export class TMRUtility {
|
|||||||
return Grammar.articleDetermine(tmr.type) + ' ' + tmr.label;
|
return Grammar.articleDetermine(tmr.type) + ' ' + tmr.label;
|
||||||
}
|
}
|
||||||
|
|
||||||
static findTMRLike(type, options = { inclusMauvaise: true }) {
|
static findTMRLike(type, options = { inclusMauvaise: false }) {
|
||||||
const choix = [...Object.values(TMRType)]
|
const choix = [...Object.values(TMRType)]
|
||||||
if (options.inclusMauvaise) {
|
if (options.inclusMauvaise) {
|
||||||
choix.push({ name: 'Mauvaise', type: 'mauvaise'});
|
choix.push({ name: 'Mauvaise', type: 'mauvaise'});
|
||||||
}
|
}
|
||||||
const selection = Misc.findAllLike(type, choix)
|
const selection = Misc.findAllLike(type, choix)
|
||||||
if (selection.length == 0) {
|
if (selection.length == 0) {
|
||||||
ui.notifications.warn(`Un type de TMR doit être indiqué, '${type}' n'est pas trouvé dans ${choix}`);
|
ui.notifications.warn(`Un type de TMR doit être indiqué, '${type}' n'est pas trouvé dans ${choix.map(it => it.name).reduce(Misc.joining(', '))}`);
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
if (selection.length > 1) {
|
if (selection.length > 1) {
|
||||||
ui.notifications.warn(`Plusieurs types de TMR pourraient correspondre à '${type}': ${selection.map(it => it.name)}`);
|
ui.notifications.warn(`Plusieurs types de TMR pourraient correspondre à '${type}': ${selection.map(it => it.name).reduce(Misc.joining(', '))}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return selection[0]
|
return selection[0]
|
||||||
@ -357,7 +357,7 @@ export class TMRUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static filterTMR(filter) {
|
static filterTMR(filter) {
|
||||||
return Object.values(TMRMapping).filter(filter);
|
return Object.values(TMRMapping).filter(it => !it.generique && filter(it))
|
||||||
}
|
}
|
||||||
|
|
||||||
static getCasesType(type) {
|
static getCasesType(type) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { TMRUtility } from "../tmr-utility.js";
|
import { TMRUtility } from "../tmr-utility.js";
|
||||||
import { PixiTMR } from "./pixi-tmr.js";
|
import { PixiTMR } from "./pixi-tmr.js";
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import { Periple } from "./periple.js";
|
|||||||
import { UrgenceDraconique } from "./urgence-draconique.js";
|
import { UrgenceDraconique } from "./urgence-draconique.js";
|
||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
import { AugmentationSeuil } from "./augmentation-seuil.js";
|
import { AugmentationSeuil } from "./augmentation-seuil.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
|
||||||
export class EffetsDraconiques {
|
export class EffetsDraconiques {
|
||||||
static carteTmr = new CarteTmr();
|
static carteTmr = new CarteTmr();
|
||||||
|
@ -5,7 +5,7 @@ import { RdDRollTables } from "../rdd-rolltables.js";
|
|||||||
import { TMRUtility } from "../tmr-utility.js";
|
import { TMRUtility } from "../tmr-utility.js";
|
||||||
import { tmrTokenZIndex } from "../tmr-constants.js";
|
import { tmrTokenZIndex } from "../tmr-constants.js";
|
||||||
import { Draconique } from "./draconique.js";
|
import { Draconique } from "./draconique.js";
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
import { TMRAnimations } from "./animation.js";
|
import { TMRAnimations } from "./animation.js";
|
||||||
|
|
||||||
export class UrgenceDraconique extends Draconique {
|
export class UrgenceDraconique extends Draconique {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ITEM_TYPES } from "../item.js"
|
import { ITEM_TYPES } from "../constants.js"
|
||||||
import { RdDItemCompetence } from "../item-competence.js"
|
import { RdDItemCompetence } from "../item-competence.js"
|
||||||
import { ChatUtility } from "../chat-utility.js"
|
import { ChatUtility } from "../chat-utility.js"
|
||||||
import { Misc } from "../misc.js"
|
import { Misc } from "../misc.js"
|
||||||
|
@ -300,7 +300,7 @@ system:
|
|||||||
déchirure. Celle-là se contente de chercher à fuir en
|
déchirure. Celle-là se contente de chercher à fuir en
|
||||||
cas d’agression, ou attaque toutes griffes dehors si elle se sent
|
cas d’agression, ou attaque toutes griffes dehors si elle se sent
|
||||||
acculée. Pour la distinguer (visuellement) de la rieuse,
|
acculée. Pour la distinguer (visuellement) de la rieuse,
|
||||||
réussir VUE/Zoologie à -5. Les caractéristiques de
|
réussir @roll[VUE/Zoologie/-5]. Les caractéristiques de
|
||||||
combat indiquées ne s’appliquent qu’à la
|
combat indiquées ne s’appliquent qu’à la
|
||||||
pointue.</p>
|
pointue.</p>
|
||||||
race: ''
|
race: ''
|
||||||
|
@ -215,7 +215,7 @@ system:
|
|||||||
souffrir ses premiers malus à la course et au saut. La vitesse
|
souffrir ses premiers malus à la course et au saut. La vitesse
|
||||||
indiquée correspond à une allure plutôt lente.
|
indiquée correspond à une allure plutôt lente.
|
||||||
Contrairement aux autres animaux pour qui la vitesse de base est fixe, le
|
Contrairement aux autres animaux pour qui la vitesse de base est fixe, le
|
||||||
gardien des rêves peut rajouter jusqu’à 3d6 points
|
gardien des rêves peut rajouter jusqu’à @roll[3d6] points
|
||||||
à la vitesse de course de chaque individu. Cette nouvelle vitesse de
|
à la vitesse de course de chaque individu. Cette nouvelle vitesse de
|
||||||
course est rajoutée une fois pour toutes, mais peut être
|
course est rajoutée une fois pour toutes, mais peut être
|
||||||
modulée par un jet de course sur la table de Course animale.</p>
|
modulée par un jet de course sur la table de Course animale.</p>
|
||||||
|
@ -3897,7 +3897,7 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -5349,7 +5349,7 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -5605,7 +5605,7 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -5765,7 +5765,7 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -6437,7 +6437,7 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -7610,7 +7610,7 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -8010,7 +8010,7 @@ items:
|
|||||||
poussant dans les lieux frais et humides : marais ombragés,
|
poussant dans les lieux frais et humides : marais ombragés,
|
||||||
certaines forêts, et parfois vallées de montagne. Un peu
|
certaines forêts, et parfois vallées de montagne. Un peu
|
||||||
moins rare est la fausse endebrume, qui lui ressemble physiquement, mais
|
moins rare est la fausse endebrume, qui lui ressemble physiquement, mais
|
||||||
n'a aucune vertu. <br /><em>VUE/Botanique à -1 pour savoir
|
n'a aucune vertu. <br /><em>@roll[VUE/Botanique/-1] pour savoir
|
||||||
à quelle espèce on a affaire (jet obligatoire à
|
à quelle espèce on a affaire (jet obligatoire à
|
||||||
chaque cueillette).</em></p>
|
chaque cueillette).</em></p>
|
||||||
|
|
||||||
@ -8782,7 +8782,7 @@ items:
|
|||||||
system:
|
system:
|
||||||
description: |-
|
description: |-
|
||||||
<p>Poudre brune apparaissant sur les parois des grottes.</p>
|
<p>Poudre brune apparaissant sur les parois des grottes.</p>
|
||||||
<p>VUE/Alchimie à -1.</p>
|
<p>@roll[VUE/Alchimie/-1].</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
@ -8818,7 +8818,7 @@ items:
|
|||||||
<p>Poudre blanche apparaissant sous l’écorce de nombreux
|
<p>Poudre blanche apparaissant sous l’écorce de nombreux
|
||||||
arbres,</p>
|
arbres,</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à 0.</p>
|
<p>@roll[VUE/Alchimie/0].</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
@ -8854,7 +8854,7 @@ items:
|
|||||||
<p>Poudre rouge obtenue par disruption alchimique de la
|
<p>Poudre rouge obtenue par disruption alchimique de la
|
||||||
<em>chramaele</em>, minerai ayant l’apparence de la glaise.</p>
|
<em>chramaele</em>, minerai ayant l’apparence de la glaise.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -4</p>
|
<p>@roll[VUE/Alchimie/-4]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
@ -8899,7 +8899,7 @@ items:
|
|||||||
<p>Poudre noire obtenue par disruption alchimique du minerai
|
<p>Poudre noire obtenue par disruption alchimique du minerai
|
||||||
appelé <em>narthalide</em>, sorte de marne.</p>
|
appelé <em>narthalide</em>, sorte de marne.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -3</p>
|
<p>@roll[VUE/Alchimie/-3]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
@ -8941,7 +8941,7 @@ items:
|
|||||||
<p>Poudre bleuâtre obtenue par disruption alchimique du minerai
|
<p>Poudre bleuâtre obtenue par disruption alchimique du minerai
|
||||||
appelé <em>obbadine</em>, sorte de tourbe.</p>
|
appelé <em>obbadine</em>, sorte de tourbe.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -2</p>
|
<p>@roll[VUE/Alchimie/-2]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
@ -8983,7 +8983,7 @@ items:
|
|||||||
<p>Plus rare que le vert, poudre grisâtre apparaissant le long de
|
<p>Plus rare que le vert, poudre grisâtre apparaissant le long de
|
||||||
certaines lianes des marais.</p>
|
certaines lianes des marais.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -4</p>
|
<p>@roll[VUE/Alchimie/-4]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
@ -9019,7 +9019,7 @@ items:
|
|||||||
<p>Poudre verdâtre apparaissant sur les tiges de certains
|
<p>Poudre verdâtre apparaissant sur les tiges de certains
|
||||||
roseaux.</p>
|
roseaux.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -2</p>
|
<p>@roll[VUE/Alchimie/-2]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -30,7 +30,7 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,7 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,7 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -28,7 +28,7 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,7 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,7 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Alchimie
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -5,7 +5,7 @@ effects: []
|
|||||||
system:
|
system:
|
||||||
description: |-
|
description: |-
|
||||||
<p>Poudre brune apparaissant sur les parois des grottes.</p>
|
<p>Poudre brune apparaissant sur les parois des grottes.</p>
|
||||||
<p>VUE/Alchimie à -1.</p>
|
<p>@roll[VUE/Alchimie/-1].</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -7,7 +7,7 @@ system:
|
|||||||
<p>Poudre blanche apparaissant sous l’écorce de nombreux
|
<p>Poudre blanche apparaissant sous l’écorce de nombreux
|
||||||
arbres,</p>
|
arbres,</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à 0.</p>
|
<p>@roll[VUE/Alchimie/0].</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -7,7 +7,7 @@ system:
|
|||||||
<p>Poudre rouge obtenue par disruption alchimique de la <em>chramaele</em>,
|
<p>Poudre rouge obtenue par disruption alchimique de la <em>chramaele</em>,
|
||||||
minerai ayant l’apparence de la glaise.</p>
|
minerai ayant l’apparence de la glaise.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -4</p>
|
<p>@roll[VUE/Alchimie/-4]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -7,7 +7,7 @@ system:
|
|||||||
<p>Poudre noire obtenue par disruption alchimique du minerai appelé
|
<p>Poudre noire obtenue par disruption alchimique du minerai appelé
|
||||||
<em>narthalide</em>, sorte de marne.</p>
|
<em>narthalide</em>, sorte de marne.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -3</p>
|
<p>@roll[VUE/Alchimie/-3]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -7,7 +7,7 @@ system:
|
|||||||
<p>Poudre bleuâtre obtenue par disruption alchimique du minerai
|
<p>Poudre bleuâtre obtenue par disruption alchimique du minerai
|
||||||
appelé <em>obbadine</em>, sorte de tourbe.</p>
|
appelé <em>obbadine</em>, sorte de tourbe.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -2</p>
|
<p>@roll[VUE/Alchimie/-2]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -7,7 +7,7 @@ system:
|
|||||||
<p>Plus rare que le vert, poudre grisâtre apparaissant le long de
|
<p>Plus rare que le vert, poudre grisâtre apparaissant le long de
|
||||||
certaines lianes des marais.</p>
|
certaines lianes des marais.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à -4</p>
|
<p>@roll[VUE/Alchimie/-4]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -5,7 +5,7 @@ effects: []
|
|||||||
system:
|
system:
|
||||||
description: |-
|
description: |-
|
||||||
<p>Poudre verdâtre apparaissant sur les tiges de certains roseaux.</p>
|
<p>Poudre verdâtre apparaissant sur les tiges de certains roseaux.</p>
|
||||||
<p>VUE/Alchimie à -2</p>
|
<p>@roll[VUE/Alchimie/-2]</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
encombrement: 0.001
|
encombrement: 0.001
|
||||||
quantite: 1
|
quantite: 1
|
||||||
|
@ -4,7 +4,7 @@ type: ombre
|
|||||||
img: systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp
|
||||||
effects: []
|
effects: []
|
||||||
system:
|
system:
|
||||||
description: <p>Prise immédiate de 3d6 points de fatigue.</p>
|
description: <p>Prise immédiate de @roll[3d6] points de fatigue.</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
temporel:
|
temporel:
|
||||||
debut:
|
debut:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
_id: OjG8XRbeYtq2jcgB
|
_id: OjG8XRbeYtq2jcgB
|
||||||
name: Casser 3d6 oeufs en les jetant à terre
|
name: Casser @roll[3d6] oeufs en les jetant à terre
|
||||||
type: queue
|
type: queue
|
||||||
img: systems/foundryvtt-reve-de-dragon/icons/queues/desir_lancinant.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/queues/desir_lancinant.webp
|
||||||
effects: []
|
effects: []
|
||||||
|
@ -4,7 +4,7 @@ type: queue
|
|||||||
img: systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp
|
||||||
effects: []
|
effects: []
|
||||||
system:
|
system:
|
||||||
description: <p>Prise immédiate de 3d6 points de fatigue.</p>
|
description: <p>Prise immédiate de @roll[3d6] points de fatigue.</p>
|
||||||
descriptionmj: ''
|
descriptionmj: ''
|
||||||
temporel:
|
temporel:
|
||||||
debut:
|
debut:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
_id: F8G3rdU1nfJzYwYR
|
_id: F8G3rdU1nfJzYwYR
|
||||||
name: Garder sur soi 3d6 kilos de cailloux
|
name: Garder sur soi @roll[3d6] kilos de cailloux
|
||||||
type: queue
|
type: queue
|
||||||
img: systems/foundryvtt-reve-de-dragon/icons/queues/idee_fixe.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/queues/idee_fixe.webp
|
||||||
effects: []
|
effects: []
|
||||||
|
@ -9,7 +9,7 @@ system:
|
|||||||
<p><strong>L’huile de pierre</strong> (pétrole brut) se trouve
|
<p><strong>L’huile de pierre</strong> (pétrole brut) se trouve
|
||||||
naturellement à la surface de certains marais.</p>
|
naturellement à la surface de certains marais.</p>
|
||||||
|
|
||||||
<p>VUE/Alchimie à zéro pour l’identifier.</p>
|
<p>@roll[VUE/Alchimie/0] pour l’identifier.</p>
|
||||||
|
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ results:
|
|||||||
- _id: 5AHjNXDrQL5TqLjv
|
- _id: 5AHjNXDrQL5TqLjv
|
||||||
flags: {}
|
flags: {}
|
||||||
type: pack
|
type: pack
|
||||||
text: 'Désir lancinant : Casser 3d6 oeufs en les jetant à terre'
|
text: 'Désir lancinant : Casser @roll[3d6] oeufs en les jetant à terre'
|
||||||
img: systems/foundryvtt-reve-de-dragon/icons/queues/desir_lancinant.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/queues/desir_lancinant.webp
|
||||||
weight: 1
|
weight: 1
|
||||||
range:
|
range:
|
||||||
|
@ -64,7 +64,7 @@ results:
|
|||||||
- _id: P0eaJjtQQfpNIL9I
|
- _id: P0eaJjtQQfpNIL9I
|
||||||
flags: {}
|
flags: {}
|
||||||
type: pack
|
type: pack
|
||||||
text: 'Idée fixe : Garder sur soi 3d6 kilos de cailloux'
|
text: 'Idée fixe : Garder sur soi @roll[3d6] kilos de cailloux'
|
||||||
img: systems/foundryvtt-reve-de-dragon/icons/queues/idee_fixe.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/queues/idee_fixe.webp
|
||||||
weight: 1
|
weight: 1
|
||||||
range:
|
range:
|
||||||
|
@ -37,7 +37,7 @@ results:
|
|||||||
- _id: wpUaRAW4HVRM8eOs
|
- _id: wpUaRAW4HVRM8eOs
|
||||||
flags: {}
|
flags: {}
|
||||||
type: text
|
type: text
|
||||||
text: Reflet d’ancien rêve 2d6+4.
|
text: Reflet d’ancien rêve @roll[2d6+4].
|
||||||
img: systems/foundryvtt-reve-de-dragon/icons/heures/hd06.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/heures/hd06.webp
|
||||||
weight: 1
|
weight: 1
|
||||||
range:
|
range:
|
||||||
@ -53,7 +53,7 @@ results:
|
|||||||
- _id: tPwuPqShKzWo5jkG
|
- _id: tPwuPqShKzWo5jkG
|
||||||
flags: {}
|
flags: {}
|
||||||
type: text
|
type: text
|
||||||
text: Tourbillon blanc 2d6+4.
|
text: Tourbillon blanc @roll[2d6+4].
|
||||||
img: systems/foundryvtt-reve-de-dragon/icons/heures/hd06.webp
|
img: systems/foundryvtt-reve-de-dragon/icons/heures/hd06.webp
|
||||||
weight: 1
|
weight: 1
|
||||||
range:
|
range:
|
||||||
|
@ -67,7 +67,8 @@
|
|||||||
|
|
||||||
/* =================== 3. some constants ============ */
|
/* =================== 3. some constants ============ */
|
||||||
--color-controls:rgba(0, 0, 0, 0.9);
|
--color-controls:rgba(0, 0, 0, 0.9);
|
||||||
--color-controls-hover:rgba(255, 255, 128, 0.7);
|
--color-controls-light:hsla(0, 0%, 20%, 0.8);
|
||||||
|
--color-controls-hover:hsla(60, 100%, 75%, 0.7);
|
||||||
--color-control-border-hover:rgba(255, 128, 0, 0.8);
|
--color-control-border-hover:rgba(255, 128, 0, 0.8);
|
||||||
--color-gold: rgba(191, 149, 63, 0.8);
|
--color-gold: rgba(191, 149, 63, 0.8);
|
||||||
--gradient-gold: linear-gradient(30deg, rgba(191, 149, 63, 0.3), rgba(252, 246, 186, 0.3), rgba(179, 135, 40, 0.3), rgba(251, 245, 183, 0.3), rgba(170, 119, 28, 0.3));
|
--gradient-gold: linear-gradient(30deg, rgba(191, 149, 63, 0.3), rgba(252, 246, 186, 0.3), rgba(179, 135, 40, 0.3), rgba(251, 245, 183, 0.3), rgba(170, 119, 28, 0.3));
|
||||||
@ -391,9 +392,7 @@ table {border: 1px solid #7a7971;}
|
|||||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex-group-center,
|
.flex-group-center {
|
||||||
.flex-group-left,
|
|
||||||
.flex-group-right {
|
|
||||||
-webkit-box-pack: center;
|
-webkit-box-pack: center;
|
||||||
-ms-flex-pack: center;
|
-ms-flex-pack: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -405,8 +404,11 @@ table {border: 1px solid #7a7971;}
|
|||||||
}
|
}
|
||||||
|
|
||||||
.flex-group-left {
|
.flex-group-left {
|
||||||
|
-webkit-box-align: start;
|
||||||
-webkit-box-pack: start;
|
-webkit-box-pack: start;
|
||||||
|
-ms-flex-align: start;
|
||||||
-ms-flex-pack: start;
|
-ms-flex-pack: start;
|
||||||
|
align-items: start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
@ -417,8 +419,11 @@ table {border: 1px solid #7a7971;}
|
|||||||
}
|
}
|
||||||
|
|
||||||
.flex-group-right {
|
.flex-group-right {
|
||||||
|
-webkit-box-align: end;
|
||||||
-webkit-box-pack: end;
|
-webkit-box-pack: end;
|
||||||
|
-ms-flex-align: end;
|
||||||
-ms-flex-pack: end;
|
-ms-flex-pack: end;
|
||||||
|
align-items: end;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
@ -440,9 +445,9 @@ table {border: 1px solid #7a7971;}
|
|||||||
}
|
}
|
||||||
.flex-shrink {
|
.flex-shrink {
|
||||||
flex: 'flex-shrink' ;
|
flex: 'flex-shrink' ;
|
||||||
flex-shrink: 2;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
:is(.flex-grow, .flex-grow-3) {
|
.flex-grow, .flex-grow-3 {
|
||||||
flex-grow: 3;
|
flex-grow: 3;
|
||||||
}
|
}
|
||||||
.flex-grow-2 {
|
.flex-grow-2 {
|
||||||
@ -493,12 +498,13 @@ span.equipement-detail-buttons {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.item-actions-controls,
|
||||||
.equipement-actions {
|
.equipement-actions {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
flex-grow: 2;
|
flex-grow: 2;
|
||||||
align-items: center;
|
align-items: end;
|
||||||
justify-content: center;
|
justify-content: flex-end;
|
||||||
text-align: left;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blessure-control {
|
.blessure-control {
|
||||||
@ -813,16 +819,21 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.competence-list .item-controls {
|
.competence-list .item-controls,
|
||||||
|
.competence-list .item-actions-controls {
|
||||||
display: contents !important;
|
display: contents !important;
|
||||||
}
|
}
|
||||||
|
.competence-list .item-actions-controls.hidden-controls,
|
||||||
.competence-list .item-controls.hidden-controls {
|
.competence-list .item-controls.hidden-controls {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-actions-controls a.actionItem i:is(.fas, .fa, .fa-solid, .fa-regular),
|
||||||
.item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) {
|
.item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
color: var(--color-controls);
|
color: var(--color-controls-light);
|
||||||
}
|
}
|
||||||
|
.item-actions-controls a.actionItem i:is(.fas, .fa, .fa-solid, .fa-regular):hover,
|
||||||
.item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover {
|
.item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
@ -1050,6 +1061,10 @@ a.content-link {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
a.roll-text i.fas{
|
||||||
|
color: var(--color-text-dark-inactive);
|
||||||
|
margin-right: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
li label.compteur {
|
li label.compteur {
|
||||||
@ -1084,25 +1099,29 @@ li label.compteur {
|
|||||||
padding: 0.25rem;
|
padding: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.window-app.sheet .window-content .carac-value, .window-app.sheet .window-content .competence-xp {
|
.window-app.sheet .window-content .carac-value,
|
||||||
|
.window-app.sheet .window-content .competence-xp {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
margin: 0.05rem;
|
margin: 0.05rem;
|
||||||
flex-basis: 2rem;
|
flex-basis: 2rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.window-app.sheet .window-content .carac-value, .window-app.sheet .window-content .competence-value {
|
.window-app.sheet .window-content .carac-value,
|
||||||
|
.window-app.sheet .window-content .competence-value {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
margin: 0.05rem;
|
margin: 0.05rem;
|
||||||
flex-basis: 2rem;
|
flex-basis: 2rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.window-app.sheet .window-content .carac-value, .window-app.sheet .window-content .competence-archetype {
|
.window-app.sheet .window-content .carac-value,
|
||||||
|
.window-app.sheet .window-content .competence-archetype {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
margin: 0.05rem;
|
margin: 0.05rem;
|
||||||
flex-basis: 2rem;
|
flex-basis: 2rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.window-app.sheet .window-content .carac-value, .window-app.sheet .window-content .competence-xp-sort {
|
.window-app.sheet .window-content .carac-value,
|
||||||
|
.window-app.sheet .window-content .competence-xp-sort {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
margin: 0.05rem;
|
margin: 0.05rem;
|
||||||
flex-basis: 2rem;
|
flex-basis: 2rem;
|
||||||
@ -1192,6 +1211,9 @@ ul.chat-list li:nth-child(odd) {
|
|||||||
.item-controls i.fas.allouer-stress.level-up {
|
.item-controls i.fas.allouer-stress.level-up {
|
||||||
color: var(--color-gold);
|
color: var(--color-gold);
|
||||||
}
|
}
|
||||||
|
.item-action-controls i.fa-solid.allouer-stress.level-up {
|
||||||
|
color: var(--color-gold);
|
||||||
|
}
|
||||||
.blessures-list ul {
|
.blessures-list ul {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
@ -1308,21 +1330,11 @@ div.competence-column div.categorie-competence{
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
.arme-label,
|
|
||||||
.generic-label,
|
|
||||||
.competence-label,
|
|
||||||
.astrologie-label,
|
.astrologie-label,
|
||||||
.tache-label,
|
.generic-label,
|
||||||
.subacteur-label,
|
.subacteur-label,
|
||||||
.chant-label,
|
.list-item-label,
|
||||||
.musique-label,
|
.list-title-label {
|
||||||
.oeuvre-label,
|
|
||||||
.chant-label,
|
|
||||||
.danse-label,
|
|
||||||
.recette-label,
|
|
||||||
.jeu-label,
|
|
||||||
.recettecuisine-label,
|
|
||||||
.description-label {
|
|
||||||
flex-grow: 2;
|
flex-grow: 2;
|
||||||
}
|
}
|
||||||
.attribut-value,
|
.attribut-value,
|
||||||
|
@ -802,7 +802,9 @@
|
|||||||
"herbebrins": 0,
|
"herbebrins": 0,
|
||||||
"herbebonus": 0,
|
"herbebonus": 0,
|
||||||
"reposalchimique": false,
|
"reposalchimique": false,
|
||||||
|
"magique": false,
|
||||||
"pr": 0,
|
"pr": 0,
|
||||||
|
"purifie": false,
|
||||||
"prpermanent": false,
|
"prpermanent": false,
|
||||||
"prdate": 0
|
"prdate": 0
|
||||||
},
|
},
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-left flexcol competence-column">
|
<div class="flex-group-left flexcol competence-column">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
{{!-- Equipment Tab --}}
|
{{!-- Equipment Tab --}}
|
||||||
<div class="tab items" data-group="primary" data-tab="items">
|
<div class="tab items" data-group="primary" data-tab="items">
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex-group-left flexcol">
|
<div class="flex-group-left flexcol">
|
||||||
<div class="flex-group-left flexcol competence-column">
|
<div class="flex-group-left flexcol competence-column">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/resonances.hbs"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/resonances.hbs"}}
|
||||||
|
@ -111,19 +111,19 @@
|
|||||||
<div class="tab combat" data-group="primary" data-tab="combat">
|
<div class="tab combat" data-group="primary" data-tab="combat">
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/combat.html"}}<hr>
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/combat.html"}}<hr>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/possessions.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if options.isObserver}}{{!-- Connaissances Tab --}}
|
{{#if options.isObserver}}{{!-- Connaissances Tab --}}
|
||||||
<div class="tab connaissances" data-group="primary" data-tab="connaissances">
|
<div class="tab connaissances" data-group="primary" data-tab="connaissances">
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.html"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeux.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if options.isObserver}}{{!-- hautreve Tab --}}
|
{{#if options.isObserver}}{{!-- hautreve Tab --}}
|
||||||
@ -143,7 +143,7 @@
|
|||||||
|
|
||||||
{{!-- Equipment Tab --}}
|
{{!-- Equipment Tab --}}
|
||||||
<div class="tab items" data-group="primary" data-tab="items">
|
<div class="tab items" data-group="primary" data-tab="items">
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/liens-animaux.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/liens-animaux.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs"}}
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
|
|
||||||
{{!-- Equipment Tab --}}
|
{{!-- Equipment Tab --}}
|
||||||
<div class="tab items" data-group="primary" data-tab="items">
|
<div class="tab items" data-group="primary" data-tab="items">
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
11
templates/actor/alchimie.hbs
Normal file
11
templates/actor/alchimie.hbs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{{#if recettealchimiques.length}}
|
||||||
|
<h3>Recettes Alchimiques</h3>
|
||||||
|
<ul class="item-list alterne-list">
|
||||||
|
{{#each (trier recettealchimiques) as |recette id|}}
|
||||||
|
<li class="item flexrow list-item" data-item-id="{{recette._id}}">
|
||||||
|
<span class="list-item-label"><a class="item-edit">{{recette.name}}</a></span>
|
||||||
|
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=recette options=@root.options}}
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
{{/if}}
|
@ -1,15 +0,0 @@
|
|||||||
{{#if recettesAlchimiques.length}}
|
|
||||||
<h3>Recettes Alchimiques</h3>
|
|
||||||
<ul class="item-list alterne-list">
|
|
||||||
{{#each (trier recettesAlchimiques) as |recette id|}}
|
|
||||||
<li class="item flexrow list-item" data-item-id="{{recette._id}}"><span class="competence-title recette-label item-edit"><a>{{recette.name}}</a></span>
|
|
||||||
<div class="item-controls">
|
|
||||||
<a class="item-edit" data-tooltip="Modifier"><i class="fas fa-edit"></i></a>
|
|
||||||
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
|
|
||||||
<a class="item-montrer" data-tooltip="Montrer"><i class="fas fa-comment"></i></a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
{{/if}}
|
|
@ -3,7 +3,7 @@
|
|||||||
<li class="caracteristique item flexrow list-item" data-item-id="{{armure.id}}">
|
<li class="caracteristique item flexrow list-item" data-item-id="{{armure.id}}">
|
||||||
<span class="flex-grow">
|
<span class="flex-grow">
|
||||||
<img class="sheet-competence-img subacteur-open" src="{{armure.img}}" data-tooltip="{{armure.name}}"/>
|
<img class="sheet-competence-img subacteur-open" src="{{armure.img}}" data-tooltip="{{armure.name}}"/>
|
||||||
<a class="item-equip" data-tooltip="Equiper">{{#if armure.system.equipe}}<i class="fas fa-hand-rock"></i>{{else}}<i class="far fa-hand-paper"></i>{{/if}}</a>
|
<a class="item-equip-armure" data-tooltip="Equiper">{{#if armure.system.equipe}}<i class="fas fa-hand-rock"></i>{{else}}<i class="far fa-hand-paper"></i>{{/if}}</a>
|
||||||
<a>{{armure.name}}</a>
|
<a>{{armure.name}}</a>
|
||||||
{{#if armure.system.malus}}
|
{{#if armure.system.malus}}
|
||||||
<span class="derivee-value">({{armure.system.malus}})</span>
|
<span class="derivee-value">({{armure.system.malus}})</span>
|
||||||
|
@ -33,10 +33,5 @@
|
|||||||
{{#if system.origine}}<span>Par {{system.origine}}</span>{{/if}}
|
{{#if system.origine}}<span>Par {{system.origine}}</span>{{/if}}
|
||||||
{{#if system.localisation}}<span>{{system.localisation}}</span>{{/if}}
|
{{#if system.localisation}}<span>{{system.localisation}}</span>{{/if}}
|
||||||
</span>
|
</span>
|
||||||
<span class="item-controls">
|
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=this options=@root.options}}
|
||||||
<a class="item-edit" data-tooltip="Editer"><i class="fas fa-edit"></i></a>
|
|
||||||
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
|
|
||||||
<a class="item-montrer" data-tooltip="Montrer"><i class="fas fa-comment"></i></a>
|
|
||||||
</span>
|
|
||||||
</li>
|
</li>
|
||||||
|
@ -10,14 +10,9 @@
|
|||||||
<li class="item flexrow list-item" data-item-id="{{tache._id}}"
|
<li class="item flexrow list-item" data-item-id="{{tache._id}}"
|
||||||
data-tooltip="Premiers soins: {{tache.name}} ({{tache.system.points_de_tache_courant}}/{{tache.system.points_de_tache}})">
|
data-tooltip="Premiers soins: {{tache.name}} ({{tache.system.points_de_tache_courant}}/{{tache.system.points_de_tache}})">
|
||||||
<img class="sheet-competence-img" src="{{tache.img}}"/>
|
<img class="sheet-competence-img" src="{{tache.img}}"/>
|
||||||
<span class="competence-title tache-label"><a>{{tache.name}}
|
<span class="list-item-label"><a class="action-tache">{{tache.name}}
|
||||||
({{tache.system.points_de_tache_courant}}/{{tache.system.points_de_tache}})</a></span>
|
({{tache.system.points_de_tache_courant}}/{{tache.system.points_de_tache}})</a></span>
|
||||||
<div class="item-controls">
|
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=tache options=@root.options}}
|
||||||
<a class="item-edit" data-tooltip="Modifier"><i class="fas fa-edit"></i></a>
|
|
||||||
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
|
|
||||||
<a class="item-montrer" data-tooltip="Montrer"><i class="fas fa-comment"></i></a>
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
@ -1,10 +1,10 @@
|
|||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
<li class="competence-header flexrow">
|
<li class="competence-header flexrow">
|
||||||
<span class="competence-title competence-label">Armes et Défenses</span>
|
<span class="generic-label">Armes et Défenses</span>
|
||||||
<span class="competence-title competence-value">Niveau</span>
|
<span class="competence-value">Niveau</span>
|
||||||
<span class="competence-title competence-value">+dom</span>
|
<span class="competence-value">+dom</span>
|
||||||
<span class="competence-title competence-value"></span>
|
<span class="competence-value"></span>
|
||||||
<span class="competence-title initiative-value">Initiative</span>
|
<span class="initiative-value">Initiative</span>
|
||||||
</li>
|
</li>
|
||||||
{{#each combat as |arme key|}}
|
{{#each combat as |arme key|}}
|
||||||
<li class="item flexrow list-item"
|
<li class="item flexrow list-item"
|
||||||
@ -12,7 +12,7 @@
|
|||||||
data-arme-name="{{arme.name}}"
|
data-arme-name="{{arme.name}}"
|
||||||
data-competence-name="{{arme.system.competence}}"
|
data-competence-name="{{arme.system.competence}}"
|
||||||
data-tooltip="{{arme.name}}: niveau {{plusMoins arme.system.niveau}}">
|
data-tooltip="{{arme.name}}: niveau {{plusMoins arme.system.niveau}}">
|
||||||
<span class="arme-label">
|
<span class="list-item-label">
|
||||||
<a class="roll-arme">
|
<a class="roll-arme">
|
||||||
{{#if arme.img}}
|
{{#if arme.img}}
|
||||||
<img class="sheet-competence-img" src="{{arme.img}}" data-tooltip="{{arme.name}}"/>
|
<img class="sheet-competence-img" src="{{arme.img}}" data-tooltip="{{arme.name}}"/>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
{{#each esquives as |esq key|}}
|
{{#each esquives as |esq key|}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{esq._id}}"
|
<li class="item flexrow list-item" data-item-id="{{esq._id}}"
|
||||||
data-tooltip="{{esq.name}}: niveau {{plusMoins esq.system.niveau}}">
|
data-tooltip="{{esq.name}}: niveau {{plusMoins esq.system.niveau}}">
|
||||||
<span class="competence-label">
|
<span class="list-item-label">
|
||||||
<a class="roll-competence" name="{{esq.name}}">
|
<a class="roll-competence" name="{{esq.name}}">
|
||||||
<img class="sheet-competence-img" src="{{esq.img}}" />
|
<img class="sheet-competence-img" src="{{esq.img}}" />
|
||||||
<span>{{esq.name}}</span>
|
<span>{{esq.name}}</span>
|
||||||
@ -47,26 +47,20 @@
|
|||||||
|
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
<li class="competence-header flexrow">
|
<li class="competence-header flexrow">
|
||||||
<span class="competence-title competence-label">Empoignades</span>
|
<span class="flex-grow-3">Empoignades</span>
|
||||||
<span class="competence-title competence-value">Points d'Emp</span>
|
<span class="flex-group-right">Points d'Emp</span>
|
||||||
|
<span class="item-controls"></span>
|
||||||
</li>
|
</li>
|
||||||
{{#each empoignades as |emp key|}}
|
{{#each empoignades as |emp key|}}
|
||||||
<li class="item flexrow list-item"
|
<li class="item flexrow list-item"
|
||||||
data-item-id="{{emp._id}}" data-arme-name="{{emp.name}}"
|
data-item-id="{{emp._id}}" data-arme-name="{{emp.name}}"
|
||||||
data-tooltip="{{emp.name}}: niveau {{plusMoins emp.system.niveau}}">
|
data-tooltip="{{emp.name}}: niveau {{plusMoins emp.system.pointsemp}}">
|
||||||
<span class="empoignade-label">
|
<a class="flex-grow-3 action-empoignade">
|
||||||
<a>
|
|
||||||
{{#if emp.img}}
|
|
||||||
<img class="sheet-competence-img" src="{{emp.img}}"/>
|
<img class="sheet-competence-img" src="{{emp.img}}"/>
|
||||||
{{/if}}
|
|
||||||
<span>{{emp.name}}</span>
|
<span>{{emp.name}}</span>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
<span class="flex-grow-0-5 flex-group-right">{{emp.system.pointsemp}}</span>
|
||||||
<span class="competence-value">{{emp.system.pointsemp}}</span>
|
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=emp options=@root.options}}
|
||||||
<div class="item-controls">
|
|
||||||
<a class="item-edit" data-tooltip="Modifier"><i class="fas fa-edit"></i></a>
|
|
||||||
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
@ -39,46 +39,13 @@
|
|||||||
{{editor description target="system.description" button=true owner=options.isOwner editable=options.isOwner engine="prosemirror"}}
|
{{editor description target="system.description" button=true owner=options.isOwner editable=options.isOwner engine="prosemirror"}}
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.hbs"}}
|
||||||
{{#unless system.illimite}}
|
{{#unless system.illimite}}
|
||||||
{{#if @root.options.isObserver}}
|
{{#if @root.options.isObserver}}
|
||||||
<hr>
|
<hr>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{!--
|
|
||||||
<br>
|
|
||||||
<div class="flexcol">
|
|
||||||
<ul class="item-list alterne-list">
|
|
||||||
<li class="item flexrow list-item">
|
|
||||||
<label class="flex-grow">Service</label>
|
|
||||||
<label>Moral</label>
|
|
||||||
<label>Qualité</label>
|
|
||||||
<label>Prix (sols)</label>
|
|
||||||
<label>
|
|
||||||
{{#unless disabled}}
|
|
||||||
<a class="service-add"><i class="fas fa-plus-circle"></i></a>
|
|
||||||
{{/unless}}
|
|
||||||
</label>
|
|
||||||
</li>
|
|
||||||
{{#each (trier system.services) as |service key|}}
|
|
||||||
<li class="item flexrow list-item" data-key="{{key}}">
|
|
||||||
<input {{@root.disabled}} type="text" name="services[{{key}}].name" value="{{service.name}}" data-dtype="String" />
|
|
||||||
<input {{@root.disabled}} type="checkbox" name="services[{{key}}].system.moral" {{#if service.system.moral}}checked{{/if}} />
|
|
||||||
<input {{@root.disabled}} type="number" name="services[{{key}}].system.qualite" value="{{service.system.qualite}}" data-dtype="Number" min="-10" max="10"/>
|
|
||||||
<input {{@root.disabled}} type="number" class="input-prix" name="services[{{key}}].system.cout" value="{{numberFormat service.system.cout decimals=2 sign=false}}" data-dtype="Number" min="0" />
|
|
||||||
<div class="item-controls">
|
|
||||||
<a class="service-acheter" data-tooltip="Acheter"><i class="fa-sharp fa-solid fa-coins"></i></a>
|
|
||||||
{{#unless @root.disabled}}
|
|
||||||
<a class="service-vendre" data-tooltip="Proposer"><i class="fas fa-comments-dollar"></i></a>
|
|
||||||
<a class="service-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
{{/unless}}
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
--}}
|
|
||||||
<br>
|
<br>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}}
|
||||||
<br>
|
<br>
|
||||||
|
@ -39,23 +39,7 @@
|
|||||||
{{/if}} />
|
{{/if}} />
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</span>
|
</span>
|
||||||
<span class="equipement-actions item-controls">
|
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=item options=@root.options}}
|
||||||
{{#if options.isOwner}}
|
|
||||||
<a class="item-edit" data-tooltip="Editer"><i class="fas fa-edit"></i></a>
|
|
||||||
{{#unless (and (eq item.type 'conteneur') (not vide))}}
|
|
||||||
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
{{#if (or item.parent.system.illimite (ne item.system.quantite 0))}}
|
|
||||||
<a class="item-vendre" data-tooltip="Vendre"><i class="fas fa-comments-dollar"></i></a>
|
|
||||||
{{/if}}
|
|
||||||
{{/unless}}
|
|
||||||
{{/if}}
|
|
||||||
{{#unless (and (eq item.type 'conteneur') (not vide))}}
|
|
||||||
{{#if (or item.parent.system.illimite (gt item.system.quantite 0))}}
|
|
||||||
<a class="item-acheter" data-tooltip="Acheter"><i class="fa-regular fa-coins"></i></a>
|
|
||||||
{{/if}}
|
|
||||||
<a class="item-montrer" data-tooltip="Montrer"><i class="fas fa-comment"></i></a>
|
|
||||||
{{/unless}}
|
|
||||||
</span>
|
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
@ -4,7 +4,7 @@
|
|||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each (trier competences) as |comp key|}}
|
{{#each (trier competences) as |comp key|}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<a class="competence-label roll-competence">
|
<a class="list-item-label roll-competence">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}" data-tooltip="{{comp.name}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}" data-tooltip="{{comp.name}}"/>
|
||||||
<span>{{comp.name}}</span>
|
<span>{{comp.name}}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -23,12 +23,7 @@
|
|||||||
{{#unless @root.options.vueDetaillee}}disabled{{/unless}}
|
{{#unless @root.options.vueDetaillee}}disabled{{/unless}}
|
||||||
{{else}}disabled{{/if}}
|
{{else}}disabled{{/if}}
|
||||||
/>
|
/>
|
||||||
{{#if @root.options.vueDetaillee}}
|
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=comp options=@root.options}}
|
||||||
<div class="item-controls">
|
|
||||||
<a class="item-edit" data-tooltip="Modifier"><i class="fas fa-edit"></i></a>
|
|
||||||
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
@ -4,11 +4,8 @@
|
|||||||
{{#each possessions as |possession key|}}
|
{{#each possessions as |possession key|}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{possession._id}}">
|
<li class="item flexrow list-item" data-item-id="{{possession._id}}">
|
||||||
<img class="sheet-competence-img" src="{{possession.img}}" data-tooltip="{{possession.name}}"/>
|
<img class="sheet-competence-img" src="{{possession.img}}" data-tooltip="{{possession.name}}"/>
|
||||||
<span class="competence-label">{{possession.name}}</span>
|
<span class="list-item-label">{{possession.name}}</span>
|
||||||
<div class="item-controls">
|
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=possession options=@root.options}}
|
||||||
<a class="item-edit" data-tooltip="Modifier"><i class="fas fa-edit"></i></a>
|
|
||||||
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ol>
|
</ol>
|
@ -14,17 +14,17 @@
|
|||||||
<span class="competence-xp-sort">sort</span>
|
<span class="competence-xp-sort">sort</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="item-controls">
|
<div class="item-controls">
|
||||||
<i class="far fa-arrow-alt-circle-up"></i>
|
<i class="fa-regular fa-arrow-alt-circle-up"></i>
|
||||||
<span class="competence-archetype">Arch.</span>
|
<span class="competence-archetype">Arch.</span>
|
||||||
<i class="far fa-edit"></i>
|
<i class="fa-regular fa-edit"></i>
|
||||||
{{#if @root.options.isGM}}
|
{{#if @root.options.isGM}}
|
||||||
<i class="far fa-trash"></i>
|
<i class="fa-regular fa-trash"></i>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
{{#each competences as |comp key|}}
|
{{#each competences as |comp key|}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence.html" comp}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence.hbs" comp}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
<li></li>
|
<li></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user