Compare commits
9 Commits
12.0.46
...
ecdcdb69d5
Author | SHA1 | Date | |
---|---|---|---|
ecdcdb69d5 | |||
8479fdda8a | |||
83e57fbbc7 | |||
2d256b1217 | |||
526d38d32e | |||
2ff3dfef89 | |||
f1b6c01cd7 | |||
675fe5838e | |||
bafdec9924 |
40
changelog.md
40
changelog.md
@ -1,48 +1,17 @@
|
||||
# 12.0
|
||||
|
||||
## 12.0.46 - Le double demi d'Astrobazzarh
|
||||
- correction des raffraîchissement lors du sommeil qui empêchait de dormir
|
||||
plusieurs heures
|
||||
- Si la fatigue n'est pas utilisée, les rounds dans les TMR font perdre de l'endurance (au lieu d'en gagner)
|
||||
- les TMRs se ferment correctement quand la fatigue maximale est dépassée
|
||||
- le message de lancement de sort en réserve donne la description du sort
|
||||
- suppression de double-messages lors de la fermeture des TMR
|
||||
|
||||
## 12.0.45 - Les errements d'Astrobazzarh, encore
|
||||
|
||||
- La difficulté des méditations n'augmente plus en cas de réussite et d'échec normal
|
||||
- Renommage du Bouton pour révéler/masquer le demi-rêve
|
||||
|
||||
## 12.0.44 - Les errements d'Astrobazzarh, suite
|
||||
|
||||
- on peut de nouveau dormir et se réveiller reposé
|
||||
- les possessions utilisent maintenant correctement le rêve actuel
|
||||
- les sorts variables ne causent plus de soucis de voie pour le lancement de sorts
|
||||
- les acteurs ayant un sort avec un coût de rêve entier ne sont plus considérés
|
||||
comme pouvant avoir un rêve variable
|
||||
|
||||
## 12.0.42 - Les errements d'Astrobazzarh
|
||||
|
||||
- Correction de différentes automatisations de combat incorrectes
|
||||
- Correction des jets `@roll[vue/-2]` qui tentaient de chercher une compétence -2 (à cause des armes à 1/2 mains)
|
||||
|
||||
## 12.0.41 - La loupe d'Astrobazzarh
|
||||
|
||||
- On peut de nouveau effectuer des tirages cachés
|
||||
- Le stress transformé est bien diminué lorsqu'on met le stress dans une compétence
|
||||
|
||||
## 12.0.40 - Les mains d'Astrobazzarh
|
||||
|
||||
- correction des attaques particulières en combat
|
||||
- correction de message sur les min/max liés aux modificateurs de races (s'applique uniquement sur la taille)
|
||||
|
||||
## 12.0.39 - Les mains d'Astrobazzarh
|
||||
|
||||
- les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés
|
||||
- commande `/jet` pour poster une demande de jet de dés
|
||||
|
||||
## 12.0.38 - Les prévisions d'Astrobazzarh
|
||||
|
||||
- Correction de modifications de personnages qui ne s'affichaient pas:
|
||||
- changements d'endurance/vie/fatigue, transformé, ...
|
||||
- Migration des compétences "Ecriture" en "Écriture" dans les tâches, livres, oeuvres et méditations
|
||||
@ -52,14 +21,12 @@
|
||||
- utilisation de l'extension hbs pour tous les fichiers handlebars
|
||||
|
||||
## 12.0.37 - Les enchantements d'Astrobazzarh
|
||||
|
||||
- les potions ont un état, seules les potions liquides sont enchantables
|
||||
- les lancements de sorts du jour sont conservés jusqu'à chateau dormant
|
||||
- lorsqu'un joueur souhaite enchanter une potion, les sorts d'enchantements/purification/permanence doivent avoir été lancés auparavant
|
||||
- on peut enchanter des gemmes exactement comme des potions
|
||||
|
||||
## 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
|
||||
@ -74,11 +41,9 @@
|
||||
- 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
|
||||
|
||||
- support de liens "jets de dés"
|
||||
- on peut ajouter des liens "jet de dés" dans les journaux, descriptions, notes, maladresses, ...
|
||||
- avec la syntaxe `@roll[...]` on peut ajouter le lien vers:
|
||||
@ -93,26 +58,21 @@
|
||||
- gestion des blocs secrets dans les descriptions
|
||||
|
||||
## 12.0.33 - la vieillesse d'Astrobazzarh
|
||||
|
||||
- retour de l'expérience pour les joueurs
|
||||
- suppression du message "Pas de caractéristique" sur les jets d'odorat-goût
|
||||
|
||||
## 12.0.32 - les rêveries d'Astrobazzarh
|
||||
|
||||
- Ajout des Items Race pour gérer les ajustements liés aux races
|
||||
|
||||
## 12.0.31 - le mausolée d'Astrobazzarh
|
||||
|
||||
- Correction: les automatisation de combat jouer-MJ fonctionnentde nouveau
|
||||
|
||||
## 12.0.30 - le cauchemar d'Astrobazzarh
|
||||
|
||||
- calcul automatique du niveau des entités selon leur rêve
|
||||
- la description des créatures venimeuses contient un lien vers leur venin
|
||||
- Correction: les messages de combats ne marchaient plus (Changement combiné Foundry + rêve de Dragon)
|
||||
|
||||
## 12.0.29 - L'indexation d'Astrobazzarh
|
||||
|
||||
- les liens dans la descriptions des sorts pointent vers les sorts du compendium
|
||||
- la description du chrasme contient le lien vers son venin plutôt qu'un tableau
|
||||
|
||||
|
150
module/actor.js
150
module/actor.js
@ -243,7 +243,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
await this.resetInfoSommeil()
|
||||
ChatMessage.create(message);
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
this.sheet.render(true);
|
||||
}
|
||||
|
||||
async _recuperationSante(message) {
|
||||
@ -279,32 +279,28 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
/* -------------------------------------------- */
|
||||
async dormirChateauDormant() {
|
||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
|
||||
await this.$dormirChateauDormant();
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
}
|
||||
}
|
||||
const message = {
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: ""
|
||||
};
|
||||
|
||||
async $dormirChateauDormant() {
|
||||
const message = {
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: ""
|
||||
};
|
||||
|
||||
await this._recuperationSante(message);
|
||||
await this._recupereMoralChateauDormant(message);
|
||||
await this._recupereChance();
|
||||
await this.transformerStress();
|
||||
await this.retourSeuilDeReve(message);
|
||||
await this.setBonusPotionSoin(0);
|
||||
await this.retourSust(message);
|
||||
await this.$perteReveEnchantementsChateauDormants();
|
||||
await this.$suppressionLancementsSort();
|
||||
await RdDCoeur.applyCoeurChateauDormant(this, message);
|
||||
if (message.content != "") {
|
||||
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
|
||||
ChatMessage.create(message);
|
||||
await this._recuperationSante(message)
|
||||
await this._recupereMoralChateauDormant(message)
|
||||
await this._recupereChance()
|
||||
await this.transformerStress()
|
||||
await this.retourSeuilDeReve(message)
|
||||
await this.setBonusPotionSoin(0)
|
||||
await this.retourSust(message)
|
||||
await this.$perteReveEnchantementsChateauDormants()
|
||||
await this.$suppressionLancementsSort()
|
||||
await RdDCoeur.applyCoeurChateauDormant(this, message)
|
||||
if (message.content != "") {
|
||||
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
await this.resetInfoSommeil();
|
||||
this.sheet.render(true);
|
||||
}
|
||||
await this.resetInfoSommeil();
|
||||
}
|
||||
|
||||
async resetInfoSommeil() {
|
||||
@ -446,9 +442,10 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
message.content += 'Vous ne trouvez pas le sommeil';
|
||||
}
|
||||
else {
|
||||
let dormi = await this.$dormirDesHeures(message, heures, options);
|
||||
if (dormi.jetsReve.length > 0) {
|
||||
message.content += `Vous récupérez ${dormi.jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `;
|
||||
let jetsReve = [];
|
||||
let dormi = await this.dormirDesHeures(jetsReve, message, heures, options);
|
||||
if (jetsReve.length > 0) {
|
||||
message.content += `Vous récupérez ${jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `;
|
||||
}
|
||||
if (dormi.etat == 'eveil') {
|
||||
await this.reveilReveDeDragon(message, dormi.heures);
|
||||
@ -461,9 +458,11 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
if (options.chateauDormant) {
|
||||
await this.$dormirChateauDormant();
|
||||
await this.dormirChateauDormant();
|
||||
}
|
||||
else {
|
||||
this.sheet.render(true);
|
||||
}
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
}
|
||||
|
||||
async reveilReveDeDragon(message, heures) {
|
||||
@ -473,18 +472,18 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
}
|
||||
|
||||
async $dormirDesHeures(message, heures, options) {
|
||||
const dormi = { heures: 0, etat: 'dort', jetsReve: [] };
|
||||
async dormirDesHeures(jetsReve, message, heures, options) {
|
||||
const dormi = { heures: 0, etat: 'dort' };
|
||||
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
|
||||
await this.$recupererEthylisme(message);
|
||||
await this._recupererEthylisme(message);
|
||||
if (options.grisReve) {
|
||||
await this.$recupererFatigue(message);
|
||||
await this.recupererFatigue(message);
|
||||
}
|
||||
else if (!this.system.sommeil?.insomnie) {
|
||||
await this.$recupererFatigue(message);
|
||||
await this.$jetRecuperationReve(dormi, message);
|
||||
await this.recupererFatigue(message);
|
||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
||||
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
||||
dormi.etat = await this.$jetRecuperationReve(dormi, message);
|
||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -492,36 +491,35 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $jetRecuperationReve(dormi, message) {
|
||||
async jetRecuperationReve(jetsReve, message) {
|
||||
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
||||
const reve = await RdDDice.rollTotal("1dr")
|
||||
let reve = await RdDDice.rollTotal("1dr");
|
||||
if (reve >= 7) {
|
||||
// Rêve de Dragon !
|
||||
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `;
|
||||
await this.combattreReveDeDragon(reve);
|
||||
dormi.jetsReve.push(-1);
|
||||
dormi.etat = 'eveil'
|
||||
return
|
||||
jetsReve.push(-1);
|
||||
return 'eveil';
|
||||
}
|
||||
else {
|
||||
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||
})
|
||||
dormi.jetsReve.push(0)
|
||||
});
|
||||
jetsReve.push(0);
|
||||
}
|
||||
else {
|
||||
await this.reveActuelIncDec(reve)
|
||||
dormi.jetsReve.push(reve)
|
||||
await this.reveActuelIncDec(reve);
|
||||
jetsReve.push(reve);
|
||||
}
|
||||
}
|
||||
}
|
||||
dormi.etat = 'dort'
|
||||
return 'dort';
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $recupererEthylisme(message) {
|
||||
async _recupererEthylisme(message) {
|
||||
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
|
||||
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
||||
if (value <= 0) {
|
||||
@ -543,6 +541,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
max = Math.floor(max / 2);
|
||||
}
|
||||
const manquant = max - this.system.sante.endurance.value;
|
||||
|
||||
if (manquant > 0) {
|
||||
await this.santeIncDec("endurance", manquant);
|
||||
message.content += `Vous récuperez ${manquant} points d'endurance. `;
|
||||
@ -550,15 +549,15 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $recupererFatigue(message) {
|
||||
async recupererFatigue(message) {
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
let fatigue = this.system.sante.fatigue.value
|
||||
const fatigueMin = this.getFatigueMin()
|
||||
let fatigue = this.system.sante.fatigue.value;
|
||||
const fatigueMin = this.getFatigueMin();
|
||||
if (fatigue <= fatigueMin) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue))
|
||||
await this.update({ 'system.sante.fatigue.value': fatigue });
|
||||
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue));
|
||||
await this.update({ "system.sante.fatigue.value": fatigue });
|
||||
if (fatigue == 0) {
|
||||
message.content += "Vous êtes complêtement reposé. ";
|
||||
}
|
||||
@ -1048,10 +1047,20 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async deleteRencontreTMRAtPosition() {
|
||||
const rencontreIds = this.itemTypes[ITEM_TYPES.rencontre].filter(this.filterRencontreTMRDemiReve()).map(it => it.id)
|
||||
if (rencontreIds.length > 0) {
|
||||
await this.deleteEmbeddedDocuments('Item', rencontreIds)
|
||||
}
|
||||
}
|
||||
|
||||
getRencontreTMREnAttente() {
|
||||
return this.itemTypes[ITEM_TYPES.rencontre].find(this.filterRencontreTMRDemiReve())
|
||||
}
|
||||
|
||||
filterRencontreTMRDemiReve() {
|
||||
const position = this.getDemiReve()
|
||||
return this.itemTypes[ITEM_TYPES.rencontre].find(it => it.system.coord == position)
|
||||
return it => it.system.coord == position
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1791,10 +1800,8 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
};
|
||||
RollDataAjustements.calcul(rollData, this);
|
||||
await RdDResolutionTable.rollData(rollData);
|
||||
await RdDRollResult.displayRollData(rollData, this)
|
||||
|
||||
this.gererExperience(rollData);
|
||||
|
||||
await RdDRollResult.displayRollData(rollData, this)
|
||||
return rollData.rolled;
|
||||
}
|
||||
|
||||
@ -2109,6 +2116,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
label: "Jet de méditation",
|
||||
callbacks: [
|
||||
this.createCallbackExperience(),
|
||||
{ condition: r => r.rolled.isEPart, action: r => this._meditationEPart(r) },
|
||||
{ action: r => this._meditationResult(r) }
|
||||
]
|
||||
});
|
||||
@ -2117,16 +2125,21 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _meditationResult(meditationRoll) {
|
||||
this.santeIncDec("fatigue", 2);
|
||||
|
||||
if (meditationRoll.rolled.isSuccess) {
|
||||
await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]);
|
||||
}
|
||||
if (meditationRoll.rolled.isEPart){
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'system.malus': meditationRoll.meditation.system.malus - 1 }]);
|
||||
}
|
||||
await this.santeIncDec("fatigue", 2);
|
||||
|
||||
await RdDRollResult.displayRollData(meditationRoll, this.name, 'chat-resultat-meditation.hbs');
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_meditationEPart(meditationRoll) {
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'system.malus': meditationRoll.meditation.system.malus - 1 }]);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_getSignesDraconiques(coord) {
|
||||
const type = TMRUtility.getTMRType(coord);
|
||||
@ -2630,13 +2643,12 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async incDecItemUse(itemId, shouldIncrease = true) {
|
||||
if (shouldIncrease) {
|
||||
const currentItemUse = this.getFlag(SYSTEM_RDD, 'itemUse');
|
||||
let itemUse = currentItemUse ? foundry.utils.duplicate(currentItemUse) : {};
|
||||
itemUse[itemId] = (itemUse[itemId] ?? 0) + 1;
|
||||
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
||||
}
|
||||
async incDecItemUse(itemId, inc = 1) {
|
||||
const currentItemUse = this.getFlag(SYSTEM_RDD, 'itemUse');
|
||||
let itemUse = currentItemUse ? foundry.utils.duplicate(currentItemUse) : {};
|
||||
itemUse[itemId] = (itemUse[itemId] ?? 0) + inc;
|
||||
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
||||
console.log("ITEM USE INC", inc, itemUse);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -277,9 +277,14 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
return dialog
|
||||
}
|
||||
|
||||
createCallbackExperience() { return { action: r => { } } }
|
||||
createCallbackAppelAuMoral() { return { action: r => { } } }
|
||||
|
||||
createEmptyCallback() {
|
||||
return {
|
||||
condition: r => false,
|
||||
action: r => { }
|
||||
};
|
||||
}
|
||||
createCallbackExperience() { return this.createEmptyCallback(); }
|
||||
createCallbackAppelAuMoral() { return this.createEmptyCallback(); }
|
||||
async _onCloseRollDialog(html) { }
|
||||
|
||||
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||
|
@ -39,12 +39,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
return 0;
|
||||
}
|
||||
|
||||
isCumulFatigueCauseSommeil(cumulFatigue){
|
||||
return ReglesOptionnelles.isUsing("appliquer-fatigue")
|
||||
? (this.getFatigueRestante() <= cumulFatigue)
|
||||
: (this.getEnduranceActuelle() <= cumulFatigue)
|
||||
}
|
||||
getFatigueRestante() {return this.getFatigueMax() - this.getFatigueActuelle() }
|
||||
getFatigueRestante() { return this.getFatigueMax() - this.getFatigueActuelle() }
|
||||
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
|
||||
|
||||
malusFatigue() {
|
||||
|
@ -747,7 +747,7 @@ export class RdDBaseActor extends Actor {
|
||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||
|
||||
async resetItemUse() { }
|
||||
async incDecItemUse(itemId, shouldIncrease = true) { }
|
||||
async incDecItemUse(itemId, inc = 1) { }
|
||||
getItemUse(itemId) { return 0; }
|
||||
|
||||
async finDeRound(options = { terminer: false }) { }
|
||||
|
4
module/applications/sheets/_module.mjs
Normal file
4
module/applications/sheets/_module.mjs
Normal file
@ -0,0 +1,4 @@
|
||||
export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs"
|
||||
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
|
||||
export { default as RdDMunitionSheet } from "./munition-sheet.mjs"
|
||||
|
111
module/applications/sheets/common-item-sheet.mjs
Normal file
111
module/applications/sheets/common-item-sheet.mjs
Normal file
@ -0,0 +1,111 @@
|
||||
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||
import { SYSTEM_RDD } from "../../constants.js"
|
||||
import { Misc } from "../../misc.js"
|
||||
import { RdDSheetUtility } from "../../rdd-sheet-utility.js";
|
||||
|
||||
|
||||
export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
||||
|
||||
static preloadHandlebars(...templatesList) {
|
||||
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
|
||||
templatesList.forEach(templates =>
|
||||
templates.forEach(t =>
|
||||
t.handlebars().forEach(h => handlebars.push(h))
|
||||
)
|
||||
)
|
||||
loadTemplates(Misc.distinct(handlebars))
|
||||
}
|
||||
|
||||
static register(sheetClass) {
|
||||
const itemType = sheetClass.ITEM_TYPE
|
||||
Items.registerSheet(SYSTEM_RDD, sheetClass, {
|
||||
label: Misc.typeName('Item', itemType),
|
||||
types: [itemType],
|
||||
makeDefault: true
|
||||
})
|
||||
}
|
||||
|
||||
static registerAll(...sheetClasses) {
|
||||
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
|
||||
sheetClasses.forEach(sheetClass => {
|
||||
sheetClass.TEMPLATES.forEach(t =>
|
||||
t.handlebars().forEach(h => handlebars.push(h))
|
||||
)
|
||||
const itemType = sheetClass.ITEM_TYPE
|
||||
Items.registerSheet(SYSTEM_RDD, sheetClass, {
|
||||
label: Misc.typeName('Item', itemType),
|
||||
types: [itemType],
|
||||
makeDefault: true
|
||||
})
|
||||
})
|
||||
loadTemplates(Misc.distinct(handlebars))
|
||||
}
|
||||
|
||||
static get ITEM_TYPE() { return undefined }
|
||||
|
||||
constructor(options = {}) {
|
||||
super(options)
|
||||
}
|
||||
|
||||
static get TEMPLATES() { return [] }
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["fvtt-rdd", "item"],
|
||||
position: {
|
||||
width: 600,
|
||||
height: "auto",
|
||||
},
|
||||
form: {
|
||||
submitOnChange: true,
|
||||
},
|
||||
window: {
|
||||
resizable: true,
|
||||
},
|
||||
actions: {
|
||||
editImage: RdDItemBaseSheet.#onEditImage,
|
||||
}
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
return {
|
||||
item: this.document,
|
||||
options: RdDSheetUtility.getOptions(this.document, this.isEditable),
|
||||
fields: this.document.schema.fields,
|
||||
systemFields: this.document.system.schema.fields,
|
||||
system: this.document.system,
|
||||
source: this.document.toObject(),
|
||||
isEditable: this.isEditable,
|
||||
}
|
||||
}
|
||||
|
||||
// #region Actions
|
||||
|
||||
/**
|
||||
* Handle changing a Document's image.
|
||||
*
|
||||
* @this RdDItemBaseSheet
|
||||
* @param {PointerEvent} event The originating click event
|
||||
* @param {HTMLElement} target The capturing HTML element which defined a [data-action]
|
||||
* @returns {Promise}
|
||||
* @private
|
||||
*/
|
||||
static async #onEditImage(event, target) {
|
||||
const attr = target.dataset.edit
|
||||
const current = foundry.utils.getProperty(this.document, attr)
|
||||
const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {}
|
||||
const fp = new FilePicker({
|
||||
current,
|
||||
type: "image",
|
||||
redirectToRoot: img ? [img] : [],
|
||||
callback: (path) => {
|
||||
this.document.update({ [attr]: path })
|
||||
},
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + 10,
|
||||
})
|
||||
return fp.browse()
|
||||
}
|
||||
// #endregion
|
||||
}
|
35
module/applications/sheets/monnaie-sheet.mjs
Normal file
35
module/applications/sheets/monnaie-sheet.mjs
Normal file
@ -0,0 +1,35 @@
|
||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||
import { ITEM_TYPES } from "../../constants.js";
|
||||
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
||||
|
||||
export default class RdDMonnaieSheet extends RdDItemBaseSheet {
|
||||
|
||||
/** @override */
|
||||
static get ITEM_TYPE() { return ITEM_TYPES.monnaie }
|
||||
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = Object.assign({},
|
||||
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
||||
{
|
||||
classes: ["fvtt-rdd", "item", "monnaie"],
|
||||
position: { width: 400 },
|
||||
window: { contentClasses: ["monnaie-content"] }
|
||||
})
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/monnaie.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
return Object.assign(
|
||||
await super._prepareContext(),
|
||||
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
|
||||
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
|
||||
)
|
||||
}
|
||||
}
|
34
module/applications/sheets/munition-sheet.mjs
Normal file
34
module/applications/sheets/munition-sheet.mjs
Normal file
@ -0,0 +1,34 @@
|
||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||
import { ITEM_TYPES } from "../../constants.js";
|
||||
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
||||
|
||||
export default class RdDMunitionSheet extends RdDItemBaseSheet {
|
||||
/** @override */
|
||||
static get ITEM_TYPE() { return ITEM_TYPES.munition }
|
||||
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = Object.assign({},
|
||||
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
||||
{
|
||||
classes: ["fvtt-rdd", "item", "munition"],
|
||||
position: { width: 400 },
|
||||
window: { contentClasses: ["munition-content"] }
|
||||
})
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/munition.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
return Object.assign(
|
||||
await super._prepareContext(),
|
||||
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
|
||||
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
|
||||
)
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ import { RdDUtility } from "../../rdd-utility.js";
|
||||
import { TextRollManager } from "./text-roll-formatter.js";
|
||||
|
||||
const REGECP_CARAC = "(?<carac>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)"
|
||||
const REGEXP_COMP = "(\\/(?<competence>[A-Za-zÀ-ÖØ-öø-ÿ ]+([1-2]?[A-Za-zÀ-ÖØ-öø-ÿ ]+)?))?"
|
||||
const REGEXP_COMP = "(\\/(?<competence>[A-Za-z0-9À-ÖØ-öø-ÿ -]+))?"
|
||||
const REGEXP_DIFF = "(/(?<diff>[\\+\\-]?\\d+(d\\d+)?))?"
|
||||
const REGEXP_ROLL_CARAC_COMP = REGECP_CARAC + REGEXP_COMP + REGEXP_DIFF
|
||||
const XREGEXP_ROLL_CARAC_COMP = XRegExp("@roll\\[" + REGEXP_ROLL_CARAC_COMP + "\\]", 'giu')
|
||||
|
8
module/common/_module.mjs
Normal file
8
module/common/_module.mjs
Normal file
@ -0,0 +1,8 @@
|
||||
import { CommonDescription } from "./description.mjs";
|
||||
import { CommonInventaire } from "./inventaire.mjs";
|
||||
|
||||
export const TEMPLATE_DESCRIPTION = new CommonDescription()
|
||||
export const TEMPLATE_INVENTAIRE = new CommonInventaire()
|
||||
|
||||
export const ALL_COMMON_TEMPLATES = [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE]
|
||||
|
10
module/common/common-template.mjs
Normal file
10
module/common/common-template.mjs
Normal file
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* class describing common methods implemented by template parts,
|
||||
* used for sheet/models/documents
|
||||
*/
|
||||
export default class CommonTemplate {
|
||||
fields() { }
|
||||
handlebars() { return [] }
|
||||
actions() { return {} }
|
||||
async prepareContext(item) { }
|
||||
}
|
32
module/common/description.mjs
Normal file
32
module/common/description.mjs
Normal file
@ -0,0 +1,32 @@
|
||||
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js"
|
||||
import CommonTemplate from "./common-template.mjs"
|
||||
import { HTMLSTRING } from "./field-types.mjs"
|
||||
|
||||
const fields = foundry.data.fields
|
||||
|
||||
export class CommonDescription extends CommonTemplate {
|
||||
fields() {
|
||||
return {
|
||||
description: new fields.HTMLField({ ...HTMLSTRING }),
|
||||
descriptionmj: new fields.HTMLField({ gmOnly: true, ...HTMLSTRING })
|
||||
}
|
||||
}
|
||||
|
||||
handlebars() {
|
||||
return [
|
||||
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs",
|
||||
]
|
||||
}
|
||||
actions() {
|
||||
return {}
|
||||
}
|
||||
|
||||
async prepareContext(item) {
|
||||
const enriched = {
|
||||
description: await RdDTextEditor.enrichHTML(item.system.description, item),
|
||||
descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item),
|
||||
}
|
||||
return { enriched }
|
||||
}
|
||||
|
||||
}
|
9
module/common/field-types.mjs
Normal file
9
module/common/field-types.mjs
Normal file
@ -0,0 +1,9 @@
|
||||
export const INTEGER = { required: true, nullable: false, min: 0, integer: true }
|
||||
export const DECIMAL = { required: true, nullable: false, min: 0, integer: false } /* TODO: validation de nombre décimales?*/
|
||||
export const INTEGER_SIGNED = { required: true, nullable: false, integer: true }
|
||||
export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false }
|
||||
export const STRING = { required: true, nullable: false, blank: true, trim: true }
|
||||
export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, textSearch: true }
|
||||
|
||||
export const MODEL_ARRAY = { initial: [], required: true, nullable: false }
|
||||
|
36
module/common/inventaire.mjs
Normal file
36
module/common/inventaire.mjs
Normal file
@ -0,0 +1,36 @@
|
||||
import CommonTemplate from "./common-template.mjs"
|
||||
import { RARETES } from "../item/raretes.js"
|
||||
import { DECIMAL, INTEGER, INTEGER_SIGNED, MODEL_ARRAY, STRING } from "./field-types.mjs"
|
||||
|
||||
const fields = foundry.data.fields
|
||||
|
||||
export class CommonInventaire extends CommonTemplate {
|
||||
fields() {
|
||||
return {
|
||||
encombrement: new fields.NumberField({ label: "Encombrement", initial: 0, ...INTEGER }),
|
||||
quantite: new fields.NumberField({ label: "Quantité", initial: 1, ...INTEGER }),
|
||||
qualite: new fields.NumberField({ label: "Qualité", initial: 0, ...INTEGER_SIGNED }),
|
||||
cout: new fields.NumberField({ label: "Coût", initial: 0.0, ...DECIMAL }),
|
||||
environnement: new fields.ArrayField(
|
||||
new fields.SchemaField({
|
||||
milieu: new fields.StringField({ label: "Milieu", initial: "", ...STRING }),
|
||||
rarete: new fields.StringField({
|
||||
label: "Rareté", initial: RARETES[0].code, ...STRING,
|
||||
validate: (value, options) => RARETES.find(it => it.code == value)
|
||||
}),
|
||||
frequence: new fields.NumberField({ label: "Fréquence", initial: RARETES[0].frequence, ...INTEGER }),
|
||||
}),
|
||||
{ label: "Environnement", ...MODEL_ARRAY }),
|
||||
}
|
||||
}
|
||||
|
||||
handlebars() {
|
||||
return [
|
||||
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"
|
||||
]
|
||||
}
|
||||
|
||||
async prepareContext(item) {
|
||||
return {}
|
||||
}
|
||||
}
|
2
module/documents/_module.mjs
Normal file
2
module/documents/_module.mjs
Normal file
@ -0,0 +1,2 @@
|
||||
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
||||
export { default as RdDModelMunition } from "./munition.mjs"
|
7
module/documents/monnaie.mjs
Normal file
7
module/documents/monnaie.mjs
Normal file
@ -0,0 +1,7 @@
|
||||
import { RdDItem } from "../item.js";
|
||||
|
||||
export default class RdDItemMonnaie extends RdDItem {
|
||||
static get defaultIcon() {
|
||||
return 'systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp'
|
||||
}
|
||||
}
|
7
module/documents/munition.mjs
Normal file
7
module/documents/munition.mjs
Normal file
@ -0,0 +1,7 @@
|
||||
import { RdDItem } from "../item.js";
|
||||
|
||||
export default class RdDItemMunition extends RdDItem {
|
||||
static get defaultIcon() {
|
||||
return 'systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp'
|
||||
}
|
||||
}
|
@ -123,10 +123,10 @@ export class RdDItemArme extends Item {
|
||||
if (defCategory == 'bouclier') {
|
||||
return 'norm'
|
||||
}
|
||||
if (armeAttaque?.system?.competence?.toLowerCase().match(/(fléau)/)) {
|
||||
if (armeAttaque.system.competence.toLowerCase().match(/(fléau)/)) {
|
||||
return ''
|
||||
}
|
||||
if (armeParade.system?.tir) {
|
||||
if (armeParade.system.tir) {
|
||||
return ''
|
||||
}
|
||||
const attCategory = RdDItemArme.getCategorieParade(armeAttaque)
|
||||
|
@ -14,12 +14,11 @@ import { RdDItem } from "./item.js";
|
||||
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
||||
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
||||
import { ItemAction } from "./item/item-actions.js";
|
||||
import { RdDItemGemme } from "./item/gemme.js";
|
||||
|
||||
/**
|
||||
* Extend the basic ItemSheet for RdD specific items
|
||||
*/
|
||||
export class RdDItemSheet extends ItemSheet {
|
||||
export class RdDItemSheetV1 extends ItemSheet {
|
||||
|
||||
static get ITEM_TYPE() {
|
||||
return undefined
|
||||
@ -43,7 +42,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: [SYSTEM_RDD, "sheet", "item"],
|
||||
template: RdDItemSheet.defaultTemplate(RdDItemSheet.ITEM_TYPE),
|
||||
template: RdDItemSheetV1.defaultTemplate(RdDItemSheetV1.ITEM_TYPE),
|
||||
width: 550,
|
||||
height: 550
|
||||
}, { inplace: false });
|
||||
@ -51,7 +50,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
get template() {
|
||||
return RdDItemSheet.defaultTemplate(this.item.type);
|
||||
return RdDItemSheetV1.defaultTemplate(this.item.type);
|
||||
}
|
||||
|
||||
get title() {
|
||||
@ -101,7 +100,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item),
|
||||
descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item),
|
||||
isComestible: this.item.getUtilisationCuisine(),
|
||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
||||
options: RdDSheetUtility.mergeDocumentRights({}, this.item, this.isEditable),
|
||||
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
|
||||
categories: RdDItem.getCategories(this.item.type),
|
||||
}
|
||||
@ -264,7 +263,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
_updateObject(event, formData) {
|
||||
switch (this.item.type) {
|
||||
case ITEM_TYPES.sort:
|
||||
formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheet._listCaseTmr(
|
||||
formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheetV1._listCaseTmr(
|
||||
formData.caseTmrCoord,
|
||||
formData.caseTmrBonus,
|
||||
formData.caseTmrAdd
|
||||
@ -314,7 +313,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
async _onDrop(event) {
|
||||
// Try to extract the dragData
|
||||
let dragData = RdDItemSheet.$extractDragData(event);
|
||||
let dragData = RdDItemSheetV1.$extractDragData(event);
|
||||
if (!dragData) return false;
|
||||
const allowed = Hooks.call("dropActorSheetData", this.actor, this, dragData);
|
||||
if (allowed === false) return false;
|
||||
|
@ -56,10 +56,6 @@ export class RdDItemSort extends Item {
|
||||
return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie))
|
||||
}
|
||||
|
||||
static getBestDraconicSort(competencesDraconic, sort) {
|
||||
return RdDItemSort.getDraconicsSort(competencesDraconic, sort).sort(Misc.descending(it => it.system.niveau)).find(it=>true)
|
||||
}
|
||||
|
||||
static getOrdreCode(code) {
|
||||
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
|
||||
}
|
||||
@ -96,7 +92,7 @@ export class RdDItemSort extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isCoutVariable(sort) {
|
||||
return sort && !Number.isInteger(sort.system.ptreve) && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
|
||||
return sort && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { HtmlUtility } from "../html-utility.js";
|
||||
import { RdDItemSheet } from "../item-sheet.js";
|
||||
import { RdDItemSheetV1 } from "../item-sheet.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDRaretes } from "./raretes.js";
|
||||
|
||||
const TYPE_ITEMS_NATURELS = ["faune", "herbe", "plante", "ingredient"];
|
||||
|
||||
export class RdDItemInventaireSheet extends RdDItemSheet {
|
||||
export class RdDItemInventaireSheet extends RdDItemSheetV1 {
|
||||
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(RdDItemSheet.defaultOptions, {
|
||||
return foundry.utils.mergeObject(RdDItemSheetV1.defaultOptions, {
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "informations" }]
|
||||
}, { inplace: false })
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { RdDItemSheet } from "../item-sheet.js";
|
||||
import { RdDItemSheetV1 } from "../item-sheet.js";
|
||||
|
||||
export class RdDBlessureItemSheet extends RdDItemSheet {
|
||||
export class RdDBlessureItemSheet extends RdDItemSheetV1 {
|
||||
|
||||
static get ITEM_TYPE() { return "blessure" };
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { RdDRencontre } from "./rencontre.js";
|
||||
import { RdDItemSheet } from "../item-sheet.js";
|
||||
import { RdDItemSheetV1 } from "../item-sheet.js";
|
||||
|
||||
export class RdDRencontreItemSheet extends RdDItemSheet {
|
||||
export class RdDRencontreItemSheet extends RdDItemSheetV1 {
|
||||
|
||||
static get ITEM_TYPE() { return "rencontre" };
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { RdDItemSheet } from "../item-sheet.js";
|
||||
import { RdDItemSheetV1 } from "../item-sheet.js";
|
||||
|
||||
export class RdDServiceItemSheet extends RdDItemSheet {
|
||||
export class RdDServiceItemSheet extends RdDItemSheetV1 {
|
||||
|
||||
static get ITEM_TYPE() { return "service" };
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { RdDItemSheet } from "../item-sheet.js";
|
||||
import { RdDItemSheetV1 } from "../item-sheet.js";
|
||||
import { RdDItemSigneDraconique } from "./signedraconique.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
|
||||
/**
|
||||
* Item sheet pour signes draconiques
|
||||
* @extends {RdDItemSheet}
|
||||
* @extends {RdDItemSheetV1}
|
||||
*/
|
||||
export class RdDSigneDraconiqueItemSheet extends RdDItemSheet {
|
||||
export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 {
|
||||
|
||||
static get ITEM_TYPE() { return "signedraconique" }
|
||||
|
||||
|
@ -265,7 +265,7 @@ export class Misc {
|
||||
const subset = elements.filter(options.preFilter)
|
||||
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value))
|
||||
.sort(Misc.ascending(it => options.mapper(it)))
|
||||
if (subset.length == 0 && options?.onMessage) {
|
||||
if (subset.length == 0) {
|
||||
options.onMessage(`Pas de ${options.description} correspondant à ${value}`);
|
||||
}
|
||||
return subset;
|
||||
|
2
module/models/_module.mjs
Normal file
2
module/models/_module.mjs
Normal file
@ -0,0 +1,2 @@
|
||||
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
||||
export { default as RdDModelMunition } from "./munition.mjs"
|
10
module/models/monnaie.mjs
Normal file
10
module/models/monnaie.mjs
Normal file
@ -0,0 +1,10 @@
|
||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
|
||||
|
||||
export default class RdDModelMonnaie extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
return Object.assign({},
|
||||
TEMPLATE_DESCRIPTION.fields(),
|
||||
TEMPLATE_INVENTAIRE.fields()
|
||||
)
|
||||
}
|
||||
}
|
10
module/models/munition.mjs
Normal file
10
module/models/munition.mjs
Normal file
@ -0,0 +1,10 @@
|
||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
|
||||
|
||||
export default class RdDModelMunition extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
return Object.assign({},
|
||||
TEMPLATE_DESCRIPTION.fields(),
|
||||
TEMPLATE_INVENTAIRE.fields()
|
||||
)
|
||||
}
|
||||
}
|
@ -743,13 +743,23 @@ export class RdDCombat {
|
||||
this.attacker.createCallbackExperience(),
|
||||
this.attacker.createCallbackAppelAuMoral(),
|
||||
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
||||
{ action: async r => await this.attacker.incDecItemUse(arme._id, arme && !RdDCombat.isParticuliere(r)) },
|
||||
{ action: r => this._onAttaque(r) },
|
||||
{ action: r => this._increaseItemUse(r, arme) },
|
||||
{ action: r => this._onAttaqueNormale(r) },
|
||||
{ action: r => this._onAttaqueParticuliere(r) },
|
||||
{ action: r => this._onAttaqueEchec(r) },
|
||||
{ action: r => this._onAttaqueEchecTotal(r) },
|
||||
]
|
||||
});
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
_increaseItemUse(rollData, arme) {
|
||||
if (!arme || RdDCombat.isParticuliere(rollData)) {
|
||||
return
|
||||
}
|
||||
this.attacker.incDecItemUse(arme._id)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_prepareAttaque(competence, arme) {
|
||||
let rollData = {
|
||||
@ -780,23 +790,11 @@ export class RdDCombat {
|
||||
return rollData;
|
||||
}
|
||||
|
||||
async _onAttaque(attackerRoll) {
|
||||
if (RdDCombat.isParticuliere(attackerRoll)) {
|
||||
return await this._onAttaqueParticuliere(attackerRoll)
|
||||
}
|
||||
if (RdDCombat.isReussite(attackerRoll)) {
|
||||
return await this._onAttaqueNormale(attackerRoll)
|
||||
}
|
||||
// if (RdDCombat.isParticuliere(attackerRoll) && attackerRoll.particuliere == undefined) {
|
||||
// return
|
||||
// }
|
||||
if (RdDCombat.isEchecTotal(attackerRoll)) {
|
||||
return await this._onAttaqueEchecTotal(attackerRoll)
|
||||
}
|
||||
return await this._onAttaqueEchec(attackerRoll)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async _onAttaqueParticuliere(rollData) {
|
||||
if (!RdDCombat.isParticuliere(rollData)) {
|
||||
return
|
||||
}
|
||||
const isMeleeDiffNegative = (rollData.competence.type == 'competencecreature' || rollData.selectedCarac.label == "Mêlée") && rollData.diffLibre < 0;
|
||||
// force toujours, sauf empoignade
|
||||
// finesse seulement en mélée, pour l'empoignade, ou si la difficulté libre est de -1 minimum
|
||||
@ -834,6 +832,12 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onAttaqueNormale(attackerRoll) {
|
||||
if (!RdDCombat.isReussite(attackerRoll)) {
|
||||
return
|
||||
}
|
||||
if (RdDCombat.isParticuliere(attackerRoll) && attackerRoll.particuliere == undefined) {
|
||||
return
|
||||
}
|
||||
console.log("RdDCombat.onAttaqueNormale >>>", attackerRoll);
|
||||
|
||||
attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker, this.defender.isEntite());
|
||||
@ -950,6 +954,9 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onAttaqueEchecTotal(attackerRoll) {
|
||||
if (!RdDCombat.isEchecTotal(attackerRoll)) {
|
||||
return
|
||||
}
|
||||
const choixEchecTotal = await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.attacker),
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-etotal.hbs', {
|
||||
@ -976,16 +983,22 @@ export class RdDCombat {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onAttaqueEchec(attackerRoll) {
|
||||
console.log("RdDCombat.onAttaqueEchec >>>", attackerRoll);
|
||||
await RdDRollResult.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.hbs');
|
||||
async _onAttaqueEchec(rollData) {
|
||||
if (!RdDCombat.isEchec(rollData)) {
|
||||
return
|
||||
}
|
||||
console.log("RdDCombat.onAttaqueEchec >>>", rollData);
|
||||
await RdDRollResult.displayRollData(rollData, this.attacker, 'chat-resultat-attaque.hbs');
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async choixParticuliere(rollData, choix) {
|
||||
console.log("RdDCombat.choixParticuliere >>>", rollData, choix);
|
||||
|
||||
await this.attacker.incDecItemUse(rollData.arme.id, choix != "rapidite")
|
||||
if (choix != "rapidite") {
|
||||
this.attacker.incDecItemUse(rollData.arme.id);
|
||||
}
|
||||
|
||||
this.removeChatMessageActionsPasseArme(rollData.passeArme);
|
||||
rollData.particuliere = choix;
|
||||
@ -1013,8 +1026,10 @@ export class RdDCombat {
|
||||
this.defender.createCallbackExperience(),
|
||||
this.defender.createCallbackAppelAuMoral(),
|
||||
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
||||
{ action: async r => await this.defender.incDecItemUse(armeParadeId, !RdDCombat.isParticuliere(r)) },
|
||||
{ action: r => this._onParade(r) },
|
||||
{ condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(armeParadeId) },
|
||||
{ condition: RdDCombat.isReussite, action: r => this._onParadeNormale(r) },
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onParadeParticuliere(r) },
|
||||
{ condition: RdDCombat.isEchec, action: r => this._onParadeEchec(r) },
|
||||
]
|
||||
});
|
||||
dialog.render(true);
|
||||
@ -1045,19 +1060,8 @@ export class RdDCombat {
|
||||
return defenderRoll;
|
||||
}
|
||||
|
||||
|
||||
async _onParade(defenderRoll) {
|
||||
if (RdDCombat.isParticuliere(defenderRoll)) {
|
||||
return await this._onParadeParticuliere(defenderRoll)
|
||||
}
|
||||
if (RdDCombat.isReussite(defenderRoll)) {
|
||||
return await this._onParadeNormale(defenderRoll)
|
||||
}
|
||||
await this._onParadeEchec(defenderRoll)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onParadeParticuliere(defenderRoll) {
|
||||
_onParadeParticuliere(defenderRoll) {
|
||||
console.log("RdDCombat._onParadeParticuliere >>>", defenderRoll);
|
||||
if (!defenderRoll.attackerRoll.isPart) {
|
||||
// TODO: attaquant doit jouer résistance et peut être désarmé p132
|
||||
@ -1066,6 +1070,7 @@ export class RdDCombat {
|
||||
this.defender)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onParadeNormale(defenderRoll) {
|
||||
console.log("RdDCombat._onParadeNormale >>>", defenderRoll);
|
||||
@ -1104,9 +1109,11 @@ export class RdDCombat {
|
||||
callbacks: [
|
||||
this.defender.createCallbackExperience(),
|
||||
this.defender.createCallbackAppelAuMoral(),
|
||||
{ action: async r => await this.defender.incDecItemUse(esquive._id, !RdDCombat.isParticuliere(r)) },
|
||||
{ condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(esquive._id) },
|
||||
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
||||
{ action: r => this._onEsquive(r) },
|
||||
{ condition: RdDCombat.isReussite, action: r => this._onEsquiveNormale(r) },
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onEsquiveParticuliere(r) },
|
||||
{ condition: RdDCombat.isEchec, action: r => this._onEsquiveEchec(r) },
|
||||
]
|
||||
});
|
||||
dialog.render(true);
|
||||
@ -1134,18 +1141,9 @@ export class RdDCombat {
|
||||
return rollData;
|
||||
}
|
||||
|
||||
async _onEsquive(defenderRoll) {
|
||||
if (RdDCombat.isParticuliere(defenderRoll)) {
|
||||
return await this._onEsquiveParticuliere(defenderRoll)
|
||||
}
|
||||
if (RdDCombat.isReussite(defenderRoll)) {
|
||||
return await this._onEsquiveNormale(defenderRoll)
|
||||
}
|
||||
return await this._onEsquiveEchec(defenderRoll)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async _onEsquiveParticuliere(defenderRoll) {
|
||||
console.log("RdDCombat._onEsquiveParticuliere >>>", defenderRoll);
|
||||
_onEsquiveParticuliere(rollData) {
|
||||
console.log("RdDCombat._onEsquiveParticuliere >>>", rollData);
|
||||
ChatUtility.createChatWithRollMode(
|
||||
{ content: "<strong>Vous pouvez esquiver une deuxième fois!</strong>" },
|
||||
this.defender);
|
||||
|
@ -54,7 +54,7 @@ import { RdDItemSouffle } from "./item/souffle.js"
|
||||
|
||||
import { RdDRencontre } from "./item/rencontre.js"
|
||||
|
||||
import { RdDItemSheet } from "./item-sheet.js"
|
||||
import { RdDItemSheetV1 } from "./item-sheet.js"
|
||||
import { RdDBlessureItemSheet } from "./item/sheet-blessure.js"
|
||||
import { RdDServiceItemSheet } from "./item/sheet-service.js"
|
||||
import { RdDRencontreItemSheet } from "./item/sheet-rencontre.js"
|
||||
@ -80,6 +80,10 @@ import { RdDItemPotion } from "./item/potion.js"
|
||||
import { RdDItemGemme } from "./item/gemme.js"
|
||||
import { RdDGemmeItemSheet } from "./item/sheet-gemme.js"
|
||||
|
||||
import * as models from "./models/_module.mjs"
|
||||
import * as items from "./documents/_module.mjs"
|
||||
import * as sheets from "./applications/sheets/_module.mjs"
|
||||
|
||||
/**
|
||||
* RdD system
|
||||
* Author: LeRatierBretonnien
|
||||
@ -100,6 +104,8 @@ export class SystemReveDeDragon {
|
||||
this.RdDHotbar = RdDHotbar
|
||||
this.RdDStatBlockParser = RdDStatBlockParser
|
||||
this.itemClasses = {
|
||||
monnaie: items.RdDModelMonnaie,
|
||||
munition: items.RdDModelMunition,
|
||||
armure: RdDItemArmure,
|
||||
blessure: RdDItemBlessure,
|
||||
gemme: RdDItemGemme,
|
||||
@ -129,6 +135,9 @@ export class SystemReveDeDragon {
|
||||
/* -------------------------------------------- */
|
||||
onInit() {
|
||||
game.system.rdd = this
|
||||
|
||||
globalThis.RdD = game.system
|
||||
|
||||
this.AppAstrologie = AppAstrologie
|
||||
|
||||
console.log(`Initializing Reve de Dragon System Settings`)
|
||||
@ -175,6 +184,10 @@ export class SystemReveDeDragon {
|
||||
console.log(`Initializing Reve de Dragon Documents`)
|
||||
CONFIG.Actor.documentClass = RdDBaseActor
|
||||
CONFIG.Item.documentClass = RdDItem
|
||||
CONFIG.Item.dataModels = {
|
||||
monnaie: models.RdDModelMonnaie,
|
||||
munition: models.RdDModelMunition,
|
||||
}
|
||||
CONFIG.RDD = {
|
||||
resolutionTable: RdDResolutionTable.resolutionTable,
|
||||
carac_array: RdDUtility.getCaracArray(),
|
||||
@ -195,12 +208,17 @@ export class SystemReveDeDragon {
|
||||
|
||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||
types: [
|
||||
"objet", "arme", "armure", "livre", "munition",
|
||||
"monnaie", "nourritureboisson",
|
||||
"objet", "arme", "armure", "livre", "nourritureboisson",
|
||||
],
|
||||
makeDefault: true
|
||||
})
|
||||
Items.registerSheet(SYSTEM_RDD, RdDItemSheet, {
|
||||
|
||||
sheets.RdDItemBaseSheet.registerAll(
|
||||
sheets.RdDMonnaieSheet,
|
||||
sheets.RdDMunitionSheet
|
||||
)
|
||||
|
||||
Items.registerSheet(SYSTEM_RDD, RdDItemSheetV1, {
|
||||
types: [
|
||||
"competence", "competencecreature",
|
||||
"recettealchimique", "musique", "chant", "danse", "jeu", "race",
|
||||
@ -211,18 +229,18 @@ export class SystemReveDeDragon {
|
||||
],
|
||||
makeDefault: true
|
||||
})
|
||||
|
||||
RdDItemSheet.register(RdDBlessureItemSheet)
|
||||
RdDItemSheet.register(RdDConteneurItemSheet)
|
||||
RdDItemSheet.register(RdDFauneItemSheet)
|
||||
RdDItemSheet.register(RdDGemmeItemSheet)
|
||||
RdDItemSheet.register(RdDHerbeItemSheet)
|
||||
RdDItemSheet.register(RdDIngredientItemSheet)
|
||||
RdDItemSheet.register(RdDPlanteItemSheet)
|
||||
RdDItemSheet.register(RdDPotionItemSheet)
|
||||
RdDItemSheet.register(RdDRencontreItemSheet)
|
||||
RdDItemSheet.register(RdDServiceItemSheet)
|
||||
RdDItemSheet.register(RdDSigneDraconiqueItemSheet)
|
||||
|
||||
RdDItemSheetV1.register(RdDBlessureItemSheet)
|
||||
RdDItemSheetV1.register(RdDConteneurItemSheet)
|
||||
RdDItemSheetV1.register(RdDFauneItemSheet)
|
||||
RdDItemSheetV1.register(RdDGemmeItemSheet)
|
||||
RdDItemSheetV1.register(RdDHerbeItemSheet)
|
||||
RdDItemSheetV1.register(RdDIngredientItemSheet)
|
||||
RdDItemSheetV1.register(RdDPlanteItemSheet)
|
||||
RdDItemSheetV1.register(RdDPotionItemSheet)
|
||||
RdDItemSheetV1.register(RdDRencontreItemSheet)
|
||||
RdDItemSheetV1.register(RdDServiceItemSheet)
|
||||
RdDItemSheetV1.register(RdDSigneDraconiqueItemSheet)
|
||||
RdDJournalSheet.register()
|
||||
|
||||
// préparation des différents modules
|
||||
|
@ -104,8 +104,8 @@ export class RdDPossession {
|
||||
rollData.selectedCarac = carac.reve
|
||||
}
|
||||
else {
|
||||
rollData.selectedCarac = rollingActor.system.carac.reve
|
||||
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: rollingActor.getReveActuel() } }
|
||||
rollData.selectedCarac = rollData.forceCarac['reve-actuel']
|
||||
rollData.competence.system.defaut_carac = 'reve-actuel'
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { ChatUtility } from "./chat-utility.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDDice } from "./rdd-dice.js";
|
||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||
|
@ -279,7 +279,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
async setSelectedSort(sort) {
|
||||
this.rollData.selectedSort = sort; // Update the selectedCarac
|
||||
this.rollData.competence = RdDItemSort.getBestDraconicSort(this.rollData.draconicList, sort)
|
||||
this.rollData.competence = RdDItemCompetence.getVoieDraconic(this.rollData.draconicList, sort.system.draconic);
|
||||
this.rollData.bonus = RdDItemSort.getCaseBonus(sort, this.rollData.tmr.coord);
|
||||
this.rollData.diffLibre = RdDItemSort.getDifficulte(sort, -7);
|
||||
RdDItemSort.setCoutReveReel(sort);
|
||||
|
@ -3,11 +3,11 @@ import { RdDItem } from "./item.js";
|
||||
|
||||
export class RdDSheetUtility {
|
||||
|
||||
static mergeDocumentRights(options, document, editable) {
|
||||
static getOptions(document, editable) {
|
||||
const userRightLevel = game.user.isGM
|
||||
? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
||||
: document.getUserLevel(game.user);
|
||||
let newOptions = {
|
||||
return {
|
||||
isGM: game.user.isGM,
|
||||
isOwned: document.parent ? true : false,
|
||||
editable: editable,
|
||||
@ -16,10 +16,15 @@ export class RdDSheetUtility {
|
||||
isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER,
|
||||
isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
||||
}
|
||||
}
|
||||
|
||||
static mergeDocumentRights(options, document, editable) {
|
||||
const newOptions = RdDSheetUtility.getOptions(document, editable);
|
||||
foundry.utils.mergeObject(options, newOptions);
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
static getItem(event, actor) {
|
||||
return actor.items.get(RdDSheetUtility.getItemId(event))
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||
import { RdDDice } from "./rdd-dice.js";
|
||||
import { STATUSES } from "./settings/status-effects.js";
|
||||
import { RdDRencontre } from "./item/rencontre.js";
|
||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||
import { ITEM_TYPES } from "./constants.js";
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
@ -82,7 +83,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.subdialog = undefined
|
||||
this.displaySize = undefined
|
||||
if (!this.viewOnly && !game.user.isGM) {
|
||||
this.$tellToGM(this.actor.name + " monte dans les terres médianes (" + tmrData.mode + ")");
|
||||
this._tellToGM(this.actor.name + " monte dans les terres médianes (" + tmrData.mode + ")");
|
||||
}
|
||||
this.callbacksOnAnimate = [];
|
||||
const displaySize = TMR_DISPLAY_SIZE.clamp(game.settings.get(SYSTEM_RDD, TMR_DISPLAY_SIZE.code) ?? TMR_DISPLAY_SIZE.def);
|
||||
@ -138,7 +139,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.cumulFatigue += this.fatigueParCase;
|
||||
|
||||
// Le reste...
|
||||
this.$updateValuesDisplay();
|
||||
this.updateValuesDisplay();
|
||||
}
|
||||
|
||||
lancerUnSort() {
|
||||
@ -189,7 +190,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
forceTMRContinueAction() {
|
||||
ui.notifications.warn('Vous devez finir votre action avant de continuer dans les TMR');
|
||||
this.bringSubDialogToTop();
|
||||
return false
|
||||
return;
|
||||
}
|
||||
|
||||
setTMRPendingAction(dialog) {
|
||||
@ -296,7 +297,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
const coordOrig = this._getCoordActor();
|
||||
const coordTarget = TMRUtility.deplacement(coordOrig, move);
|
||||
await this._deplacerDemiReve(coordTarget, 'normal');
|
||||
await this.$checkQuitterTMR();
|
||||
this.checkQuitterTMR();
|
||||
}
|
||||
|
||||
calculCoutMonteeTMR() {
|
||||
@ -304,7 +305,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $updateValuesDisplay() {
|
||||
async updateValuesDisplay() {
|
||||
if (this.viewOnly || !this.rendered) {
|
||||
return;
|
||||
}
|
||||
@ -335,30 +336,22 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async close() {
|
||||
await this.$forceClose(this.actor.name + " a quitté les terres médianes")
|
||||
}
|
||||
|
||||
async $forceClose(message) {
|
||||
if (this.subdialog) {
|
||||
this.forceTMRContinueAction()
|
||||
return false
|
||||
return this.forceTMRContinueAction()
|
||||
}
|
||||
this.descenteTMR = true;
|
||||
if (this.actor.tmrApp) {
|
||||
this.actor.tmrApp = undefined; // Cleanup reference
|
||||
if (!this.viewOnly) {
|
||||
await this.actor.setEffect(STATUSES.StatusDemiReve, false);
|
||||
this.$tellToUserAndGM(message)
|
||||
await this.actor.setEffect(STATUSES.StatusDemiReve, false)
|
||||
this._tellToGM(this.actor.name + " a quitté les terres médianes");
|
||||
}
|
||||
const appliquerFatigue = ReglesOptionnelles.isUsing("appliquer-fatigue");
|
||||
await this.actor.santeIncDec(
|
||||
appliquerFatigue ? "fatigue" : "endurance",
|
||||
(appliquerFatigue ? 1 : -1) * this.cumulFatigue);
|
||||
await this.actor.santeIncDec((ReglesOptionnelles.isUsing("appliquer-fatigue") ? "fatigue" : "endurance"),
|
||||
this.cumulFatigue)
|
||||
}
|
||||
this.pixiTMR.close();
|
||||
this.pixiTMR = undefined
|
||||
await super.close();
|
||||
return true
|
||||
this.pixiTMR.close()
|
||||
this.pixiTMR = undefined
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -370,53 +363,48 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
switch (action) {
|
||||
case 'derober':
|
||||
await this.$derober()
|
||||
this.restoreTMRAfterAction()
|
||||
return
|
||||
await this.derober();
|
||||
this.restoreTMRAfterAction();
|
||||
return;
|
||||
case 'refouler':
|
||||
await this.$refouler()
|
||||
break
|
||||
await this.refouler();
|
||||
break;
|
||||
case 'maitriser':
|
||||
await this.$maitriserRencontre()
|
||||
break
|
||||
await this.maitriserRencontre();
|
||||
break;
|
||||
case 'ignorer':
|
||||
await this.$ignorerRencontre()
|
||||
break
|
||||
await this.ignorerRencontre();
|
||||
break;
|
||||
}
|
||||
await this.postRencontre(tmr);
|
||||
this.restoreTMRAfterAction();
|
||||
}
|
||||
|
||||
async $derober() {
|
||||
if (this.currentRencontre) {
|
||||
console.log("-> derober", this.currentRencontre);
|
||||
await this.actor.addTMRRencontre(this.currentRencontre);
|
||||
this.$forceClose(`${this.actor.name} s'est dérobé face à la rencontre ${this.currentRencontre.name}, et quitte les TMR.`)
|
||||
}
|
||||
async derober() {
|
||||
console.log("-> derober", this.currentRencontre);
|
||||
await this.actor.addTMRRencontre(this.currentRencontre);
|
||||
this._tellToGM(this.actor.name + " s'est dérobé et quitte les TMR.");
|
||||
this.close();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $refouler() {
|
||||
if (this.currentRencontre) {
|
||||
console.log("-> refouler", this.currentRencontre);
|
||||
await this.actor.ajouterRefoulement(this.currentRencontre.system.refoulement, `${this.currentRencontre.system.genre == 'f' ? 'une' : 'un'} ${this.currentRencontre.name}`);
|
||||
await this.$deleteRencontreTMRAtPosition()
|
||||
this.updateTokens();
|
||||
this.$updateValuesDisplay();
|
||||
this.$nettoyerRencontre();
|
||||
}
|
||||
async refouler() {
|
||||
console.log("-> refouler", this.currentRencontre);
|
||||
await this.actor.ajouterRefoulement(this.currentRencontre.system.refoulement, `${this.currentRencontre.system.genre == 'f' ? 'une' : 'un'} ${this.currentRencontre.name}`);
|
||||
await this.actor.deleteRencontreTMRAtPosition()
|
||||
this.updateTokens();
|
||||
this.updateValuesDisplay();
|
||||
this.nettoyerRencontre();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $ignorerRencontre() {
|
||||
if (this.currentRencontre) {
|
||||
console.log("-> ignorer", this.currentRencontre);
|
||||
this.$tellToGM(this.actor.name + " a ignoré: " + this.currentRencontre.name);
|
||||
await this.$deleteRencontreTMRAtPosition()
|
||||
this.updateTokens();
|
||||
this.$updateValuesDisplay();
|
||||
this.$nettoyerRencontre();
|
||||
}
|
||||
async ignorerRencontre() {
|
||||
console.log("-> ignorer", this.currentRencontre);
|
||||
this._tellToGM(this.actor.name + " a ignoré: " + this.currentRencontre.name);
|
||||
await this.actor.deleteRencontreTMRAtPosition()
|
||||
this.updateTokens();
|
||||
this.updateValuesDisplay();
|
||||
this.nettoyerRencontre();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -433,29 +421,41 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $checkQuitterTMR() {
|
||||
const reason = this.actor.isDead()
|
||||
? "est mort"
|
||||
: this.actor.isCumulFatigueCauseSommeil(this.cumulFatigue)
|
||||
? "s'écroule de fatigue"
|
||||
: (this.actor.getReveActuel() == 0)
|
||||
? "tombe à 0 Points de Rêve"
|
||||
: undefined
|
||||
if (reason) {
|
||||
if (!this.actor.isDead()) {
|
||||
await this.$refouler()
|
||||
}
|
||||
this.$forceClose(`${this.actor.name} ${reason} et quitte les Terres médianes !`)
|
||||
return true
|
||||
checkQuitterTMR() {
|
||||
if (this.actor.isDead()) {
|
||||
this._tellToGM("Vous êtes mort : vous quittez les Terres médianes !");
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
return false
|
||||
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")
|
||||
? (this.actor.getFatigueRestante() <= this.cumulFatigue)
|
||||
: (this.actor.getEnduranceActuelle() <= this.cumulFatigue)
|
||||
) {
|
||||
this._tellToGM("Vous vous écroulez de fatigue : vous quittez les Terres médianes !");
|
||||
this.quitterLesTMRInconscient();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.actor.getReveActuel() == 0) {
|
||||
this._tellToGM("Vos Points de Rêve sont à 0 : vous quittez les Terres médianes !");
|
||||
this.quitterLesTMRInconscient();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $maitriserRencontre() {
|
||||
async quitterLesTMRInconscient() {
|
||||
await this.refouler();
|
||||
this.close();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async maitriserRencontre() {
|
||||
console.log("-> maitriser", this.currentRencontre);
|
||||
|
||||
await this.$deleteRencontreTMRAtPosition();
|
||||
await this.actor.deleteRencontreTMRAtPosition()
|
||||
this.updateTokens();
|
||||
|
||||
let rencontreData = {
|
||||
@ -470,21 +470,11 @@ export class RdDTMRDialog extends Dialog {
|
||||
tmr: TMRUtility.getTMR(this._getCoordActor())
|
||||
}
|
||||
|
||||
await this.$tentativeMaitrise(rencontreData);
|
||||
}
|
||||
|
||||
async $deleteRencontreTMRAtPosition() {
|
||||
const position = this.actor.getDemiReve()
|
||||
const rencontreIds = this.actor.itemTypes[ITEM_TYPES.rencontre]
|
||||
.filter(it => it.system.coord == position)
|
||||
.map(it => it.id)
|
||||
if (rencontreIds.length > 0) {
|
||||
await this.actor.deleteEmbeddedDocuments('Item', rencontreIds)
|
||||
}
|
||||
await this._tentativeMaitrise(rencontreData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $tentativeMaitrise(rencData) {
|
||||
async _tentativeMaitrise(rencData) {
|
||||
this.rencontreState = 'normal';
|
||||
|
||||
rencData.reve = this.actor.getReveActuel();
|
||||
@ -493,7 +483,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
RollDataAjustements.calcul(rencData, this.actor);
|
||||
|
||||
rencData.rolled = rencData.presentCite
|
||||
? this.$rollPresentCite(rencData)
|
||||
? this._rollPresentCite(rencData)
|
||||
: await RdDResolutionTable.roll(rencData.reve, RollDataAjustements.sum(rencData.ajustements));
|
||||
|
||||
const result = rencData.rolled.isSuccess
|
||||
@ -503,41 +493,38 @@ export class RdDTMRDialog extends Dialog {
|
||||
await RdDRencontre.appliquer(result.effets, this, rencData);
|
||||
|
||||
rencData.poesie = { extrait: result.poesie, reference: result.reference };
|
||||
rencData.message = this.$formatMessageRencontre(rencData, result.message);
|
||||
rencData.message = this.formatMessageRencontre(rencData, result.message);
|
||||
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.hbs`, rencData)
|
||||
});
|
||||
|
||||
this.$updateValuesDisplay();
|
||||
if (await this.$checkQuitterTMR()) {
|
||||
this.updateValuesDisplay();
|
||||
if (this.checkQuitterTMR()) {
|
||||
return;
|
||||
}
|
||||
if (this.rencontreState == 'persistant') {
|
||||
this.$nouvelleTentativeMaitrise(rencData);
|
||||
this._nouvelleTentativeMaitrise(rencData);
|
||||
}
|
||||
else if (!this.isRencontreDeplacement()) {
|
||||
this.$nettoyerRencontre();
|
||||
this.nettoyerRencontre();
|
||||
}
|
||||
}
|
||||
|
||||
$nouvelleTentativeMaitrise(rencData) {
|
||||
_nouvelleTentativeMaitrise(rencData) {
|
||||
setTimeout(() => {
|
||||
/**
|
||||
* TODO: remplacer par une boucle while(this.currentRencontre) ?
|
||||
* ajouter un moyen d'attendre la saisie de l'utilisateur (jet obligatoire)?
|
||||
*/
|
||||
// TODO: remplacer par une boucle while(this.currentRencontre) ?
|
||||
rencData.nbRounds++;
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
this.cumulFatigue += this.fatigueParCase;
|
||||
}
|
||||
this.$tentativeMaitrise(rencData);
|
||||
this.$deleteTmrMessages(rencData.actor, rencData.nbRounds);
|
||||
this._tentativeMaitrise(rencData);
|
||||
this._deleteTmrMessages(rencData.actor, rencData.nbRounds);
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
$formatMessageRencontre(rencData, template) {
|
||||
formatMessageRencontre(rencData, template) {
|
||||
let messageDuree = ''
|
||||
if (rencData.nbRounds > 1) {
|
||||
if (rencData.rolled.isSuccess) {
|
||||
@ -556,7 +543,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
$rollPresentCite(rencData) {
|
||||
_rollPresentCite(rencData) {
|
||||
let rolled = RdDResolutionTable.computeChances(rencData.reve, 0);
|
||||
foundry.utils.mergeObject(rolled, { caracValue: rencData.reve, finalLevel: 0, roll: rolled.score });
|
||||
RdDResolutionTable.succesRequis(rolled);
|
||||
@ -564,7 +551,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
$deleteTmrMessages(actor, nbRounds = -1) {
|
||||
_deleteTmrMessages(actor, nbRounds = -1) {
|
||||
setTimeout(() => {
|
||||
if (nbRounds < 0) {
|
||||
ChatUtility.removeChatMessageContaining(`<h4 data-categorie="tmr" data-actor-id="${actor._id}"`);
|
||||
@ -583,7 +570,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
$tellToGM(message) {
|
||||
_tellToGM(message) {
|
||||
ChatMessage.create({
|
||||
user: game.user.id,
|
||||
content: message,
|
||||
@ -592,7 +579,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
$tellToUserAndGM(message) {
|
||||
_tellToUserAndGM(message) {
|
||||
ChatMessage.create({
|
||||
user: game.user.id,
|
||||
content: message,
|
||||
@ -614,7 +601,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
if (this.currentRencontre) {
|
||||
if (this.rencontresExistantes.find(it => it.id == this.currentRencontre.id)) {
|
||||
// rencontre en attente suite à dérobade
|
||||
await this.$maitriserRencontre();
|
||||
await this.maitriserRencontre();
|
||||
}
|
||||
else {
|
||||
const dialog = new RdDTMRRencontreDialog(this.actor, this.currentRencontre, tmr);
|
||||
@ -661,7 +648,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
tmr: tmr,
|
||||
presentCite: presentCite
|
||||
};
|
||||
await this.$tentativeMaitrise(rencontreData);
|
||||
await this._tentativeMaitrise(rencontreData);
|
||||
this.postRencontre(tmr);
|
||||
}
|
||||
|
||||
@ -740,7 +727,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData)
|
||||
});
|
||||
if (rollData.rolled.isEchec) {
|
||||
await this.$forceClose(`n'a pas maîtrisé la case ${rollData.tmr.label} et quitte les terres médianes`)
|
||||
await this.close();
|
||||
}
|
||||
await this.souffleSiEchecTotal(rollData);
|
||||
}
|
||||
@ -795,7 +782,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
||||
onConqueteEchec: r => {
|
||||
this.souffleSiEchecTotal(rollData);
|
||||
this.$forceClose(`${this.actor.name} n'a pas maîtrisé la ${tmr.label}, et quitte les TMR.`)
|
||||
this.close()
|
||||
},
|
||||
canClose: false
|
||||
});
|
||||
@ -810,7 +797,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
onConqueteReussie: r => EffetsDraconiques.periple.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
||||
onConqueteEchec: r => {
|
||||
this.souffleSiEchecTotal(rollData);
|
||||
this.$forceClose(`${this.actor.name} n'a pas purifié la ${tmr.label}, et quitte les TMR.`)
|
||||
this.close()
|
||||
},
|
||||
canClose: false
|
||||
});
|
||||
@ -824,7 +811,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
difficulte: -7,
|
||||
action: 'Conquérir',
|
||||
onConqueteReussie: r => EffetsDraconiques.conquete.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
||||
onConqueteEchec: r => this.$forceClose(`${this.actor.name} n'a pas conquis la case ${tmr.label}, et quitte les TMR.`),
|
||||
onConqueteEchec: r => this.close(),
|
||||
canClose: false
|
||||
});
|
||||
}
|
||||
@ -935,15 +922,19 @@ export class RdDTMRDialog extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
async processSortReserve(sortReserve) {
|
||||
await this.actor.deleteEmbeddedDocuments('Item', [sortReserve.id]);
|
||||
console.log("declencheSortEnReserve", sortReserve)
|
||||
const sort = sortReserve.system.sortid ? this.actor.items.get(sortReserve.system.sortid) : undefined
|
||||
const message = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-lancement-sortreserve.hbs`,
|
||||
{ sortReserve, sort })
|
||||
await this.$forceClose(message)
|
||||
console.log("declencheSortEnReserve", sortReserve);
|
||||
const heureCible = RdDTimestamp.definition(sortReserve.system.heurecible).label;
|
||||
this._tellToUserAndGM(`Vous avez déclenché
|
||||
${sortReserve.system.echectotal ? "<strong>l'échec total!</strong>" : "le sort"}
|
||||
en réserve <strong>${sortReserve.name}</strong>
|
||||
avec ${sortReserve.system.ptreve} points de Rêve
|
||||
en ${sortReserve.system.coord} (${TMRUtility.getTMRLabel(sortReserve.system.coord)}).
|
||||
L'heure ciblée est ${heureCible}`);
|
||||
this.close();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
$nettoyerRencontre() {
|
||||
nettoyerRencontre() {
|
||||
// Suppression des dessins des zones possibles
|
||||
this.currentRencontre?.graphics?.forEach(graphic => this.pixiTMR.removeGraphic(graphic))
|
||||
// Nettoyage de la structureet de l'état
|
||||
@ -1030,7 +1021,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
console.log("STATUS :", this.rencontreState, this.currentRencontre);
|
||||
}
|
||||
|
||||
await this.$checkQuitterTMR();
|
||||
this.checkQuitterTMR();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1063,13 +1054,13 @@ export class RdDTMRDialog extends Dialog {
|
||||
*/
|
||||
this.notifierResonanceSigneDraconique(targetCoord);
|
||||
await this.actor.rollUnSort(targetCoord);
|
||||
this.$nettoyerRencontre();
|
||||
this.nettoyerRencontre();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
externalRefresh() {
|
||||
this.createPixiSprites();
|
||||
this.$updateValuesDisplay();
|
||||
this.updateValuesDisplay();
|
||||
this.updateTokens();
|
||||
console.log("TMR REFRESHED !!!");
|
||||
}
|
||||
@ -1080,7 +1071,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
return this.forceTMRContinueAction()
|
||||
}
|
||||
if (this.currentRencontre != 'normal') {
|
||||
this.$nettoyerRencontre();
|
||||
this.nettoyerRencontre();
|
||||
}
|
||||
let tmr = TMRUtility.getTMR(targetCoord);
|
||||
// Gestion cases spéciales type Trou noir, etc
|
||||
@ -1092,7 +1083,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
this.cumulFatigue += this.fatigueParCase;
|
||||
}
|
||||
this.$updateValuesDisplay();
|
||||
this.updateValuesDisplay();
|
||||
this.actor.notifyRefreshTMR();
|
||||
|
||||
if (deplacementType == 'normal') { // Pas de rencontres après un saut de type passeur/changeur/...
|
||||
|
@ -318,7 +318,6 @@ export class RdDUtility {
|
||||
// gestion des dates et heures
|
||||
Handlebars.registerHelper('timestamp-imgSigneHeure', (heure) => { return new Handlebars.SafeString(RdDTimestamp.imgSigneHeure(heure)) });
|
||||
Handlebars.registerHelper('timestamp-imgSigne', (heure) => { return new Handlebars.SafeString(RdDTimestamp.imgSigne(heure)) });
|
||||
Handlebars.registerHelper('timestamp-definition', (heure) => RdDTimestamp.definition(heure))
|
||||
Handlebars.registerHelper('timestamp-extract', timestamp => new RdDTimestamp(timestamp).toCalendrier());
|
||||
Handlebars.registerHelper('timestamp-formulesDuree', () => RdDTimestamp.formulesDuree());
|
||||
Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode());
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"scripts": {
|
||||
"build": "npx vite build",
|
||||
"run": "npx vite serve",
|
||||
"packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs",
|
||||
"packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs",
|
||||
"unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs"
|
||||
|
@ -28,6 +28,9 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
body {
|
||||
--input-height: 1.4rem;
|
||||
}
|
||||
:root {
|
||||
/* =================== 1. ACTOR SHEET FONT STYLES =========== */
|
||||
--window-header-title-font-family: CaslonAntique;
|
||||
@ -731,10 +734,36 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
||||
.flex-grow-3 {
|
||||
flex-grow: 3;
|
||||
}
|
||||
|
||||
.editor.prosemirror {
|
||||
fieldset {
|
||||
border-style: groove;
|
||||
border-width: 0.1rem;
|
||||
padding-inline: 0.2rem;
|
||||
padding-block: 0.1rem;
|
||||
margin-inline: 0.1rem;
|
||||
margin-block: 0.1rem;
|
||||
}
|
||||
form.application.sheet.fvtt-rdd fieldset :is(label, input) {
|
||||
font-family: CaslonAntique;
|
||||
text-align: justify;
|
||||
font-size: 1rem;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
form.application.sheet.fvtt-rdd div.form-group {
|
||||
clear: both;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
margin: 0.1rem 0;
|
||||
align-items: center;
|
||||
}
|
||||
form.application.sheet.fvtt-rdd .editor.prosemirror {
|
||||
height: fit-content;
|
||||
min-height: 20rem;
|
||||
min-height: 5rem;
|
||||
}
|
||||
form.application.sheet.fvtt-rdd prose-mirror.prosemirror .editor-container {
|
||||
min-height: 5rem;
|
||||
height: fit-content;
|
||||
margin: 0;
|
||||
}
|
||||
.large-editor {
|
||||
border: 2;
|
||||
@ -742,6 +771,7 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
||||
min-height: 12rem;
|
||||
padding: 0 3px;
|
||||
}
|
||||
|
||||
.editor {
|
||||
border: 2;
|
||||
height: fit-content;
|
||||
@ -765,6 +795,7 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
||||
.foundryvtt-reve-de-dragon.sheet :is(.large-editor,.editor,.medium-editor,.small-editor){
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.foundryvtt-reve-de-dragon.sheet :is(.large-editor,.editor,.medium-editor,.small-editor) .editor.prosemirror{
|
||||
align-items: normal;
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "12.0.44",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.44/rddsystem.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.44/system.json",
|
||||
"version": "12.0.38",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.38/rddsystem.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.38/system.json",
|
||||
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
||||
"compatibility": {
|
||||
"minimum": "11",
|
||||
|
@ -742,9 +742,6 @@
|
||||
"objet": {
|
||||
"templates": ["description", "equipement", "inventaire"]
|
||||
},
|
||||
"monnaie": {
|
||||
"templates": ["description", "inventaire"]
|
||||
},
|
||||
"gemme": {
|
||||
"templates": ["description", "enchantable", "inventaire", "temporel"],
|
||||
"type": "",
|
||||
@ -753,9 +750,6 @@
|
||||
"inertie": 0,
|
||||
"enchantabilite": 0
|
||||
},
|
||||
"munition": {
|
||||
"templates": ["description", "inventaire"]
|
||||
},
|
||||
"nourritureboisson": {
|
||||
"templates": ["description", "inventaire", "comestible"],
|
||||
"cuisinier": "",
|
||||
|
@ -4,7 +4,8 @@
|
||||
<a class="chat-card-button forcer-tmr-aleatoire" data-tooltip="Ré-insérer aléatoirement le demi-rêve, et masquer la position au joueur">Ré-insertion aléatoire</a>
|
||||
</span>
|
||||
<span>
|
||||
<a class="chat-card-button afficher-tmr" data-tooltip="{{#if hautreve.cacheTMR}}Révéler la position du demi-rêve au joueur{{else}}Cacher la position du demi-rêve au joueur{{/if}}">{{#if hautreve.cacheTMR}}Révéler le demi-rêve{{else}}Cacher le demi-rêve{{/if}}</a>
|
||||
<a class="chat-card-button afficher-tmr"
|
||||
data-tooltip="{{#if hautreve.cacheTMR}}Montrer la position du demi-rêve au joueur{{else}}Cacher la position du demi-rêve au joueur{{/if}}">{{#if hautreve.cacheTMR}}Montrer les TMR{{else}}Cacher les TMR{{/if}}</a>
|
||||
</span>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -1,15 +0,0 @@
|
||||
<img class="chat-icon" src="{{sortReserve.img}}" data-tooltip="{{sortReserve.name}}"/>
|
||||
<p> Vous avez déclenché
|
||||
{{#if sortReserve.system.echectotal}}<strong>l'échec total</strong>{{else}}le sort{{/if}}
|
||||
en réserve
|
||||
<strong>{{sortReserve.name}}</strong>
|
||||
avec {{sortReserve.system.ptreve}} points de Rêve
|
||||
en {{sortReserve.system.coord}} ({{caseTmr-label sortReserve.system.coord}}).
|
||||
L'heure ciblée est {{sortReserve.system.heurecible}}
|
||||
{{timestamp-imgSigneHeure sortReserve.system.heurecible}}
|
||||
</p>
|
||||
{{#if sort}}
|
||||
<div class="poesie-extrait poesie-overflow">
|
||||
{{{sort.system.description}}}
|
||||
</div>
|
||||
{{/if}}
|
14
templates/item/munition.hbs
Normal file
14
templates/item/munition.hbs
Normal file
@ -0,0 +1,14 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.hbs"}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="informations">Informations</a>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.hbs"}}
|
||||
</nav>
|
||||
<section class="sheet-body">
|
||||
<div class="tab items flexcol" data-group="primary" data-tab="informations">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.hbs"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.hbs"}}
|
||||
</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.hbs"}}
|
||||
</section>
|
||||
</form>
|
6
templates/sheets/item/common/header.hbs
Normal file
6
templates/sheets/item/common/header.hbs
Normal file
@ -0,0 +1,6 @@
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" data-tooltip="{{item.name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
</div>
|
||||
</header>
|
21
templates/sheets/item/common/template-description.hbs
Normal file
21
templates/sheets/item/common/template-description.hbs
Normal file
@ -0,0 +1,21 @@
|
||||
<fieldset>
|
||||
<div>
|
||||
<label>Description :</label>
|
||||
{{formInput
|
||||
systemFields.description
|
||||
enriched=enriched.description
|
||||
value=system.description
|
||||
name="system.description"
|
||||
toggled=true}}
|
||||
</div>
|
||||
{{#if options.isGM}}
|
||||
<div>
|
||||
<label>Description (MJ seulement):</label>
|
||||
{{formInput
|
||||
systemFields.descriptionmj
|
||||
enriched=enriched.descriptionmj
|
||||
value=system.descriptionmj
|
||||
name="system.descriptionmj" toggled=true}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</fieldset>
|
17
templates/sheets/item/common/template-inventaire.hbs
Normal file
17
templates/sheets/item/common/template-inventaire.hbs
Normal file
@ -0,0 +1,17 @@
|
||||
<fieldset>
|
||||
{{formField systemFields.qualite value=system.qualite}}
|
||||
{{formField systemFields.encombrement value=system.encombrement}}
|
||||
{{formField systemFields.quantite value=system.quantite}}
|
||||
|
||||
<div class="form-group item-cout">
|
||||
<label>Prix (sols)</label>
|
||||
<div class="form-fields">
|
||||
<input class="attribute-value number-x3 {{#if (and (eq item.type 'monnaie') (eq system.cout 0))}} field-error{{/if}}"
|
||||
type="number" data-dtype="Number"
|
||||
name="system.cout"
|
||||
value="{{numberFormat system.cout decimals=2 sign=false}}"
|
||||
{{#unless (isFieldInventaireModifiable type 'cout')}}disabled{{/unless}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
5
templates/sheets/item/monnaie.hbs
Normal file
5
templates/sheets/item/monnaie.hbs
Normal file
@ -0,0 +1,5 @@
|
||||
<section>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs"}}
|
||||
</section>
|
5
templates/sheets/item/munition.hbs
Normal file
5
templates/sheets/item/munition.hbs
Normal file
@ -0,0 +1,5 @@
|
||||
<section>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs"}}
|
||||
</section>
|
Reference in New Issue
Block a user