Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
6661805f6f | |||
29931fdcb5 | |||
ec24e4a7e7 | |||
d1adf3f6c4 | |||
8eb1387be4 | |||
85378d74e3 | |||
9471420d38 | |||
6e456ca92c | |||
482256c218 | |||
fa1c4ff221 | |||
b777271657 | |||
d06a55b615 | |||
adfbc11eb8 | |||
9dd905134b | |||
f32b6af7b6 | |||
9b8a600e22 | |||
25db7e0712 | |||
776d4ce9ec | |||
1de0806e37 | |||
03366fdf26 | |||
14f324360d | |||
d60c9f1b28 | |||
cf514470fd | |||
b09b095897 | |||
d81965155c | |||
9fa8a2e6f3 | |||
da7f87fd45 | |||
6aba92900c | |||
4939e5564e | |||
40be65a94e | |||
633638a9ab | |||
88a3464eed | |||
921e470498 | |||
0009876a6d | |||
54785f0c3a | |||
df76c4bd78 | |||
5f3c678195 | |||
89bbe63340 | |||
149990e352 | |||
3e355784c7 | |||
b92055d5dd | |||
220f8142f5 | |||
a8bb00ad0b | |||
78e30b5503 | |||
069fef4720 | |||
e32a7d7540 | |||
0773493851 | |||
da982678b7 | |||
c1066d70f6 | |||
5085ba5b54 | |||
f37483a61d | |||
5357e53a5f | |||
764dde6296 | |||
681fbc3177 | |||
70e3e63001 | |||
7ed9a4a12b | |||
acfab362a0 | |||
3d49a3de11 | |||
24518642a7 | |||
d917f80e88 | |||
b29027c61a | |||
6083dd41fa |
88
changelog.md
88
changelog.md
@ -1,5 +1,86 @@
|
|||||||
# 12.0
|
# 12.0
|
||||||
|
## 12.0.50 - Le sommeil d'Astrobazzarh
|
||||||
|
- Le don de double rêve n'interrompt plus le sommeil toutes les heures
|
||||||
|
- la perte de fatigue à la descente des TMR est visible immédiatement
|
||||||
|
|
||||||
|
## 12.0.49 - La deuxième lame d'Astrobazzarh
|
||||||
|
- Corrections
|
||||||
|
- les défenses particulières sont correctement affichées
|
||||||
|
- les vieux boucliers (sans catégorie de parade car créés il y a longtemps) peuvent parer...
|
||||||
|
- Les attaques à distance n'ont pas de difficulté libre
|
||||||
|
|
||||||
|
## 12.0.48 - La chèvre d'Astrobazzarh
|
||||||
|
- le Bandersnatch a une protection de 10
|
||||||
|
- la consistance chèvre est maintenant possible dans les recettes
|
||||||
|
alchimiques (et toutes les consistances avec accents)
|
||||||
|
- un échec au lancement d'un sort pour le mettre en réserve brise
|
||||||
|
la concentration du haut-rêvant
|
||||||
|
- Correction: les réussites particulières fonctionnent avec les caractéristiques dérivées
|
||||||
|
|
||||||
|
## 12.0.47
|
||||||
|
- Correction sur les mise à jour en cascade -
|
||||||
|
- Correction sur le force rendering après un changement de competence
|
||||||
|
|
||||||
|
## 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
|
||||||
|
- Correction des jets de compétences de créatures
|
||||||
|
- Premières préparations techniques pour le passage à Founry v13
|
||||||
|
- liste des impacts d'un jet de dés (expérience, points de tâche, ...)
|
||||||
|
- 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
|
## 12.0.36 - L'alchimie d'Astrobazzarh
|
||||||
|
|
||||||
- Nouveautés
|
- Nouveautés
|
||||||
- ajout d'un bouton pour enchanter les potions
|
- ajout d'un bouton pour enchanter les potions
|
||||||
- standardisation des boutons d'actions sur les items
|
- standardisation des boutons d'actions sur les items
|
||||||
@ -14,9 +95,11 @@
|
|||||||
- Corrections de descriptions pour proposer les jet de dés
|
- Corrections de descriptions pour proposer les jet de dés
|
||||||
|
|
||||||
## 12.0.35 - La Solution d'Astrobazzarh
|
## 12.0.35 - La Solution d'Astrobazzarh
|
||||||
|
|
||||||
- Fix problème d'initialisation des feuilles d'items
|
- 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, ...
|
||||||
- avec la syntaxe `@roll[...]` on peut ajouter le lien vers:
|
- avec la syntaxe `@roll[...]` on peut ajouter le lien vers:
|
||||||
@ -31,21 +114,26 @@
|
|||||||
- gestion des blocs secrets dans les descriptions
|
- gestion des blocs secrets dans les descriptions
|
||||||
|
|
||||||
## 12.0.33 - la vieillesse d'Astrobazzarh
|
## 12.0.33 - la vieillesse d'Astrobazzarh
|
||||||
|
|
||||||
- retour de l'expérience pour les joueurs
|
- retour de l'expérience pour les joueurs
|
||||||
- suppression du message "Pas de caractéristique" sur les jets d'odorat-goût
|
- suppression du message "Pas de caractéristique" sur les jets d'odorat-goût
|
||||||
|
|
||||||
## 12.0.32 - les rêveries d'Astrobazzarh
|
## 12.0.32 - les rêveries d'Astrobazzarh
|
||||||
|
|
||||||
- Ajout des Items Race pour gérer les ajustements liés aux races
|
- Ajout des Items Race pour gérer les ajustements liés aux races
|
||||||
|
|
||||||
## 12.0.31 - le mausolée d'Astrobazzarh
|
## 12.0.31 - le mausolée d'Astrobazzarh
|
||||||
|
|
||||||
- Correction: les automatisation de combat jouer-MJ fonctionnentde nouveau
|
- Correction: les automatisation de combat jouer-MJ fonctionnentde nouveau
|
||||||
|
|
||||||
## 12.0.30 - le cauchemar d'Astrobazzarh
|
## 12.0.30 - le cauchemar d'Astrobazzarh
|
||||||
|
|
||||||
- calcul automatique du niveau des entités selon leur rêve
|
- calcul automatique du niveau des entités selon leur rêve
|
||||||
- la description des créatures venimeuses contient un lien vers leur venin
|
- 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)
|
- Correction: les messages de combats ne marchaient plus (Changement combiné Foundry + rêve de Dragon)
|
||||||
|
|
||||||
## 12.0.29 - L'indexation d'Astrobazzarh
|
## 12.0.29 - L'indexation d'Astrobazzarh
|
||||||
|
|
||||||
- les liens dans la descriptions des sorts pointent vers les sorts du compendium
|
- 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
|
- la description du chrasme contient le lien vers son venin plutôt qu'un tableau
|
||||||
|
|
||||||
|
@ -44,13 +44,13 @@ export class ChatVente {
|
|||||||
vente.nbLots = Math.max(0, vente.nbLots - quantite)
|
vente.nbLots = Math.max(0, vente.nbLots - quantite)
|
||||||
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||||
|
|
||||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente);
|
||||||
chatMessage.update({ content: html });
|
chatMessage.update({ content: html });
|
||||||
chatMessage.render(true);
|
chatMessage.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async displayAchatVente(vente) {
|
static async displayAchatVente(vente) {
|
||||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente);
|
||||||
const chatMessage = await ChatMessage.create(RdDUtility.chatDataSetup(html))
|
const chatMessage = await ChatMessage.create(RdDUtility.chatDataSetup(html))
|
||||||
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||||
await chatMessage.setFlag(SYSTEM_RDD, DETAIL_VENTE, {
|
await chatMessage.setFlag(SYSTEM_RDD, DETAIL_VENTE, {
|
||||||
|
@ -29,7 +29,7 @@ export class DialogItemAchat extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DialogItemAchat.changeNombreLots(venteData, 1)
|
DialogItemAchat.changeNombreLots(venteData, 1)
|
||||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.html`, venteData)
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.hbs`, venteData)
|
||||||
new DialogItemAchat(html, venteData).render(true)
|
new DialogItemAchat(html, venteData).render(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ export class DialogItemVente extends Dialog {
|
|||||||
quantiteIllimite: item.isItemCommerce() ? quantiteMax == undefined : !item.parent,
|
quantiteIllimite: item.isItemCommerce() ? quantiteMax == undefined : !item.parent,
|
||||||
isOwned: item.parent,
|
isOwned: item.parent,
|
||||||
}
|
}
|
||||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-vente.html`, venteData);
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-vente.hbs`, venteData);
|
||||||
return new DialogItemVente(venteData, html).render(true);
|
return new DialogItemVente(venteData, html).render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ import { RdDEmpoignade } from "./rdd-empoignade.js";
|
|||||||
import { RdDBaseActorSangSheet } from "./actor/base-actor-sang-sheet.js";
|
import { RdDBaseActorSangSheet } from "./actor/base-actor-sang-sheet.js";
|
||||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||||
import { AppPersonnageAleatoire } from "./actor/random/app-personnage-aleatoire.js";
|
import { AppPersonnageAleatoire } from "./actor/random/app-personnage-aleatoire.js";
|
||||||
import { RdDItemRace } from "./item/race.js";
|
|
||||||
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -31,7 +30,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.hbs",
|
||||||
width: 550,
|
width: 550,
|
||||||
showCompNiveauBase: false,
|
showCompNiveauBase: false,
|
||||||
vueArchetype: false,
|
vueArchetype: false,
|
||||||
@ -127,77 +126,73 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.html.find('.show-hide-competences').click(async event => {
|
this.html.find('.show-hide-competences').click(async event => {
|
||||||
this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
|
this.options.showCompNiveauBase = !this.options.showCompNiveauBase
|
||||||
this.render(true);
|
this.render(true)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.html.find('.button-tmr-visu').click(async event => this.actor.displayTMR("visu"))
|
this.html.find('.button-tmr-visu').click(async event => await this.actor.displayTMR("visu"))
|
||||||
|
|
||||||
// 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('.sheet-possession-attack').click(async event => {
|
this.html.find('.sheet-possession-attack').click(async event => {
|
||||||
const poss = RdDSheetUtility.getItem(event, this.actor)
|
const poss = RdDSheetUtility.getItem(event, this.actor)
|
||||||
this.actor.conjurerPossession(poss)
|
await this.actor.conjurerPossession(poss)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.html.find('.subacteur-coeur-toggle a').click(async event => {
|
this.html.find('.subacteur-coeur-toggle a').click(async event => {
|
||||||
const subActorIdactorId = RdDSheetUtility.getEventItemData(event, 'subactor-id')
|
const subActorIdactorId = RdDSheetUtility.getEventItemData(event, 'subactor-id')
|
||||||
const coeurNombre = $(event.currentTarget).data('numero-coeur')
|
const coeurNombre = $(event.currentTarget).data('numero-coeur')
|
||||||
RdDCoeur.toggleSubActeurCoeur(this.actor.id, subActorIdactorId, coeurNombre)
|
await RdDCoeur.toggleSubActeurCoeur(this.actor.id, subActorIdactorId, coeurNombre)
|
||||||
})
|
})
|
||||||
this.html.find('.subacteur-tendre-moment').click(async event => {
|
this.html.find('.subacteur-tendre-moment').click(async event => {
|
||||||
const subActorId = RdDSheetUtility.getEventItemData(event, 'subactor-id')
|
const subActorId = RdDSheetUtility.getEventItemData(event, 'subactor-id')
|
||||||
RdDCoeur.startSubActeurTendreMoment(this.actor.id, subActorId)
|
await RdDCoeur.startSubActeurTendreMoment(this.actor.id, subActorId)
|
||||||
})
|
})
|
||||||
this.html.find('.subacteur-delete').click(async event => {
|
this.html.find('.subacteur-delete').click(async event => {
|
||||||
const li = RdDSheetUtility.getEventElement(event);
|
const li = RdDSheetUtility.getEventElement(event);
|
||||||
const subActorId = li.data("subactor-id");
|
const subActorId = li.data("subactor-id");
|
||||||
this.deleteSubActeur(subActorId, li);
|
this.deleteSubActeur(subActorId, li);
|
||||||
})
|
})
|
||||||
this.html.find("input.derivee-value[name='system.compteurs.stress.value']").change(async event => {
|
this.html.find("input.derivee-value[name='system.compteurs.stress.value']").change(async event =>
|
||||||
this.actor.updateCompteurValue("stress", parseInt(event.target.value));
|
await this.actor.updateCompteurValue("stress", parseInt(event.target.value))
|
||||||
});
|
);
|
||||||
this.html.find("input.derivee-value[name='system.compteurs.experience.value']").change(async event => {
|
this.html.find("input.derivee-value[name='system.compteurs.experience.value']").change(async event =>
|
||||||
this.actor.updateCompteurValue("experience", parseInt(event.target.value));
|
await this.actor.updateCompteurValue("experience", parseInt(event.target.value))
|
||||||
});
|
);
|
||||||
|
|
||||||
this.html.find('.creer-tache').click(async event => this.createEmptyTache());
|
this.html.find('.creer-tache').click(async event => await this.createEmptyTache());
|
||||||
this.html.find('.creer-une-oeuvre').click(async event => this.selectTypeOeuvreToCreate());
|
this.html.find('.creer-une-oeuvre').click(async event => await this.selectTypeOeuvreToCreate());
|
||||||
this.html.find('.creer-tache-blessure-legere').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 2));
|
this.html.find('.creer-tache-blessure-legere').click(async event => await RdDItemBlessure.createTacheSoinBlessure(this.actor, 2));
|
||||||
this.html.find('.creer-tache-blessure-grave').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 4));
|
this.html.find('.creer-tache-blessure-grave').click(async event => await RdDItemBlessure.createTacheSoinBlessure(this.actor, 4));
|
||||||
this.html.find('.creer-tache-blessure-critique').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 6));
|
this.html.find('.creer-tache-blessure-critique').click(async event => await RdDItemBlessure.createTacheSoinBlessure(this.actor, 6));
|
||||||
|
|
||||||
this.html.find('.blessure-premierssoins-done').change(async event => {
|
this.html.find('.blessure-premierssoins-done').change(async event => {
|
||||||
const blessure = this.getBlessure(event);
|
await this.getBlessure(event)?.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
||||||
await blessure?.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
|
||||||
});
|
});
|
||||||
this.html.find('.blessure-soinscomplets-done').change(async event => {
|
this.html.find('.blessure-soinscomplets-done').change(async event => {
|
||||||
const blessure = this.getBlessure(event);
|
await this.getBlessure(event)?.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||||
await blessure?.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
|
||||||
});
|
});
|
||||||
this.html.find('.blessure-premierssoins-bonus').change(async event => {
|
this.html.find('.blessure-premierssoins-bonus').change(async event => {
|
||||||
const blessure = this.getBlessure(event);
|
await this.getBlessure(event)?.setSoinsBlessure({ premierssoins: { bonus: Number(event.currentTarget.value) } })
|
||||||
await blessure?.setSoinsBlessure({ premierssoins: { bonus: Number(event.currentTarget.value) } })
|
|
||||||
});
|
});
|
||||||
this.html.find('.blessure-soinscomplets-bonus').change(async event => {
|
this.html.find('.blessure-soinscomplets-bonus').change(async event => {
|
||||||
const blessure = this.getBlessure(event);
|
await this.getBlessure(event)?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
||||||
await blessure?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.html.find('.roll-chance-actuelle').click(async event => this.actor.rollCarac('chance-actuelle'))
|
this.html.find('.roll-chance-actuelle').click(async event => await 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 => await this.actor.rollAppelChance())
|
||||||
|
|
||||||
this.html.find('[name="jet-astrologie"]').click(async event => this.actor.astrologieNombresAstraux())
|
this.html.find('[name="jet-astrologie"]').click(async event => await this.actor.astrologieNombresAstraux())
|
||||||
this.html.find('.action-tache').click(async event => this.actor.rollTache(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-tache').click(async event => await 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 => await this.actor.rollMeditation(RdDSheetUtility.getItemId(event)))
|
||||||
|
|
||||||
this.html.find('.action-chant').click(async event => this.actor.rollChant(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-chant').click(async event => await this.actor.rollChant(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.action-danse').click(async event => this.actor.rollDanse(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-danse').click(async event => await this.actor.rollDanse(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.action-musique').click(async event => this.actor.rollMusique(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-musique').click(async event => await this.actor.rollMusique(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.action-oeuvre').click(async event => this.actor.rollOeuvre(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-oeuvre').click(async event => await this.actor.rollOeuvre(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.action-jeu').click(async event => this.actor.rollJeu(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-jeu').click(async event => await this.actor.rollJeu(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.action-recettecuisine').click(async event => this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event)))
|
this.html.find('.action-recettecuisine').click(async event => await 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) {
|
||||||
@ -213,16 +208,16 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
await this.actor.deleteExperienceLog(0, key + 1);
|
await this.actor.deleteExperienceLog(0, key + 1);
|
||||||
});
|
});
|
||||||
// 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 => await 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 => await this.actor.addDonDeHautReve())
|
||||||
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
|
this.html.find('.afficher-tmr').click(async event => await 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 => await this.actor.rollCarac('reve-actuel', { resistance: true }))
|
||||||
this.html.find('.action-empoignade').click(async event => RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
this.html.find('.action-empoignade').click(async event => await 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 => await this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence'))
|
||||||
|
|
||||||
// Initiative pour l'arme
|
// Initiative pour l'arme
|
||||||
this.html.find('.roll-init-arme').click(async event => {
|
this.html.find('.roll-init-arme').click(async event => {
|
||||||
@ -235,30 +230,34 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
})
|
})
|
||||||
// Display TMR
|
// Display TMR
|
||||||
|
|
||||||
this.html.find('.button-tmr').click(async event => this.actor.displayTMR("normal"))
|
this.html.find('.button-tmr').click(async event => await this.actor.displayTMR("normal"))
|
||||||
this.html.find('.button-tmr-rapide').click(async event => this.actor.displayTMR("rapide"))
|
this.html.find('.button-tmr-rapide').click(async event => await this.actor.displayTMR("rapide"))
|
||||||
|
|
||||||
this.html.find('.button-repos').click(async event => await this.actor.repos())
|
this.html.find('.button-repos').click(async event => await this.actor.repos())
|
||||||
|
|
||||||
this.html.find('.carac-xp-augmenter').click(async event => this.actor.updateCaracXPAuto(event.currentTarget.name.replace("augmenter.", "")))
|
this.html.find('.carac-xp-augmenter').click(async event => await this.actor.updateCaracXPAuto(event.currentTarget.name.replace("augmenter.", "")))
|
||||||
this.html.find('.competence-xp-augmenter').click(async event => this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event)))
|
this.html.find('.competence-xp-augmenter').click(async event => await this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.competence-stress-augmenter').click(async event => this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event)))
|
this.html.find('.competence-stress-augmenter').click(async event =>{
|
||||||
|
await this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event))
|
||||||
|
this.render(true)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
if (this.options.vueDetaillee) {
|
if (this.options.vueDetaillee) {
|
||||||
// On carac change
|
// On carac change
|
||||||
this.html.find('input.carac-xp').change(async event => {
|
this.html.find('input.carac-xp').change(async event => {
|
||||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "");
|
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "")
|
||||||
this.actor.updateCaracXP(caracName, parseInt(event.target.value));
|
await this.actor.updateCaracXP(caracName, parseInt(event.target.value))
|
||||||
});
|
})
|
||||||
// On competence xp change
|
// On competence xp change
|
||||||
this.html.find('input.competence-xp').change(async event => {
|
this.html.find('input.competence-xp').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value
|
||||||
this.actor.updateCompetenceXP(compName, parseInt(event.target.value));
|
await this.actor.updateCompetenceXP(compName, parseInt(event.target.value))
|
||||||
});
|
})
|
||||||
this.html.find('input.competence-xp-sort').change(async event => {
|
this.html.find('input.competence-xp-sort').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value
|
||||||
this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value));
|
await this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value))
|
||||||
});
|
})
|
||||||
|
|
||||||
this.html.find('.toggle-archetype').click(async event => {
|
this.html.find('.toggle-archetype').click(async event => {
|
||||||
this.options.vueArchetype = !this.options.vueArchetype;
|
this.options.vueArchetype = !this.options.vueArchetype;
|
||||||
@ -267,27 +266,27 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
// On competence archetype change
|
// On competence archetype change
|
||||||
this.html.find('.competence-archetype').change(async event => {
|
this.html.find('.competence-archetype').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value;
|
||||||
this.actor.updateCompetenceArchetype(compName, parseInt(event.target.value));
|
await this.actor.updateCompetenceArchetype(compName, parseInt(event.target.value));
|
||||||
});
|
});
|
||||||
this.html.find('.nouvelle-incarnation').click(async event => this.actor.nouvelleIncarnation())
|
this.html.find('.nouvelle-incarnation').click(async event => await this.actor.nouvelleIncarnation())
|
||||||
}
|
}
|
||||||
|
|
||||||
// On pts de reve change
|
// On pts de reve change
|
||||||
this.html.find('.pointsreve-value').change(async event => this.actor.update({ "system.reve.reve.value": event.currentTarget.value }))
|
this.html.find('.pointsreve-value').change(async event => await this.actor.update({ "system.reve.reve.value": event.currentTarget.value }))
|
||||||
this.html.find('.seuil-reve-value').change(async event => this.actor.setPointsDeSeuil(event.currentTarget.value))
|
this.html.find('.seuil-reve-value').change(async event => await this.actor.setPointsDeSeuil(event.currentTarget.value))
|
||||||
|
|
||||||
this.html.find('.stress-test').click(async event => this.actor.transformerStress())
|
this.html.find('.stress-test').click(async event => await this.actor.transformerStress())
|
||||||
this.html.find('.moral-malheureux').click(async event => this.actor.jetDeMoral('malheureuse'))
|
this.html.find('.moral-malheureux').click(async event => await this.actor.jetDeMoral('malheureuse'))
|
||||||
this.html.find('.moral-neutre').click(async event => this.actor.jetDeMoral('neutre'))
|
this.html.find('.moral-neutre').click(async event => await this.actor.jetDeMoral('neutre'))
|
||||||
this.html.find('.moral-heureux').click(async event => this.actor.jetDeMoral('heureuse'))
|
this.html.find('.moral-heureux').click(async event => await this.actor.jetDeMoral('heureuse'))
|
||||||
this.html.find('.button-ethylisme').click(async event => this.actor.jetEthylisme())
|
this.html.find('.button-ethylisme').click(async event => await this.actor.jetEthylisme())
|
||||||
|
|
||||||
this.html.find('.ptreve-actuel-plus').click(async event => this.actor.reveActuelIncDec(1))
|
this.html.find('.ptreve-actuel-plus').click(async event => await this.actor.reveActuelIncDec(1))
|
||||||
this.html.find('.ptreve-actuel-moins').click(async event => this.actor.reveActuelIncDec(-1))
|
this.html.find('.ptreve-actuel-moins').click(async event => await this.actor.reveActuelIncDec(-1))
|
||||||
this.html.find('.chance-actuelle-plus').click(async event => this.actor.chanceActuelleIncDec(1))
|
this.html.find('.chance-actuelle-plus').click(async event => await this.actor.chanceActuelleIncDec(1))
|
||||||
this.html.find('.chance-actuelle-moins').click(async event => this.actor.chanceActuelleIncDec(-1))
|
this.html.find('.chance-actuelle-moins').click(async event => await this.actor.chanceActuelleIncDec(-1))
|
||||||
this.html.find('.fatigue-plus').click(async event => this.actor.santeIncDec("fatigue", 1))
|
this.html.find('.fatigue-plus').click(async event => await this.actor.santeIncDec("fatigue", 1))
|
||||||
this.html.find('.fatigue-moins').click(async event => this.actor.santeIncDec("fatigue", -1))
|
this.html.find('.fatigue-moins').click(async event => await this.actor.santeIncDec("fatigue", -1))
|
||||||
}
|
}
|
||||||
|
|
||||||
getBlessure(event) {
|
getBlessure(event) {
|
||||||
|
477
module/actor.js
477
module/actor.js
@ -42,6 +42,7 @@ import { RdDItemTete } from "./item/tete.js";
|
|||||||
import { DialogSelect } from "./dialog-select.js";
|
import { DialogSelect } from "./dialog-select.js";
|
||||||
import { PAS_DE_DRACONIC, POSSESSION_SANS_DRACONIC } from "./item/base-items.js";
|
import { PAS_DE_DRACONIC, POSSESSION_SANS_DRACONIC } from "./item/base-items.js";
|
||||||
import { RdDItemRace } from "./item/race.js";
|
import { RdDItemRace } from "./item/race.js";
|
||||||
|
import { RdDRollResult } from "./rdd-roll-result.js";
|
||||||
|
|
||||||
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
|
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
|
||||||
|
|
||||||
@ -166,22 +167,29 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $perteRevePotionsEnchantees() {
|
async $perteReveEnchantementsChateauDormants() {
|
||||||
const potionUpdates = this.itemTypes[ITEM_TYPES.potion].map(it => it.perteRevePotion())
|
const toUpdate = this.items.filter(it => [ITEM_TYPES.potion, ITEM_TYPES.gemme].includes(it.type))
|
||||||
|
.map(it => it.perteReveChateauDormant())
|
||||||
.filter(it => it != undefined)
|
.filter(it => it != undefined)
|
||||||
if (potionUpdates.length > 0) {
|
|
||||||
console.log('perte rêve de potions', potionUpdates)
|
if (toUpdate.length > 0) {
|
||||||
const messageUpdates = await Promise.all(potionUpdates.map(async p => await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, {
|
console.log('perte de rêve des enchantements', toUpdate)
|
||||||
pr: foundry.utils.getProperty(p, 'system.pr'),
|
const messageUpdates = await Promise.all(
|
||||||
alias: this.getAlias(),
|
toUpdate.map(async it => await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-pertereve-enchantement-chateaudormant.hbs`, it)))
|
||||||
potionName: p.name,
|
|
||||||
potionImg: p.img
|
|
||||||
})))
|
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: messageUpdates.reduce(Misc.joining('<br>'))
|
content: messageUpdates.reduce(Misc.joining('<br>'))
|
||||||
})
|
})
|
||||||
await this.updateEmbeddedDocuments('Item', potionUpdates);
|
await this.updateEmbeddedDocuments('Item', toUpdate.map(it => it.update));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async $suppressionLancementsSort() {
|
||||||
|
const updates = this.itemTypes[ITEM_TYPES.sort]
|
||||||
|
.filter(it => it.system.lancements.length > 0)
|
||||||
|
.map(it => { return { _id: it.id, 'system.lancements': [] } })
|
||||||
|
if (updates.length > 0) {
|
||||||
|
await this.updateEmbeddedDocuments('Item', updates)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +243,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
await this.resetInfoSommeil()
|
await this.resetInfoSommeil()
|
||||||
ChatMessage.create(message);
|
ChatMessage.create(message);
|
||||||
this.sheet.render(true);
|
setTimeout(() => this.sheet.render(), 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
async _recuperationSante(message) {
|
async _recuperationSante(message) {
|
||||||
@ -271,29 +279,34 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async dormirChateauDormant() {
|
async dormirChateauDormant() {
|
||||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
|
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
|
||||||
const message = {
|
await this.$dormirChateauDormant();
|
||||||
whisper: ChatUtility.getOwners(this),
|
setTimeout(() => this.sheet.render(), 20)
|
||||||
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.$perteRevePotionsEnchantees();
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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.resetInfoSommeil();
|
||||||
|
}
|
||||||
|
|
||||||
async resetInfoSommeil() {
|
async resetInfoSommeil() {
|
||||||
await this.update({
|
await this.update({
|
||||||
'system.sommeil': {
|
'system.sommeil': {
|
||||||
@ -433,10 +446,9 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
message.content += 'Vous ne trouvez pas le sommeil';
|
message.content += 'Vous ne trouvez pas le sommeil';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let jetsReve = [];
|
let dormi = await this.$dormirDesHeures(message, heures, options);
|
||||||
let dormi = await this.dormirDesHeures(jetsReve, message, heures, options);
|
if (dormi.jetsReve.length > 0) {
|
||||||
if (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. `;
|
||||||
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') {
|
if (dormi.etat == 'eveil') {
|
||||||
await this.reveilReveDeDragon(message, dormi.heures);
|
await this.reveilReveDeDragon(message, dormi.heures);
|
||||||
@ -449,11 +461,9 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
ChatMessage.create(message);
|
ChatMessage.create(message);
|
||||||
}
|
}
|
||||||
if (options.chateauDormant) {
|
if (options.chateauDormant) {
|
||||||
await this.dormirChateauDormant();
|
await this.$dormirChateauDormant();
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.sheet.render(true);
|
|
||||||
}
|
}
|
||||||
|
setTimeout(() => this.sheet.render(), 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
async reveilReveDeDragon(message, heures) {
|
async reveilReveDeDragon(message, heures) {
|
||||||
@ -463,18 +473,18 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async dormirDesHeures(jetsReve, message, heures, options) {
|
async $dormirDesHeures(message, heures, options) {
|
||||||
const dormi = { heures: 0, etat: 'dort' };
|
const dormi = { heures: 0, etat: 'dort', jetsReve: [] };
|
||||||
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
|
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
|
||||||
await this._recupererEthylisme(message);
|
await this.$recupererEthylisme(message);
|
||||||
if (options.grisReve) {
|
if (options.grisReve) {
|
||||||
await this.recupererFatigue(message);
|
await this.$recupererFatigue(message);
|
||||||
}
|
}
|
||||||
else if (!this.system.sommeil?.insomnie) {
|
else if (!this.system.sommeil?.insomnie) {
|
||||||
await this.recupererFatigue(message);
|
await this.$recupererFatigue(message);
|
||||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
await this.$jetRecuperationReve(dormi, message);
|
||||||
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
||||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
await this.$jetRecuperationReve(dormi, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -482,35 +492,36 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async jetRecuperationReve(jetsReve, message) {
|
async $jetRecuperationReve(dormi, message) {
|
||||||
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
||||||
let reve = await RdDDice.rollTotal("1dr");
|
const reve = await RdDDice.rollTotal("1dr")
|
||||||
if (reve >= 7) {
|
if (reve >= 7) {
|
||||||
// Rêve de Dragon !
|
// 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! `;
|
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);
|
await this.combattreReveDeDragon(reve);
|
||||||
jetsReve.push(-1);
|
dormi.jetsReve.push(-1);
|
||||||
return 'eveil';
|
dormi.etat = 'eveil'
|
||||||
|
return
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||||
});
|
})
|
||||||
jetsReve.push(0);
|
dormi.jetsReve.push(0)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await this.reveActuelIncDec(reve);
|
await this.reveActuelIncDec(reve)
|
||||||
jetsReve.push(reve);
|
dormi.jetsReve.push(reve)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 'dort';
|
dormi.etat = 'dort'
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _recupererEthylisme(message) {
|
async $recupererEthylisme(message) {
|
||||||
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
|
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
|
||||||
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
||||||
if (value <= 0) {
|
if (value <= 0) {
|
||||||
@ -532,7 +543,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
max = Math.floor(max / 2);
|
max = Math.floor(max / 2);
|
||||||
}
|
}
|
||||||
const manquant = max - this.system.sante.endurance.value;
|
const manquant = max - this.system.sante.endurance.value;
|
||||||
|
|
||||||
if (manquant > 0) {
|
if (manquant > 0) {
|
||||||
await this.santeIncDec("endurance", manquant);
|
await this.santeIncDec("endurance", manquant);
|
||||||
message.content += `Vous récuperez ${manquant} points d'endurance. `;
|
message.content += `Vous récuperez ${manquant} points d'endurance. `;
|
||||||
@ -540,15 +550,15 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async recupererFatigue(message) {
|
async $recupererFatigue(message) {
|
||||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||||
let fatigue = this.system.sante.fatigue.value;
|
let fatigue = this.system.sante.fatigue.value
|
||||||
const fatigueMin = this.getFatigueMin();
|
const fatigueMin = this.getFatigueMin()
|
||||||
if (fatigue <= fatigueMin) {
|
if (fatigue <= fatigueMin) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue));
|
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue))
|
||||||
await this.update({ "system.sante.fatigue.value": fatigue });
|
await this.update({ 'system.sante.fatigue.value': fatigue });
|
||||||
if (fatigue == 0) {
|
if (fatigue == 0) {
|
||||||
message.content += "Vous êtes complêtement reposé. ";
|
message.content += "Vous êtes complêtement reposé. ";
|
||||||
}
|
}
|
||||||
@ -619,7 +629,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
rollData.competence.system.defaut_carac = 'reve-actuel';
|
rollData.competence.system.defaut_carac = 'reve-actuel';
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, rollData,
|
const dialog = await RdDRoll.create(this, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-reve-de-dragon.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-reve-de-dragon.hbs' },
|
||||||
{
|
{
|
||||||
name: 'maitrise',
|
name: 'maitrise',
|
||||||
label: 'Maîtriser le Rêve de Dragon',
|
label: 'Maîtriser le Rêve de Dragon',
|
||||||
@ -658,19 +668,23 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (!RdDItemRace.checkRacialMax(this, caracName, to)) {
|
if (!RdDItemRace.checkRacialMax(this, caracName, to)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let updates = {};
|
||||||
if (caracName == LIST_CARAC_PERSONNAGE.reve.code) {
|
if (caracName == LIST_CARAC_PERSONNAGE.reve.code) {
|
||||||
if (to > Misc.toInt(this.system.reve.seuil.value)) {
|
if (to > Misc.toInt(this.system.reve.seuil.value)) {
|
||||||
this.setPointsDeSeuil(to);
|
updates[`system.reve.seuil.value`] = to; // SFA : Direct and packed changes
|
||||||
}
|
//this.setPointsDeSeuil(to);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (caracName == LIST_CARAC_PERSONNAGE.chance.code) {
|
if (caracName == LIST_CARAC_PERSONNAGE.chance.code) {
|
||||||
if (to > Misc.toInt(this.system.compteurs.chance.value)) {
|
if (to > Misc.toInt(this.system.compteurs.chance.value)) {
|
||||||
this.setPointsDeChance(to);
|
updates[`system.compteurs.chance.value`] = to; // SFA : Direct and packed changes
|
||||||
|
//this.setPointsDeChance(to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let selectedCarac = this.findCaracByName(caracName);
|
let selectedCarac = this.findCaracByName(caracName);
|
||||||
const from = selectedCarac.value
|
const from = selectedCarac.value
|
||||||
await this.update({ [`system.carac.${caracName}.value`]: to });
|
updates[`system.carac.${caracName}.value`] = to;
|
||||||
|
await this.update(updates);
|
||||||
await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName);
|
await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,7 +741,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await competence.update({
|
await competence.update({
|
||||||
"system.xp": toXp,
|
"system.xp": toXp,
|
||||||
"system.niveau": toNiveau,
|
"system.niveau": toNiveau,
|
||||||
});
|
}, { render: false })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name);
|
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name);
|
||||||
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name);
|
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name);
|
||||||
}
|
}
|
||||||
@ -749,7 +763,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
expérience requise: ${xpRequis}
|
expérience requise: ${xpRequis}
|
||||||
niveau : ${fromNiveau}
|
niveau : ${fromNiveau}
|
||||||
archétype : ${competence.system.niveau_archetype}`);
|
archétype : ${competence.system.niveau_archetype}`);
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
const xpUtilise = Math.max(0, Math.min(fromXpStress, xpRequis));
|
const xpUtilise = Math.max(0, Math.min(fromXpStress, xpRequis));
|
||||||
const gainNiveau = (xpUtilise >= xpRequis || xpRequis <= 0) ? 1 : 0;
|
const gainNiveau = (xpUtilise >= xpRequis || xpRequis <= 0) ? 1 : 0;
|
||||||
@ -758,7 +772,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await competence.update({
|
await competence.update({
|
||||||
"system.xp": newXp,
|
"system.xp": newXp,
|
||||||
"system.niveau": toNiveau,
|
"system.niveau": toNiveau,
|
||||||
});
|
}, { render: false })
|
||||||
const toXpStress = Math.max(0, fromXpStress - xpUtilise);
|
const toXpStress = Math.max(0, fromXpStress - xpUtilise);
|
||||||
await this.update({ "system.compteurs.experience.value": toXpStress });
|
await this.update({ "system.compteurs.experience.value": toXpStress });
|
||||||
|
|
||||||
@ -774,7 +788,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories());
|
const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories());
|
||||||
this.notifyCompetencesTronc(competence, toNiveau);
|
this.notifyCompetencesTronc(competence, toNiveau);
|
||||||
const fromNiveau = competence.system.niveau;
|
const fromNiveau = competence.system.niveau;
|
||||||
await competence.update({ 'system.niveau': toNiveau });
|
await competence.update({ 'system.niveau': toNiveau }, { render: true })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true);
|
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -799,10 +813,10 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (isNaN(toXp) || typeof (toXp) != 'number') toXp = 0;
|
if (isNaN(toXp) || typeof (toXp) != 'number') toXp = 0;
|
||||||
const fromXp = competence.system.xp;
|
const fromXp = competence.system.xp;
|
||||||
this.checkCompetenceXP(idOrName, toXp);
|
this.checkCompetenceXP(idOrName, toXp);
|
||||||
await competence.update({ 'system.xp': toXp });
|
await competence.update({ 'system.xp': toXp }, { render: false })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name, true);
|
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name, true);
|
||||||
if (toXp > fromXp) {
|
if (toXp > fromXp) {
|
||||||
RdDUtility.checkThanatosXP(idOrName);
|
RdDUtility.checkThanatosXP(competence)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -813,10 +827,10 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (competence) {
|
if (competence) {
|
||||||
if (isNaN(toXpSort) || typeof (toXpSort) != 'number') toXpSort = 0;
|
if (isNaN(toXpSort) || typeof (toXpSort) != 'number') toXpSort = 0;
|
||||||
const fromXpSort = competence.system.xp_sort;
|
const fromXpSort = competence.system.xp_sort;
|
||||||
await competence.update({ 'system.xp_sort': toXpSort });
|
await competence.update({ 'system.xp_sort': toXpSort }, { render: false })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, competence.name, true);
|
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, competence.name, true);
|
||||||
if (toXpSort > fromXpSort) {
|
if (toXpSort > fromXpSort) {
|
||||||
RdDUtility.checkThanatosXP(idOrName);
|
RdDUtility.checkThanatosXP(competence)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -825,7 +839,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
async updateCompetenceArchetype(idOrName, compValue) {
|
async updateCompetenceArchetype(idOrName, compValue) {
|
||||||
let competence = this.getCompetence(idOrName)
|
let competence = this.getCompetence(idOrName)
|
||||||
if (competence) {
|
if (competence) {
|
||||||
await competence.update({ 'system.niveau_archetype': Math.max(compValue ?? 0, 0) });
|
await competence.update({ 'system.niveau_archetype': Math.max(compValue ?? 0, 0) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1038,20 +1052,10 @@ 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() {
|
getRencontreTMREnAttente() {
|
||||||
return this.itemTypes[ITEM_TYPES.rencontre].find(this.filterRencontreTMRDemiReve())
|
|
||||||
}
|
|
||||||
|
|
||||||
filterRencontreTMRDemiReve() {
|
|
||||||
const position = this.getDemiReve()
|
const position = this.getDemiReve()
|
||||||
return it => it.system.coord == position
|
return this.itemTypes[ITEM_TYPES.rencontre].find(it => it.system.coord == position)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1189,12 +1193,12 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
diffConditions: 0,
|
diffConditions: 0,
|
||||||
ajustementsForce: CONFIG.RDD.difficultesLibres
|
ajustementsForce: CONFIG.RDD.difficultesLibres
|
||||||
}
|
}
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-ethylisme.html', rollData);
|
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-ethylisme.hbs', rollData);
|
||||||
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 mangerNourriture(item, onActionItem) {
|
async mangerNourriture(item) {
|
||||||
return (await DialogConsommer.create(this, item, onActionItem)).render(true);
|
return (await DialogConsommer.create(this, item)).render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
async actionLire(item) {
|
async actionLire(item) {
|
||||||
@ -1204,9 +1208,9 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async actionHerbe(item, onActionItem = async () => { }) {
|
async fabriquerDecoctionHerbe(item) {
|
||||||
if (item.isHerbeAPotion()) {
|
if (item.isHerbeAPotion()) {
|
||||||
return DialogFabriquerPotion.create(this, item, onActionItem);
|
return DialogFabriquerPotion.create(this, item);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1382,7 +1386,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
ethylismeData.doses = ethylisme.nb_doses;
|
ethylismeData.doses = ethylisme.nb_doses;
|
||||||
|
|
||||||
await this.update({ 'system.compteurs.ethylisme': ethylisme });
|
await this.update({ 'system.compteurs.ethylisme': ethylisme });
|
||||||
await RdDResolutionTable.displayRollData(ethylismeData, this, 'chat-resultat-ethylisme.html');
|
await RdDRollResult.displayRollData(ethylismeData, this, 'chat-resultat-ethylisme.hbs');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1423,7 +1427,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-transformer-stress.html`, stressRollData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-transformer-stress.hbs`, stressRollData)
|
||||||
});
|
});
|
||||||
|
|
||||||
const toStress = Math.max(fromStress - stressRollData.perte - 1, 0);
|
const toStress = Math.max(fromStress - stressRollData.perte - 1, 0);
|
||||||
@ -1471,7 +1475,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
createCallbackExperience() {
|
createCallbackExperience() {
|
||||||
return {
|
return {
|
||||||
condition: r => r.rolled.isPart && r.finalLevel < 0 && game.settings.get("core", "rollMode") != 'selfroll',
|
|
||||||
action: r => this.appliquerAjoutExperience(r)
|
action: r => this.appliquerAjoutExperience(r)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -1479,7 +1482,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
createCallbackAppelAuMoral() { /* Si l'appel au moral est utilisé, on l'affiche dans le chat et on diminue éventuellement le moral */
|
createCallbackAppelAuMoral() { /* Si l'appel au moral est utilisé, on l'affiche dans le chat et on diminue éventuellement le moral */
|
||||||
return {
|
return {
|
||||||
condition: r => r.use.appelAuMoral && game.settings.get("core", "rollMode") != 'selfroll',
|
|
||||||
action: r => this._appliquerAppelMoral(r)
|
action: r => this._appliquerAppelMoral(r)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -1508,7 +1510,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (display) {
|
if (display) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.html`, checkXp)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.hbs`, checkXp)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return checkXp;
|
return checkXp;
|
||||||
@ -1540,7 +1542,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (display) {
|
if (display) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-competence-xp.html`, checkXp)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-competence-xp.hbs`, checkXp)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return checkXp;
|
return checkXp;
|
||||||
@ -1550,13 +1552,16 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
||||||
if (!Misc.hasConnectedGM()) {
|
if (!rollData.rolled.isPart ||
|
||||||
|
rollData.finalLevel >= 0 ||
|
||||||
|
game.settings.get("core", "rollMode") == 'selfroll' ||
|
||||||
|
!Misc.hasConnectedGM()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
||||||
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence, rollData.jetResistance);
|
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence, rollData.jetResistance);
|
||||||
if (xpData.length) {
|
if (xpData.length) {
|
||||||
const content = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, {
|
const content = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.hbs`, {
|
||||||
actor: this,
|
actor: this,
|
||||||
xpData
|
xpData
|
||||||
})
|
})
|
||||||
@ -1574,7 +1579,9 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _appliquerAppelMoral(rollData) {
|
async _appliquerAppelMoral(rollData) {
|
||||||
if (!rollData.use.moral) return;
|
if (!rollData.use.moral || game.settings.get("core", "rollMode") == 'selfroll') {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (rollData.rolled.isEchec ||
|
if (rollData.rolled.isEchec ||
|
||||||
(rollData.ajustements.diviseurSignificative && (rollData.rolled.roll * rollData.ajustements.diviseurSignificative > rollData.score))) {
|
(rollData.ajustements.diviseurSignificative && (rollData.rolled.roll * rollData.ajustements.diviseurSignificative > rollData.score))) {
|
||||||
rollData.perteMoralEchec = rollData.moral <= -3 ? 'dissolution' : 'perte';
|
rollData.perteMoralEchec = rollData.moral <= -3 ? 'dissolution' : 'perte';
|
||||||
@ -1636,7 +1643,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
const dialog = await this.openRollDialog({
|
const dialog = await this.openRollDialog({
|
||||||
name: 'lancer-un-sort',
|
name: 'lancer-un-sort',
|
||||||
label: 'Lancer un sort',
|
label: 'Lancer un sort',
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.hbs',
|
||||||
rollData: {
|
rollData: {
|
||||||
carac: { 'reve': reve },
|
carac: { 'reve': reve },
|
||||||
forceCarac: { 'reve': reve },
|
forceCarac: { 'reve': reve },
|
||||||
@ -1649,10 +1656,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
diffLibre: RdDItemSort.getDifficulte(sorts[0], -7), // Per default at startup
|
diffLibre: RdDItemSort.getDifficulte(sorts[0], -7), // Per default at startup
|
||||||
coutreve: Array(30).fill().map((item, index) => 1 + index),
|
coutreve: Array(30).fill().map((item, index) => 1 + index),
|
||||||
},
|
},
|
||||||
callbackAction: async r => {
|
callbacks: [{ action: r => this._rollUnSortResult(r) }]
|
||||||
await this._rollUnSortResult(r);
|
|
||||||
if (!r.isSortReserve) this.tmrApp?.close();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
this.tmrApp?.setTMRPendingAction(dialog);
|
this.tmrApp?.setTMRPendingAction(dialog);
|
||||||
}
|
}
|
||||||
@ -1726,6 +1730,17 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (rollData.isSortReserve) {
|
if (rollData.isSortReserve) {
|
||||||
await this.sortMisEnReserve(selectedSort, rollData.competence, rollData.tmr.coord, Number(selectedSort.system.ptreve_reel));
|
await this.sortMisEnReserve(selectedSort, rollData.competence, rollData.tmr.coord, Number(selectedSort.system.ptreve_reel));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
console.log('lancement de sort', rollData.selectedSort)
|
||||||
|
const precedents = rollData.selectedSort.system.lancements ?? []
|
||||||
|
const lancements = [...precedents, {
|
||||||
|
timestamp: game.system.rdd.calendrier.getTimestamp(),
|
||||||
|
reve: rollData.selectedSort.system.ptreve_reel
|
||||||
|
}]
|
||||||
|
await this.updateEmbeddedDocuments('Item',
|
||||||
|
[{ _id: rollData.selectedSort._id, 'system.lancements': lancements }]
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rollData.depenseReve = 0;
|
rollData.depenseReve = 0;
|
||||||
@ -1745,20 +1760,51 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
reveActuel = Math.max(reveActuel - rollData.depenseReve, 0);
|
reveActuel = Math.max(reveActuel - rollData.depenseReve, 0);
|
||||||
await this.update({ "system.reve.reve.value": reveActuel });
|
await this.update({ "system.reve.reve.value": reveActuel });
|
||||||
|
|
||||||
// Final chat message
|
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-sort.hbs');
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-sort.html');
|
|
||||||
|
|
||||||
if (reveActuel == 0) { // 0 points de reve
|
if (reveActuel == 0) { // 0 points de reve
|
||||||
ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" });
|
ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" });
|
||||||
}
|
}
|
||||||
|
if (!rollData.isSortReserve || !rolled.isSuccess) {
|
||||||
|
this.tmrApp?.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Méthode pour faire un jet prédéterminer sans ouvrir la fenêtre de dialogue
|
||||||
|
* @param {*} caracName
|
||||||
|
* @param {*} compName
|
||||||
|
* @param {*} diff
|
||||||
|
* @param {*} options
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
async doRollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||||
|
const carac = this.getCaracByName(caracName);
|
||||||
|
if (!carac) {
|
||||||
|
ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const competence = this.getCompetence(compName);
|
||||||
|
let rollData = {
|
||||||
|
alias: this.getAlias(),
|
||||||
|
caracValue: Number(carac.value),
|
||||||
|
selectedCarac: carac,
|
||||||
|
competence: competence,
|
||||||
|
diffLibre: diff,
|
||||||
|
show: { title: options?.title ?? '' }
|
||||||
|
};
|
||||||
|
RollDataAjustements.calcul(rollData, this);
|
||||||
|
await RdDResolutionTable.rollData(rollData);
|
||||||
|
await RdDRollResult.displayRollData(rollData, this)
|
||||||
|
|
||||||
|
this.gererExperience(rollData);
|
||||||
|
|
||||||
|
return rollData.rolled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
gererExperience(rollData) {
|
gererExperience(rollData) {
|
||||||
const callback = this.createCallbackExperience();
|
this.createCallbackExperience().action(rollData);
|
||||||
if (callback.condition(rollData)) {
|
|
||||||
callback.action(rollData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1771,7 +1817,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
name: nomTache, type: 'tache',
|
name: nomTache, type: 'tache',
|
||||||
system: {
|
system: {
|
||||||
carac: 'intellect',
|
carac: 'intellect',
|
||||||
competence: 'Ecriture',
|
competence: 'Écriture',
|
||||||
difficulte: item.system.difficulte,
|
difficulte: item.system.difficulte,
|
||||||
periodicite: "60 minutes",
|
periodicite: "60 minutes",
|
||||||
fatigue: 2,
|
fatigue: 2,
|
||||||
@ -1804,6 +1850,27 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||||
|
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||||
|
const competence = this.getCompetence(compName);
|
||||||
|
await this.openRollDialog({
|
||||||
|
name: 'jet-competence',
|
||||||
|
label: 'Jet ' + Grammar.apostrophe('de', competence.name),
|
||||||
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||||
|
rollData: {
|
||||||
|
alias: this.getAlias(),
|
||||||
|
carac: this.system.carac,
|
||||||
|
selectedCarac: this.getCaracByName(caracName),
|
||||||
|
selectedCaracName: caracName,
|
||||||
|
diffLibre: diff,
|
||||||
|
competence: competence,
|
||||||
|
show: { title: options?.title ?? '' }
|
||||||
|
},
|
||||||
|
// TODO:
|
||||||
|
callbacks: [{ action: r => this.$onRollCompetence(r, options) }]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollTache(id, options = {}) {
|
async rollTache(id, options = {}) {
|
||||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||||
@ -1814,7 +1881,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: 'jet-competence',
|
name: 'jet-competence',
|
||||||
label: 'Jet de Tâche ' + tacheData.name,
|
label: 'Jet de Tâche ' + tacheData.name,
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||||
rollData: {
|
rollData: {
|
||||||
competence: compData,
|
competence: compData,
|
||||||
tache: tacheData,
|
tache: tacheData,
|
||||||
@ -1825,7 +1892,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
[tacheData.system.carac]: foundry.utils.duplicate(this.system.carac[tacheData.system.carac])
|
[tacheData.system.carac]: foundry.utils.duplicate(this.system.carac[tacheData.system.carac])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
callbackAction: r => this._tacheResult(r, options)
|
callbacks: [{ action: r => this._tacheResult(r, options) }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1848,14 +1915,14 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await this.updateEmbeddedDocuments('Item', [rollData.tache]);
|
await this.updateEmbeddedDocuments('Item', [rollData.tache]);
|
||||||
await 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 RdDRollResult.displayRollData(rollData, this, 'chat-resultat-tache.hbs');
|
||||||
if (options?.onRollAutomate) {
|
if (options?.onRollAutomate) {
|
||||||
options.onRollAutomate(rollData);
|
options.onRollAutomate(rollData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _rollArt(artData, selected, oeuvre, callbackAction = r => this._resultArt(r)) {
|
async _rollArt(artData, selected, oeuvre, callbackAction = async r => await this._resultArt(r)) {
|
||||||
oeuvre.system.niveau = oeuvre.system.niveau ?? 0;
|
oeuvre.system.niveau = oeuvre.system.niveau ?? 0;
|
||||||
foundry.utils.mergeObject(artData,
|
foundry.utils.mergeObject(artData,
|
||||||
{
|
{
|
||||||
@ -1877,10 +1944,10 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: `jet-${artData.art}`,
|
name: `jet-${artData.art}`,
|
||||||
label: `${artData.verbe} ${oeuvre.name}`,
|
label: `${artData.verbe} ${oeuvre.name}`,
|
||||||
template: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.html`,
|
template: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.hbs`,
|
||||||
rollData: artData,
|
rollData: artData,
|
||||||
callbackAction: callbackAction
|
callbacks: [{ action: callbackAction }],
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1889,7 +1956,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
const baseQualite = (artData.rolled.isSuccess ? niveau : artData.competence.system.niveau);
|
const baseQualite = (artData.rolled.isSuccess ? niveau : artData.competence.system.niveau);
|
||||||
artData.qualiteFinale = Math.min(baseQualite, niveau) + artData.rolled.ptQualite;
|
artData.qualiteFinale = Math.min(baseQualite, niveau) + artData.rolled.ptQualite;
|
||||||
|
|
||||||
await RdDResolutionTable.displayRollData(artData, this.name, `chat-resultat-${artData.art}.html`);
|
await RdDRollResult.displayRollData(artData, this.name, `chat-resultat-${artData.art}.hbs`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1966,7 +2033,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
ui.notifications.info(`${platCuisine.system.quantite} rations de ${platCuisine.name} ont été ajoutés à votre équipement`);
|
ui.notifications.info(`${platCuisine.system.quantite} rations de ${platCuisine.name} ont été ajoutés à votre équipement`);
|
||||||
}
|
}
|
||||||
cuisine.platCuisine = platCuisine;
|
cuisine.platCuisine = platCuisine;
|
||||||
await RdDResolutionTable.displayRollData(cuisine, this.name, `chat-resultat-${cuisine.art}.html`);
|
await RdDRollResult.displayRollData(cuisine, this.name, `chat-resultat-${cuisine.art}.hbs`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async preparerNourriture(item) {
|
async preparerNourriture(item) {
|
||||||
@ -2040,13 +2107,12 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, meditationData,
|
const dialog = await RdDRoll.create(this, meditationData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-meditation.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-meditation.hbs' },
|
||||||
{
|
{
|
||||||
name: 'jet-meditation',
|
name: 'jet-meditation',
|
||||||
label: "Jet de méditation",
|
label: "Jet de méditation",
|
||||||
callbacks: [
|
callbacks: [
|
||||||
this.createCallbackExperience(),
|
this.createCallbackExperience(),
|
||||||
{ condition: r => r.rolled.isEPart, action: r => this._meditationEPart(r) },
|
|
||||||
{ action: r => this._meditationResult(r) }
|
{ action: r => this._meditationResult(r) }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@ -2055,21 +2121,16 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _meditationResult(meditationRoll) {
|
async _meditationResult(meditationRoll) {
|
||||||
this.santeIncDec("fatigue", 2);
|
|
||||||
|
|
||||||
if (meditationRoll.rolled.isSuccess) {
|
if (meditationRoll.rolled.isSuccess) {
|
||||||
await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]);
|
await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]);
|
||||||
}
|
}
|
||||||
|
if (meditationRoll.rolled.isEPart){
|
||||||
await RdDResolutionTable.displayRollData(meditationRoll, this.name, 'chat-resultat-meditation.html');
|
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) {
|
_getSignesDraconiques(coord) {
|
||||||
const type = TMRUtility.getTMRType(coord);
|
const type = TMRUtility.getTMRType(coord);
|
||||||
@ -2113,7 +2174,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
const dialog = await RdDRoll.create(this, rollData,
|
const dialog = await RdDRoll.create(this, rollData,
|
||||||
{
|
{
|
||||||
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-signedraconique.html',
|
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-signedraconique.hbs',
|
||||||
close: async html => await this._onCloseRollDialog(html)
|
close: async html => await this._onCloseRollDialog(html)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2148,7 +2209,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXp, toXp, `${rollData.competence.name} : signe draconique`);
|
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXp, toXp, `${rollData.competence.name} : signe draconique`);
|
||||||
}
|
}
|
||||||
await this.deleteEmbeddedDocuments("Item", [rollData.signe._id]);
|
await this.deleteEmbeddedDocuments("Item", [rollData.signe._id]);
|
||||||
await RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-lecture-signedraconique.html');
|
await RdDRollResult.displayRollData(rollData, this.name, 'chat-resultat-lecture-signedraconique.hbs');
|
||||||
this.tmrApp.close();
|
this.tmrApp.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2157,15 +2218,15 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: 'appelChance',
|
name: 'appelChance',
|
||||||
label: 'Appel à la chance',
|
label: 'Appel à la chance',
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.hbs',
|
||||||
rollData: { selectedCarac: this.getCaracByName('chance-actuelle'), surprise: '' },
|
rollData: { selectedCarac: this.getCaracByName('chance-actuelle'), surprise: '' },
|
||||||
callbackAction: r => this._appelChanceResult(r, onSuccess, onEchec)
|
callbacks: [{ action: r => this.$appelChanceResult(r, onSuccess, onEchec) }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _appelChanceResult(rollData, onSuccess, onEchec) {
|
async $appelChanceResult(rollData, onSuccess, onEchec) {
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-appelchance.html')
|
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-appelchance.hbs')
|
||||||
if (rollData.rolled.isSuccess) {
|
if (rollData.rolled.isSuccess) {
|
||||||
await this.setFlag(SYSTEM_RDD, 'utilisationChance', true);
|
await this.setFlag(SYSTEM_RDD, 'utilisationChance', true);
|
||||||
await this.chanceActuelleIncDec(-1);
|
await this.chanceActuelleIncDec(-1);
|
||||||
@ -2457,7 +2518,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const blessure = this.getItem(blessureId, 'blessure')
|
const blessure = this.getItem(blessureId, 'blessure')
|
||||||
console.log('TODO update blessure', this, blessureId, rollData, rollData.tache);
|
|
||||||
if (blessure && !blessure.system.premierssoins.done) {
|
if (blessure && !blessure.system.premierssoins.done) {
|
||||||
const tache = rollData.tache;
|
const tache = rollData.tache;
|
||||||
if (rollData.rolled.isETotal) {
|
if (rollData.rolled.isETotal) {
|
||||||
@ -2574,12 +2634,13 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async incDecItemUse(itemId, inc = 1) {
|
async incDecItemUse(itemId, shouldIncrease = true) {
|
||||||
const currentItemUse = this.getFlag(SYSTEM_RDD, 'itemUse');
|
if (shouldIncrease) {
|
||||||
let itemUse = currentItemUse ? foundry.utils.duplicate(currentItemUse) : {};
|
const currentItemUse = this.getFlag(SYSTEM_RDD, 'itemUse');
|
||||||
itemUse[itemId] = (itemUse[itemId] ?? 0) + inc;
|
let itemUse = currentItemUse ? foundry.utils.duplicate(currentItemUse) : {};
|
||||||
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
itemUse[itemId] = (itemUse[itemId] ?? 0) + 1;
|
||||||
console.log("ITEM USE INC", inc, itemUse);
|
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -2618,7 +2679,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
rollData.competence.system.defaut_carac = caracTache;
|
rollData.competence.system.defaut_carac = caracTache;
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, rollData,
|
const dialog = await RdDRoll.create(this, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.hbs' },
|
||||||
{
|
{
|
||||||
name: 'tache-alchimique',
|
name: 'tache-alchimique',
|
||||||
label: 'Tache Alchimique',
|
label: 'Tache Alchimique',
|
||||||
@ -2639,7 +2700,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _alchimieResult(rollData) {
|
async _alchimieResult(rollData) {
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-alchimie.html');
|
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-alchimie.hbs');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -2788,25 +2849,25 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async consommerPotionSoin(potionData) {
|
async consommerPotionSoin(potion) {
|
||||||
potionData.alias = this.name;
|
potion.alias = this.name;
|
||||||
potionData.supprimer = true;
|
potion.supprimer = true;
|
||||||
|
|
||||||
if (potionData.system.magique) {
|
if (potion.system.magique) {
|
||||||
// Gestion de la résistance:
|
// Gestion de la résistance:
|
||||||
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
potion.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||||
if (potionData.rolled.isEchec) {
|
if (potion.rolled.isEchec) {
|
||||||
await this.reveActuelIncDec(-1);
|
await this.reveActuelIncDec(-1);
|
||||||
potionData.guerisonData = await this.buildPotionGuerisonList(potionData.system.puissance);
|
potion.guerisonData = await this.buildPotionGuerisonList(potion.system.puissance);
|
||||||
potionData.guerisonMinutes = potionData.guerisonData.pointsConsommes * 5;
|
potion.guerisonMinutes = potion.guerisonData.pointsConsommes * 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!potionData.system.magique || potionData.rolled.isSuccess) {
|
if (!potion.system.magique || potion.rolled.isSuccess) {
|
||||||
await this.setBonusPotionSoin(potionData.system.herbebonus);
|
await this.setBonusPotionSoin(potion.system.herbebonus);
|
||||||
}
|
}
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-soin.html`, potionData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-soin.hbs`, potion)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2815,46 +2876,47 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async consommerPotionRepos(potionData) {
|
async consommerPotionRepos(potion) {
|
||||||
potionData.alias = this.name;
|
potion.alias = this.name;
|
||||||
potionData.supprimer = true;
|
potion.supprimer = true;
|
||||||
|
|
||||||
if (potionData.system.magique) {
|
if (potion.system.magique) {
|
||||||
// Gestion de la résistance:
|
// Gestion de la résistance:
|
||||||
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
potion.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||||
if (potionData.rolled.isEchec) {
|
if (potion.rolled.isEchec) {
|
||||||
await this.reveActuelIncDec(-1);
|
await this.reveActuelIncDec(-1);
|
||||||
let fatigueActuelle = this.getFatigueActuelle();
|
let fatigueActuelle = this.getFatigueActuelle();
|
||||||
potionData.caseFatigueReel = Math.min(fatigueActuelle, potionData.system.puissance);
|
potion.caseFatigueReel = Math.min(fatigueActuelle, potion.system.puissance);
|
||||||
potionData.guerisonDureeUnite = (potionData.system.reposalchimique) ? "rounds" : "minutes";
|
potion.guerisonDureeUnite = (potion.system.reposalchimique) ? "rounds" : "minutes";
|
||||||
potionData.guerisonDureeValue = (potionData.system.reposalchimique) ? potionData.caseFatigueReel : potionData.caseFatigueReel * 5;
|
potion.guerisonDureeValue = (potion.system.reposalchimique) ? potion.caseFatigueReel : potion.caseFatigueReel * 5;
|
||||||
potionData.aphasiePermanente = false;
|
potion.aphasiePermanente = false;
|
||||||
if (potionData.system.reposalchimique) {
|
if (potion.system.reposalchimique) {
|
||||||
let chanceAphasie = await RdDDice.rollTotal("1d100");
|
let chanceAphasie = await RdDDice.rollTotal("1d100");
|
||||||
if (chanceAphasie <= potionData.system.pr) {
|
if (chanceAphasie <= potion.system.pr) {
|
||||||
potionData.aphasiePermanente = true;
|
potion.aphasiePermanente = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.santeIncDec("fatigue", -potionData.caseFatigueReel);
|
await this.santeIncDec("fatigue", -potion.caseFatigueReel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!potionData.system.magique || potionData.rolled.isSuccess) {
|
if (!potion.system.magique || potion.rolled.isSuccess) {
|
||||||
this.bonusRepos = potionData.system.herbebonus;
|
this.bonusRepos = potion.system.herbebonus;
|
||||||
}
|
}
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-repos.html`, potionData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-repos.hbs`, potion)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async fabriquerPotion(herbeData) {
|
async fabriquerPotion(herbeData) {
|
||||||
let newPotion = {
|
const newPotion = {
|
||||||
name: `Potion de ${herbeData.system.categorie} (${herbeData.name})`, type: 'potion',
|
name: `Potion de ${herbeData.system.categorie} (${herbeData.name})`, type: 'potion',
|
||||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/fiole_verre.webp",
|
img: "systems/foundryvtt-reve-de-dragon/icons/objets/fiole_verre.webp",
|
||||||
system: {
|
system: {
|
||||||
quantite: 1, cout: 0, encombrement: 0.1,
|
quantite: 1, cout: 0, encombrement: 0.1,
|
||||||
categorie: herbeData.system.categorie,
|
categorie: herbeData.system.categorie,
|
||||||
|
etat: 'Liquide',
|
||||||
herbe: herbeData.name,
|
herbe: herbeData.name,
|
||||||
rarete: herbeData.system.rarete,
|
rarete: herbeData.system.rarete,
|
||||||
herbebrins: herbeData.nbBrins,
|
herbebrins: herbeData.nbBrins,
|
||||||
@ -2862,61 +2924,52 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
description: ""
|
description: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.createEmbeddedDocuments('Item', [newPotion], { renderSheet: true });
|
await this.createEmbeddedDocuments('Item', [newPotion])
|
||||||
|
await this.diminuerQuantiteObjet(herbeData._id, herbeData.nbBrins)
|
||||||
let newQuantite = herbeData.system.quantite - herbeData.nbBrins;
|
|
||||||
let messageData = {
|
|
||||||
alias: this.getAlias(),
|
|
||||||
nbBrinsReste: newQuantite,
|
|
||||||
potion: newPotion,
|
|
||||||
herbe: herbeData
|
|
||||||
}
|
|
||||||
this.diminuerQuantiteObjet(herbeData._id, herbeData.nbBrins);
|
|
||||||
|
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-fabriquer-potion-base.html`, messageData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-fabriquer-potion-base.hbs`, {
|
||||||
});
|
alias: this.getAlias(),
|
||||||
|
nbBrinsReste: herbeData.system.quantite - herbeData.nbBrins,
|
||||||
|
potion: newPotion,
|
||||||
|
herbe: herbeData
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async diminuerQuantiteObjet(id, nb, options = { supprimerSiZero: false }) {
|
async diminuerQuantiteObjet(id, nb, options = { supprimerSiZero: false }) {
|
||||||
const item = this.getItem(id);
|
await this.getItem(id)?.diminuerQuantite(nb, options);
|
||||||
if (item) {
|
|
||||||
await item.diminuerQuantite(nb, options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async consommerPotionGenerique(potionData) {
|
async consommerPotionGenerique(potion) {
|
||||||
potionData.alias = this.name;
|
potion.alias = this.name;
|
||||||
|
|
||||||
if (potionData.system.magique) {
|
if (potion.system.magique) {
|
||||||
// Gestion de la résistance:
|
// Gestion de la résistance:
|
||||||
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
potion.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||||
if (potionData.rolled.isEchec) {
|
if (potion.rolled.isEchec) {
|
||||||
await this.reveActuelIncDec(-1);
|
await this.reveActuelIncDec(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-generique.html`, potionData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-generique.hbs`, potion)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async consommerPotion(potion, onActionItem = async () => { }) {
|
async consommerPotion(potion) {
|
||||||
const potionData = potion
|
if (potion.system.categorie.includes('Soin')) {
|
||||||
|
this.consommerPotionSoin(potion);
|
||||||
if (potionData.system.categorie.includes('Soin')) {
|
} else if (potion.system.categorie.includes('Repos')) {
|
||||||
this.consommerPotionSoin(potionData);
|
this.consommerPotionRepos(potion);
|
||||||
} else if (potionData.system.categorie.includes('Repos')) {
|
|
||||||
this.consommerPotionRepos(potionData);
|
|
||||||
} else {
|
} else {
|
||||||
this.consommerPotionGenerique(potionData);
|
this.consommerPotionGenerique(potion);
|
||||||
}
|
}
|
||||||
await this.diminuerQuantiteObjet(potion.id, 1, { supprimerSiZero: potionData.supprimer });
|
await this.diminuerQuantiteObjet(potion.id, 1, { supprimerSiZero: potion.supprimer });
|
||||||
await onActionItem()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -26,16 +26,17 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
|
|||||||
// 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('.button-encaissement').click(async event => this.actor.encaisser())
|
this.html.find('.button-encaissement').click(async event => await this.actor.encaisser())
|
||||||
this.html.find('.roll-carac').click(async event => {
|
this.html.find('.roll-carac').click(async event => {
|
||||||
this.actor.rollCarac(Grammar.toLowerCaseNoAccent(event.currentTarget.attributes['data-carac-name'].value))})
|
await this.actor.rollCarac(Grammar.toLowerCaseNoAccent(event.currentTarget.attributes['data-carac-name'].value))
|
||||||
this.html.find('.roll-competence').click(async event => this.actor.rollCompetence(RdDSheetUtility.getItemId(event)));
|
})
|
||||||
this.html.find('.endurance-plus').click(async event => this.actor.santeIncDec("endurance", 1));
|
this.html.find('.roll-competence').click(async event => await this.actor.rollCompetence(RdDSheetUtility.getItemId(event)));
|
||||||
this.html.find('.endurance-moins').click(async event => this.actor.santeIncDec("endurance", -1));
|
this.html.find('.endurance-plus').click(async event => await this.actor.santeIncDec("endurance", 1));
|
||||||
|
this.html.find('.endurance-moins').click(async event => await this.actor.santeIncDec("endurance", -1));
|
||||||
|
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
this.html.find('.button-remise-a-neuf').click(async event => this.actor.remiseANeuf())
|
this.html.find('.button-remise-a-neuf').click(async event => await this.actor.remiseANeuf())
|
||||||
this.html.find('.delete-active-effect').click(async event => this.actor.removeEffect(this.html.find(event.currentTarget).parents(".active-effect").data('effect')));
|
this.html.find('.delete-active-effect').click(async event => await this.actor.removeEffect(this.html.find(event.currentTarget).parents(".active-effect").data('effect')));
|
||||||
this.html.find('.enlever-tous-effets').click(async event => await this.actor.removeEffects());
|
this.html.find('.enlever-tous-effets').click(async event => await this.actor.removeEffects());
|
||||||
}
|
}
|
||||||
this.html.find('.competence-add').click(async event =>
|
this.html.find('.competence-add').click(async event =>
|
||||||
@ -55,14 +56,13 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
|
|||||||
if (this.options.vueDetaillee) {
|
if (this.options.vueDetaillee) {
|
||||||
// On carac change
|
// On carac change
|
||||||
this.html.find('.carac-value').change(async event => {
|
this.html.find('.carac-value').change(async event => {
|
||||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
|
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "")
|
||||||
this.actor.updateCarac(caracName, parseInt(event.target.value));
|
await this.actor.updateCarac(caracName, parseInt(event.target.value))
|
||||||
});
|
});
|
||||||
// On competence change
|
// On competence change
|
||||||
this.html.find('.competence-value').change(async event => {
|
this.html.find('.competence-value').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value
|
||||||
//console.log("Competence changed :", compName);
|
await this.actor.updateCompetence(compName, parseInt(event.target.value))
|
||||||
this.actor.updateCompetence(compName, parseInt(event.target.value));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import { StatusEffects } from "../settings/status-effects.js";
|
|||||||
import { Targets } from "../targets.js";
|
import { Targets } from "../targets.js";
|
||||||
import { RdDConfirm } from "../rdd-confirm.js";
|
import { RdDConfirm } from "../rdd-confirm.js";
|
||||||
import { RdDCarac } from "../rdd-carac.js";
|
import { RdDCarac } from "../rdd-carac.js";
|
||||||
|
import { RdDRollResult } from "../rdd-roll-result.js";
|
||||||
|
|
||||||
import { ChatUtility } from "../chat-utility.js";
|
import { ChatUtility } from "../chat-utility.js";
|
||||||
import { DialogValidationEncaissement } from "../dialog-validation-encaissement.js";
|
import { DialogValidationEncaissement } from "../dialog-validation-encaissement.js";
|
||||||
@ -268,30 +269,17 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async openRollDialog({ name, label, template, rollData, callbackAction }) {
|
async openRollDialog({ name, label, template, rollData, callbacks }) {
|
||||||
const dialog = await RdDRoll.create(this, rollData,
|
const dialog = await RdDRoll.create(this, rollData,
|
||||||
{ html: template, close: async html => await this._onCloseRollDialog(html) },
|
{ html: template, close: async html => await this._onCloseRollDialog(html) },
|
||||||
{
|
{ name: name, label: label, callbacks: [this.createCallbackExperience(), this.createCallbackAppelAuMoral()].concat(callbacks) })
|
||||||
name: name,
|
dialog.render(true)
|
||||||
label: label,
|
|
||||||
callbacks: [
|
|
||||||
this.createCallbackExperience(),
|
|
||||||
this.createCallbackAppelAuMoral(),
|
|
||||||
{ action: callbackAction }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
dialog.render(true);
|
|
||||||
return dialog
|
return dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
createEmptyCallback() {
|
createCallbackExperience() { return { action: r => { } } }
|
||||||
return {
|
createCallbackAppelAuMoral() { return { action: r => { } } }
|
||||||
condition: r => false,
|
|
||||||
action: r => { }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
createCallbackExperience() { return this.createEmptyCallback(); }
|
|
||||||
createCallbackAppelAuMoral() { return this.createEmptyCallback(); }
|
|
||||||
async _onCloseRollDialog(html) { }
|
async _onCloseRollDialog(html) { }
|
||||||
|
|
||||||
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||||
@ -299,8 +287,8 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
const competence = this.getCompetence(compName);
|
const competence = this.getCompetence(compName);
|
||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: 'jet-competence',
|
name: 'jet-competence',
|
||||||
label: competence? 'Jet ' + Grammar.apostrophe('de', competence.name) : `Jet sans compétence (${compName})`,
|
label: competence ? 'Jet ' + Grammar.apostrophe('de', competence.name) : `Jet sans compétence (${compName})`,
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||||
rollData: {
|
rollData: {
|
||||||
alias: this.getAlias(),
|
alias: this.getAlias(),
|
||||||
carac: this.system.carac,
|
carac: this.system.carac,
|
||||||
@ -310,7 +298,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
competence: competence,
|
competence: competence,
|
||||||
show: { title: options?.title ?? '' }
|
show: { title: options?.title ?? '' }
|
||||||
},
|
},
|
||||||
callbackAction: r => this.$onRollCompetence(r, options)
|
callbacks: [async r => this.$onRollCompetence(r, options)]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -353,16 +341,14 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
const selectedCaracName = ['apparence', 'perception', 'force', 'reve'].find(it => carac[it] != undefined)
|
const selectedCaracName = ['apparence', 'perception', 'force', 'reve'].find(it => carac[it] != undefined)
|
||||||
|
|
||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: `jet-${this.id}`,
|
|
||||||
label: `Jet de ${this.getAlias()}`,
|
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.html',
|
|
||||||
rollData: {
|
rollData: {
|
||||||
|
alias: this.getAlias(),
|
||||||
carac: carac,
|
carac: carac,
|
||||||
selectedCarac: carac[selectedCaracName],
|
selectedCarac: carac[selectedCaracName],
|
||||||
selectedCaracName: selectedCaracName,
|
selectedCaracName: selectedCaracName,
|
||||||
competences: this.itemTypes['competence']
|
competences: this.itemTypes['competence']
|
||||||
},
|
},
|
||||||
callbackAction: r => this.$onRollCaracResult(r)
|
callbacks: [{ action: r => this.$onRollCaracResult(r) }]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -373,32 +359,38 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
foundry.utils.mergeObject(options, { resistance: false, diff: 0 }, { overwrite: false })
|
foundry.utils.mergeObject(options, { resistance: false, diff: 0 }, { overwrite: false })
|
||||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||||
let selectedCarac = this.getCaracByName(caracName)
|
let selectedCarac = this.getCaracByName(caracName)
|
||||||
console.log("selectedCarac", selectedCarac)
|
const title = 'Jet ' + Grammar.apostrophe('de', selectedCarac.label);
|
||||||
|
const jetResistance = options.resistance ? caracName : undefined;
|
||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: 'jet-' + caracName,
|
name: 'jet-' + caracName,
|
||||||
label: 'Jet ' + Grammar.apostrophe('de', selectedCarac.label),
|
label: title,
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.hbs',
|
||||||
rollData: {
|
rollData: {
|
||||||
|
alias: this.getAlias(),
|
||||||
selectedCarac: selectedCarac,
|
selectedCarac: selectedCarac,
|
||||||
competences: this.itemTypes['competence'],
|
competences: this.itemTypes['competence'],
|
||||||
diffLibre: options.diff ?? 0,
|
diffLibre: options.diff ?? 0,
|
||||||
jetResistance: options.resistance ? caracName : undefined
|
jetResistance: jetResistance
|
||||||
},
|
},
|
||||||
callbackAction: r => this.$onRollCaracResult(r)
|
callbacks: [{ action: r => this.$onRollCaracResult(r) }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $onRollCaracResult(rollData) {
|
async $onRollCaracResult(rollData) {
|
||||||
// Final chat message
|
// Final chat message
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-general.html');
|
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-general.hbs');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollCompetence(idOrName, options = { tryTarget: true, arme: undefined }) {
|
async rollCompetence(idOrName, options = { tryTarget: true, arme: undefined }) {
|
||||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||||
const competence = this.getCompetence(idOrName);
|
const competence = this.getCompetence(idOrName);
|
||||||
let rollData = { carac: this.system.carac, competence: competence, arme: options.arme }
|
let rollData = {
|
||||||
|
carac: this.system.carac,
|
||||||
|
competence: competence,
|
||||||
|
arme: options.arme
|
||||||
|
}
|
||||||
if (competence.type == ITEM_TYPES.competencecreature) {
|
if (competence.type == ITEM_TYPES.competencecreature) {
|
||||||
const token = RdDUtility.getSelectedToken(this)
|
const token = RdDUtility.getSelectedToken(this)
|
||||||
const arme = RdDItemCompetenceCreature.armeCreature(competence)
|
const arme = RdDItemCompetenceCreature.armeCreature(competence)
|
||||||
@ -416,18 +408,18 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
// Transformer la competence de créature
|
// Transformer la competence de créature
|
||||||
RdDItemCompetenceCreature.setRollDataCreature(rollData)
|
RdDItemCompetenceCreature.setRollDataCreature(rollData)
|
||||||
}
|
}
|
||||||
|
const dialogLabel = 'Jet ' + Grammar.apostrophe('de', competence.name);
|
||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: 'jet-competence',
|
name: 'jet-competence',
|
||||||
label: 'Jet ' + Grammar.apostrophe('de', competence.name),
|
label: dialogLabel,
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||||
rollData: rollData,
|
rollData: rollData,
|
||||||
callbackAction: r => this.$onRollCompetence(r, options)
|
callbacks: [{ action: r => this.$onRollCompetence(r, options) }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async $onRollCompetence(rollData, options) {
|
async $onRollCompetence(rollData, options) {
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-competence.html')
|
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-competence.hbs')
|
||||||
if (options?.onRollAutomate) {
|
if (options?.onRollAutomate) {
|
||||||
options.onRollAutomate(rollData);
|
options.onRollAutomate(rollData);
|
||||||
}
|
}
|
||||||
@ -527,7 +519,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
await ChatUtility.createChatWithRollMode(
|
await ChatUtility.createChatWithRollMode(
|
||||||
{
|
{
|
||||||
roll: encaissement.roll,
|
roll: encaissement.roll,
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.hbs', encaissement)
|
||||||
},
|
},
|
||||||
this
|
this
|
||||||
)
|
)
|
||||||
@ -537,7 +529,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
encaissement.isGM = true
|
encaissement.isGM = true
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getGMs(),
|
whisper: ChatUtility.getGMs(),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.hbs', encaissement)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -562,10 +554,8 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
await entite.setEntiteReveAccordee(this);
|
await entite.setEntiteReveAccordee(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-accorder-cauchemar.html');
|
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-accorder-cauchemar.hbs');
|
||||||
if (rolled.isPart) {
|
await this.appliquerAjoutExperience(rollData, true);
|
||||||
await this.appliquerAjoutExperience(rollData, true);
|
|
||||||
}
|
|
||||||
return rolled.isSuccess;
|
return rolled.isSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,20 +17,20 @@ export class RdDBaseActorSangSheet extends RdDBaseActorReveSheet {
|
|||||||
// 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('.creer-blessure-legere').click(async event => RdDItemBlessure.createBlessure(this.actor, 2));
|
this.html.find('.creer-blessure-legere').click(async event => await RdDItemBlessure.createBlessure(this.actor, 2));
|
||||||
this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4));
|
this.html.find('.creer-blessure-grave').click(async event => await RdDItemBlessure.createBlessure(this.actor, 4));
|
||||||
this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6));
|
this.html.find('.creer-blessure-critique').click(async event => await RdDItemBlessure.createBlessure(this.actor, 6));
|
||||||
|
|
||||||
this.html.find('.subir-blessure-contusion').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 0));
|
this.html.find('.subir-blessure-contusion').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 0));
|
||||||
this.html.find('.subir-blessure-legere').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 2));
|
this.html.find('.subir-blessure-legere').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 2));
|
||||||
this.html.find('.subir-blessure-grave').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 4));
|
this.html.find('.subir-blessure-grave').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 4));
|
||||||
this.html.find('.subir-blessure-critique').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 6));
|
this.html.find('.subir-blessure-critique').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 6));
|
||||||
|
|
||||||
this.html.find('.jet-vie').click(async event => this.actor.jetDeVie())
|
this.html.find('.jet-vie').click(async event => await this.actor.jetDeVie())
|
||||||
this.html.find('.jet-endurance').click(async event => await this.jetEndurance())
|
this.html.find('.jet-endurance').click(async event => await this.jetEndurance())
|
||||||
|
|
||||||
this.html.find('.vie-plus').click(async event => this.actor.santeIncDec("vie", 1))
|
this.html.find('.vie-plus').click(async event => await this.actor.santeIncDec("vie", 1))
|
||||||
this.html.find('.vie-moins').click(async event => this.actor.santeIncDec("vie", -1))
|
this.html.find('.vie-moins').click(async event => await this.actor.santeIncDec("vie", -1))
|
||||||
}
|
}
|
||||||
|
|
||||||
async jetEndurance() {
|
async jetEndurance() {
|
||||||
|
@ -39,7 +39,12 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFatigueRestante() { return this.getFatigueMax() - this.getFatigueActuelle() }
|
isCumulFatigueCauseSommeil(cumulFatigue){
|
||||||
|
return ReglesOptionnelles.isUsing("appliquer-fatigue")
|
||||||
|
? (this.getFatigueRestante() <= cumulFatigue)
|
||||||
|
: (this.getEnduranceActuelle() <= cumulFatigue)
|
||||||
|
}
|
||||||
|
getFatigueRestante() {return this.getFatigueMax() - this.getFatigueActuelle() }
|
||||||
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
|
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
|
||||||
|
|
||||||
malusFatigue() {
|
malusFatigue() {
|
||||||
|
@ -85,14 +85,14 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
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('.actionItem').click(async event => await ItemAction.onActionItem(event, this.actor, this.options))
|
||||||
this.html.find('.item-edit').click(async event => this.itemActionEdit(event))
|
this.html.find('.item-edit').click(async event => await 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 => await this.actor.postActorToChat());
|
||||||
|
|
||||||
this.html.find('.recherche')
|
this.html.find('.recherche')
|
||||||
.each((index, field) => {
|
.each((index, field) => {
|
||||||
@ -106,22 +106,17 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
// 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-equip-armure').click(async event => this.actor.equiperObjet(this.getItem(event)))
|
this.html.find('.item-equip-armure').click(async event => await this.actor.equiperObjet(this.getItem(event)))
|
||||||
this.html.find('.item-delete').click(async event => RdDUtility.confirmActorItemDelete(this.getItem(event), this.actor));
|
this.html.find('.item-delete').click(async event => await RdDUtility.confirmActorItemDelete(this.getItem(event), this.actor));
|
||||||
this.html.find('.item-split').click(async event => RdDSheetUtility.splitItem(this.getItem(event), this.actor))
|
this.html.find('.item-quantite-plus').click(async event => await 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 => await 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('.creer-un-objet').click(async event => {
|
this.html.find('.creer-un-objet').click(async event => await this.selectObjetTypeToCreate())
|
||||||
this.selectObjetTypeToCreate();
|
this.html.find('.nettoyer-conteneurs').click(async event => await this.actor.nettoyerConteneurs())
|
||||||
});
|
|
||||||
this.html.find('.nettoyer-conteneurs').click(async event => {
|
|
||||||
this.actor.nettoyerConteneurs();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.html.find('.vue-detaillee').click(async event => {
|
this.html.find('.vue-detaillee').click(async event => {
|
||||||
this.options.vueDetaillee = !this.options.vueDetaillee;
|
this.options.vueDetaillee = !this.options.vueDetaillee
|
||||||
this.render(true);
|
this.render(true)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,16 +244,19 @@ export class RdDBaseActor extends Actor {
|
|||||||
async onUpdateActor(update, options, actorId) { }
|
async onUpdateActor(update, options, actorId) { }
|
||||||
async onDeleteItem(item, options, id) {
|
async onDeleteItem(item, options, id) {
|
||||||
if (item.isInventaire()) {
|
if (item.isInventaire()) {
|
||||||
this._removeItemFromConteneur(item)
|
await this._removeItemFromConteneur(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_removeItemFromConteneur(item) {
|
async _removeItemFromConteneur(item) {
|
||||||
this.items.filter(it => it.isConteneur() && it.system.contenu.includes(item.id))
|
const updates = this.items.filter(it => it.isConteneur() && it.system.contenu.includes(item.id))
|
||||||
.forEach(conteneur => {
|
.map(conteneur => {
|
||||||
const nouveauContenu = conteneur.system.contenu.filter(id => id != item.id);
|
const nouveauContenu = conteneur.system.contenu.filter(id => id != item.id)
|
||||||
conteneur.update({ 'system.contenu': nouveauContenu });
|
return { _id: conteneur.id, 'system.contenu': nouveauContenu }
|
||||||
});
|
})
|
||||||
|
if (updates.length > 0) {
|
||||||
|
await this.updateEmbeddedDocuments('Item', updates)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async onTimeChanging(oldTimestamp, newTimestamp) {
|
async onTimeChanging(oldTimestamp, newTimestamp) {
|
||||||
@ -414,7 +417,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
user: achat.userId,
|
user: achat.userId,
|
||||||
speaker: { alias: (acheteur ?? vendeur).getAlias() },
|
speaker: { alias: (acheteur ?? vendeur).getAlias() },
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', chatAchatItem)
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.hbs', chatAchatItem)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!achat.vente.quantiteIllimite) {
|
if (!achat.vente.quantiteIllimite) {
|
||||||
@ -731,7 +734,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
name: this.getAlias(),
|
name: this.getAlias(),
|
||||||
system: { description: this.system.description }
|
system: { description: this.system.description }
|
||||||
}
|
}
|
||||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.html', chatData)
|
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData)
|
||||||
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,7 +747,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||||
|
|
||||||
async resetItemUse() { }
|
async resetItemUse() { }
|
||||||
async incDecItemUse(itemId, inc = 1) { }
|
async incDecItemUse(itemId, shouldIncrease = true) { }
|
||||||
getItemUse(itemId) { return 0; }
|
getItemUse(itemId) { return 0; }
|
||||||
|
|
||||||
async finDeRound(options = { terminer: false }) { }
|
async finDeRound(options = { terminer: false }) { }
|
||||||
|
@ -12,7 +12,7 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
|||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-actor-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-actor-sheet.hbs",
|
||||||
width: 600, height: 720,
|
width: 600, height: 720,
|
||||||
tabs: []
|
tabs: []
|
||||||
}, { inplace: false })
|
}, { inplace: false })
|
||||||
|
@ -10,7 +10,7 @@ export class RdDCreatureSheet extends RdDBaseActorSangSheet {
|
|||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(RdDBaseActorSangSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDBaseActorSangSheet.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.hbs",
|
||||||
width: 640, height: 720
|
width: 640, height: 720
|
||||||
}, { inplace: false })
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
@ -26,15 +26,15 @@ export class RdDCreatureSheet extends RdDBaseActorSangSheet {
|
|||||||
// On competence change
|
// On competence change
|
||||||
this.html.find('.creature-carac').change(async event => {
|
this.html.find('.creature-carac').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value;
|
||||||
this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
await this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
||||||
});
|
});
|
||||||
this.html.find('.creature-niveau').change(async event => {
|
this.html.find('.creature-niveau').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value;
|
||||||
this.actor.updateCreatureCompetence(compName, "niveau", parseInt(event.target.value));
|
await this.actor.updateCreatureCompetence(compName, "niveau", parseInt(event.target.value));
|
||||||
});
|
});
|
||||||
this.html.find('.creature-dommages').change(async event => {
|
this.html.find('.creature-dommages').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value;
|
||||||
this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
await this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ export class RdDActorEntiteSheet extends RdDBaseActorReveSheet {
|
|||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.hbs",
|
||||||
width: 640, height: 720,
|
width: 640, height: 720,
|
||||||
}, { inplace: false })
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
@ -33,15 +33,15 @@ export class RdDActorEntiteSheet extends RdDBaseActorReveSheet {
|
|||||||
// On competence change
|
// On competence change
|
||||||
this.html.find('.creature-carac').change(async event => {
|
this.html.find('.creature-carac').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value;
|
||||||
this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
await this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
||||||
});
|
});
|
||||||
this.html.find('.creature-dommages').change(async event => {
|
this.html.find('.creature-dommages').change(async event => {
|
||||||
let compName = event.currentTarget.attributes.compname.value;
|
let compName = event.currentTarget.attributes.compname.value;
|
||||||
this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
await this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
||||||
})
|
})
|
||||||
|
|
||||||
this.html.find('.resonance-add').click(async event =>
|
this.html.find('.resonance-add').click(async event =>
|
||||||
DialogSelect.select({
|
await DialogSelect.select({
|
||||||
label: "Choisir un acteur à accorder",
|
label: "Choisir un acteur à accorder",
|
||||||
list: game.actors.filter(it => it.isPersonnage() && it.prototypeToken.actorLink)
|
list: game.actors.filter(it => it.isPersonnage() && it.prototypeToken.actorLink)
|
||||||
},
|
},
|
||||||
|
@ -104,13 +104,12 @@ export class RdDActorExportSheet extends RdDActorSheet {
|
|||||||
this.html.find('.click-blessure-add').click(async event =>
|
this.html.find('.click-blessure-add').click(async event =>
|
||||||
await this.actor.ajouterBlessure({
|
await this.actor.ajouterBlessure({
|
||||||
gravite: this.html.find(event.currentTarget).data('gravite')
|
gravite: this.html.find(event.currentTarget).data('gravite')
|
||||||
// event.currentTarget.attributes['data-gravite'].value
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
this.html.find('.button-export').click(async event => {
|
this.html.find('.button-export').click(async event => await
|
||||||
ExportScriptarium.INSTANCE.exportActors([this.actor],
|
ExportScriptarium.INSTANCE.exportActors([this.actor],
|
||||||
`${this.actor.uuid}-${this.actor.name}`
|
`${this.actor.uuid}-${this.actor.name}`
|
||||||
)
|
)
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ export class RdDActorVehiculeSheet extends RdDBaseActorSheet {
|
|||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(RdDBaseActorSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDBaseActorSheet.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.hbs",
|
||||||
width: 640, height: 720,
|
width: 640, height: 720,
|
||||||
}, { inplace: false })
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
@ -32,18 +32,10 @@ export class RdDActorVehiculeSheet extends RdDBaseActorSheet {
|
|||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
this.html.find('.resistance-moins').click(async event => {
|
this.html.find('.resistance-moins').click(async event => await this.actor.vehicleIncDec("resistance", -1))
|
||||||
this.actor.vehicleIncDec("resistance", -1);
|
this.html.find('.resistance-plus').click(async event => await this.actor.vehicleIncDec("resistance", 1))
|
||||||
});
|
this.html.find('.structure-moins').click(async event => await this.actor.vehicleIncDec("structure", -1))
|
||||||
this.html.find('.resistance-plus').click(async event => {
|
this.html.find('.structure-plus').click(async event => await this.actor.vehicleIncDec("structure", 1))
|
||||||
this.actor.vehicleIncDec("resistance", 1);
|
|
||||||
});
|
|
||||||
this.html.find('.structure-moins').click(async event => {
|
|
||||||
this.actor.vehicleIncDec("structure", -1);
|
|
||||||
});
|
|
||||||
this.html.find('.structure-plus').click(async event => {
|
|
||||||
this.actor.vehicleIncDec("structure", 1);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import { RdDUtility } from "../../rdd-utility.js";
|
|||||||
import { RdDAlchimie } from "../../rdd-alchimie.js";
|
import { RdDAlchimie } from "../../rdd-alchimie.js";
|
||||||
import { TextRollManager } from "./text-roll-formatter.js";
|
import { TextRollManager } from "./text-roll-formatter.js";
|
||||||
|
|
||||||
const REGEX_ALCHIMIE_TERMES = "(?<termes>(\\w|-)+)"
|
const REGEX_ALCHIMIE_TERMES = "(?<termes>([-A-Za-zÀ-ÖØ-öø-ÿ ])+)"
|
||||||
const REGEX_ALCHIMIE_MANIP = "(?<manip>(couleur|consistance))"
|
const REGEX_ALCHIMIE_MANIP = "(?<manip>(couleur|consistance))"
|
||||||
const XREGEXP_ROLL_ALCHIMIE = XRegExp("@roll\\[" + REGEX_ALCHIMIE_MANIP + "\\s+" + REGEX_ALCHIMIE_TERMES + "\\]", 'giu')
|
const XREGEXP_ROLL_ALCHIMIE = XRegExp("@roll\\[" + REGEX_ALCHIMIE_MANIP + "\\s+" + REGEX_ALCHIMIE_TERMES + "\\]", 'giu')
|
||||||
const XREGEXP_ROLL_ALCHIMIE_MANIP = XRegExp("@" + REGEX_ALCHIMIE_MANIP + "\\{" + REGEX_ALCHIMIE_TERMES + "\\}", 'giu')
|
const XREGEXP_ROLL_ALCHIMIE_MANIP = XRegExp("@" + REGEX_ALCHIMIE_MANIP + "\\{" + REGEX_ALCHIMIE_TERMES + "\\}", 'giu')
|
||||||
|
@ -5,7 +5,7 @@ import { RdDUtility } from "../../rdd-utility.js";
|
|||||||
import { TextRollManager } from "./text-roll-formatter.js";
|
import { TextRollManager } from "./text-roll-formatter.js";
|
||||||
|
|
||||||
const REGECP_CARAC = "(?<carac>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)"
|
const REGECP_CARAC = "(?<carac>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)"
|
||||||
const REGEXP_COMP = "(\\/(?<competence>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+))?"
|
const REGEXP_COMP = "(\\/(?<competence>[A-Za-zÀ-ÖØ-öø-ÿ ]+([1-2]?[A-Za-zÀ-ÖØ-öø-ÿ ]+)?))?"
|
||||||
const REGEXP_DIFF = "(/(?<diff>[\\+\\-]?\\d+(d\\d+)?))?"
|
const REGEXP_DIFF = "(/(?<diff>[\\+\\-]?\\d+(d\\d+)?))?"
|
||||||
const REGEXP_ROLL_CARAC_COMP = REGECP_CARAC + REGEXP_COMP + REGEXP_DIFF
|
const REGEXP_ROLL_CARAC_COMP = REGECP_CARAC + REGEXP_COMP + REGEXP_DIFF
|
||||||
const XREGEXP_ROLL_CARAC_COMP = XRegExp("@roll\\[" + REGEXP_ROLL_CARAC_COMP + "\\]", 'giu')
|
const XREGEXP_ROLL_CARAC_COMP = XRegExp("@roll\\[" + REGEXP_ROLL_CARAC_COMP + "\\]", 'giu')
|
||||||
|
@ -62,7 +62,6 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
static removeMessages(socketData) {
|
static removeMessages(socketData) {
|
||||||
if (Misc.isFirstConnectedGM()) {
|
if (Misc.isFirstConnectedGM()) {
|
||||||
ChatUtility.onRemoveMessages(socketData);
|
ChatUtility.onRemoveMessages(socketData);
|
||||||
@ -97,7 +96,7 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case "gmroll":
|
case "gmroll":
|
||||||
messageData.whisper = ChatUtility.getOwners(actor)
|
messageData.whisper = actor ? ChatUtility.getOwners(actor) : ChatUtility.getUserAndGMs()
|
||||||
break
|
break
|
||||||
case "selfroll":
|
case "selfroll":
|
||||||
messageData.whisper = [game.user]
|
messageData.whisper = [game.user]
|
||||||
@ -108,7 +107,7 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getOwners(document) {
|
static getOwners(document) {
|
||||||
return game.users.filter(it => document.getUserLevel(it) == CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)
|
return document ? game.users.filter(it => document.getUserLevel(it) == CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER) : [game.user]
|
||||||
}
|
}
|
||||||
|
|
||||||
static getUserAndGMs() {
|
static getUserAndGMs() {
|
||||||
@ -199,7 +198,7 @@ export class ChatUtility {
|
|||||||
static async onCreateChatMessage(chatMessage, options, id) {
|
static async onCreateChatMessage(chatMessage, options, id) {
|
||||||
if (chatMessage.isAuthor) {
|
if (chatMessage.isAuthor) {
|
||||||
await chatMessage.setFlag(SYSTEM_RDD, 'rdd-timestamp', game.system.rdd.calendrier.getTimestamp());
|
await chatMessage.setFlag(SYSTEM_RDD, 'rdd-timestamp', game.system.rdd.calendrier.getTimestamp());
|
||||||
await chatMessage.update({ content: await RdDTextEditor.enrichHTML(chatMessage.content, undefined, {showLink:false}) })
|
await chatMessage.update({ content: await RdDTextEditor.enrichHTML(chatMessage.content, undefined, { showLink: false }) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ export class DialogChoixXpCarac extends Dialog {
|
|||||||
dialogData = foundry.utils.mergeObject(dialogData, {
|
dialogData = foundry.utils.mergeObject(dialogData, {
|
||||||
default: 'appliquer',
|
default: 'appliquer',
|
||||||
buttons: {
|
buttons: {
|
||||||
'appliquer': { icon:'<i class="fa-solid fa-check"></i>', label: "Ajouter la répartition", callback: it => this.appliquerSelection() }
|
'appliquer': { icon: '<i class="fa-solid fa-check"></i>', label: "Ajouter la répartition", callback: it => this.appliquerSelection() }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
super(dialogData, dialogOptions)
|
super(dialogData, dialogOptions)
|
||||||
@ -37,18 +37,13 @@ export class DialogChoixXpCarac extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
//TODO
|
|
||||||
super.activateListeners(html)
|
super.activateListeners(html)
|
||||||
this.html = html
|
this.html = html
|
||||||
this.html.find("li.xpCarac-option .xpCarac-moins").click(event =>
|
this.html.find("li.xpCarac-option .xpCarac-moins").click(event => this.ajouterXp(event, -1))
|
||||||
this.ajouterXp(event, -1)
|
this.html.find("li.xpCarac-option .xpCarac-plus").click(event => this.ajouterXp(event, 1))
|
||||||
)
|
|
||||||
this.html.find("li.xpCarac-option .xpCarac-plus").click(event =>
|
|
||||||
this.ajouterXp(event, 1)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async ajouterXp(event, delta) {
|
ajouterXp(event, delta) {
|
||||||
const liCarac = this.html.find(event.currentTarget)?.parents("li.xpCarac-option")
|
const liCarac = this.html.find(event.currentTarget)?.parents("li.xpCarac-option")
|
||||||
const label = liCarac?.data("carac-label")
|
const label = liCarac?.data("carac-label")
|
||||||
const carac = this.caracs.find(c => c.label == label)
|
const carac = this.caracs.find(c => c.label == label)
|
||||||
|
@ -27,7 +27,7 @@ export class DialogChronologie extends Dialog {
|
|||||||
timestamp: game.system.rdd.calendrier.timestamp,
|
timestamp: game.system.rdd.calendrier.timestamp,
|
||||||
dateReel: game.system.rdd.calendrier.dateReel()
|
dateReel: game.system.rdd.calendrier.dateReel()
|
||||||
};
|
};
|
||||||
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-chronologie.html", dialogData);
|
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-chronologie.hbs", dialogData);
|
||||||
const dialog = new DialogChronologie(html, dialogData);
|
const dialog = new DialogChronologie(html, dialogData);
|
||||||
dialog.render(true);
|
dialog.render(true);
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ export class DialogChronologie extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async prepareChronologieEntry(journalParameters) {
|
async prepareChronologieEntry(journalParameters) {
|
||||||
return await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chronologie-entry.html", journalParameters);
|
return await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chronologie-entry.hbs", journalParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
extractJournalParameters() {
|
extractJournalParameters() {
|
||||||
|
@ -18,7 +18,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
|||||||
}))
|
}))
|
||||||
};
|
};
|
||||||
|
|
||||||
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-create-signedraconique.html", dialogData);
|
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-create-signedraconique.hbs", dialogData);
|
||||||
new DialogCreateSigneDraconique(dialogData, html)
|
new DialogCreateSigneDraconique(dialogData, html)
|
||||||
.render(true);
|
.render(true);
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
|||||||
actor.createEmbeddedDocuments("Item", [signe]);
|
actor.createEmbeddedDocuments("Item", [signe]);
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(actor),
|
whisper: ChatUtility.getOwners(actor),
|
||||||
content: await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.html", {
|
content: await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.hbs", {
|
||||||
signe: signe,
|
signe: signe,
|
||||||
alias: actor.getAlias()
|
alias: actor.getAlias()
|
||||||
})
|
})
|
||||||
|
@ -1,88 +1,79 @@
|
|||||||
import { Grammar } from "./grammar.js";
|
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDUtility } from "./rdd-utility.js";
|
import { RdDUtility } from "./rdd-utility.js";
|
||||||
|
|
||||||
export class DialogFabriquerPotion extends Dialog {
|
export class DialogFabriquerPotion extends Dialog {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async create(actor, item, onActionItem) {
|
static async create(actor, item) {
|
||||||
const min = DialogFabriquerPotion.nombreBrinsMinimum(item);
|
const brinsMinimum = DialogFabriquerPotion.nombreBrinsMinimum(item)
|
||||||
if (item.system.quantite < min) {
|
if (item.system.quantite < brinsMinimum) {
|
||||||
ui.notifications.warn(`Vous avez ${item.system.quantite} brins de ${item.name}, il en faut au moins ${min} pour faire une potion!`);
|
ui.notifications.warn(`Vous avez ${item.system.quantite} brins de ${item.name}, il en faut au moins ${brinsMinimum} pour faire une potion!`)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
let potionData = DialogFabriquerPotion.prepareData(actor, item);
|
const potionData = DialogFabriquerPotion.prepareData(item, brinsMinimum)
|
||||||
|
const options = { classes: ["dialogfabriquerpotion"], width: 600, height: 160, 'z-index': 99999 }
|
||||||
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-fabriquer-potion-base.hbs', potionData)
|
||||||
|
|
||||||
const html = await renderTemplate( 'systems/foundryvtt-reve-de-dragon/templates/dialog-fabriquer-potion-base.html', potionData);
|
new DialogFabriquerPotion(actor, potionData, html, options).render(true)
|
||||||
|
|
||||||
let options = { classes: ["dialogfabriquerpotion"], width: 600, height: 160, 'z-index': 99999 };
|
|
||||||
new DialogFabriquerPotion(actor, potionData, onActionItem, html, options).render(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static prepareData(actor, item) {
|
static prepareData(item, brinsMinimum) {
|
||||||
let potionData = foundry.utils.duplicate(item)
|
const brinsOptimal = DialogFabriquerPotion.nombreBrinsOptimal(item)
|
||||||
potionData.nbBrinsSelect = RdDUtility.buildListOptions(
|
return foundry.utils.mergeObject(foundry.utils.duplicate(item), {
|
||||||
DialogFabriquerPotion.nombreBrinsMinimum(item),
|
nbBrinsSelect: RdDUtility.buildListOptions(brinsMinimum, brinsOptimal),
|
||||||
DialogFabriquerPotion.nombreBrinsOptimal(item));
|
nbBrins: Math.min(item.system.quantite, brinsOptimal),
|
||||||
potionData.nbBrins = Math.min(potionData.system.quantite, DialogFabriquerPotion.nombreBrinsOptimal(potionData));
|
herbebonus: item.system.niveau
|
||||||
potionData.herbebonus = item.system.niveau;
|
})
|
||||||
potionData.buttonName = "Fabriquer";
|
|
||||||
return potionData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
constructor(actor, potionData, onActionItem, html, options) {
|
constructor(actor, potionData, html, options) {
|
||||||
const conf = {
|
const conf = {
|
||||||
title: `Fabriquer une potion de ${potionData.system.categorie}`,
|
title: `Fabriquer une potion de ${potionData.system.categorie}`,
|
||||||
content: html,
|
content: html,
|
||||||
default: 'fabriquer',
|
default: 'fabriquer',
|
||||||
buttons: {
|
buttons: {
|
||||||
'fabriquer': {
|
'fabriquer': { label: "Fabriquer", callback: it => this.onFabriquer() }
|
||||||
label: potionData.buttonName, callback: it => this.onFabriquer()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
super(conf, options)
|
||||||
|
|
||||||
super(conf, options);
|
this.actor = actor
|
||||||
|
this.potionData = potionData
|
||||||
this.actor = actor;
|
|
||||||
this.potionData = potionData;
|
|
||||||
this.onActionItem = onActionItem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.activateListeners(html);
|
super.activateListeners(html)
|
||||||
this.html = html;
|
this.html = html
|
||||||
this.html.find("[name='nbBrins']").change(event => {
|
this.html.find("[name='nbBrins']").change(event => {
|
||||||
this.potionData.nbBrins = Misc.toInt(event.currentTarget.value);
|
this.potionData.nbBrins = Misc.toInt(event.currentTarget.value)
|
||||||
const brinsManquants = Math.max(0, DialogFabriquerPotion.nombreBrinsOptimal(this.potionData) - this.potionData.nbBrins);
|
const brinsManquants = Math.max(0, DialogFabriquerPotion.nombreBrinsOptimal(this.potionData) - this.potionData.nbBrins)
|
||||||
this.potionData.herbebonus = Math.max(0, this.potionData.system.niveau - brinsManquants)
|
this.potionData.herbebonus = Math.max(0, this.potionData.system.niveau - brinsManquants)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async onFabriquer() {
|
async onFabriquer() {
|
||||||
await this.html.find("[name='nbBrins']").change();
|
await this.html.find("[name='nbBrins']").change()
|
||||||
await this.actor.fabriquerPotion(this.potionData);
|
await this.actor.fabriquerPotion(this.potionData)
|
||||||
this.close();
|
this.close()
|
||||||
await this.onActionItem()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static nombreBrinsMinimum(herbeData) {
|
static nombreBrinsMinimum(herbeData) {
|
||||||
switch (herbeData.system.categorie ?? '') {
|
switch (herbeData.system.categorie ?? '') {
|
||||||
case "Soin": return 1 + Math.max(0, 12 - 2 * herbeData.system.niveau);
|
case "Soin": return 1 + Math.max(0, 12 - 2 * herbeData.system.niveau)
|
||||||
case "Repos": return 1 + Math.max(0, 7 - 2 * herbeData.system.niveau);
|
case "Repos": return 1 + Math.max(0, 7 - 2 * herbeData.system.niveau)
|
||||||
}
|
}
|
||||||
return 1;
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
static nombreBrinsOptimal(herbeData) {
|
static nombreBrinsOptimal(herbeData) {
|
||||||
switch (herbeData.system.categorie ?? '') {
|
switch (herbeData.system.categorie ?? '') {
|
||||||
case "Soin": return 12 - herbeData.system.niveau;
|
case "Soin": return 12 - herbeData.system.niveau
|
||||||
case "Repos": return 7 - herbeData.system.niveau;
|
case "Repos": return 7 - herbeData.system.niveau
|
||||||
}
|
}
|
||||||
return 1;
|
return 1
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,13 +2,13 @@ import { Misc } from "./misc.js";
|
|||||||
|
|
||||||
export class DialogConsommer extends Dialog {
|
export class DialogConsommer extends Dialog {
|
||||||
|
|
||||||
static async create(actor, item, onActionItem = async () => { }) {
|
static async create(actor, item) {
|
||||||
const consommerData = DialogConsommer.prepareData(actor, item);
|
const consommerData = DialogConsommer.prepareData(actor, item);
|
||||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-item-consommer.html', consommerData);
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-item-consommer.hbs', consommerData);
|
||||||
return new DialogConsommer(actor, item, consommerData, html, onActionItem)
|
return new DialogConsommer(actor, item, consommerData, html)
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(actor, item, consommerData, html, onActionItem = async () => { }) {
|
constructor(actor, item, consommerData, html) {
|
||||||
const options = { classes: ["dialogconsommer"], width: 350, height: 'fit-content', 'z-index': 99999 };
|
const options = { classes: ["dialogconsommer"], width: 350, height: 'fit-content', 'z-index': 99999 };
|
||||||
let conf = {
|
let conf = {
|
||||||
title: consommerData.title,
|
title: consommerData.title,
|
||||||
@ -16,10 +16,7 @@ export class DialogConsommer extends Dialog {
|
|||||||
default: consommerData.buttonName,
|
default: consommerData.buttonName,
|
||||||
buttons: {
|
buttons: {
|
||||||
[consommerData.buttonName]: {
|
[consommerData.buttonName]: {
|
||||||
label: consommerData.buttonName, callback: async it => {
|
label: consommerData.buttonName, callback: async it => await this.onConsommer()
|
||||||
await this.onConsommer();
|
|
||||||
await onActionItem();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@ export class DialogSelect extends Dialog {
|
|||||||
static extractIdNameImg(it) { return { id: it.id, name: it.name, img: it.img } }
|
static extractIdNameImg(it) { return { id: it.id, name: it.name, img: it.img } }
|
||||||
|
|
||||||
static async select(selectionData, onSelectChoice) {
|
static async select(selectionData, onSelectChoice) {
|
||||||
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-select.html", selectionData)
|
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-select.hbs", selectionData)
|
||||||
|
|
||||||
const dialogData = {
|
const dialogData = {
|
||||||
title: selectionData.title ?? selectionData.label,
|
title: selectionData.title ?? selectionData.label,
|
||||||
|
@ -7,7 +7,7 @@ export class DialogSplitItem extends Dialog {
|
|||||||
item: item,
|
item: item,
|
||||||
choix: { quantite: 1, max: item.system.quantite - 1 }
|
choix: { quantite: 1, max: item.system.quantite - 1 }
|
||||||
};
|
};
|
||||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-split.html`, splitData);
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-split.hbs`, splitData);
|
||||||
return new DialogSplitItem(item, splitData, html, callback)
|
return new DialogSplitItem(item, splitData, html, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ export class DialogValidationEncaissement extends Dialog {
|
|||||||
|
|
||||||
static async validerEncaissement(actor, rollData, armure, onEncaisser) {
|
static async validerEncaissement(actor, rollData, armure, onEncaisser) {
|
||||||
const encaissement = await RdDUtility.jetEncaissement(actor, rollData, armure, { showDice: HIDE_DICE });
|
const encaissement = await RdDUtility.jetEncaissement(actor, rollData, armure, { showDice: HIDE_DICE });
|
||||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-validation-encaissement.html', {
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-validation-encaissement.hbs', {
|
||||||
actor: actor,
|
actor: actor,
|
||||||
rollData: rollData,
|
rollData: rollData,
|
||||||
encaissement: encaissement
|
encaissement: encaissement
|
||||||
|
177
module/enchantement/dialog-enchanter.js
Normal file
177
module/enchantement/dialog-enchanter.js
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
import { ITEM_TYPES } from "../constants.js"
|
||||||
|
import { RdDItemSort } from "../item-sort.js"
|
||||||
|
import { Misc } from "../misc.js"
|
||||||
|
|
||||||
|
export const ACTION_ITEM_ENCHANTER = {
|
||||||
|
code: 'item-enchanter', label: 'Enchanter', icon: it => 'fa-solid fa-sparkles',
|
||||||
|
filter: it => game.user.isGM || DialogEnchanter.isEnchantable(it),
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
|
action: (item, actor) => DialogEnchanter.enchanter(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DialogEnchanter extends Dialog {
|
||||||
|
|
||||||
|
static isEnchantable(item) {
|
||||||
|
if (!item.isEnchantementPossible) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (game.user.isGM) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (item.system.prpermanent) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!item.parent?.isHautRevant()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return RdDItemSort.lancements(RdDItemSort.findEnchantement(item.parent)) > 0
|
||||||
|
|| RdDItemSort.lancements(RdDItemSort.findPurification(item.parent)) > 0
|
||||||
|
|| RdDItemSort.lancements(RdDItemSort.findPermanence(item.parent)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
static dateEnchantement() {
|
||||||
|
return game.system.rdd.calendrier.getTimestamp().debutJournee().indexDate
|
||||||
|
}
|
||||||
|
|
||||||
|
static async enchanter(item) {
|
||||||
|
const actor = item.parent
|
||||||
|
const sorts = {
|
||||||
|
enchantement: RdDItemSort.findEnchantement(actor),
|
||||||
|
purification: RdDItemSort.findPurification(actor),
|
||||||
|
permanence: RdDItemSort.findPermanence(actor)
|
||||||
|
}
|
||||||
|
const nouveauxpr = (sorts.enchantement?.system.lancements ?? []).map(it => it.reve)
|
||||||
|
const purification = (sorts.purification?.system.lancements ?? []).find(it => true)
|
||||||
|
const permanence = (sorts.permanence?.system.lancements ?? []).find(it => true)
|
||||||
|
|
||||||
|
const enchanter = {
|
||||||
|
type: item.type == ITEM_TYPES.potion ? 'potion' : Misc.typeName('Item', item.type),
|
||||||
|
actor: actor,
|
||||||
|
item: item,
|
||||||
|
reve: item.system.pr,
|
||||||
|
sorts: sorts,
|
||||||
|
nouveauxpr: nouveauxpr,
|
||||||
|
purification: purification != undefined,
|
||||||
|
permanence: permanence != undefined,
|
||||||
|
options: { isGM: game.user.isGM }
|
||||||
|
}
|
||||||
|
if (!item.isEnchantementPossible) {
|
||||||
|
ui.notifications.info("Seuls les liquides et les gemmes sont enchantables")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (item.system.prpermanent) {
|
||||||
|
ui.notifications.info(`La ${enchanter.type} est permanente`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!game.user.isGM) {
|
||||||
|
if (!(actor?.isPersonnage() || actor?.isHautRevant())) {
|
||||||
|
ui.notifications.info(`Seul un haut rêvant peut enchanter une ${enchanter.type}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (item.system.quantite != 1) {
|
||||||
|
ui.notifications.info(`Impossible d'enchanter ${item.system.quantite} ${enchanter.type}s ${item.system.quantite > 1 ? 'en une seule fois' : ''}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!(nouveauxpr.length > 0 || purification || permanence)) {
|
||||||
|
ui.notifications.info("Le haut-rêvant n'a lancé de rituel d'enchantement")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (item.system.magique && item.system.purifie && !purification && !permanence) {
|
||||||
|
ui.notifications.info(`La ${enchanter.type} est déjà enchantée et doit être purifiée`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/enchantement/dialog-enchanter.hbs`, enchanter)
|
||||||
|
const dialog = new DialogEnchanter(enchanter, html)
|
||||||
|
dialog.render(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(enchanter, html) {
|
||||||
|
let options = { classes: ["dialog-enchanter"], width: 400, height: 'fit-content', 'z-index': 99999 }
|
||||||
|
let conf = {
|
||||||
|
title: `Enchanter une ${enchanter.type}`,
|
||||||
|
content: html,
|
||||||
|
default: "enchanter",
|
||||||
|
buttons: {
|
||||||
|
"enchanter": { label: "Enchanter", callback: it => this.onEnchanter() }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
super(conf, options)
|
||||||
|
this.html = html
|
||||||
|
this.enchanter = enchanter
|
||||||
|
this.item = enchanter.item
|
||||||
|
}
|
||||||
|
|
||||||
|
activateListeners(html) {
|
||||||
|
super.activateListeners(html)
|
||||||
|
this.html = html
|
||||||
|
this.html.find("input.enchantement").change(event => this.$onSelectEnchantement(event))
|
||||||
|
this.html.find("input.reve").change(event => this.$onForceReve(event))
|
||||||
|
}
|
||||||
|
|
||||||
|
$onSelectEnchantement(event) {
|
||||||
|
const addReve = $(event.currentTarget).data('reve')
|
||||||
|
this.enchanter.idx = $(event.currentTarget).data('idx')
|
||||||
|
this.enchanter.reve = this.item.system.pr + Number(addReve)
|
||||||
|
this.html.find("input.reve").val(this.enchanter.reve)
|
||||||
|
for (let idx = 0; idx < this.enchanter.nouveauxpr.length; idx++) {
|
||||||
|
if (idx != this.enchanter.idx) {
|
||||||
|
this.html.find(`.enchantement[data-idx='${idx}']`).prop("checked", false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$onForceReve(event) {
|
||||||
|
const newReve = Number(event.currentTarget.value)
|
||||||
|
if (this.enchanter.reve != newReve) {
|
||||||
|
this.enchanter.idx = undefined
|
||||||
|
}
|
||||||
|
this.enchanter.reve = newReve
|
||||||
|
}
|
||||||
|
|
||||||
|
async onEnchanter() {
|
||||||
|
foundry.utils.mergeObject(this.enchanter,
|
||||||
|
{
|
||||||
|
rendrepurifie: this.html.find("input.rendrepurifie").prop("checked"),
|
||||||
|
rendrepermanent: this.html.find("input.rendrepermanent").prop("checked"),
|
||||||
|
addreve: this.enchanter.reve != this.item.system.pr
|
||||||
|
},
|
||||||
|
{ inplace: true })
|
||||||
|
const item = this.enchanter.item
|
||||||
|
const actor = this.enchanter.actor
|
||||||
|
|
||||||
|
if (this.enchanter.reve == 0) {
|
||||||
|
await item.update({
|
||||||
|
'system.pr': 0,
|
||||||
|
'system.magique': false,
|
||||||
|
'system.purifie': false,
|
||||||
|
'system.prpermanent': false,
|
||||||
|
'system.prdate': 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const isPurifiee = this.enchanter.addreve
|
||||||
|
? (this.enchanter.rendrepurifie && (item.item.system.pr == 0 ? true : item.system.purifie))
|
||||||
|
: (this.enchanter.rendrepurifie || item.system.purifie)
|
||||||
|
await item.update({
|
||||||
|
'system.pr': this.enchanter.reve,
|
||||||
|
'system.magique': true,
|
||||||
|
'system.purifie': isPurifiee,
|
||||||
|
'system.prpermanent': item.system.prpermanent || this.enchanter.rendrepermanent,
|
||||||
|
'system.prdate': DialogEnchanter.dateEnchantement()
|
||||||
|
})
|
||||||
|
if (actor) {
|
||||||
|
if (this.enchanter.rendrepurifie) {
|
||||||
|
await RdDItemSort.changeLancementsSort(this.enchanter.sorts.purification, it => it.slice(1));
|
||||||
|
}
|
||||||
|
if (this.enchanter.rendrepermanent) {
|
||||||
|
await RdDItemSort.changeLancementsSort(this.enchanter.sorts.permanence, it => it.slice(1));
|
||||||
|
}
|
||||||
|
if (this.enchanter.addreve && this.enchanter.idx != undefined) {
|
||||||
|
await RdDItemSort.changeLancementsSort(RdDItemSort.findEnchantement(actor), it => it.toSpliced(this.enchanter.idx, 1))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -120,13 +120,13 @@ export class RdDItemArme extends Item {
|
|||||||
|
|
||||||
static defenseArmeParade(armeAttaque, armeParade) {
|
static defenseArmeParade(armeAttaque, armeParade) {
|
||||||
const defCategory = RdDItemArme.getCategorieParade(armeParade)
|
const defCategory = RdDItemArme.getCategorieParade(armeParade)
|
||||||
if (defCategory == 'bouclier') {
|
if (defCategory == 'boucliers') {
|
||||||
return 'norm'
|
return 'norm'
|
||||||
}
|
}
|
||||||
if (armeAttaque.system.competence.toLowerCase().match(/(fléau)/)) {
|
if (armeAttaque?.system?.competence?.toLowerCase().match(/(fléau)/)) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
if (armeParade.system.tir) {
|
if (armeParade.system?.tir) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
const attCategory = RdDItemArme.getCategorieParade(armeAttaque)
|
const attCategory = RdDItemArme.getCategorieParade(armeAttaque)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
import { ITEM_TYPES } from "./constants.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
|
import { Grammar } from "./grammar.js";
|
||||||
import { RdDCombatManager } from "./rdd-combat.js";
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
|
||||||
export const CATEGORIES_COMPETENCES_CREATURES = {
|
export const CATEGORIES_COMPETENCES_CREATURES = {
|
||||||
@ -17,9 +18,11 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static setRollDataCreature(rollData) {
|
static setRollDataCreature(rollData) {
|
||||||
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.system.carac_value } }
|
const code = Grammar.toLowerCaseNoAccentNoSpace(rollData.competence.name);
|
||||||
rollData.competence.system.defaut_carac = "carac_creature"
|
const selectedCarac = { code: code, label: rollData.competence.name, value: rollData.competence.system.carac_value };
|
||||||
rollData.selectedCarac = rollData.carac.carac_creature
|
rollData.carac = { [code]: selectedCarac }
|
||||||
|
rollData.competence.system.defaut_carac = code
|
||||||
|
rollData.selectedCarac = selectedCarac
|
||||||
rollData.arme = RdDItemCompetenceCreature.armeCreature(rollData.competence);
|
rollData.arme = RdDItemCompetenceCreature.armeCreature(rollData.competence);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,20 +32,20 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
if (categorieAttaque != undefined) {
|
if (categorieAttaque != undefined) {
|
||||||
// cloner pour ne pas modifier la compétence
|
// cloner pour ne pas modifier la compétence
|
||||||
return foundry.utils.mergeObject(item, {
|
return foundry.utils.mergeObject(item, {
|
||||||
action: item.isCompetencePossession() ? 'possession' : 'attaque',
|
action: item.isCompetencePossession() ? 'possession' : 'attaque',
|
||||||
system: {
|
system: {
|
||||||
competence: item.name,
|
competence: item.name,
|
||||||
cac: categorieAttaque == "naturelle" ? "naturelle" : "",
|
cac: categorieAttaque == "naturelle" ? "naturelle" : "",
|
||||||
niveau: item.system.niveau,
|
niveau: item.system.niveau,
|
||||||
initiative: RdDCombatManager.calculInitiative(item.system.niveau, item.system.carac_value),
|
initiative: RdDCombatManager.calculInitiative(item.system.niveau, item.system.carac_value),
|
||||||
equipe: true,
|
equipe: true,
|
||||||
resistance: 100,
|
resistance: 100,
|
||||||
dommagesReels: item.system.dommages,
|
dommagesReels: item.system.dommages,
|
||||||
penetration: 0,
|
penetration: 0,
|
||||||
force: 0,
|
force: 0,
|
||||||
rapide: true,
|
rapide: true,
|
||||||
}
|
}
|
||||||
}, { inplace: false, });
|
}, { inplace: false, });
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ 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 { 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";
|
||||||
import { SYSTEM_RDD } from "./constants.js";
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
@ -15,6 +14,7 @@ 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";
|
import { ItemAction } from "./item/item-actions.js";
|
||||||
|
import { RdDItemGemme } from "./item/gemme.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the basic ItemSheet for RdD specific items
|
* Extend the basic ItemSheet for RdD specific items
|
||||||
@ -133,10 +133,6 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
formData.enchantement = await RdDTextEditor.enrichHTML(this.item.system.enchantement, this.item)
|
formData.enchantement = await RdDTextEditor.enrichHTML(this.item.system.enchantement, this.item)
|
||||||
formData.sureffet = await RdDTextEditor.enrichHTML(this.item.system.sureffet, this.item)
|
formData.sureffet = await RdDTextEditor.enrichHTML(this.item.system.sureffet, this.item)
|
||||||
}
|
}
|
||||||
if (this.item.type == ITEM_TYPES.gemme) {
|
|
||||||
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
|
||||||
RdDGemme.calculDataDerivees(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)) {
|
||||||
@ -163,23 +159,19 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
|
|
||||||
HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionnelles.isUsing('afficher-prix-joueurs')
|
HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionnelles.isUsing('afficher-prix-joueurs')
|
||||||
|| game.user.isGM
|
|| game.user.isGM
|
||||||
|| !this.item.isOwned);
|
|| !this.item.isOwned)
|
||||||
HtmlUtility.showControlWhen(this.html.find(".item-magique"), this.item.isMagique());
|
HtmlUtility.showControlWhen(this.html.find(".item-magique"), this.item.isMagique)
|
||||||
|
|
||||||
// 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.form.ondragstart = (event) => this._onDragStart(event);
|
this.form.ondragstart = async event => await this._onDragStart(event)
|
||||||
this.form.ondrop = (event) => this._onDrop(event);
|
this.form.ondrop = async event => await this._onDrop(event)
|
||||||
|
|
||||||
// Select competence categorie
|
// Select competence categorie
|
||||||
this.html.find(".categorie").change(event => this._onSelectCategorie(event));
|
this.html.find(".categorie").change(async event => await this._onSelectCategorie(event))
|
||||||
|
|
||||||
this.html.find('.sheet-competence-xp').change((event) => {
|
this.html.find('.sheet-competence-xp').change(event => RdDUtility.checkThanatosXP(this.item))
|
||||||
if (this.item.isCompetencePersonnage()) {
|
|
||||||
RdDUtility.checkThanatosXP(this.item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.html.find(".item-cout input[name='system.cout']").change(event => {
|
this.html.find(".item-cout input[name='system.cout']").change(event => {
|
||||||
if (this.item.isMonnaie()) {
|
if (this.item.isMonnaie()) {
|
||||||
const value = event.currentTarget.value;
|
const value = event.currentTarget.value;
|
||||||
@ -188,46 +180,41 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.html.find('.delete-bonus-case').click((event) => {
|
this.html.find('.delete-bonus-case').click(async event => await this.supprimerBonusCase(event.currentTarget.attributes['data-deleteCoord'].value))
|
||||||
this.supprimerBonusCase(event.currentTarget.attributes['data-deleteCoord'].value)
|
this.html.find('.creer-tache-livre').click(async event => await this._getEventActor(event).creerTacheDepuisLivre(this.item))
|
||||||
})
|
this.html.find('.creer-potion-base').click(async event => await this._getEventActor(event).fabriquerDecoctionHerbe(this.item))
|
||||||
|
this.html.find('input[name="system.cacher_points_de_tache"]').change(async event =>
|
||||||
this.html.find('.creer-tache-livre').click((event) => this._getEventActor(event).creerTacheDepuisLivre(this.item));
|
await this.item.update({ 'system.cacher_points_de_tache': event.currentTarget.checked })
|
||||||
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('.roll-text').click(async event => await RdDTextEditor.rollText(event, this.actor))
|
this.html.find('.roll-text').click(async event => await RdDTextEditor.rollText(event, this.actor))
|
||||||
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) {
|
||||||
// TODO
|
this.html.find('.actionItem').click(async event => await ItemAction.onActionItem(event, this.actor, this.options))
|
||||||
this.html.find('.actionItem').click(event => ItemAction.onActionItem(event, this.actor, this.options))
|
|
||||||
|
|
||||||
this.html.find('.item-potion-consommer').click(event => this.itemActionConsommer(event))
|
// TODO: utiliser un itemAction?
|
||||||
|
this.html.find('.item-potion-consommer').click(async event => await 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-delete').click(async event => this.itemActionDelete(event));
|
|
||||||
|
|
||||||
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)
|
||||||
this.render();
|
//this.render()
|
||||||
});
|
})
|
||||||
this.html.find('.item-quantite-moins').click(async event => {
|
this.html.find('.item-quantite-moins').click(async event => {
|
||||||
await this.actor.itemQuantiteIncDec(RdDSheetUtility.getItemId(event), -1)
|
await this.actor.itemQuantiteIncDec(RdDSheetUtility.getItemId(event), -1)
|
||||||
this.render();
|
//this.render()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateItemTimestamp = (path, timestamp) => this.item.update({ [path]: foundry.utils.duplicate(timestamp) })
|
const updateItemTimestamp = (path, timestamp) => this.item.update({ [path]: foundry.utils.duplicate(timestamp) })
|
||||||
|
|
||||||
RdDTimestamp.handleTimestampEditor(this.html, 'system.temporel.debut', updateItemTimestamp);
|
RdDTimestamp.handleTimestampEditor(this.html, 'system.temporel.debut', updateItemTimestamp)
|
||||||
RdDTimestamp.handleTimestampEditor(this.html, 'system.temporel.fin', updateItemTimestamp);
|
RdDTimestamp.handleTimestampEditor(this.html, 'system.temporel.fin', updateItemTimestamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
itemActionDelete(event) {
|
async itemActionDelete(event) {
|
||||||
const item = RdDSheetUtility.getItem(event, this.actor)
|
const item = RdDSheetUtility.getItem(event, this.actor)
|
||||||
return RdDUtility.confirmActorItemDelete(item, this.actor)
|
return await RdDUtility.confirmActorItemDelete(item, this.actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
async itemActionConsommer(event) {
|
async itemActionConsommer(event) {
|
||||||
@ -246,12 +233,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_getEventActor(event) {
|
_getEventActor(event) { return game.actors.get(event.currentTarget.attributes['data-actor-id'].value) }
|
||||||
let actorId = event.currentTarget.attributes['data-actor-id'].value;
|
|
||||||
let actor = game.actors.get(actorId);
|
|
||||||
return actor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onSelectCategorie(event) {
|
async _onSelectCategorie(event) {
|
||||||
@ -293,7 +275,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.item.update(formData);
|
return this.item.update(formData)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -326,8 +308,9 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onDragStart(event) {
|
async _onDragStart(event) { }
|
||||||
}
|
async _onDropItem(event, dragData) { }
|
||||||
|
async _onDropActor(event, dragData) { }
|
||||||
|
|
||||||
async _onDrop(event) {
|
async _onDrop(event) {
|
||||||
// Try to extract the dragData
|
// Try to extract the dragData
|
||||||
@ -353,13 +336,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
return JSON.parse(eventData);
|
return JSON.parse(eventData);
|
||||||
}
|
}
|
||||||
} catch (err) { }
|
} catch (err) { }
|
||||||
return undefined;
|
return undefined
|
||||||
}
|
|
||||||
|
|
||||||
async _onDropItem(event, dragData) {
|
|
||||||
}
|
|
||||||
|
|
||||||
async _onDropActor(event, dragData) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,21 @@ export class RdDItemSort extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static addSpaceToNonNumeric(value) {
|
static addSpaceToNonNumeric(value) {
|
||||||
return Number.isNumeric(value) || ['-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes( String(value).charAt[0]) ? value : ' ' + RdDItemSort.toVar(value)
|
return Number.isNumeric(value) || ['-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(String(value).charAt[0]) ? value : ' ' + RdDItemSort.toVar(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
static lancements(sort) { return sort?.system.lancements.length ?? 0 }
|
||||||
|
|
||||||
|
static findEnchantement(actor) { return RdDItemSort.findSort(actor, 'Enchantement', ['Narcos', 'N']) }
|
||||||
|
static findPermanence(actor) { return RdDItemSort.findSort(actor, 'Permanence', ['Narcos', 'N']) }
|
||||||
|
static findPurification(actor) { return RdDItemSort.findSort(actor, 'Purification', ['Narcos', 'N']) }
|
||||||
|
|
||||||
|
static findSort(actor, name, draconics) {
|
||||||
|
return actor.itemTypes[ITEM_TYPES.sort].find(it => Grammar.includesLowerCaseNoAccent(it.name, name)
|
||||||
|
&& (draconics == undefined || draconics.includes(it.system.draconic)))
|
||||||
|
}
|
||||||
|
static async changeLancementsSort(sort, changement) {
|
||||||
|
await sort?.update({ 'system.lancements': changement(sort.system.lancements) });
|
||||||
}
|
}
|
||||||
|
|
||||||
static toVar(value) {
|
static toVar(value) {
|
||||||
@ -42,6 +56,10 @@ export class RdDItemSort extends Item {
|
|||||||
return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie))
|
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) {
|
static getOrdreCode(code) {
|
||||||
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
|
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
|
||||||
}
|
}
|
||||||
@ -78,7 +96,7 @@ export class RdDItemSort extends Item {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isCoutVariable(sort) {
|
static isCoutVariable(sort) {
|
||||||
return sort && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
|
return sort && !Number.isInteger(sort.system.ptreve) && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -151,5 +169,4 @@ export class RdDItemSort extends Item {
|
|||||||
.map(it => it.split(':'))
|
.map(it => it.split(':'))
|
||||||
.map(it => { return { case: it[0], bonus: it[1] } });
|
.map(it => { return { case: it[0], bonus: it[1] } });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -41,9 +41,6 @@ const typesObjetsTemporels = [ITEM_TYPES.blessure, ITEM_TYPES.poison, ITEM_TYPES
|
|||||||
const typesObjetsEquipable = [ITEM_TYPES.arme, ITEM_TYPES.armure, ITEM_TYPES.objet];
|
const typesObjetsEquipable = [ITEM_TYPES.arme, ITEM_TYPES.armure, ITEM_TYPES.objet];
|
||||||
const typesEnvironnement = typesInventaireMateriel;
|
const typesEnvironnement = typesInventaireMateriel;
|
||||||
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
|
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
|
||||||
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
|
|
||||||
densité 3.5 (~2.3 à 4, parfois plus) -- https://www.juwelo.fr/guide-des-pierres/faits-et-chiffres/
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const defaultItemImg = {
|
export const defaultItemImg = {
|
||||||
arme: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_gnome.webp",
|
arme: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_gnome.webp",
|
||||||
@ -85,7 +82,6 @@ export const defaultItemImg = {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class RdDItem extends Item {
|
export class RdDItem extends Item {
|
||||||
|
|
||||||
static get defaultIcon() {
|
static get defaultIcon() {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -184,7 +180,6 @@ export class RdDItem extends Item {
|
|||||||
isCompetenceCreature() { return this.type == ITEM_TYPES.competencecreature }
|
isCompetenceCreature() { return this.type == ITEM_TYPES.competencecreature }
|
||||||
isConteneur() { return this.type == ITEM_TYPES.conteneur; }
|
isConteneur() { return this.type == ITEM_TYPES.conteneur; }
|
||||||
isMonnaie() { return this.type == ITEM_TYPES.monnaie; }
|
isMonnaie() { return this.type == ITEM_TYPES.monnaie; }
|
||||||
isPotion() { return this.type == ITEM_TYPES.potion; }
|
|
||||||
isNourritureBoisson() { return this.type == ITEM_TYPES.nourritureboisson; }
|
isNourritureBoisson() { return this.type == ITEM_TYPES.nourritureboisson; }
|
||||||
isService() { return this.type == ITEM_TYPES.service; }
|
isService() { return this.type == ITEM_TYPES.service; }
|
||||||
|
|
||||||
@ -223,6 +218,12 @@ export class RdDItem extends Item {
|
|||||||
return this.getEnvironnements(milieux).length > 0
|
return this.getEnvironnements(milieux).length > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get nameDisplay() {
|
||||||
|
return this.isMagique ? (this.name + ' <i class="fa-solid fa-sparkles"></i>') : this.name
|
||||||
|
}
|
||||||
|
|
||||||
|
get isEnchantementPossible() { return false }
|
||||||
|
|
||||||
getEnvironnements(milieux = undefined) {
|
getEnvironnements(milieux = undefined) {
|
||||||
const environnements = this.isInventaire() ? this.system.environnement : undefined;
|
const environnements = this.isInventaire() ? this.system.environnement : undefined;
|
||||||
if (milieux == undefined || !environnements) {
|
if (milieux == undefined || !environnements) {
|
||||||
@ -331,7 +332,7 @@ export class RdDItem extends Item {
|
|||||||
return this.type == ITEM_TYPES.objet && Grammar.includesLowerCaseNoAccent(this.name, 'cristal alchimique') && this.system.quantite > 0;
|
return this.type == ITEM_TYPES.objet && Grammar.includesLowerCaseNoAccent(this.name, 'cristal alchimique') && this.system.quantite > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
isMagique() {
|
get isMagique() {
|
||||||
return this.system.magique
|
return this.system.magique
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,6 +343,7 @@ export class RdDItem extends Item {
|
|||||||
isNomLike(texte) {
|
isNomLike(texte) {
|
||||||
return Grammar.includesLowerCaseNoAccent(this.name, texte)
|
return Grammar.includesLowerCaseNoAccent(this.name, texte)
|
||||||
}
|
}
|
||||||
|
|
||||||
isNomTypeLike(texte) {
|
isNomTypeLike(texte) {
|
||||||
return this.isNomLike(texte) || Grammar.includesLowerCaseNoAccent(Misc.typeName(this.type, 'Item'), texte)
|
return this.isNomLike(texte) || Grammar.includesLowerCaseNoAccent(Misc.typeName(this.type, 'Item'), texte)
|
||||||
}
|
}
|
||||||
@ -360,8 +362,6 @@ export class RdDItem extends Item {
|
|||||||
return 0;
|
return 0;
|
||||||
case ITEM_TYPES.herbe:
|
case ITEM_TYPES.herbe:
|
||||||
return this.getEncHerbe();
|
return this.getEncHerbe();
|
||||||
case ITEM_TYPES.gemme:
|
|
||||||
return encPepin * this.system.taille;
|
|
||||||
}
|
}
|
||||||
return Math.max(this.system.encombrement ?? 0, 0);
|
return Math.max(this.system.encombrement ?? 0, 0);
|
||||||
}
|
}
|
||||||
@ -427,10 +427,6 @@ export class RdDItem extends Item {
|
|||||||
|
|
||||||
itemSpecificActions() {
|
itemSpecificActions() {
|
||||||
const actions = ITEM_ACTIONS[this.type] ?? []
|
const actions = ITEM_ACTIONS[this.type] ?? []
|
||||||
// const actorTypes = actions.actorTypes ?? [ACTOR_TYPES.personnage]
|
|
||||||
// if (!actorTypes.includes(this.actor?.type)) {
|
|
||||||
// return []
|
|
||||||
// }
|
|
||||||
return actions
|
return actions
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,7 +591,7 @@ export class RdDItem extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getChatItemTemplate() {
|
getChatItemTemplate() {
|
||||||
return 'systems/foundryvtt-reve-de-dragon/templates/post-item.html';
|
return 'systems/foundryvtt-reve-de-dragon/templates/post-item.hbs';
|
||||||
}
|
}
|
||||||
|
|
||||||
static propertyIfDefined(name, val, condition = true) {
|
static propertyIfDefined(name, val, condition = true) {
|
||||||
|
112
module/item/gemme.js
Normal file
112
module/item/gemme.js
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
import { RdDItem } from "../item.js";
|
||||||
|
import { ACTION_ITEM_ENCHANTER } from "../enchantement/dialog-enchanter.js";
|
||||||
|
|
||||||
|
const tableGemmes = {
|
||||||
|
"almaze": { label: "Almaze", couleur: "Blanc" },
|
||||||
|
"aquafane": { label: "Aquafane", couleur: "Vert Profond" },
|
||||||
|
"asterite": { label: "Astérite", couleur: "Bleu, Violet ou Blanc" },
|
||||||
|
"cyanolithe": { label: "Cyanolithe", couleur: "Bleu Intense" },
|
||||||
|
"larmededragon": { label: "Larme de Dragon", couleur: "Rouge Intense" },
|
||||||
|
"muska": { label: "Muska", couleur: "Violet Profond" },
|
||||||
|
"nebuleuse": { label: "Nébuleuse", couleur: "Brouillard Intense" },
|
||||||
|
"nebuleuse": { label: "Nébuleuse", couleur: "Brouillard Intense, Rose, Vert ou Bleu Pâle" },
|
||||||
|
"oeildetigre": { label: "Oeil de Tigre", couleur: "Jaune" },
|
||||||
|
"scarlatine": { label: "Scarlatine", couleur: "Rouge Clair ou Orangé" },
|
||||||
|
"seliphane": { label: "Séliphane", couleur: "Vert Lumineux" },
|
||||||
|
"tournelune": { label: "Tournelune", couleur: "Violet ou Bleu" },
|
||||||
|
"zebraide": { label: "Zebraïde", couleur: "Bandes Bicolores, toutes couleurs" }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
|
||||||
|
* densité 3.5 (~2.3 à 4, parfois plus) -- https://www.juwelo.fr/guide-des-pierres/faits-et-chiffres/
|
||||||
|
*/
|
||||||
|
const encPepin = 0.0007;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item pour gérer les gemmes
|
||||||
|
*/
|
||||||
|
export class RdDItemGemme extends RdDItem {
|
||||||
|
|
||||||
|
static getGemmeTypeOptionList() {
|
||||||
|
// TODO: look how to map object key-value pairs
|
||||||
|
let options = ""
|
||||||
|
for (let gemmeKey in tableGemmes) {
|
||||||
|
options += `<option value="${gemmeKey}">${tableGemmes[gemmeKey].label}</option>`
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get defaultIcon() {
|
||||||
|
return "systems/foundryvtt-reve-de-dragon/icons/gemmes/almaze.webp"
|
||||||
|
}
|
||||||
|
|
||||||
|
get isEnchantementPossible() {
|
||||||
|
return this.enchantabilite > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
get inertie() { return 7 - Number(this.system.purete) }
|
||||||
|
get enchantabilite() { return this.system.taille - this.inertie }
|
||||||
|
|
||||||
|
getEnc() {
|
||||||
|
return encPepin * this.system.taille;
|
||||||
|
}
|
||||||
|
|
||||||
|
itemSpecificActions() {
|
||||||
|
return [ACTION_ITEM_ENCHANTER]
|
||||||
|
}
|
||||||
|
|
||||||
|
prepareDerivedData() {
|
||||||
|
super.prepareDerivedData()
|
||||||
|
this.system.cout = (this.system.taille * this.system.purete) + this.system.qualite
|
||||||
|
this.system.inertie = this.inertie
|
||||||
|
this.system.enchantabilite = this.enchantabilite
|
||||||
|
}
|
||||||
|
|
||||||
|
getUtilisation() {
|
||||||
|
switch (this.system.categorie) {
|
||||||
|
case 'Alchimie': case 'Autre': case 'AlchimieAutre':
|
||||||
|
// TODO: distinguer les remèdes alchimiques enchantables/non
|
||||||
|
return 'alchimie'
|
||||||
|
case 'Cuisine':
|
||||||
|
return 'cuisine'
|
||||||
|
case 'Remede': case 'Repos': case 'Soin':
|
||||||
|
return 'soins'
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
getProprietes() {
|
||||||
|
const proprietes = [
|
||||||
|
`<b>Taille</b>: ${this.system.taille}`,
|
||||||
|
`<b>Pureté</b>: ${this.system.purete}`,
|
||||||
|
`<b>Inertie</b>: ${this.system.inertie}`,
|
||||||
|
`<b>Enchantabilité</b>: ${this.system.enchantabilite}`
|
||||||
|
]
|
||||||
|
const proprietesMagiques = this.system.magique ? [
|
||||||
|
`<b>Enchantée</b> <i class="fa-solid fa-sparkles"></i> ${this.system.purifie ? ', purifiée' : ''} ${this.system.prpermanent ? 'permanente' : ''} `,
|
||||||
|
`<b>Points de rêve</b>: ${this.system.pr}`,
|
||||||
|
`<b>Puissance</b>: ${this.system.puissance}`,
|
||||||
|
] : []
|
||||||
|
return proprietes
|
||||||
|
.concat(proprietesMagiques)
|
||||||
|
.concat(this._inventaireTemplateChatData())
|
||||||
|
.filter(it => it != undefined)
|
||||||
|
}
|
||||||
|
|
||||||
|
perteReveChateauDormant() {
|
||||||
|
if (this.system.magique && !this.system.prpermanent && this.system.pr > 0) {
|
||||||
|
const nouveauReve = Math.max(this.system.pr - 1, 0)
|
||||||
|
return {
|
||||||
|
alias: this.parent.getAlias(),
|
||||||
|
item: this,
|
||||||
|
update: {
|
||||||
|
_id: this.id,
|
||||||
|
'system.pr': nouveauReve,
|
||||||
|
'system.magique': nouveauReve > 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
}
|
@ -27,6 +27,12 @@ const _MONTRER = {
|
|||||||
code: 'item-montrer', label: 'Montrer', icon: it => 'fa-solid fa-comment',
|
code: 'item-montrer', label: 'Montrer', icon: it => 'fa-solid fa-comment',
|
||||||
action: (item, actor) => item.postItemToChat()
|
action: (item, actor) => item.postItemToChat()
|
||||||
}
|
}
|
||||||
|
const _SPLIT = {
|
||||||
|
code: 'item-split', label: 'Séparer le goupe', icon: it => 'fa-solid fa-unlink',
|
||||||
|
filter: it => Misc.toInt(it.system.quantite) > 1,
|
||||||
|
action: (item, actor) => RdDSheetUtility.splitItem(item, actor)
|
||||||
|
}
|
||||||
|
|
||||||
const _EDIT = {
|
const _EDIT = {
|
||||||
code: 'item-edit', label: 'Editer', icon: it => 'fa-solid fa-edit',
|
code: 'item-edit', label: 'Editer', icon: it => 'fa-solid fa-edit',
|
||||||
action: (item, actor) => item.sheet.render(true)
|
action: (item, actor) => item.sheet.render(true)
|
||||||
@ -69,7 +75,7 @@ const _BOIRE = {
|
|||||||
const _DECOCTION = {
|
const _DECOCTION = {
|
||||||
code: 'item-decoction', label: 'Décoction', icon: it => 'fa-solid fa-flask-vial',
|
code: 'item-decoction', label: 'Décoction', icon: it => 'fa-solid fa-flask-vial',
|
||||||
optionsFilter: options => options.editable,
|
optionsFilter: options => options.editable,
|
||||||
action: (item, actor) => actor.actionHerbe(item)
|
action: (item, actor) => actor.fabriquerDecoctionHerbe(item)
|
||||||
}
|
}
|
||||||
const _OUVRIR = {
|
const _OUVRIR = {
|
||||||
code: 'item-edit', label: 'Ouvrir', icon: it => 'fa-solid fa-eye',
|
code: 'item-edit', label: 'Ouvrir', icon: it => 'fa-solid fa-eye',
|
||||||
@ -89,19 +95,6 @@ const _REFOULER = {
|
|||||||
action: (item, actor) => actor.actionRefoulement(item)
|
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 = {
|
const _SORT_RESERVE = {
|
||||||
code: 'item-sortreserve-add', label: 'Ajouter en réserve', icon: it => 'fa-solid fa-sparkles',
|
code: 'item-sortreserve-add', label: 'Ajouter en réserve', icon: it => 'fa-solid fa-sparkles',
|
||||||
filter: it => game.user.isGM && !it.system.isrituel,
|
filter: it => game.user.isGM && !it.system.isrituel,
|
||||||
@ -109,7 +102,7 @@ const _SORT_RESERVE = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const COMMON_ACTIONS = [_EQUIPER]
|
export const COMMON_ACTIONS = [_EQUIPER]
|
||||||
export const DEFAULT_ACTIONS = [_SPACEHOLDER, _VENDRE, _MONTRER, _EDIT, _DELETE]
|
export const DEFAULT_ACTIONS = [_SPACEHOLDER, _SPLIT, _VENDRE, _MONTRER, _EDIT, _DELETE]
|
||||||
|
|
||||||
export const ITEM_ACTIONS = {
|
export const ITEM_ACTIONS = {
|
||||||
faune: [_CUISINER, _MANGER_CRU],
|
faune: [_CUISINER, _MANGER_CRU],
|
||||||
@ -120,7 +113,6 @@ export const ITEM_ACTIONS = {
|
|||||||
nourritureboisson: [_MANGER, _BOIRE],
|
nourritureboisson: [_MANGER, _BOIRE],
|
||||||
ombre: [_REFOULER],
|
ombre: [_REFOULER],
|
||||||
plante: [_CUISINER, _MANGER_CRU],
|
plante: [_CUISINER, _MANGER_CRU],
|
||||||
potion: [_CONSOMMER_POTION, _ENCHANTER],
|
|
||||||
queue: [_REFOULER],
|
queue: [_REFOULER],
|
||||||
sort: [_SORT_RESERVE],
|
sort: [_SORT_RESERVE],
|
||||||
service: [_ACHAT_SERVICE]
|
service: [_ACHAT_SERVICE]
|
||||||
@ -130,7 +122,7 @@ export const ITEM_ACTIONS = {
|
|||||||
export class ItemAction {
|
export class ItemAction {
|
||||||
|
|
||||||
static applies(action, item, options) {
|
static applies(action, item, options) {
|
||||||
return action
|
return action && item
|
||||||
&& item.isActionAllowed(action.code)
|
&& item.isActionAllowed(action.code)
|
||||||
&& (!action.filter || action.filter(item))
|
&& (!action.filter || action.filter(item))
|
||||||
&& (!action.optionsFilter || action.optionsFilter(options))
|
&& (!action.optionsFilter || action.optionsFilter(options))
|
||||||
@ -143,12 +135,12 @@ export class ItemAction {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
static onActionItem(event, actor, options) {
|
static async onActionItem(event, actor, options) {
|
||||||
const item = RdDSheetUtility.getItem(event, actor)
|
const item = RdDSheetUtility.getItem(event, actor)
|
||||||
const code = $(event.currentTarget).data('code')
|
const code = $(event.currentTarget).data('code')
|
||||||
const action = item.itemActions().find(it => it.code == code)
|
const action = item?.itemActions().find(it => it.code == code)
|
||||||
if (action && (!action.optionsFilter || action.optionsFilter(options))) {
|
if (action && (!action.optionsFilter || action.optionsFilter(options))) {
|
||||||
action.action(item, actor)
|
await action.action(item, actor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
import { ITEM_TYPES } from "../constants.js";
|
|
||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
import { RdDItem } from "../item.js";
|
import { RdDItem } from "../item.js";
|
||||||
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
||||||
import { ITEM_ACTIONS } from "./item-actions.js";
|
import { ACTION_ITEM_ENCHANTER } from "../enchantement/dialog-enchanter.js";
|
||||||
import { DialogEnchanter } from "./potion/dialog-enchanter.js";
|
|
||||||
|
|
||||||
const POTION_MAGIQUE = ['AlchimieEnchante', 'ReposEnchante', 'SoinEnchante', 'AutreEnchante']
|
// --- Actions sur les "potions"
|
||||||
const POTION_ENCHANTABLE = ['Alchimie', 'Repos', 'Soin', 'Autre']
|
const _CONSOMMER_POTION = {
|
||||||
.concat(POTION_MAGIQUE)
|
code: 'item-potion-consommer', label: 'Consommer', icon: it => 'fa-solid fa-vial',
|
||||||
|
optionsFilter: options => options.editable,
|
||||||
const MAP_CATEGORIE_ENCHANTEMENT = [
|
action: (item, actor) => actor.consommerPotion(item)
|
||||||
{ basique: 'Alchimie', enchante: 'AlchimieEnchante' },
|
}
|
||||||
{ basique: 'Repos', enchante: 'ReposEnchante' },
|
|
||||||
{ basique: 'Soin', enchante: 'SoinEnchante' },
|
|
||||||
{ basique: 'Autre', enchante: 'AutreEnchante' }]
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item pour gérer les potions
|
||||||
|
*/
|
||||||
export class RdDItemPotion extends RdDItem {
|
export class RdDItemPotion extends RdDItem {
|
||||||
|
|
||||||
static async herbesSoins() {
|
static async herbesSoins() {
|
||||||
@ -33,114 +31,67 @@ export class RdDItemPotion extends RdDItem {
|
|||||||
return "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp"
|
return "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isEnchantementPossible() {
|
||||||
|
return this.system.etat == 'Liquide'
|
||||||
|
}
|
||||||
|
|
||||||
|
itemSpecificActions() {
|
||||||
|
return [_CONSOMMER_POTION, ACTION_ITEM_ENCHANTER]
|
||||||
|
}
|
||||||
|
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
super.prepareDerivedData()
|
super.prepareDerivedData()
|
||||||
this.system.puissance = this.system.magique ? this.calculPuissance() : 0
|
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() {
|
getUtilisation() {
|
||||||
switch (this.system.categorie) {
|
switch (this.system.categorie) {
|
||||||
case 'Alchimie': case 'AlchimieEnchante':
|
case 'Alchimie': case 'Autre': case 'AlchimieAutre':
|
||||||
case 'AlchimieAutre':
|
// TODO: distinguer les remèdes alchimiques enchantables/non
|
||||||
return 'alchimie'
|
return 'alchimie'
|
||||||
case 'Cuisine': return 'cuisine'
|
case 'Cuisine':
|
||||||
case 'Remede': case 'Repos': case 'ReposEnchante': case 'Soin': case 'SoinEnchante':
|
return 'cuisine'
|
||||||
|
case 'Remede': case 'Repos': case 'Soin':
|
||||||
return 'soins'
|
return 'soins'
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
_potionChatData() {
|
getProprietes() {
|
||||||
return [
|
const proprietes = [
|
||||||
`<b>Rareté</b>: ${this.system.rarete}`,
|
`<b>Rareté</b>: ${this.system.rarete} `,
|
||||||
`<b>Catégorie</b>: ${this.system.categorie}`,
|
`<b>Catégorie</b>: ${this.system.categorie}`,
|
||||||
...this._inventaireTemplateChatData()
|
`<b>Etat</b>: ${this.system.etat}`
|
||||||
]
|
]
|
||||||
|
const proprietesMagiques = this.system.magique ? [
|
||||||
|
`<b>Enchantée</b> <i class="fa-solid fa-sparkles"></i> ${this.system.purifie ? ', purifiée' : ''} ${this.system.prpermanent ? 'permanente' : ''} `,
|
||||||
|
`<b>Points de rêve</b>: ${this.system.pr}`,
|
||||||
|
] : []
|
||||||
|
return proprietes
|
||||||
|
.concat(proprietesMagiques)
|
||||||
|
.concat(this._inventaireTemplateChatData())
|
||||||
|
.filter(it => it != undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
async enchanterPotion() {
|
perteReveChateauDormant() {
|
||||||
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) {
|
if (this.system.magique && !this.system.prpermanent && this.system.pr > 0) {
|
||||||
const nouveauReve = Math.max(this.system.pr - 1, 0)
|
const nouveaupr = Math.max(this.system.pr - 1, 0)
|
||||||
return {
|
return {
|
||||||
_id: this.id,
|
alias: this.parent.getAlias(),
|
||||||
name: this.name,
|
item: this,
|
||||||
img: this.img,
|
nouveaupr: nouveaupr,
|
||||||
'system.pr': nouveauReve,
|
update: {
|
||||||
'system.quantite': nouveauReve > 0 ? this.system.quantite : 0,
|
_id: this.id,
|
||||||
'system.magique': nouveauReve > 0
|
'system.pr': nouveaupr,
|
||||||
|
'system.magique': nouveaupr > 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return undefined
|
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 }
|
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) {
|
static buildHerbesList(listeHerbes, max) {
|
||||||
let list = {}
|
let list = {}
|
||||||
for (let herbe of listeHerbes) {
|
for (let herbe of listeHerbes) {
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -19,10 +19,12 @@ export class RdDItemRace extends RdDItem {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const carac = RdDCarac.carac(code)
|
if (code == LIST_CARAC_PERSONNAGE.taille.code) {
|
||||||
if (race.isMax(actor, code, value - 1)) {
|
const carac = RdDCarac.carac(code)
|
||||||
ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`)
|
if (race.isMax(actor, code, value - 1)) {
|
||||||
return false
|
ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -53,13 +55,18 @@ export class RdDItemRace extends RdDItem {
|
|||||||
|
|
||||||
isMax(actor, code, value = undefined) {
|
isMax(actor, code, value = undefined) {
|
||||||
const path = RdDCarac.carac(code)?.path
|
const path = RdDCarac.carac(code)?.path
|
||||||
|
if (path == undefined) {
|
||||||
|
// cas des caractéristiques dérivées, pas de max
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (value == undefined) {
|
if (value == undefined) {
|
||||||
value = path ? foundry.utils.getProperty(actor, path) : 0
|
value = path ? foundry.utils.getProperty(actor, path) : 0
|
||||||
}
|
}
|
||||||
if (code == LIST_CARAC_PERSONNAGE.force.code) {
|
if (code == LIST_CARAC_PERSONNAGE.force.code) {
|
||||||
return value >= this.getForceMax(actor)
|
return value >= this.getForceMax(actor)
|
||||||
}
|
}
|
||||||
const max = foundry.utils.getProperty(this, path) ?? -1
|
const pathMax = path.replace(".value", ".max");
|
||||||
|
const max = foundry.utils.getProperty(this, pathMax) ?? -1
|
||||||
return (max > 0 && value >= max)
|
return (max > 0 && value >= max)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ const RARETE_FREQUENTE = { code: 'Frequente', label: 'Fréquente', frequence: 18
|
|||||||
const RARETE_RARE = { code: 'Rare', label: 'Rare', frequence: 6, min: 3, max: 12 };
|
const RARETE_RARE = { code: 'Rare', label: 'Rare', frequence: 6, min: 3, max: 12 };
|
||||||
const RARETE_RARISSIME = { code: 'Rarissime', label: 'Rarissime', frequence: 2, min: 1, max: 4 };
|
const RARETE_RARISSIME = { code: 'Rarissime', label: 'Rarissime', frequence: 2, min: 1, max: 4 };
|
||||||
const RARETE_INEXISTANT = { code: 'Inexistant', label: 'Inexistant', frequence: 0, min: 0, max: 0 };
|
const RARETE_INEXISTANT = { code: 'Inexistant', label: 'Inexistant', frequence: 0, min: 0, max: 0 };
|
||||||
const RARETE_EGALE = { code: 'eqal', label: 'Egal', frequence: 1, min: 1, max: 1 };
|
const RARETE_EGALE = { code: 'egal', label: 'Egal', frequence: 1, min: 1, max: 1 };
|
||||||
|
|
||||||
const RARETES = [
|
export const RARETES = [
|
||||||
RARETE_COMMUNE,
|
RARETE_COMMUNE,
|
||||||
RARETE_FREQUENTE,
|
RARETE_FREQUENTE,
|
||||||
RARETE_RARE,
|
RARETE_RARE,
|
||||||
|
@ -34,8 +34,8 @@ export class RdDItemInventaireSheet extends RdDItemSheet {
|
|||||||
HtmlUtility.showControlWhen(this.html.find("div.description-milieu"), TYPE_ITEMS_NATURELS.includes(this.item.type));
|
HtmlUtility.showControlWhen(this.html.find("div.description-milieu"), TYPE_ITEMS_NATURELS.includes(this.item.type));
|
||||||
|
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
this.html.find("a.preparer-nourriture").click(event => this.preparerNourriture(event));
|
this.html.find("a.preparer-nourriture").click(async event => await this.preparerNourriture(event));
|
||||||
this.html.find("a.manger-nourriture").click(event => this.mangerNourriture(event));
|
this.html.find("a.manger-nourriture").click(async event => await this.mangerNourriture(event));
|
||||||
|
|
||||||
this.html.find("input.input-selection-milieu").keypress(event => {
|
this.html.find("input.input-selection-milieu").keypress(event => {
|
||||||
if (event.keyCode == '13') {
|
if (event.keyCode == '13') {
|
||||||
@ -43,11 +43,11 @@ export class RdDItemInventaireSheet extends RdDItemSheet {
|
|||||||
}
|
}
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
})
|
})
|
||||||
this.html.find("a.milieu-add").click(event => this.onAddMilieu(event));
|
this.html.find("a.milieu-add").click(async event => await this.onAddMilieu(event));
|
||||||
this.html.find("div.environnement-milieu a.milieu-delete").click(event => this.onDeleteMilieu(event));
|
this.html.find("div.environnement-milieu a.milieu-delete").click(async event => await this.onDeleteMilieu(event));
|
||||||
this.html.find("div.environnement-milieu select.environnement-rarete").change(event => this.onChange(event,
|
this.html.find("div.environnement-milieu select.environnement-rarete").change(async event => await this.onChange(event,
|
||||||
updated => this.$changeRarete(event, updated)));
|
updated => this.$changeRarete(event, updated)));
|
||||||
this.html.find("div.environnement-milieu input[name='environnement-frequence']").change(event => this.onChange(event,
|
this.html.find("div.environnement-milieu input[name='environnement-frequence']").change(async event => await this.onChange(event,
|
||||||
updated => this.$changeFrequence(event, updated)));
|
updated => this.$changeFrequence(event, updated)));
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,15 +15,15 @@ export class RdDBlessureItemSheet extends RdDItemSheet {
|
|||||||
|
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
this.html.find('[name="premierssoins-done"]').change(async event => {
|
this.html.find('[name="premierssoins-done"]').change(async event =>
|
||||||
await this.item.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
await this.item.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } })
|
||||||
});
|
)
|
||||||
this.html.find('[name="soinscomplets-done"]').change(async event => {
|
this.html.find('[name="soinscomplets-done"]').change(async event =>
|
||||||
await this.item.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
await this.item.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||||
});
|
)
|
||||||
this.html.find('[name="system-gravite"]').change(async event => {
|
this.html.find('[name="system-gravite"]').change(async event => {
|
||||||
const gravite = Number(event.currentTarget.value)
|
const gravite = Number(event.currentTarget.value)
|
||||||
await this.item.setSoinsBlessure({ gravite: gravite, difficulte: - gravite })
|
await this.item.setSoinsBlessure({ gravite: gravite, difficulte: - gravite })
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ export class RdDFauneItemSheet extends RdDItemInventaireSheet {
|
|||||||
|
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
html.find("a.linked-actor-delete").click(event => this.onDeleteLinkedActor());
|
html.find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor());
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onDropActor(event, dragData) {
|
async _onDropActor(event, dragData) {
|
||||||
|
38
module/item/sheet-gemme.js
Normal file
38
module/item/sheet-gemme.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { DialogEnchanter } from "../enchantement/dialog-enchanter.js";
|
||||||
|
import { RdDTimestamp } from "../time/rdd-timestamp.js";
|
||||||
|
import { RdDItemGemme } from "./gemme.js";
|
||||||
|
import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js";
|
||||||
|
|
||||||
|
export class RdDGemmeItemSheet extends RdDItemInventaireSheet {
|
||||||
|
|
||||||
|
static get ITEM_TYPE() { return ITEM_TYPES.gemme };
|
||||||
|
|
||||||
|
async getData() {
|
||||||
|
const formData = foundry.utils.mergeObject(await super.getData(),
|
||||||
|
{
|
||||||
|
inertie: this.item.inertie,
|
||||||
|
enchantabilite: this.item.enchantabilite,
|
||||||
|
isEnchantementPossible: this.item.isEnchantementPossible,
|
||||||
|
gemmeTypeList: RdDItemGemme.getGemmeTypeOptionList(),
|
||||||
|
dateActuelle: game.system.rdd.calendrier.dateCourante(),
|
||||||
|
enchantement: RdDTimestamp.splitIndexDate(this.item.system.prdate)
|
||||||
|
})
|
||||||
|
return formData
|
||||||
|
}
|
||||||
|
|
||||||
|
activateListeners(html) {
|
||||||
|
super.activateListeners(html);
|
||||||
|
|
||||||
|
this.html.find('.item-enchanter').click((event) => DialogEnchanter.enchanter(this.item))
|
||||||
|
|
||||||
|
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}`)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import { ITEM_TYPES } from "../constants.js";
|
import { ITEM_TYPES } from "../constants.js";
|
||||||
|
import { DialogEnchanter } from "../enchantement/dialog-enchanter.js";
|
||||||
import { RdDTimestamp } from "../time/rdd-timestamp.js";
|
import { RdDTimestamp } from "../time/rdd-timestamp.js";
|
||||||
import { RdDItemPotion } from "./potion.js";
|
import { RdDItemPotion } from "./potion.js";
|
||||||
import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js";
|
import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js";
|
||||||
@ -18,14 +19,12 @@ export class RdDPotionItemSheet extends RdDItemInventaireSheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get potion(){ return this.item }
|
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
const formData = await super.getData()
|
const formData = await super.getData()
|
||||||
formData.enchantable = this.potion.isEnchantable()
|
formData.isEnchantementPossible = this.item.isEnchantementPossible
|
||||||
const enchantement = this.potion.categorieEnchantement()
|
formData.isSoins = this.item.categorie == 'Soin'
|
||||||
formData.isSoins = enchantement.basique == 'Soin'
|
formData.isRepos = this.item.categorie == 'Repos'
|
||||||
formData.isRepos = enchantement.basique == 'Repos'
|
|
||||||
if (formData.isSoins) {
|
if (formData.isSoins) {
|
||||||
const herbesSoins = await RdDItemPotion.herbesSoins()
|
const herbesSoins = await RdDItemPotion.herbesSoins()
|
||||||
RdDPotionItemSheet.$calculBonusHerbe(formData, herbesSoins, 12);
|
RdDPotionItemSheet.$calculBonusHerbe(formData, herbesSoins, 12);
|
||||||
@ -37,20 +36,20 @@ export class RdDPotionItemSheet extends RdDItemInventaireSheet {
|
|||||||
formData.herbesRepos = RdDItemPotion.buildHerbesList(herbesRepos, 7)
|
formData.herbesRepos = RdDItemPotion.buildHerbesList(herbesRepos, 7)
|
||||||
}
|
}
|
||||||
formData.dateActuelle = game.system.rdd.calendrier.dateCourante()
|
formData.dateActuelle = game.system.rdd.calendrier.dateCourante()
|
||||||
formData.enchantement = RdDTimestamp.splitIndexDate(this.potion.system.prdate)
|
formData.enchantement = RdDTimestamp.splitIndexDate(this.item.system.prdate)
|
||||||
return formData
|
return formData
|
||||||
}
|
}
|
||||||
|
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
|
|
||||||
this.html.find('.item-enchanter').click((event) => this.potion.enchanterPotion())
|
this.html.find('.item-enchanter').click((event) => DialogEnchanter.enchanter(this.item))
|
||||||
|
|
||||||
this.html.find('.date-enchantement').change((event) => {
|
this.html.find('.date-enchantement').change((event) => {
|
||||||
const jour = Number(this.html.find('input.date-enchantement[name="enchantement.jour"]').val())
|
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 mois = RdDTimestamp.definition(this.html.find('select.date-enchantement[name="enchantement.mois"]').val())
|
||||||
const indexDate = game.system.rdd.calendrier.getIndexFromDate(jour, mois.heure)
|
const indexDate = game.system.rdd.calendrier.getIndexFromDate(jour, mois.heure)
|
||||||
this.potion.update({ 'system.prdate': indexDate })
|
this.item.update({ 'system.prdate': indexDate })
|
||||||
console.warn(`Date d'enchantement modifiée ${jour}/${mois.heure}: ${indexDate}`)
|
console.warn(`Date d'enchantement modifiée ${jour}/${mois.heure}: ${indexDate}`)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ export class RdDRencontreItemSheet extends RdDItemSheet {
|
|||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
this.html.find("a.effet-add").click(event => this.onAddEffet(event));
|
this.html.find("a.effet-add").click(async event => await this.onAddEffet(event));
|
||||||
this.html.find("a.effet-delete").click(event => this.onDeleteEffet(event));
|
this.html.find("a.effet-delete").click(async event => await this.onDeleteEffet(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
async onAddEffet(event) {
|
async onAddEffet(event) {
|
||||||
|
@ -36,9 +36,9 @@ export class RdDSigneDraconiqueItemSheet extends RdDItemSheet {
|
|||||||
|
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
html.find(".signe-aleatoire").click(event => this.setSigneAleatoire());
|
html.find(".signe-aleatoire").click(async event => await this.setSigneAleatoire());
|
||||||
html.find("input.select-tmr").change(event => this.onSelectTmr(event));
|
html.find("input.select-tmr").change(async event => await this.onSelectTmr(event));
|
||||||
html.find(".signe-xp-sort").change(event => this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value)));
|
html.find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
async setSigneAleatoire() {
|
async setSigneAleatoire() {
|
||||||
|
@ -589,6 +589,55 @@ class _12_0_32_MigrationRaces extends Migration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _12_0_37_MigrationAlchimieEtat extends Migration {
|
||||||
|
get code() { return "migration-alchimie-etat" }
|
||||||
|
get version() { return "12.0.37" }
|
||||||
|
|
||||||
|
async migrate() {
|
||||||
|
await this.applyItemsUpdates(items => items
|
||||||
|
.filter(it => [ITEM_TYPES.potion].includes(it.type))
|
||||||
|
.map(it => this.migratePotion(it))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
mappingCategorie(categorie) {
|
||||||
|
switch (categorie) {
|
||||||
|
case 'AlchimieEnchante': return 'Alchimie'
|
||||||
|
case 'ReposEnchante': return 'Repos'
|
||||||
|
case 'SoinEnchante': return 'Soin'
|
||||||
|
case 'AutreEnchante': return 'Autre'
|
||||||
|
}
|
||||||
|
return categorie
|
||||||
|
}
|
||||||
|
|
||||||
|
mappingEtat(categorie) {
|
||||||
|
return ['Alchimie', 'Repos', 'Soin', 'Autre'].includes(categorie) ? 'Liquide' : 'Autre'
|
||||||
|
}
|
||||||
|
|
||||||
|
migratePotion(potion) {
|
||||||
|
const newCategorie = this.mappingCategorie(potion.system.categorie)
|
||||||
|
return {
|
||||||
|
_id: potion.id,
|
||||||
|
'system.etat': this.mappingEtat(potion.system.categorie),
|
||||||
|
'system.magique': potion.system.pr > 0,
|
||||||
|
'system.categorie': newCategorie
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _12_0_38_TachesEcriture extends Migration {
|
||||||
|
get code() { return "migration-tache-ecriture" }
|
||||||
|
get version() { return "12.0.38" }
|
||||||
|
|
||||||
|
async migrate() {
|
||||||
|
await this.applyItemsUpdates(items => items
|
||||||
|
.filter(it => [ITEM_TYPES.tache, ITEM_TYPES.livre, ITEM_TYPES.oeuvre, ITEM_TYPES.meditation].includes(it.type) )
|
||||||
|
.filter(it => it.system.competence == 'Ecriture')
|
||||||
|
.map(it => { return { _id: it.id, 'system.competence': 'Écriture' } })
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class Migrations {
|
export class Migrations {
|
||||||
static getMigrations() {
|
static getMigrations() {
|
||||||
return [
|
return [
|
||||||
@ -610,6 +659,8 @@ export class Migrations {
|
|||||||
new _11_2_20_MigrationAstrologie(),
|
new _11_2_20_MigrationAstrologie(),
|
||||||
new _12_0_26_MigrationVoieSorts(),
|
new _12_0_26_MigrationVoieSorts(),
|
||||||
new _12_0_32_MigrationRaces(),
|
new _12_0_32_MigrationRaces(),
|
||||||
|
new _12_0_37_MigrationAlchimieEtat(),
|
||||||
|
new _12_0_38_TachesEcriture()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ export class Misc {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static findFirstLike(value, elements, options = {}) {
|
static findFirstLike(value, elements, options = {}) {
|
||||||
options = foundry.utils.mergeObject(DEFAULT_FIND_OPTIONS, options, { overwrite: true, inplace: false });
|
options = foundry.utils.mergeObject(DEFAULT_FIND_OPTIONS, options, { overwrite: true, inplace: false });
|
||||||
const subset = this.findAllLike(value, elements, options);
|
const subset = this.findAllLike(value, elements, options)
|
||||||
if (subset.length == 0) {
|
if (subset.length == 0) {
|
||||||
console.log(`Aucune ${options.description} pour ${value}`);
|
console.log(`Aucune ${options.description} pour ${value}`);
|
||||||
return undefined
|
return undefined
|
||||||
@ -263,8 +263,9 @@ export class Misc {
|
|||||||
}
|
}
|
||||||
value = Grammar.toLowerCaseNoAccent(value);
|
value = Grammar.toLowerCaseNoAccent(value);
|
||||||
const subset = elements.filter(options.preFilter)
|
const subset = elements.filter(options.preFilter)
|
||||||
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value));
|
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value))
|
||||||
if (subset.length == 0) {
|
.sort(Misc.ascending(it => options.mapper(it)))
|
||||||
|
if (subset.length == 0 && options?.onMessage) {
|
||||||
options.onMessage(`Pas de ${options.description} correspondant à ${value}`);
|
options.onMessage(`Pas de ${options.description} correspondant à ${value}`);
|
||||||
}
|
}
|
||||||
return subset;
|
return subset;
|
||||||
|
@ -57,7 +57,7 @@ export const LIST_CARAC_PERSONNAGE = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const LIST_CARAC_AUTRES = {
|
export const LIST_CARAC_AUTRES = {
|
||||||
'perception': { code: 'perception', label: 'Perception', path: 'system.carac.perception.value' },
|
'perception': { code: 'perception', label: 'Perception', path: 'system.carac.perception.value' },
|
||||||
}
|
}
|
||||||
|
|
||||||
const LIST_CARAC_DERIVEE = {
|
const LIST_CARAC_DERIVEE = {
|
||||||
@ -75,12 +75,12 @@ const LIST_CARAC_ROLL = Object.values(LIST_CARAC_PERSONNAGE).filter(it => it.isC
|
|||||||
|
|
||||||
export class RdDCarac {
|
export class RdDCarac {
|
||||||
|
|
||||||
static caracDetails(name) {
|
static caracDetails(name, options = { onMessage: undefined }) {
|
||||||
let entry = Misc.findFirstLike(name, LIST_CARAC_ROLL, { mapper: it => it.code, description: 'caractéristique', onMessage: m => { } })
|
let entry = Misc.findFirstLike(name, LIST_CARAC_ROLL, { mapper: it => it.code, description: 'caractéristique', onMessage: m => { } })
|
||||||
if (entry) {
|
if (entry) {
|
||||||
return entry
|
return entry
|
||||||
}
|
}
|
||||||
return Misc.findFirstLike(name, LIST_CARAC_ROLL, { mapper: it => it.label, description: 'caractéristique' })
|
return Misc.findFirstLike(name, LIST_CARAC_ROLL, { mapper: it => it.label, description: 'caractéristique', onMessage: options.onMessage })
|
||||||
}
|
}
|
||||||
|
|
||||||
static carac(code) {
|
static carac(code) {
|
||||||
|
@ -13,6 +13,7 @@ import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
|||||||
import { STATUSES } from "./settings/status-effects.js";
|
import { STATUSES } from "./settings/status-effects.js";
|
||||||
import { Targets } from "./targets.js";
|
import { Targets } from "./targets.js";
|
||||||
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
||||||
|
import { RdDRollResult } from "./rdd-roll-result.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const premierRoundInit = [
|
const premierRoundInit = [
|
||||||
@ -361,7 +362,7 @@ export class RdDCombatManager extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static listActionsActorCombatant( actor) {
|
static listActionsActorCombatant(actor) {
|
||||||
const possessions = actor.listActionsPossessions()
|
const possessions = actor.listActionsPossessions()
|
||||||
const actions = possessions.length > 0
|
const actions = possessions.length > 0
|
||||||
? possessions
|
? possessions
|
||||||
@ -667,7 +668,7 @@ export class RdDCombat {
|
|||||||
const activite = this._ajustementMouvement(this.defender)
|
const activite = this._ajustementMouvement(this.defender)
|
||||||
const total = [portee, taille, activite].map(it => it.diff).filter(d => !Number.isNaN(d)).reduce(Misc.sum(), 0)
|
const total = [portee, taille, activite].map(it => it.diff).filter(d => !Number.isNaN(d)).reduce(Misc.sum(), 0)
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-info-distance.html', {
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-info-distance.hbs', {
|
||||||
rollData: rollData,
|
rollData: rollData,
|
||||||
attacker: _token,
|
attacker: _token,
|
||||||
isVisible: isVisible,
|
isVisible: isVisible,
|
||||||
@ -734,7 +735,7 @@ export class RdDCombat {
|
|||||||
await this.proposerAjustementTirLancer(rollData)
|
await this.proposerAjustementTirLancer(rollData)
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this.attacker, rollData,
|
const dialog = await RdDRoll.create(this.attacker, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs' },
|
||||||
{
|
{
|
||||||
name: 'jet-attaque',
|
name: 'jet-attaque',
|
||||||
label: 'Attaque: ' + (arme?.name ?? competence.name),
|
label: 'Attaque: ' + (arme?.name ?? competence.name),
|
||||||
@ -742,11 +743,8 @@ export class RdDCombat {
|
|||||||
this.attacker.createCallbackExperience(),
|
this.attacker.createCallbackExperience(),
|
||||||
this.attacker.createCallbackAppelAuMoral(),
|
this.attacker.createCallbackAppelAuMoral(),
|
||||||
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
||||||
{ condition: r => arme && !RdDCombat.isParticuliere(r), action: r => this.attacker.incDecItemUse(arme._id) },
|
{ action: async r => await this.attacker.incDecItemUse(arme._id, arme && !RdDCombat.isParticuliere(r)) },
|
||||||
{ condition: r => (RdDCombat.isReussite(r) && !RdDCombat.isParticuliere(r)), action: r => this._onAttaqueNormale(r) },
|
{ action: r => this._onAttaque(r) },
|
||||||
{ condition: RdDCombat.isParticuliere, action: r => this._onAttaqueParticuliere(r) },
|
|
||||||
{ condition: RdDCombat.isEchec, action: r => this._onAttaqueEchec(r) },
|
|
||||||
{ condition: RdDCombat.isEchecTotal, action: r => this._onAttaqueEchecTotal(r) },
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
dialog.render(true);
|
dialog.render(true);
|
||||||
@ -782,9 +780,23 @@ export class RdDCombat {
|
|||||||
return rollData;
|
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) {
|
async _onAttaqueParticuliere(rollData) {
|
||||||
|
|
||||||
const isMeleeDiffNegative = (rollData.competence.type == 'competencecreature' || rollData.selectedCarac.label == "Mêlée") && rollData.diffLibre < 0;
|
const isMeleeDiffNegative = (rollData.competence.type == 'competencecreature' || rollData.selectedCarac.label == "Mêlée") && rollData.diffLibre < 0;
|
||||||
// force toujours, sauf empoignade
|
// force toujours, sauf empoignade
|
||||||
// finesse seulement en mélée, pour l'empoignade, ou si la difficulté libre est de -1 minimum
|
// finesse seulement en mélée, pour l'empoignade, ou si la difficulté libre est de -1 minimum
|
||||||
@ -806,7 +818,7 @@ export class RdDCombat {
|
|||||||
const choixParticuliere = await ChatMessage.create({
|
const choixParticuliere = await ChatMessage.create({
|
||||||
alias: this.attacker.getAlias(),
|
alias: this.attacker.getAlias(),
|
||||||
whisper: ChatUtility.getOwners(this.attacker),
|
whisper: ChatUtility.getOwners(this.attacker),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-particuliere.html', {
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-particuliere.hbs', {
|
||||||
alias: this.attacker.getAlias(),
|
alias: this.attacker.getAlias(),
|
||||||
attackerId: this.attackerId,
|
attackerId: this.attackerId,
|
||||||
attackerToken: this.attackerToken,
|
attackerToken: this.attackerToken,
|
||||||
@ -830,13 +842,13 @@ export class RdDCombat {
|
|||||||
cible: this.defender?.getAlias() ?? 'la cible',
|
cible: this.defender?.getAlias() ?? 'la cible',
|
||||||
isRecul: (attackerRoll.particuliere == 'force' || attackerRoll.tactique == 'charge')
|
isRecul: (attackerRoll.particuliere == 'force' || attackerRoll.tactique == 'charge')
|
||||||
}
|
}
|
||||||
await RdDResolutionTable.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.html');
|
await RdDRollResult.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.hbs');
|
||||||
|
|
||||||
if (!await this.attacker.accorder(this.defender, 'avant-defense')) {
|
if (!await this.attacker.accorder(this.defender, 'avant-defense')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.target) {
|
if (this.defender) {
|
||||||
await this._sendMessageDefense(attackerRoll, defenderRoll);
|
await this._sendMessageDefense(attackerRoll, defenderRoll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -895,7 +907,7 @@ export class RdDCombat {
|
|||||||
speaker: ChatMessage.getSpeaker(this.defender, canvas.tokens.get(this.defenderTokenId)),
|
speaker: ChatMessage.getSpeaker(this.defender, canvas.tokens.get(this.defenderTokenId)),
|
||||||
alias: this.attacker?.getAlias(),
|
alias: this.attacker?.getAlias(),
|
||||||
whisper: ChatUtility.getOwners(this.defender),
|
whisper: ChatUtility.getOwners(this.defender),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-defense.html', paramDemandeDefense),
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-defense.hbs', paramDemandeDefense),
|
||||||
});
|
});
|
||||||
// flag pour garder les jets d'attaque/defense
|
// flag pour garder les jets d'attaque/defense
|
||||||
ChatUtility.setMessageData(choixDefense, 'defender-roll', defenderRoll);
|
ChatUtility.setMessageData(choixDefense, 'defender-roll', defenderRoll);
|
||||||
@ -940,7 +952,7 @@ export class RdDCombat {
|
|||||||
async _onAttaqueEchecTotal(attackerRoll) {
|
async _onAttaqueEchecTotal(attackerRoll) {
|
||||||
const choixEchecTotal = await ChatMessage.create({
|
const choixEchecTotal = await ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this.attacker),
|
whisper: ChatUtility.getOwners(this.attacker),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-etotal.html', {
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-etotal.hbs', {
|
||||||
attackerId: this.attackerId,
|
attackerId: this.attackerId,
|
||||||
attacker: this.attacker,
|
attacker: this.attacker,
|
||||||
attackerToken: this.attackerToken,
|
attackerToken: this.attackerToken,
|
||||||
@ -964,22 +976,20 @@ export class RdDCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onAttaqueEchec(rollData) {
|
async _onAttaqueEchec(attackerRoll) {
|
||||||
console.log("RdDCombat.onAttaqueEchec >>>", rollData);
|
console.log("RdDCombat.onAttaqueEchec >>>", attackerRoll);
|
||||||
await RdDResolutionTable.displayRollData(rollData, this.attacker, 'chat-resultat-attaque.html');
|
await RdDRollResult.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.hbs');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async choixParticuliere(rollData, choix) {
|
async choixParticuliere(rollData, choix) {
|
||||||
console.log("RdDCombat.choixParticuliere >>>", rollData, choix);
|
console.log("RdDCombat.choixParticuliere >>>", rollData, choix);
|
||||||
|
|
||||||
if (choix != "rapidite") {
|
await this.attacker.incDecItemUse(rollData.arme.id, choix != "rapidite")
|
||||||
this.attacker.incDecItemUse(rollData.arme.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.removeChatMessageActionsPasseArme(rollData.passeArme);
|
this.removeChatMessageActionsPasseArme(rollData.passeArme);
|
||||||
rollData.particuliere = choix;
|
rollData.particuliere = choix;
|
||||||
await this._onAttaqueNormale(rollData);
|
await this._onAttaqueNormale(rollData)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -995,7 +1005,7 @@ export class RdDCombat {
|
|||||||
let rollData = this._prepareParade(attackerRoll, arme, competence);
|
let rollData = this._prepareParade(attackerRoll, arme, competence);
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this.defender, rollData,
|
const dialog = await RdDRoll.create(this.defender, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs' },
|
||||||
{
|
{
|
||||||
name: 'jet-parade',
|
name: 'jet-parade',
|
||||||
label: 'Parade: ' + (arme ? arme.name : rollData.competence.name),
|
label: 'Parade: ' + (arme ? arme.name : rollData.competence.name),
|
||||||
@ -1003,10 +1013,8 @@ export class RdDCombat {
|
|||||||
this.defender.createCallbackExperience(),
|
this.defender.createCallbackExperience(),
|
||||||
this.defender.createCallbackAppelAuMoral(),
|
this.defender.createCallbackAppelAuMoral(),
|
||||||
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
||||||
{ condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(armeParadeId) },
|
{ action: async r => await this.defender.incDecItemUse(armeParadeId, !RdDCombat.isParticuliere(r)) },
|
||||||
{ condition: RdDCombat.isReussite, action: r => this._onParadeNormale(r) },
|
{ action: r => this._onParade(r) },
|
||||||
{ condition: RdDCombat.isParticuliere, action: r => this._onParadeParticuliere(r) },
|
|
||||||
{ condition: RdDCombat.isEchec, action: r => this._onParadeEchec(r) },
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
dialog.render(true);
|
dialog.render(true);
|
||||||
@ -1037,8 +1045,20 @@ export class RdDCombat {
|
|||||||
return defenderRoll;
|
return defenderRoll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async _onParade(defenderRoll) {
|
||||||
|
if (RdDCombat.isReussite(defenderRoll)) {
|
||||||
|
await this._onParadeNormale(defenderRoll)
|
||||||
|
if (RdDCombat.isParticuliere(defenderRoll)) {
|
||||||
|
await this._onParadeParticuliere(defenderRoll)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
await this._onParadeEchec(defenderRoll)
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_onParadeParticuliere(defenderRoll) {
|
async _onParadeParticuliere(defenderRoll) {
|
||||||
console.log("RdDCombat._onParadeParticuliere >>>", defenderRoll);
|
console.log("RdDCombat._onParadeParticuliere >>>", defenderRoll);
|
||||||
if (!defenderRoll.attackerRoll.isPart) {
|
if (!defenderRoll.attackerRoll.isPart) {
|
||||||
// TODO: attaquant doit jouer résistance et peut être désarmé p132
|
// TODO: attaquant doit jouer résistance et peut être désarmé p132
|
||||||
@ -1047,14 +1067,13 @@ export class RdDCombat {
|
|||||||
this.defender)
|
this.defender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onParadeNormale(defenderRoll) {
|
async _onParadeNormale(defenderRoll) {
|
||||||
console.log("RdDCombat._onParadeNormale >>>", defenderRoll);
|
console.log("RdDCombat._onParadeNormale >>>", defenderRoll);
|
||||||
|
|
||||||
await this.computeRecul(defenderRoll);
|
await this.computeRecul(defenderRoll);
|
||||||
await this.computeDeteriorationArme(defenderRoll);
|
await this.computeDeteriorationArme(defenderRoll);
|
||||||
await RdDResolutionTable.displayRollData(defenderRoll, this.defender, 'chat-resultat-parade.html');
|
await RdDRollResult.displayRollData(defenderRoll, this.defender, 'chat-resultat-parade.hbs');
|
||||||
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1062,7 +1081,7 @@ export class RdDCombat {
|
|||||||
async _onParadeEchec(defenderRoll) {
|
async _onParadeEchec(defenderRoll) {
|
||||||
console.log("RdDCombat._onParadeEchec >>>", defenderRoll);
|
console.log("RdDCombat._onParadeEchec >>>", defenderRoll);
|
||||||
|
|
||||||
await RdDResolutionTable.displayRollData(defenderRoll, this.defender, 'chat-resultat-parade.html');
|
await RdDRollResult.displayRollData(defenderRoll, this.defender, 'chat-resultat-parade.hbs');
|
||||||
|
|
||||||
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
||||||
this._sendMessageDefense(defenderRoll.attackerRoll, defenderRoll, { defense: true });
|
this._sendMessageDefense(defenderRoll.attackerRoll, defenderRoll, { defense: true });
|
||||||
@ -1079,18 +1098,16 @@ export class RdDCombat {
|
|||||||
let rollData = this._prepareEsquive(attackerRoll, esquive);
|
let rollData = this._prepareEsquive(attackerRoll, esquive);
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this.defender, rollData,
|
const dialog = await RdDRoll.create(this.defender, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs' },
|
||||||
{
|
{
|
||||||
name: 'jet-esquive',
|
name: 'jet-esquive',
|
||||||
label: 'Esquiver',
|
label: 'Esquiver',
|
||||||
callbacks: [
|
callbacks: [
|
||||||
this.defender.createCallbackExperience(),
|
this.defender.createCallbackExperience(),
|
||||||
this.defender.createCallbackAppelAuMoral(),
|
this.defender.createCallbackAppelAuMoral(),
|
||||||
{ condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(esquive._id) },
|
{ action: async r => await this.defender.incDecItemUse(esquive._id, !RdDCombat.isParticuliere(r)) },
|
||||||
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
{ action: r => this.removeChatMessageActionsPasseArme(r.passeArme) },
|
||||||
{ condition: RdDCombat.isReussite, action: r => this._onEsquiveNormale(r) },
|
{ action: r => this._onEsquive(r) },
|
||||||
{ condition: RdDCombat.isParticuliere, action: r => this._onEsquiveParticuliere(r) },
|
|
||||||
{ condition: RdDCombat.isEchec, action: r => this._onEsquiveEchec(r) },
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
dialog.render(true);
|
dialog.render(true);
|
||||||
@ -1118,9 +1135,19 @@ export class RdDCombat {
|
|||||||
return rollData;
|
return rollData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _onEsquive(defenderRoll) {
|
||||||
|
if (RdDCombat.isReussite(defenderRoll)) {
|
||||||
|
await this._onEsquiveNormale(defenderRoll)
|
||||||
|
if (RdDCombat.isParticuliere(defenderRoll)) {
|
||||||
|
await this._onEsquiveParticuliere(defenderRoll)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return await this._onEsquiveEchec(defenderRoll)
|
||||||
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_onEsquiveParticuliere(rollData) {
|
async _onEsquiveParticuliere(defenderRoll) {
|
||||||
console.log("RdDCombat._onEsquiveParticuliere >>>", rollData);
|
console.log("RdDCombat._onEsquiveParticuliere >>>", defenderRoll);
|
||||||
ChatUtility.createChatWithRollMode(
|
ChatUtility.createChatWithRollMode(
|
||||||
{ content: "<strong>Vous pouvez esquiver une deuxième fois!</strong>" },
|
{ content: "<strong>Vous pouvez esquiver une deuxième fois!</strong>" },
|
||||||
this.defender);
|
this.defender);
|
||||||
@ -1129,7 +1156,7 @@ export class RdDCombat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onEsquiveNormale(defenderRoll) {
|
async _onEsquiveNormale(defenderRoll) {
|
||||||
console.log("RdDCombat._onEsquiveNormal >>>", defenderRoll);
|
console.log("RdDCombat._onEsquiveNormal >>>", defenderRoll);
|
||||||
await RdDResolutionTable.displayRollData(defenderRoll, this.defender, 'chat-resultat-esquive.html');
|
await RdDRollResult.displayRollData(defenderRoll, this.defender, 'chat-resultat-esquive.hbs');
|
||||||
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1137,7 +1164,7 @@ export class RdDCombat {
|
|||||||
async _onEsquiveEchec(defenderRoll) {
|
async _onEsquiveEchec(defenderRoll) {
|
||||||
console.log("RdDCombat._onEsquiveEchec >>>", defenderRoll);
|
console.log("RdDCombat._onEsquiveEchec >>>", defenderRoll);
|
||||||
|
|
||||||
await RdDResolutionTable.displayRollData(defenderRoll, this.defender, 'chat-resultat-esquive.html');
|
await RdDRollResult.displayRollData(defenderRoll, this.defender, 'chat-resultat-esquive.hbs');
|
||||||
|
|
||||||
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
||||||
this._sendMessageDefense(defenderRoll.attackerRoll, defenderRoll, { defense: true })
|
this._sendMessageDefense(defenderRoll.attackerRoll, defenderRoll, { defense: true })
|
||||||
|
@ -18,6 +18,7 @@ import { FenetreRechercheTirage } from "./tirage/fenetre-recherche-tirage.js";
|
|||||||
import { TMRUtility } from "./tmr-utility.js";
|
import { TMRUtility } from "./tmr-utility.js";
|
||||||
import { DialogFatigueVoyage } from "./voyage/dialog-fatigue-voyage.js";
|
import { DialogFatigueVoyage } from "./voyage/dialog-fatigue-voyage.js";
|
||||||
import { ChatUtility } from "./chat-utility.js";
|
import { ChatUtility } from "./chat-utility.js";
|
||||||
|
import { RdDRollResult } from "./rdd-roll-result.js";
|
||||||
|
|
||||||
const rddRollNumeric = /^(\d+)\s*([\+\-]?\d+)?\s*(s)?/;
|
const rddRollNumeric = /^(\d+)\s*([\+\-]?\d+)?\s*(s)?/;
|
||||||
|
|
||||||
@ -128,6 +129,16 @@ export class RdDCommands {
|
|||||||
<br><strong>/rdd vol déser +2</strong> effectue un jet de Volonté/Survie en désert à +2 pour les tokens sélectionnés
|
<br><strong>/rdd vol déser +2</strong> effectue un jet de Volonté/Survie en désert à +2 pour les tokens sélectionnés
|
||||||
`
|
`
|
||||||
});
|
});
|
||||||
|
this.registerCommand({
|
||||||
|
path: ["/jet"], func: (content, msg, params) => this.askRollRdd(msg, params),
|
||||||
|
descr: `Poste dans le tchat un jet de dés à effectuer. Exemples:
|
||||||
|
<br><strong>/jet Vue Vigilance</strong> poste une demande de jet de VUE / Vigilance à 0
|
||||||
|
<br><strong>/jet Vue</strong> poste une demande de jet de VUE à 0
|
||||||
|
<br><strong>/jet Vue -2</strong> poste une demande de jet de VUE à -2
|
||||||
|
<br><strong>/jet Vue Vigilance -2</strong> poste une demande de jet de VUE / Vigilance à -2
|
||||||
|
<br><strong>/jet vol déser +2</strong> poste une demande de jet de VOLONTÉ / Survie en désert à +2
|
||||||
|
`
|
||||||
|
});
|
||||||
this.registerCommand({ path: ["/ddr"], func: (content, msg, params) => this.rollDeDraconique(msg), descr: "Lance un Dé Draconique" });
|
this.registerCommand({ path: ["/ddr"], func: (content, msg, params) => this.rollDeDraconique(msg), descr: "Lance un Dé Draconique" });
|
||||||
|
|
||||||
this.registerCommand({
|
this.registerCommand({
|
||||||
@ -256,7 +267,7 @@ export class RdDCommands {
|
|||||||
let commands = []
|
let commands = []
|
||||||
this._buildSubTableHelp(commands, table ?? this.commandsTable);
|
this._buildSubTableHelp(commands, table ?? this.commandsTable);
|
||||||
|
|
||||||
let html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/settings/dialog-aide-commands.html", { commands: commands });
|
let html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/settings/dialog-aide-commands.hbs", { commands: commands });
|
||||||
let d = new Dialog(
|
let d = new Dialog(
|
||||||
{
|
{
|
||||||
title: "Commandes disponibles dans le tchat",
|
title: "Commandes disponibles dans le tchat",
|
||||||
@ -339,6 +350,25 @@ export class RdDCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
async askRollRdd(msg, params) {
|
||||||
|
if (params.length == 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let length = params.length;
|
||||||
|
let diff = Number(params[length - 1]);
|
||||||
|
if (Number.isInteger(Number(diff))) {
|
||||||
|
length--;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
diff = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const carac = params[0];
|
||||||
|
const competence = length > 1 ? '/' + Misc.join(params.slice(1, length), ' ') : ''
|
||||||
|
ChatMessage.create({ content: `@roll[${carac}${competence}/${diff}]` })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollRdDNumeric(msg, carac, diff, significative = false) {
|
async rollRdDNumeric(msg, carac, diff, significative = false) {
|
||||||
@ -349,7 +379,7 @@ export class RdDCommands {
|
|||||||
show: { title: "Table de résolution" }
|
show: { title: "Table de résolution" }
|
||||||
};
|
};
|
||||||
await RdDResolutionTable.rollData(rollData);
|
await RdDResolutionTable.rollData(rollData);
|
||||||
return RdDCommands._chatAnswer(msg, await RdDResolutionTable.buildRollDataHtml(rollData));
|
return RdDCommands._chatAnswer(msg, await RdDRollResult.buildRollDataHtml(rollData));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
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 { 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 { ITEM_TYPES } from "./constants.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
|
import { RdDRollResult } from "./rdd-roll-result.js";
|
||||||
/* -------------------------------------------- */
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class RdDEmpoignade {
|
export class RdDEmpoignade {
|
||||||
@ -159,7 +157,7 @@ export class RdDEmpoignade {
|
|||||||
if ((isNouvelle || empoignade.system.pointsemp == 0) && defender.hasArmeeMeleeEquipee()) {
|
if ((isNouvelle || empoignade.system.pointsemp == 0) && defender.hasArmeeMeleeEquipee()) {
|
||||||
ChatUtility.createChatWithRollMode(
|
ChatUtility.createChatWithRollMode(
|
||||||
{
|
{
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-empoignade-valider.html`, { attacker: attacker, defender: defender })
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-empoignade-valider.hbs`, { attacker: attacker, defender: defender })
|
||||||
},
|
},
|
||||||
attacker
|
attacker
|
||||||
)
|
)
|
||||||
@ -192,7 +190,7 @@ export class RdDEmpoignade {
|
|||||||
}
|
}
|
||||||
if (empoignade.system.pointsemp >= 2) {
|
if (empoignade.system.pointsemp >= 2) {
|
||||||
if (!empoignade.system.ausol) {
|
if (!empoignade.system.ausol) {
|
||||||
let msg = await RdDResolutionTable.displayRollData(rollData, attacker, 'chat-empoignade-entrainer.html');
|
let msg = await RdDRollResult.displayRollData(rollData, attacker, 'chat-empoignade-entrainer.hbs');
|
||||||
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -216,7 +214,7 @@ export class RdDEmpoignade {
|
|||||||
}
|
}
|
||||||
const msg = await ChatMessage.create({
|
const msg = await ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(attacker),
|
whisper: ChatUtility.getOwners(attacker),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-empoignade-immobilise.html`, rollData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-empoignade-immobilise.hbs`, rollData)
|
||||||
})
|
})
|
||||||
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
||||||
}
|
}
|
||||||
@ -224,7 +222,7 @@ export class RdDEmpoignade {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async $rollAttaqueEmpoignade(attacker, rollData, isNouvelle = false) {
|
static async $rollAttaqueEmpoignade(attacker, rollData, isNouvelle = false) {
|
||||||
const dialog = await RdDRoll.create(attacker, rollData,
|
const dialog = await RdDRoll.create(attacker, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs' },
|
||||||
{
|
{
|
||||||
name: 'jet-empoignade',
|
name: 'jet-empoignade',
|
||||||
label: 'Empoigner',
|
label: 'Empoigner',
|
||||||
@ -250,7 +248,7 @@ export class RdDEmpoignade {
|
|||||||
if (rollData.rolled.isPart) {
|
if (rollData.rolled.isPart) {
|
||||||
rollData.particuliere = "finesse";
|
rollData.particuliere = "finesse";
|
||||||
}
|
}
|
||||||
let msg = await RdDResolutionTable.displayRollData(rollData, defender, 'chat-empoignade-resultat.html');
|
let msg = await RdDRollResult.displayRollData(rollData, defender, 'chat-empoignade-resultat.hbs');
|
||||||
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +285,7 @@ export class RdDEmpoignade {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async $rollDefenseEmpoignade(defender, defenderRoll) {
|
static async $rollDefenseEmpoignade(defender, defenderRoll) {
|
||||||
const dialog = await RdDRoll.create(defender, defenderRoll,
|
const dialog = await RdDRoll.create(defender, defenderRoll,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-defense-empoignade.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-defense-empoignade.hbs' },
|
||||||
{
|
{
|
||||||
name: 'empoignade',
|
name: 'empoignade',
|
||||||
label: 'Contrer',
|
label: 'Contrer',
|
||||||
@ -312,9 +310,9 @@ export class RdDEmpoignade {
|
|||||||
RdDEmpoignade.$updateEtatEmpoignade(empoignade)
|
RdDEmpoignade.$updateEtatEmpoignade(empoignade)
|
||||||
}
|
}
|
||||||
|
|
||||||
await RdDResolutionTable.displayRollData(rollData, rollData.defender, 'chat-empoignade-resultat.html')
|
await RdDRollResult.displayRollData(rollData, rollData.defender, 'chat-empoignade-resultat.hbs')
|
||||||
if (empoignade.system.pointsemp >= 2) {
|
if (empoignade.system.pointsemp >= 2) {
|
||||||
let msg = await RdDResolutionTable.displayRollData(rollData, rollData.attacker, 'chat-empoignade-entrainer.html');
|
let msg = await RdDRollResult.displayRollData(rollData, rollData.attacker, 'chat-empoignade-entrainer.hbs');
|
||||||
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -358,7 +356,7 @@ export class RdDEmpoignade {
|
|||||||
await attacker.setEffect(STATUSES.StatusProne, true);
|
await attacker.setEffect(STATUSES.StatusProne, true);
|
||||||
await defender.setEffect(STATUSES.StatusProne, true);
|
await defender.setEffect(STATUSES.StatusProne, true);
|
||||||
|
|
||||||
let msg = await RdDResolutionTable.displayRollData(rollData, attacker, 'chat-empoignade-entrainer-sol.html');
|
let msg = await RdDRollResult.displayRollData(rollData, attacker, 'chat-empoignade-entrainer-sol.hbs');
|
||||||
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,7 +372,7 @@ export class RdDEmpoignade {
|
|||||||
await defender.setEffect(STATUSES.StatusProne, true);
|
await defender.setEffect(STATUSES.StatusProne, true);
|
||||||
await this.$deleteEmpoignade(empoignade)
|
await this.$deleteEmpoignade(empoignade)
|
||||||
|
|
||||||
let msg = await RdDResolutionTable.displayRollData(rollData, attacker, 'chat-empoignade-projeter-sol.html');
|
let msg = await RdDRollResult.displayRollData(rollData, attacker, 'chat-empoignade-projeter-sol.hbs');
|
||||||
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,7 +399,7 @@ export class RdDEmpoignade {
|
|||||||
if (perteMode == "endquart") {
|
if (perteMode == "endquart") {
|
||||||
await defender.santeIncDec("endurance", -(3 * Math.floor(endValue / 4)));
|
await defender.santeIncDec("endurance", -(3 * Math.floor(endValue / 4)));
|
||||||
}
|
}
|
||||||
let msg = await RdDResolutionTable.displayRollData(rollData, attacker, 'chat-empoignade-perte-endurance.html');
|
let msg = await RdDRollResult.displayRollData(rollData, attacker, 'chat-empoignade-perte-endurance.hbs');
|
||||||
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
RdDEmpoignade.$storeRollEmpoignade(msg, rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
|
|
||||||
const tableGemmes = {
|
|
||||||
"almaze": { label: "Almaze", couleur: "Blanc"},
|
|
||||||
"aquafane": { label: "Aquafane", couleur: "Vert Profond"},
|
|
||||||
"asterite": { label: "Astérite", couleur: "Bleu, Violet ou Blanc"},
|
|
||||||
"cyanolithe": { label: "Cyanolithe", couleur: "Bleu Intense"},
|
|
||||||
"larmededragon": { label: "Larme de Dragon", couleur: "Rouge Intense"},
|
|
||||||
"muska": { label: "Muska", couleur: "Violet Profond"},
|
|
||||||
"nebuleuse": { label: "Nébuleuse", couleur: "Brouillard Intense"},
|
|
||||||
"nebuleuse": { label: "Nébuleuse", couleur: "Brouillard Intense, Rose, Vert ou Bleu Pâle"},
|
|
||||||
"oeildetigre": { label: "Oeil de Tigre", couleur: "Jaune"},
|
|
||||||
"scarlatine": { label: "Scarlatine", couleur: "Rouge Clair ou Orangé"},
|
|
||||||
"seliphane": { label: "Séliphane", couleur: "Vert Lumineux"},
|
|
||||||
"tournelune": { label: "Tournelune", couleur: "Violet ou Bleu"},
|
|
||||||
"zebraide": { label: "Zebraïde", couleur: "Bandes Bicolores, toutes couleurs"}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class RdDGemme extends Item {
|
|
||||||
|
|
||||||
static getGemmeTypeOptionList() {
|
|
||||||
// TODO: look how to map object key-value pairs
|
|
||||||
let options = ""
|
|
||||||
for (let gemmeKey in tableGemmes) {
|
|
||||||
options += `<option value="${gemmeKey}">${tableGemmes[gemmeKey].label}</option>`
|
|
||||||
}
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static calculDataDerivees(gemme) {
|
|
||||||
gemme.system.cout = (gemme.system.taille * gemme.system.purete) + gemme.system.qualite;
|
|
||||||
gemme.system.inertie = 7 - gemme.system.purete;
|
|
||||||
gemme.system.enchantabilite = gemme.system.taille - gemme.system.inertie;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -77,6 +77,8 @@ import { RdDStatBlockParser } from "./apps/rdd-import-stats.js"
|
|||||||
import { RdDJournalSheet } from "./journal/journal-sheet.js"
|
import { RdDJournalSheet } from "./journal/journal-sheet.js"
|
||||||
import { RdDPotionItemSheet } from "./item/sheet-potion.js"
|
import { RdDPotionItemSheet } from "./item/sheet-potion.js"
|
||||||
import { RdDItemPotion } from "./item/potion.js"
|
import { RdDItemPotion } from "./item/potion.js"
|
||||||
|
import { RdDItemGemme } from "./item/gemme.js"
|
||||||
|
import { RdDGemmeItemSheet } from "./item/sheet-gemme.js"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RdD system
|
* RdD system
|
||||||
@ -100,17 +102,18 @@ export class SystemReveDeDragon {
|
|||||||
this.itemClasses = {
|
this.itemClasses = {
|
||||||
armure: RdDItemArmure,
|
armure: RdDItemArmure,
|
||||||
blessure: RdDItemBlessure,
|
blessure: RdDItemBlessure,
|
||||||
|
gemme: RdDItemGemme,
|
||||||
maladie: RdDItemMaladie,
|
maladie: RdDItemMaladie,
|
||||||
ombre: RdDItemOmbre,
|
ombre: RdDItemOmbre,
|
||||||
poison: RdDItemPoison,
|
poison: RdDItemPoison,
|
||||||
queue: RdDItemQueue,
|
|
||||||
tete: RdDItemTete,
|
|
||||||
potion: RdDItemPotion,
|
potion: RdDItemPotion,
|
||||||
|
queue: RdDItemQueue,
|
||||||
race: RdDItemRace,
|
race: RdDItemRace,
|
||||||
rencontre: RdDRencontre,
|
rencontre: RdDRencontre,
|
||||||
service: RdDItemService,
|
service: RdDItemService,
|
||||||
signedraconique: RdDItemSigneDraconique,
|
signedraconique: RdDItemSigneDraconique,
|
||||||
souffle: RdDItemSouffle,
|
souffle: RdDItemSouffle,
|
||||||
|
tete: RdDItemTete,
|
||||||
}
|
}
|
||||||
this.actorClasses = {
|
this.actorClasses = {
|
||||||
commerce: RdDCommerce,
|
commerce: RdDCommerce,
|
||||||
@ -190,22 +193,10 @@ export class SystemReveDeDragon {
|
|||||||
Items.unregisterSheet("core", ItemSheet)
|
Items.unregisterSheet("core", ItemSheet)
|
||||||
RdDActorExportSheet.init()
|
RdDActorExportSheet.init()
|
||||||
|
|
||||||
RdDItemSheet.register(RdDSigneDraconiqueItemSheet)
|
|
||||||
RdDItemSheet.register(RdDRencontreItemSheet)
|
|
||||||
RdDItemSheet.register(RdDConteneurItemSheet)
|
|
||||||
RdDItemSheet.register(RdDHerbeItemSheet)
|
|
||||||
RdDItemSheet.register(RdDFauneItemSheet)
|
|
||||||
RdDItemSheet.register(RdDPlanteItemSheet)
|
|
||||||
RdDItemSheet.register(RdDPotionItemSheet)
|
|
||||||
RdDItemSheet.register(RdDIngredientItemSheet)
|
|
||||||
RdDItemSheet.register(RdDServiceItemSheet)
|
|
||||||
RdDItemSheet.register(RdDBlessureItemSheet)
|
|
||||||
RdDJournalSheet.register()
|
|
||||||
|
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||||
types: [
|
types: [
|
||||||
"objet", "arme", "armure", "livre", "munition",
|
"objet", "arme", "armure", "livre", "munition",
|
||||||
"monnaie", "nourritureboisson", "gemme",
|
"monnaie", "nourritureboisson",
|
||||||
],
|
],
|
||||||
makeDefault: true
|
makeDefault: true
|
||||||
})
|
})
|
||||||
@ -220,6 +211,19 @@ export class SystemReveDeDragon {
|
|||||||
],
|
],
|
||||||
makeDefault: true
|
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)
|
||||||
|
RdDJournalSheet.register()
|
||||||
|
|
||||||
// préparation des différents modules
|
// préparation des différents modules
|
||||||
console.log(`Initializing Reve de Dragon Hooks and handlers`)
|
console.log(`Initializing Reve de Dragon Hooks and handlers`)
|
||||||
|
@ -117,7 +117,7 @@ export class RdDMeteo {
|
|||||||
meteo.pluie.description = RdDMeteo.pluie(meteo.pluie.force);
|
meteo.pluie.description = RdDMeteo.pluie(meteo.pluie.force);
|
||||||
|
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-meteo.html', meteo),
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-meteo.hbs', meteo),
|
||||||
whisper: ChatUtility.getGMs()
|
whisper: ChatUtility.getGMs()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ const words = ['pore', 'pre', 'flor', 'lane', 'turlu', 'pin', 'a', 'alph', 'i',
|
|||||||
export class RdDNameGen {
|
export class RdDNameGen {
|
||||||
|
|
||||||
static async proposeName(msg, params) {
|
static async proposeName(msg, params) {
|
||||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-command-nom.html`, {
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-command-nom.hbs`, {
|
||||||
nom: await RdDNameGen.generate()
|
nom: await RdDNameGen.generate()
|
||||||
});
|
});
|
||||||
ChatMessage.create({ content: html, whisper: ChatUtility.getGMs() });
|
ChatMessage.create({ content: html, whisper: ChatUtility.getGMs() });
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* -------------------------------------------- */
|
|
||||||
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 "./constants.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
|
import { RdDRollResult } from "./rdd-roll-result.js";
|
||||||
|
import { Grammar } from "./grammar.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* On part du principe qu'une entité démarre tjs
|
/* On part du principe qu'une entité démarre tjs
|
||||||
@ -91,18 +91,21 @@ export class RdDPossession {
|
|||||||
}
|
}
|
||||||
RdDPossession.selectCompetenceDraconicOuPossession(rollData, defender)
|
RdDPossession.selectCompetenceDraconicOuPossession(rollData, defender)
|
||||||
rollData.diffLibre = RdDPossession.getInfoAttaque(rollData).diffLibre
|
rollData.diffLibre = RdDPossession.getInfoAttaque(rollData).diffLibre
|
||||||
|
|
||||||
await RdDPossession.$rollDefensePossession(defender, rollData);
|
await RdDPossession.$rollDefensePossession(defender, rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static selectCompetenceDraconicOuPossession(rollData, rollingActor) {
|
static selectCompetenceDraconicOuPossession(rollData, rollingActor) {
|
||||||
rollData.competence = rollingActor.getDraconicOuPossession();
|
rollData.competence = rollingActor.getDraconicOuPossession();
|
||||||
if (rollingActor.isCreatureEntite()) {
|
if (rollingActor.isCreatureEntite()) {
|
||||||
RdDItemCompetenceCreature.setRollDataCreature(rollData)
|
const carac = rollingActor.system.carac
|
||||||
|
rollData.carac = carac
|
||||||
|
rollData.competence.system.defaut_carac = 'reve'
|
||||||
|
rollData.selectedCarac = carac.reve
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rollData.selectedCarac = rollingActor.system.carac.reve
|
|
||||||
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: rollingActor.getReveActuel() } }
|
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: rollingActor.getReveActuel() } }
|
||||||
|
rollData.selectedCarac = rollData.forceCarac['reve-actuel']
|
||||||
rollData.competence.system.defaut_carac = 'reve-actuel'
|
rollData.competence.system.defaut_carac = 'reve-actuel'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,7 +113,7 @@ export class RdDPossession {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async $rollAttaquePossession(attacker, rollData, isNouvelle = false) {
|
static async $rollAttaquePossession(attacker, rollData, isNouvelle = false) {
|
||||||
const dialog = await RdDRoll.create(attacker, rollData,
|
const dialog = await RdDRoll.create(attacker, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs' },
|
||||||
{
|
{
|
||||||
name: 'jet-possession',
|
name: 'jet-possession',
|
||||||
label: rollData.isECNIDefender ? 'Conjurer la possession' : 'Possession',
|
label: rollData.isECNIDefender ? 'Conjurer la possession' : 'Possession',
|
||||||
@ -131,13 +134,13 @@ export class RdDPossession {
|
|||||||
}
|
}
|
||||||
const possession = (rollData.isECNIDefender ? rollData.attacker : rollData.defender).getPossession(rollData.possession.system.possessionid)
|
const possession = (rollData.isECNIDefender ? rollData.attacker : rollData.defender).getPossession(rollData.possession.system.possessionid)
|
||||||
RdDPossession.storePossessionAttaque(possession, rollData)
|
RdDPossession.storePossessionAttaque(possession, rollData)
|
||||||
await RdDResolutionTable.displayRollData(rollData, rollData.defender, 'chat-resultat-possession.html');
|
await RdDRollResult.displayRollData(rollData, rollData.defender, 'chat-resultat-possession.hbs');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async $rollDefensePossession(defender, rollData) {
|
static async $rollDefensePossession(defender, rollData) {
|
||||||
const dialog = await RdDRoll.create(defender, rollData,
|
const dialog = await RdDRoll.create(defender, rollData,
|
||||||
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-defense-possession.html' },
|
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-defense-possession.hbs' },
|
||||||
{
|
{
|
||||||
name: 'possession',
|
name: 'possession',
|
||||||
label: 'Conjurer une Possession',
|
label: 'Conjurer une Possession',
|
||||||
@ -171,7 +174,7 @@ export class RdDPossession {
|
|||||||
rollData.possession = possession
|
rollData.possession = possession
|
||||||
RdDPossession.$updateEtatPossession(rollData.possession)
|
RdDPossession.$updateEtatPossession(rollData.possession)
|
||||||
|
|
||||||
await RdDResolutionTable.displayRollData(rollData, rollData.attacker, 'chat-resultat-possession.html')
|
await RdDRollResult.displayRollData(rollData, rollData.attacker, 'chat-resultat-possession.hbs')
|
||||||
if (rollData.possession.isPosseder || rollData.possession.isConjurer) {
|
if (rollData.possession.isPosseder || rollData.possession.isConjurer) {
|
||||||
// conjuration
|
// conjuration
|
||||||
await victime.deleteEmbeddedDocuments("Item", [rollData.possession._id])
|
await victime.deleteEmbeddedDocuments("Item", [rollData.possession._id])
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { ChatUtility } from "./chat-utility.js";
|
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDDice } from "./rdd-dice.js";
|
import { RdDDice } from "./rdd-dice.js";
|
||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||||
@ -54,7 +53,6 @@ export class RdDResolutionTable {
|
|||||||
return this._computeCell(level, percentage);
|
return this._computeCell(level, percentage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static _computeRow(caracValue) {
|
static _computeRow(caracValue) {
|
||||||
let dataRow = [
|
let dataRow = [
|
||||||
@ -89,24 +87,10 @@ export class RdDResolutionTable {
|
|||||||
return resultat;
|
return resultat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static async displayRollData(rollData, actor = undefined, template = 'chat-resultat-general.html') {
|
|
||||||
return await ChatUtility.createChatWithRollMode(
|
|
||||||
{ content: await RdDResolutionTable.buildRollDataHtml(rollData, template) },
|
|
||||||
actor
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
static actorChatName(actor) {
|
static actorChatName(actor) {
|
||||||
return actor ?? game.user.name;
|
return actor ?? game.user.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static async buildRollDataHtml(rollData, template = 'chat-resultat-general.html') {
|
|
||||||
rollData.show = rollData.show || {};
|
|
||||||
return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/${template}`, rollData);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async rollData(rollData) {
|
static async rollData(rollData) {
|
||||||
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData);
|
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData);
|
||||||
@ -284,7 +268,7 @@ export class RdDResolutionTable {
|
|||||||
maxCarac = Math.min(maxCarac, minCarac + 20);
|
maxCarac = Math.min(maxCarac, minCarac + 20);
|
||||||
minLevel = Math.max(minLevel, -10);
|
minLevel = Math.max(minLevel, -10);
|
||||||
maxLevel = Math.max(Math.min(maxLevel, 30), minLevel + colonnes);
|
maxLevel = Math.max(Math.min(maxLevel, 30), minLevel + colonnes);
|
||||||
return await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/resolution-table.html', {
|
return await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/resolution-table.hbs', {
|
||||||
carac: carac,
|
carac: carac,
|
||||||
difficulte: level,
|
difficulte: level,
|
||||||
min: minLevel,
|
min: minLevel,
|
||||||
|
@ -8,7 +8,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
|||||||
export class RdDEncaisser extends Dialog {
|
export class RdDEncaisser extends Dialog {
|
||||||
|
|
||||||
static async encaisser(actor) {
|
static async encaisser(actor) {
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html',
|
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.hbs',
|
||||||
{ ajustementsEncaissement: RdDUtility.getAjustementsEncaissement() }
|
{ ajustementsEncaissement: RdDUtility.getAjustementsEncaissement() }
|
||||||
);
|
);
|
||||||
new RdDEncaisser(html, actor).render(true);
|
new RdDEncaisser(html, actor).render(true);
|
||||||
|
@ -15,7 +15,7 @@ export class RdDRollResolutionTable extends Dialog {
|
|||||||
if (RdDRollResolutionTable.resolutionTable == undefined) {
|
if (RdDRollResolutionTable.resolutionTable == undefined) {
|
||||||
const rollData = {}
|
const rollData = {}
|
||||||
RdDRollResolutionTable._setDefaultOptions(rollData);
|
RdDRollResolutionTable._setDefaultOptions(rollData);
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-resolution.html', rollData);
|
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-resolution.hbs', rollData);
|
||||||
RdDRollResolutionTable.resolutionTable = new RdDRollResolutionTable(rollData, html);
|
RdDRollResolutionTable.resolutionTable = new RdDRollResolutionTable(rollData, html);
|
||||||
RdDRollResolutionTable.resolutionTable.render(true);
|
RdDRollResolutionTable.resolutionTable.render(true);
|
||||||
}
|
}
|
||||||
|
17
module/rdd-roll-result.js
Normal file
17
module/rdd-roll-result.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { ChatUtility } from "./chat-utility.js";
|
||||||
|
|
||||||
|
export class RdDRollResult {
|
||||||
|
|
||||||
|
static async displayRollData(rollData, actor = undefined, template = 'chat-resultat-general.hbs') {
|
||||||
|
const chatMessage = await ChatUtility.createChatWithRollMode(
|
||||||
|
{ content: await RdDRollResult.buildRollDataHtml(rollData, template) },
|
||||||
|
actor
|
||||||
|
)
|
||||||
|
return chatMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
static async buildRollDataHtml(rollData, template = 'chat-resultat-general.hbs') {
|
||||||
|
rollData.show = rollData.show || {};
|
||||||
|
return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/${template}`, rollData);
|
||||||
|
}
|
||||||
|
}
|
@ -138,9 +138,9 @@ export class RdDRoll extends Dialog {
|
|||||||
}
|
}
|
||||||
if (this.rollData.selectedCarac) {
|
if (this.rollData.selectedCarac) {
|
||||||
this.html.find("[name='carac']").val(
|
this.html.find("[name='carac']").val(
|
||||||
this.actor?.type == ACTOR_TYPES.personnage
|
RdDCarac.caracDetails(this.rollData.selectedCarac.label, { onMessage: m => { } })?.code
|
||||||
? RdDCarac.caracDetails(this.rollData.selectedCarac.label).code
|
?? this.rollData.selectedCarac.code
|
||||||
: this.rollData.selectedCarac.label
|
?? Grammar.toLowerCaseNoAccentNoSpace(this.rollData.selectedCarac.label)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (this.rollData.selectedSort) {
|
if (this.rollData.selectedSort) {
|
||||||
@ -269,24 +269,21 @@ export class RdDRoll extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async onAction(action) {
|
async onAction(action) {
|
||||||
this.rollData.forceDiceResult = Number.parseInt(this.html.find("[name='force-dice-result']").val()) ?? -1;
|
this.rollData.forceDiceResult = Number.parseInt(this.html.find("[name='force-dice-result']").val()) ?? -1
|
||||||
await RdDResolutionTable.rollData(this.rollData);
|
await RdDResolutionTable.rollData(this.rollData)
|
||||||
console.log("RdDRoll -=>", this.rollData, this.rollData.rolled);
|
|
||||||
if (action.callbacks)
|
for (let callback of action.callbacks) {
|
||||||
for (let callback of action.callbacks) {
|
await callback.action(this.rollData)
|
||||||
if (callback.condition == undefined || callback.condition(this.rollData)) {
|
}
|
||||||
await callback.action(this.rollData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async setSelectedSort(sort) {
|
async setSelectedSort(sort) {
|
||||||
this.rollData.selectedSort = sort; // Update the selectedCarac
|
this.rollData.selectedSort = sort; // Update the selectedCarac
|
||||||
this.rollData.competence = RdDItemCompetence.getVoieDraconic(this.rollData.draconicList, sort.system.draconic);
|
this.rollData.competence = RdDItemSort.getBestDraconicSort(this.rollData.draconicList, sort)
|
||||||
this.rollData.bonus = RdDItemSort.getCaseBonus(sort, this.rollData.tmr.coord);
|
this.rollData.bonus = RdDItemSort.getCaseBonus(sort, this.rollData.tmr.coord);
|
||||||
this.rollData.diffLibre = RdDItemSort.getDifficulte(sort, -7);
|
this.rollData.diffLibre = RdDItemSort.getDifficulte(sort, -7);
|
||||||
RdDItemSort.setCoutReveReel(sort);
|
RdDItemSort.setCoutReveReel(sort);
|
||||||
const htmlSortDescription = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.html", { sort: sort });
|
const htmlSortDescription = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.hbs", { sort: sort });
|
||||||
this.html.find(".sort-ou-rituel").text(sort.system.isrituel ? "rituel" : "sort");
|
this.html.find(".sort-ou-rituel").text(sort.system.isrituel ? "rituel" : "sort");
|
||||||
this.html.find(".bonus-case").text(`${this.rollData.bonus}%`);
|
this.html.find(".bonus-case").text(`${this.rollData.bonus}%`);
|
||||||
this.html.find(".placeholder-description-sort").children().remove();
|
this.html.find(".placeholder-description-sort").children().remove();
|
||||||
@ -347,7 +344,7 @@ export class RdDRoll extends Dialog {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async buildAjustements(rollData) {
|
async buildAjustements(rollData) {
|
||||||
return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.html`, rollData);
|
return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.hbs`, rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -66,10 +66,12 @@ export class RdDSheetUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async splitItem(item, actor, onSplit = () => { }) {
|
static async splitItem(item, actor, onSplit = () => { }) {
|
||||||
const dialog = await DialogSplitItem.create(item, async (item, split) => {
|
const _onSplit = async (item, split) => {
|
||||||
await RdDSheetUtility._onSplitItem(item, split, actor);
|
await RdDSheetUtility._onSplitItem(item, split, actor);
|
||||||
onSplit();
|
onSplit();
|
||||||
});
|
await RdDSheetUtility.renderItemBranch(actor, item)
|
||||||
|
}
|
||||||
|
const dialog = await DialogSplitItem.create(item, _onSplit)
|
||||||
dialog.render(true)
|
dialog.render(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
|||||||
import { RdDDice } from "./rdd-dice.js";
|
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 { ITEM_TYPES } from "./constants.js";
|
import { ITEM_TYPES } from "./constants.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
|
|
||||||
static async create(actor, tmrData) {
|
static async create(actor, tmrData) {
|
||||||
await PixiTMR.init()
|
await PixiTMR.init()
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', tmrData);
|
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.hbs', tmrData);
|
||||||
if (tmrData.mode != 'visu' && !game.user.isGM) {
|
if (tmrData.mode != 'visu' && !game.user.isGM) {
|
||||||
ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatUtility.getGMs() });
|
ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatUtility.getGMs() });
|
||||||
}
|
}
|
||||||
@ -83,7 +82,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
this.subdialog = undefined
|
this.subdialog = undefined
|
||||||
this.displaySize = undefined
|
this.displaySize = undefined
|
||||||
if (!this.viewOnly && !game.user.isGM) {
|
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 = [];
|
this.callbacksOnAnimate = [];
|
||||||
const displaySize = TMR_DISPLAY_SIZE.clamp(game.settings.get(SYSTEM_RDD, TMR_DISPLAY_SIZE.code) ?? TMR_DISPLAY_SIZE.def);
|
const displaySize = TMR_DISPLAY_SIZE.clamp(game.settings.get(SYSTEM_RDD, TMR_DISPLAY_SIZE.code) ?? TMR_DISPLAY_SIZE.def);
|
||||||
@ -139,7 +138,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
this.cumulFatigue += this.fatigueParCase;
|
this.cumulFatigue += this.fatigueParCase;
|
||||||
|
|
||||||
// Le reste...
|
// Le reste...
|
||||||
this.updateValuesDisplay();
|
this.$updateValuesDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
lancerUnSort() {
|
lancerUnSort() {
|
||||||
@ -190,7 +189,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
forceTMRContinueAction() {
|
forceTMRContinueAction() {
|
||||||
ui.notifications.warn('Vous devez finir votre action avant de continuer dans les TMR');
|
ui.notifications.warn('Vous devez finir votre action avant de continuer dans les TMR');
|
||||||
this.bringSubDialogToTop();
|
this.bringSubDialogToTop();
|
||||||
return;
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
setTMRPendingAction(dialog) {
|
setTMRPendingAction(dialog) {
|
||||||
@ -297,7 +296,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
const coordOrig = this._getCoordActor();
|
const coordOrig = this._getCoordActor();
|
||||||
const coordTarget = TMRUtility.deplacement(coordOrig, move);
|
const coordTarget = TMRUtility.deplacement(coordOrig, move);
|
||||||
await this._deplacerDemiReve(coordTarget, 'normal');
|
await this._deplacerDemiReve(coordTarget, 'normal');
|
||||||
this.checkQuitterTMR();
|
await this.$checkQuitterTMR();
|
||||||
}
|
}
|
||||||
|
|
||||||
calculCoutMonteeTMR() {
|
calculCoutMonteeTMR() {
|
||||||
@ -305,7 +304,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async updateValuesDisplay() {
|
async $updateValuesDisplay() {
|
||||||
if (this.viewOnly || !this.rendered) {
|
if (this.viewOnly || !this.rendered) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -336,22 +335,31 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async close() {
|
async close() {
|
||||||
|
await this.$forceClose(this.actor.name + " a quitté les terres médianes")
|
||||||
|
}
|
||||||
|
|
||||||
|
async $forceClose(message) {
|
||||||
if (this.subdialog) {
|
if (this.subdialog) {
|
||||||
return this.forceTMRContinueAction()
|
this.forceTMRContinueAction()
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
this.descenteTMR = true;
|
this.descenteTMR = true;
|
||||||
if (this.actor.tmrApp) {
|
if (this.actor.tmrApp) {
|
||||||
this.actor.tmrApp = undefined; // Cleanup reference
|
this.actor.tmrApp = undefined // Cleanup reference
|
||||||
|
const appliquerFatigue = ReglesOptionnelles.isUsing("appliquer-fatigue")
|
||||||
|
await this.actor.santeIncDec(
|
||||||
|
appliquerFatigue ? "fatigue" : "endurance",
|
||||||
|
(appliquerFatigue ? 1 : -1) * this.cumulFatigue)
|
||||||
if (!this.viewOnly) {
|
if (!this.viewOnly) {
|
||||||
await this.actor.setEffect(STATUSES.StatusDemiReve, false)
|
await this.actor.setEffect(STATUSES.StatusDemiReve, false)
|
||||||
this._tellToGM(this.actor.name + " a quitté les terres médianes");
|
this.$tellToUserAndGM(message)
|
||||||
}
|
}
|
||||||
await this.actor.santeIncDec((ReglesOptionnelles.isUsing("appliquer-fatigue") ? "fatigue" : "endurance"),
|
|
||||||
this.cumulFatigue)
|
|
||||||
}
|
}
|
||||||
await super.close();
|
this.pixiTMR.close();
|
||||||
this.pixiTMR.close()
|
|
||||||
this.pixiTMR = undefined
|
this.pixiTMR = undefined
|
||||||
|
await super.close();
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -363,48 +371,53 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'derober':
|
case 'derober':
|
||||||
await this.derober();
|
await this.$derober()
|
||||||
this.restoreTMRAfterAction();
|
this.restoreTMRAfterAction()
|
||||||
return;
|
return
|
||||||
case 'refouler':
|
case 'refouler':
|
||||||
await this.refouler();
|
await this.$refouler()
|
||||||
break;
|
break
|
||||||
case 'maitriser':
|
case 'maitriser':
|
||||||
await this.maitriserRencontre();
|
await this.$maitriserRencontre()
|
||||||
break;
|
break
|
||||||
case 'ignorer':
|
case 'ignorer':
|
||||||
await this.ignorerRencontre();
|
await this.$ignorerRencontre()
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
await this.postRencontre(tmr);
|
await this.postRencontre(tmr);
|
||||||
this.restoreTMRAfterAction();
|
this.restoreTMRAfterAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
async derober() {
|
async $derober() {
|
||||||
console.log("-> derober", this.currentRencontre);
|
if (this.currentRencontre) {
|
||||||
await this.actor.addTMRRencontre(this.currentRencontre);
|
console.log("-> derober", this.currentRencontre);
|
||||||
this._tellToGM(this.actor.name + " s'est dérobé et quitte les TMR.");
|
await this.actor.addTMRRencontre(this.currentRencontre);
|
||||||
this.close();
|
this.$forceClose(`${this.actor.name} s'est dérobé face à la rencontre ${this.currentRencontre.name}, et quitte les TMR.`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async refouler() {
|
async $refouler() {
|
||||||
console.log("-> refouler", this.currentRencontre);
|
if (this.currentRencontre) {
|
||||||
await this.actor.ajouterRefoulement(this.currentRencontre.system.refoulement, `${this.currentRencontre.system.genre == 'f' ? 'une' : 'un'} ${this.currentRencontre.name}`);
|
console.log("-> refouler", this.currentRencontre);
|
||||||
await this.actor.deleteRencontreTMRAtPosition()
|
await this.actor.ajouterRefoulement(this.currentRencontre.system.refoulement, `${this.currentRencontre.system.genre == 'f' ? 'une' : 'un'} ${this.currentRencontre.name}`);
|
||||||
this.updateTokens();
|
await this.$deleteRencontreTMRAtPosition()
|
||||||
this.updateValuesDisplay();
|
this.updateTokens();
|
||||||
this.nettoyerRencontre();
|
this.$updateValuesDisplay();
|
||||||
|
this.$nettoyerRencontre();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async ignorerRencontre() {
|
async $ignorerRencontre() {
|
||||||
console.log("-> ignorer", this.currentRencontre);
|
if (this.currentRencontre) {
|
||||||
this._tellToGM(this.actor.name + " a ignoré: " + this.currentRencontre.name);
|
console.log("-> ignorer", this.currentRencontre);
|
||||||
await this.actor.deleteRencontreTMRAtPosition()
|
this.$tellToGM(this.actor.name + " a ignoré: " + this.currentRencontre.name);
|
||||||
this.updateTokens();
|
await this.$deleteRencontreTMRAtPosition()
|
||||||
this.updateValuesDisplay();
|
this.updateTokens();
|
||||||
this.nettoyerRencontre();
|
this.$updateValuesDisplay();
|
||||||
|
this.$nettoyerRencontre();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -421,41 +434,29 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
checkQuitterTMR() {
|
async $checkQuitterTMR() {
|
||||||
if (this.actor.isDead()) {
|
const reason = this.actor.isDead()
|
||||||
this._tellToGM("Vous êtes mort : vous quittez les Terres médianes !");
|
? "est mort"
|
||||||
this.close();
|
: this.actor.isCumulFatigueCauseSommeil(this.cumulFatigue)
|
||||||
return true;
|
? "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
|
||||||
}
|
}
|
||||||
|
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 quitterLesTMRInconscient() {
|
async $maitriserRencontre() {
|
||||||
await this.refouler();
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
async maitriserRencontre() {
|
|
||||||
console.log("-> maitriser", this.currentRencontre);
|
console.log("-> maitriser", this.currentRencontre);
|
||||||
|
|
||||||
await this.actor.deleteRencontreTMRAtPosition()
|
await this.$deleteRencontreTMRAtPosition();
|
||||||
this.updateTokens();
|
this.updateTokens();
|
||||||
|
|
||||||
let rencontreData = {
|
let rencontreData = {
|
||||||
@ -470,11 +471,21 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
tmr: TMRUtility.getTMR(this._getCoordActor())
|
tmr: TMRUtility.getTMR(this._getCoordActor())
|
||||||
}
|
}
|
||||||
|
|
||||||
await this._tentativeMaitrise(rencontreData);
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _tentativeMaitrise(rencData) {
|
async $tentativeMaitrise(rencData) {
|
||||||
this.rencontreState = 'normal';
|
this.rencontreState = 'normal';
|
||||||
|
|
||||||
rencData.reve = this.actor.getReveActuel();
|
rencData.reve = this.actor.getReveActuel();
|
||||||
@ -483,7 +494,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
RollDataAjustements.calcul(rencData, this.actor);
|
RollDataAjustements.calcul(rencData, this.actor);
|
||||||
|
|
||||||
rencData.rolled = rencData.presentCite
|
rencData.rolled = rencData.presentCite
|
||||||
? this._rollPresentCite(rencData)
|
? this.$rollPresentCite(rencData)
|
||||||
: await RdDResolutionTable.roll(rencData.reve, RollDataAjustements.sum(rencData.ajustements));
|
: await RdDResolutionTable.roll(rencData.reve, RollDataAjustements.sum(rencData.ajustements));
|
||||||
|
|
||||||
const result = rencData.rolled.isSuccess
|
const result = rencData.rolled.isSuccess
|
||||||
@ -493,38 +504,41 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
await RdDRencontre.appliquer(result.effets, this, rencData);
|
await RdDRencontre.appliquer(result.effets, this, rencData);
|
||||||
|
|
||||||
rencData.poesie = { extrait: result.poesie, reference: result.reference };
|
rencData.poesie = { extrait: result.poesie, reference: result.reference };
|
||||||
rencData.message = this.formatMessageRencontre(rencData, result.message);
|
rencData.message = this.$formatMessageRencontre(rencData, result.message);
|
||||||
|
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this.actor),
|
whisper: ChatUtility.getOwners(this.actor),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.html`, rencData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.hbs`, rencData)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.updateValuesDisplay();
|
this.$updateValuesDisplay();
|
||||||
if (this.checkQuitterTMR()) {
|
if (await this.$checkQuitterTMR()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.rencontreState == 'persistant') {
|
if (this.rencontreState == 'persistant') {
|
||||||
this._nouvelleTentativeMaitrise(rencData);
|
this.$nouvelleTentativeMaitrise(rencData);
|
||||||
}
|
}
|
||||||
else if (!this.isRencontreDeplacement()) {
|
else if (!this.isRencontreDeplacement()) {
|
||||||
this.nettoyerRencontre();
|
this.$nettoyerRencontre();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_nouvelleTentativeMaitrise(rencData) {
|
$nouvelleTentativeMaitrise(rencData) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// TODO: remplacer par une boucle while(this.currentRencontre) ?
|
/**
|
||||||
|
* TODO: remplacer par une boucle while(this.currentRencontre) ?
|
||||||
|
* ajouter un moyen d'attendre la saisie de l'utilisateur (jet obligatoire)?
|
||||||
|
*/
|
||||||
rencData.nbRounds++;
|
rencData.nbRounds++;
|
||||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||||
this.cumulFatigue += this.fatigueParCase;
|
this.cumulFatigue += this.fatigueParCase;
|
||||||
}
|
}
|
||||||
this._tentativeMaitrise(rencData);
|
this.$tentativeMaitrise(rencData);
|
||||||
this._deleteTmrMessages(rencData.actor, rencData.nbRounds);
|
this.$deleteTmrMessages(rencData.actor, rencData.nbRounds);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
formatMessageRencontre(rencData, template) {
|
$formatMessageRencontre(rencData, template) {
|
||||||
let messageDuree = ''
|
let messageDuree = ''
|
||||||
if (rencData.nbRounds > 1) {
|
if (rencData.nbRounds > 1) {
|
||||||
if (rencData.rolled.isSuccess) {
|
if (rencData.rolled.isSuccess) {
|
||||||
@ -543,7 +557,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_rollPresentCite(rencData) {
|
$rollPresentCite(rencData) {
|
||||||
let rolled = RdDResolutionTable.computeChances(rencData.reve, 0);
|
let rolled = RdDResolutionTable.computeChances(rencData.reve, 0);
|
||||||
foundry.utils.mergeObject(rolled, { caracValue: rencData.reve, finalLevel: 0, roll: rolled.score });
|
foundry.utils.mergeObject(rolled, { caracValue: rencData.reve, finalLevel: 0, roll: rolled.score });
|
||||||
RdDResolutionTable.succesRequis(rolled);
|
RdDResolutionTable.succesRequis(rolled);
|
||||||
@ -551,7 +565,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_deleteTmrMessages(actor, nbRounds = -1) {
|
$deleteTmrMessages(actor, nbRounds = -1) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (nbRounds < 0) {
|
if (nbRounds < 0) {
|
||||||
ChatUtility.removeChatMessageContaining(`<h4 data-categorie="tmr" data-actor-id="${actor._id}"`);
|
ChatUtility.removeChatMessageContaining(`<h4 data-categorie="tmr" data-actor-id="${actor._id}"`);
|
||||||
@ -570,7 +584,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_tellToGM(message) {
|
$tellToGM(message) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
content: message,
|
content: message,
|
||||||
@ -579,7 +593,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_tellToUserAndGM(message) {
|
$tellToUserAndGM(message) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
content: message,
|
content: message,
|
||||||
@ -601,7 +615,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
if (this.currentRencontre) {
|
if (this.currentRencontre) {
|
||||||
if (this.rencontresExistantes.find(it => it.id == this.currentRencontre.id)) {
|
if (this.rencontresExistantes.find(it => it.id == this.currentRencontre.id)) {
|
||||||
// rencontre en attente suite à dérobade
|
// rencontre en attente suite à dérobade
|
||||||
await this.maitriserRencontre();
|
await this.$maitriserRencontre();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const dialog = new RdDTMRRencontreDialog(this.actor, this.currentRencontre, tmr);
|
const dialog = new RdDTMRRencontreDialog(this.actor, this.currentRencontre, tmr);
|
||||||
@ -648,7 +662,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
tmr: tmr,
|
tmr: tmr,
|
||||||
presentCite: presentCite
|
presentCite: presentCite
|
||||||
};
|
};
|
||||||
await this._tentativeMaitrise(rencontreData);
|
await this.$tentativeMaitrise(rencontreData);
|
||||||
this.postRencontre(tmr);
|
this.postRencontre(tmr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,10 +738,10 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
rollData.poesie = await Poetique.getExtrait();
|
rollData.poesie = await Poetique.getExtrait();
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this.actor),
|
whisper: ChatUtility.getOwners(this.actor),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.html`, rollData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData)
|
||||||
});
|
});
|
||||||
if (rollData.rolled.isEchec) {
|
if (rollData.rolled.isEchec) {
|
||||||
await this.close();
|
await this.$forceClose(`n'a pas maîtrisé la case ${rollData.tmr.label} et quitte les terres médianes`)
|
||||||
}
|
}
|
||||||
await this.souffleSiEchecTotal(rollData);
|
await this.souffleSiEchecTotal(rollData);
|
||||||
}
|
}
|
||||||
@ -782,7 +796,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
||||||
onConqueteEchec: r => {
|
onConqueteEchec: r => {
|
||||||
this.souffleSiEchecTotal(rollData);
|
this.souffleSiEchecTotal(rollData);
|
||||||
this.close()
|
this.$forceClose(`${this.actor.name} n'a pas maîtrisé la ${tmr.label}, et quitte les TMR.`)
|
||||||
},
|
},
|
||||||
canClose: false
|
canClose: false
|
||||||
});
|
});
|
||||||
@ -797,7 +811,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
onConqueteReussie: r => EffetsDraconiques.periple.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
onConqueteReussie: r => EffetsDraconiques.periple.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
||||||
onConqueteEchec: r => {
|
onConqueteEchec: r => {
|
||||||
this.souffleSiEchecTotal(rollData);
|
this.souffleSiEchecTotal(rollData);
|
||||||
this.close()
|
this.$forceClose(`${this.actor.name} n'a pas purifié la ${tmr.label}, et quitte les TMR.`)
|
||||||
},
|
},
|
||||||
canClose: false
|
canClose: false
|
||||||
});
|
});
|
||||||
@ -811,7 +825,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
difficulte: -7,
|
difficulte: -7,
|
||||||
action: 'Conquérir',
|
action: 'Conquérir',
|
||||||
onConqueteReussie: r => EffetsDraconiques.conquete.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
onConqueteReussie: r => EffetsDraconiques.conquete.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
|
||||||
onConqueteEchec: r => this.close(),
|
onConqueteEchec: r => this.$forceClose(`${this.actor.name} n'a pas conquis la case ${tmr.label}, et quitte les TMR.`),
|
||||||
canClose: false
|
canClose: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -841,7 +855,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
rollData.poesie = await Poetique.getExtrait();
|
rollData.poesie = await Poetique.getExtrait();
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this.actor),
|
whisper: ChatUtility.getOwners(this.actor),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.html`, rollData)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData)
|
||||||
});
|
});
|
||||||
if (rollData.rolled.isEchec) {
|
if (rollData.rolled.isEchec) {
|
||||||
options.onConqueteEchec(rollData, options.effetDraconique);
|
options.onConqueteEchec(rollData, options.effetDraconique);
|
||||||
@ -857,7 +871,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
rollData.isTMRCache = rollData.actor.isTMRCache();
|
rollData.isTMRCache = rollData.actor.isTMRCache();
|
||||||
const dialog = await RdDRoll.create(this.actor, rollData,
|
const dialog = await RdDRoll.create(this.actor, rollData,
|
||||||
{
|
{
|
||||||
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-maitrise-tmr.html',
|
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-maitrise-tmr.hbs',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: rollData.maitrise.verbe, label: rollData.maitrise.action,
|
name: rollData.maitrise.verbe, label: rollData.maitrise.action,
|
||||||
@ -922,19 +936,15 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async processSortReserve(sortReserve) {
|
async processSortReserve(sortReserve) {
|
||||||
await this.actor.deleteEmbeddedDocuments('Item', [sortReserve.id]);
|
await this.actor.deleteEmbeddedDocuments('Item', [sortReserve.id]);
|
||||||
console.log("declencheSortEnReserve", sortReserve);
|
console.log("declencheSortEnReserve", sortReserve)
|
||||||
const heureCible = RdDTimestamp.definition(sortReserve.system.heurecible).label;
|
const sort = sortReserve.system.sortid ? this.actor.items.get(sortReserve.system.sortid) : undefined
|
||||||
this._tellToUserAndGM(`Vous avez déclenché
|
const message = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-lancement-sortreserve.hbs`,
|
||||||
${sortReserve.system.echectotal ? "<strong>l'échec total!</strong>" : "le sort"}
|
{ sortReserve, sort })
|
||||||
en réserve <strong>${sortReserve.name}</strong>
|
await this.$forceClose(message)
|
||||||
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
|
// Suppression des dessins des zones possibles
|
||||||
this.currentRencontre?.graphics?.forEach(graphic => this.pixiTMR.removeGraphic(graphic))
|
this.currentRencontre?.graphics?.forEach(graphic => this.pixiTMR.removeGraphic(graphic))
|
||||||
// Nettoyage de la structureet de l'état
|
// Nettoyage de la structureet de l'état
|
||||||
@ -1021,7 +1031,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
console.log("STATUS :", this.rencontreState, this.currentRencontre);
|
console.log("STATUS :", this.rencontreState, this.currentRencontre);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.checkQuitterTMR();
|
await this.$checkQuitterTMR();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1054,13 +1064,13 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
*/
|
*/
|
||||||
this.notifierResonanceSigneDraconique(targetCoord);
|
this.notifierResonanceSigneDraconique(targetCoord);
|
||||||
await this.actor.rollUnSort(targetCoord);
|
await this.actor.rollUnSort(targetCoord);
|
||||||
this.nettoyerRencontre();
|
this.$nettoyerRencontre();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
externalRefresh() {
|
externalRefresh() {
|
||||||
this.createPixiSprites();
|
this.createPixiSprites();
|
||||||
this.updateValuesDisplay();
|
this.$updateValuesDisplay();
|
||||||
this.updateTokens();
|
this.updateTokens();
|
||||||
console.log("TMR REFRESHED !!!");
|
console.log("TMR REFRESHED !!!");
|
||||||
}
|
}
|
||||||
@ -1071,7 +1081,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
return this.forceTMRContinueAction()
|
return this.forceTMRContinueAction()
|
||||||
}
|
}
|
||||||
if (this.currentRencontre != 'normal') {
|
if (this.currentRencontre != 'normal') {
|
||||||
this.nettoyerRencontre();
|
this.$nettoyerRencontre();
|
||||||
}
|
}
|
||||||
let tmr = TMRUtility.getTMR(targetCoord);
|
let tmr = TMRUtility.getTMR(targetCoord);
|
||||||
// Gestion cases spéciales type Trou noir, etc
|
// Gestion cases spéciales type Trou noir, etc
|
||||||
@ -1083,7 +1093,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||||
this.cumulFatigue += this.fatigueParCase;
|
this.cumulFatigue += this.fatigueParCase;
|
||||||
}
|
}
|
||||||
this.updateValuesDisplay();
|
this.$updateValuesDisplay();
|
||||||
this.actor.notifyRefreshTMR();
|
this.actor.notifyRefreshTMR();
|
||||||
|
|
||||||
if (deplacementType == 'normal') { // Pas de rencontres après un saut de type passeur/changeur/...
|
if (deplacementType == 'normal') { // Pas de rencontres après un saut de type passeur/changeur/...
|
||||||
@ -1098,7 +1108,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
if (!this.viewOnly && this.actor.isResonanceSigneDraconique(coord)) {
|
if (!this.viewOnly && this.actor.isResonanceSigneDraconique(coord)) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this.actor),
|
whisper: ChatUtility.getOwners(this.actor),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-resonance.html`, {
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-resonance.hbs`, {
|
||||||
alias: this.actor.getAlias(),
|
alias: this.actor.getAlias(),
|
||||||
typeTMR: TMRUtility.getTMRType(coord)
|
typeTMR: TMRUtility.getTMRType(coord)
|
||||||
})
|
})
|
||||||
|
@ -52,7 +52,7 @@ export class RdDTokenHud {
|
|||||||
};
|
};
|
||||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||||
await RdDTokenHud._configureSubMenu(controlIconCombat,
|
await RdDTokenHud._configureSubMenu(controlIconCombat,
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
|
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs',
|
||||||
hudData,
|
hudData,
|
||||||
(event) => {
|
(event) => {
|
||||||
let initCommand = event.currentTarget.attributes['data-command']?.value;
|
let initCommand = event.currentTarget.attributes['data-command']?.value;
|
||||||
@ -70,7 +70,7 @@ export class RdDTokenHud {
|
|||||||
static async addExtensionHudCombat(html, combatant, token, actions) {
|
static async addExtensionHudCombat(html, combatant, token, actions) {
|
||||||
const hudData = { combatant, token, actions, commandes: [] };
|
const hudData = { combatant, token, actions, commandes: [] };
|
||||||
const controlIconTarget = html.find('.control-icon[data-action=target]');
|
const controlIconTarget = html.find('.control-icon[data-action=target]');
|
||||||
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html', hudData,
|
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs', hudData,
|
||||||
(event) => {
|
(event) => {
|
||||||
const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
|
const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
|
||||||
const action = hudData.actions[actionIndex];
|
const action = hudData.actions[actionIndex];
|
||||||
|
@ -112,34 +112,34 @@ export class RdDUtility {
|
|||||||
static preloadHandlebarsTemplates() {
|
static preloadHandlebarsTemplates() {
|
||||||
const templatePaths = [
|
const templatePaths = [
|
||||||
//Character Sheets
|
//Character Sheets
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.hbs',
|
||||||
// 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/item-action-controls.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-creature.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-creature.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-entitee.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-entitee.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/header-hautreve.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/header-hautreve.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/archetype.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/archetype.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/armures.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/armures.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.hbs',
|
'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.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/competence.hbs',
|
'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.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.hbs',
|
||||||
'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.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.hbs',
|
||||||
@ -149,11 +149,11 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs',
|
'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.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queue.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queue.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-souffles.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-souffles.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-tetes.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-tetes.hbs',
|
||||||
@ -163,9 +163,9 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-sorts-reserve.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-sorts-reserve.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-meditations.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-meditations.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/hr-casetmrs.hbs',
|
'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.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.hbs',
|
||||||
"systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-monnaie.hbs",
|
"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',
|
||||||
@ -176,36 +176,38 @@ export class RdDUtility {
|
|||||||
//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',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/boutons-comestible.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/boutons-comestible.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/temporel.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/item/temporel.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/header-item.html',
|
'systems/foundryvtt-reve-de-dragon/templates/header-item.hbs',
|
||||||
|
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/queue-sheet.hbs',
|
'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.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-base-competence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-base-competence.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-caracteristiques.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-caracteristiques.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categories.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categories.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item/potion-enum-categorie.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/item/enum-categorie-alchimie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-queue.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item/enum-etat-alchimie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-queue.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-competence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-draconic.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-competence.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-heures.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-draconic.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-initpremierround.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-heures.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-mortalite.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-initpremierround.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-niveau-ethylisme.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-mortalite.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-periode.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-niveau-ethylisme.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-periode.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-effet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-rarete.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-type.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-effet.hbs',
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-type.hbs',
|
||||||
// Partials
|
// Partials
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/enchantement/partial-enchantement.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/coeur/chat-effet-tendre-moment.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/coeur/chat-effet-tendre-moment.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/coeur/afficher-coeur.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/coeur/afficher-coeur.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/tirage/liste-resultats-recherche.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/tirage/liste-resultats-recherche.hbs',
|
||||||
@ -217,54 +219,53 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/common/periodicite.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/common/periodicite.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/common/enum-duree.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/common/enum-duree.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/common/compendium-link.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/common/compendium-link.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-astrologique.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-astrologique.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-item-hautrevant.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-item-hautrevant.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-item-frequence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-item-frequence.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html',
|
'systems/foundryvtt-reve-de-dragon/templates/partial-item-description.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/roll/explain.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/roll/explain.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/resolution-table.html',
|
'systems/foundryvtt-reve-de-dragon/templates/resolution-table.hbs',
|
||||||
// Dialogs
|
// Dialogs
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-resolution.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-resolution.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-validation-encaissement.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-validation-encaissement.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-meditation.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-meditation.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.html',
|
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-gardien.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-gardien.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-joueur.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-joueur.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-theme.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-theme.hbs',
|
||||||
// HUD
|
// HUD
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
|
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html',
|
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs',
|
||||||
// messages tchat
|
// messages tchat
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-infojet.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-description.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-description.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-info-distance.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-info-distance.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-acteur.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-acteur.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-sante.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-sante.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-competence-xp.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-competence-xp.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-fabriquer-potion-base.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-fabriquer-potion-base.html',
|
'systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.hbs'
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.html'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// foundry et options
|
// foundry et options
|
||||||
@ -317,6 +318,7 @@ export class RdDUtility {
|
|||||||
// gestion des dates et heures
|
// gestion des dates et heures
|
||||||
Handlebars.registerHelper('timestamp-imgSigneHeure', (heure) => { return new Handlebars.SafeString(RdDTimestamp.imgSigneHeure(heure)) });
|
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-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-extract', timestamp => new RdDTimestamp(timestamp).toCalendrier());
|
||||||
Handlebars.registerHelper('timestamp-formulesDuree', () => RdDTimestamp.formulesDuree());
|
Handlebars.registerHelper('timestamp-formulesDuree', () => RdDTimestamp.formulesDuree());
|
||||||
Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode());
|
Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode());
|
||||||
@ -339,6 +341,7 @@ export class RdDUtility {
|
|||||||
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-applies', (action, item, options) => ItemAction.applies(action, item, options))
|
||||||
Handlebars.registerHelper('item-action-icon', (action, item) => ItemAction.icon(action, item))
|
Handlebars.registerHelper('item-action-icon', (action, item) => ItemAction.icon(action, item))
|
||||||
|
Handlebars.registerHelper('item-name', (item) => item.nameDisplay)
|
||||||
|
|
||||||
// TMRs
|
// TMRs
|
||||||
Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord));
|
Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord));
|
||||||
@ -962,8 +965,8 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
static checkThanatosXP(compName) {
|
static checkThanatosXP(item) {
|
||||||
if (compName.includes('Thanatos')) {
|
if (item.isCompetencePersonnage() && item.name.includes('Thanatos')) {
|
||||||
let message = "Vous avez mis des points d'Expérience en Thanatos !<br>Vous devez réduire manuellement d'un même montant d'XP une autre compétence Draconique.";
|
let message = "Vous avez mis des points d'Expérience en Thanatos !<br>Vous devez réduire manuellement d'un même montant d'XP une autre compétence Draconique.";
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getUserAndGMs(),
|
whisper: ChatUtility.getUserAndGMs(),
|
||||||
|
@ -112,7 +112,7 @@ export class StatusEffects extends FormApplication {
|
|||||||
const options = super.defaultOptions;
|
const options = super.defaultOptions;
|
||||||
foundry.utils.mergeObject(options, {
|
foundry.utils.mergeObject(options, {
|
||||||
id: "status-effects",
|
id: "status-effects",
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/settings/status-effects.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/settings/status-effects.hbs",
|
||||||
height: 800,
|
height: 800,
|
||||||
width: 350,
|
width: 350,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
|
@ -157,7 +157,7 @@ export class SystemCompendiums extends FormApplication {
|
|||||||
const options = super.defaultOptions;
|
const options = super.defaultOptions;
|
||||||
foundry.utils.mergeObject(options, {
|
foundry.utils.mergeObject(options, {
|
||||||
id: "system-compendiums",
|
id: "system-compendiums",
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/settings/system-compendiums.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/settings/system-compendiums.hbs",
|
||||||
height: 'fit-content',
|
height: 'fit-content',
|
||||||
width: 600,
|
width: 600,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
|
@ -15,7 +15,7 @@ export class DialogRepos extends Dialog {
|
|||||||
"heures": 4
|
"heures": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-repos.html", actor);
|
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-repos.hbs", actor);
|
||||||
const dialog = new DialogRepos(html, actor);
|
const dialog = new DialogRepos(html, actor);
|
||||||
dialog.render(true);
|
dialog.render(true);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ export class DialogStress extends Dialog {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-stress.html", dialogData);
|
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-stress.hbs", dialogData);
|
||||||
new DialogStress(dialogData, html)
|
new DialogStress(dialogData, html)
|
||||||
.render(true);
|
.render(true);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ export class EffetsRencontre {
|
|||||||
})
|
})
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(context.actor),
|
whisper: ChatUtility.getOwners(context.actor),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.html`, context)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.hbs`, context)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ export class EffetsRencontre {
|
|||||||
|
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(context.actor),
|
whisper: ChatUtility.getOwners(context.actor),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.html`, context)
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.hbs`, context)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npx vite build",
|
"build": "npx vite build",
|
||||||
|
"run": "npx vite serve",
|
||||||
"packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs",
|
"packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs",
|
||||||
"packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs",
|
"packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs",
|
||||||
"unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs"
|
"unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs"
|
||||||
|
@ -196,7 +196,7 @@ system:
|
|||||||
derivee: false
|
derivee: false
|
||||||
protection:
|
protection:
|
||||||
type: number
|
type: number
|
||||||
value: 2
|
value: 10
|
||||||
label: Protection
|
label: Protection
|
||||||
derivee: false
|
derivee: false
|
||||||
compteurs:
|
compteurs:
|
||||||
|
@ -2358,6 +2358,7 @@ items:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Epais
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -3897,7 +3898,8 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -4919,6 +4921,7 @@ items:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Epais
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -5349,7 +5352,8 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -5605,7 +5609,8 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -5765,7 +5770,8 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -6437,7 +6443,8 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -6672,6 +6679,7 @@ items:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Solide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -7157,6 +7165,7 @@ items:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Poudre
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -7610,7 +7619,8 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -7690,6 +7700,7 @@ items:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Solide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
@ -7768,6 +7779,7 @@ items:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Epais
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -29,6 +29,7 @@ system:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Epais
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,8 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -29,6 +29,7 @@ system:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Epais
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,8 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,8 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -28,7 +28,8 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,8 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -29,6 +29,7 @@ system:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Solide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -29,6 +29,7 @@ system:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Poudre
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -30,7 +30,8 @@ system:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -29,6 +29,7 @@ system:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Solide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -29,6 +29,7 @@ system:
|
|||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Remede
|
categorie: Remede
|
||||||
|
etat: Epais
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -3344,7 +3344,8 @@ items:
|
|||||||
indexDate: -1
|
indexDate: -1
|
||||||
indexMinute: 0
|
indexMinute: 0
|
||||||
rarete: ''
|
rarete: ''
|
||||||
categorie: Alchimie
|
categorie: Remede
|
||||||
|
etat: Liquide
|
||||||
herbe: ''
|
herbe: ''
|
||||||
herbebrins: 0
|
herbebrins: 0
|
||||||
herbebonus: 0
|
herbebonus: 0
|
||||||
|
@ -467,7 +467,7 @@ table {border: 1px solid #7a7971;}
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.equipement-nom {
|
.equipement-nom {
|
||||||
flex-grow : 4;
|
flex-grow : 3;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"id": "foundryvtt-reve-de-dragon",
|
"id": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"version": "12.0.35",
|
"version": "12.0.44",
|
||||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.35/rddsystem.zip",
|
"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.35/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.44/system.json",
|
||||||
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "11",
|
"minimum": "11",
|
||||||
|
@ -589,6 +589,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"enchantable": {
|
||||||
|
"magique": false,
|
||||||
|
"pr": 0,
|
||||||
|
"purifie": false,
|
||||||
|
"prpermanent": false,
|
||||||
|
"prdate": 0
|
||||||
|
},
|
||||||
"equipement": {
|
"equipement": {
|
||||||
"equipe": false
|
"equipe": false
|
||||||
},
|
},
|
||||||
@ -739,7 +746,7 @@
|
|||||||
"templates": ["description", "inventaire"]
|
"templates": ["description", "inventaire"]
|
||||||
},
|
},
|
||||||
"gemme": {
|
"gemme": {
|
||||||
"templates": ["description", "inventaire"],
|
"templates": ["description", "enchantable", "inventaire", "temporel"],
|
||||||
"type": "",
|
"type": "",
|
||||||
"taille": 0,
|
"taille": 0,
|
||||||
"purete": 0,
|
"purete": 0,
|
||||||
@ -795,18 +802,14 @@
|
|||||||
"niveau_maximum": 0
|
"niveau_maximum": 0
|
||||||
},
|
},
|
||||||
"potion": {
|
"potion": {
|
||||||
"templates": ["description", "inventaire", "temporel"],
|
"templates": ["description", "enchantable", "inventaire", "temporel"],
|
||||||
"rarete": "",
|
"rarete": "",
|
||||||
"categorie": "",
|
"categorie": "",
|
||||||
|
"etat": "",
|
||||||
"herbe": "",
|
"herbe": "",
|
||||||
"herbebrins": 0,
|
"herbebrins": 0,
|
||||||
"herbebonus": 0,
|
"herbebonus": 0,
|
||||||
"reposalchimique": false,
|
"reposalchimique": false
|
||||||
"magique": false,
|
|
||||||
"pr": 0,
|
|
||||||
"purifie": false,
|
|
||||||
"prpermanent": false,
|
|
||||||
"prdate": 0
|
|
||||||
},
|
},
|
||||||
"service": {
|
"service": {
|
||||||
"templates": ["description", "inventaire"],
|
"templates": ["description", "inventaire"],
|
||||||
@ -903,7 +906,7 @@
|
|||||||
"value": 0
|
"value": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"attributs":{
|
"attributs": {
|
||||||
"protection": {
|
"protection": {
|
||||||
"value": 0
|
"value": 0
|
||||||
}
|
}
|
||||||
@ -950,7 +953,8 @@
|
|||||||
"xp": 0,
|
"xp": 0,
|
||||||
"bonuscase": "",
|
"bonuscase": "",
|
||||||
"isrituel": false,
|
"isrituel": false,
|
||||||
"coutseuil": 0
|
"coutseuil": 0,
|
||||||
|
"lancements": []
|
||||||
},
|
},
|
||||||
"sortreserve": {
|
"sortreserve": {
|
||||||
"sortid": "",
|
"sortid": "",
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-creature.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-creature.hbs"}}
|
||||||
<div class="flex-group-left header-etats">
|
<div class="flex-group-left header-etats">
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<span>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</span>
|
<span>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</span>
|
||||||
<span>{{calc.resumeBlessures}}</span>
|
<span>{{calc.resumeBlessures}}</span>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -43,13 +43,13 @@
|
|||||||
{{!-- Carac & compétences --}}
|
{{!-- Carac & compétences --}}
|
||||||
<div class="tab items" data-group="primary" data-tab="carac">
|
<div class="tab items" data-group="primary" data-tab="carac">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-2col">
|
<div class="grid grid-2col">
|
||||||
<div class="flex-group-left flexcol">
|
<div class="flex-group-left flexcol">
|
||||||
<ul class="carac-list alterne-list">
|
<ul class="carac-list alterne-list">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.hbs"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.hbs"}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-left flexcol competence-column">
|
<div class="flex-group-left flexcol competence-column">
|
||||||
@ -57,13 +57,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{!-- 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.hbs"}}
|
{{> "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.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{!-- Description Tab --}}
|
{{!-- Description Tab --}}
|
||||||
@ -72,7 +72,7 @@
|
|||||||
{{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
{{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.hbs"}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-entitee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-entitee.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -29,13 +29,13 @@
|
|||||||
{{!-- Carac Tab --}}
|
{{!-- Carac Tab --}}
|
||||||
<div class="items" data-group="primary" data-tab="carac">
|
<div class="items" data-group="primary" data-tab="carac">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-2col">
|
<div class="grid grid-2col">
|
||||||
<div class="flex-group-left flexcol">
|
<div class="flex-group-left flexcol">
|
||||||
<ul class="carac-list alterne-list">
|
<ul class="carac-list alterne-list">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.hbs"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.hbs"}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-left flexcol">
|
<div class="flex-group-left flexcol">
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<div class="form-group large-editor">
|
<div class="form-group large-editor">
|
||||||
{{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
{{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
||||||
</div>
|
</div>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.hbs"}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -7,13 +7,13 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<img class="profile-img" src="{{img}}" data-edit="img" data-tooltip="{{name}}" />
|
<img class="profile-img" src="{{img}}" data-edit="img" data-tooltip="{{name}}" />
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.hbs"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.hbs"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-hautreve.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-hautreve.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -37,17 +37,17 @@
|
|||||||
{{#if options.isObserver}}{{!-- Carac Tab --}}
|
{{#if options.isObserver}}{{!-- Carac Tab --}}
|
||||||
<div class="tab items" data-group="primary" data-tab="carac">
|
<div class="tab items" data-group="primary" data-tab="carac">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-2col">
|
<div class="grid grid-2col">
|
||||||
<div class="flex-group-left flexcol">
|
<div class="flex-group-left flexcol">
|
||||||
<ul class="carac-list alterne-list">
|
<ul class="carac-list alterne-list">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.hbs"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.hbs"}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-left flexcol" >
|
<div class="flex-group-left flexcol" >
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -56,7 +56,7 @@
|
|||||||
<div class="tab competences" data-group="primary" data-tab="competences">
|
<div class="tab competences" data-group="primary" data-tab="competences">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<span>
|
<span>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.hbs"}}
|
||||||
</span>
|
</span>
|
||||||
<span class="flexrow"><a class="show-hide-competences">
|
<span class="flexrow"><a class="show-hide-competences">
|
||||||
{{#if options.showCompNiveauBase}}
|
{{#if options.showCompNiveauBase}}
|
||||||
@ -85,18 +85,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid {{#if (and options.vueDetaillee options.vueArchetype)}}grid-competence-archetype{{else}}grid-2col{{/if}}">
|
<div class="grid {{#if (and options.vueDetaillee options.vueArchetype)}}grid-competence-archetype{{else}}grid-2col{{/if}}">
|
||||||
<div class="competence-column">
|
<div class="competence-column">
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.generale) categorie="Compétences générales"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.generale) categorie="Compétences générales"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.particuliere) categorie="Compétences Particulières"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.particuliere) categorie="Compétences Particulières"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.specialisee) categorie="Compétences Spécialisées"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.specialisee) categorie="Compétences Spécialisées"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="competence-column">
|
<div class="competence-column">
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.melee) categorie="Compétences de Mêlée"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.melee) categorie="Compétences de Mêlée"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.tir) categorie="Compétences de Tir"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.tir) categorie="Compétences de Tir"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.lancer) categorie="Compétences de Lancer"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.lancer) categorie="Compétences de Lancer"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.connaissance) categorie="Connaissances"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.connaissance) categorie="Connaissances"}}
|
||||||
{{#if (or system.attributs.hautrevant.value options.vueDetaillee)}}
|
{{#if (or system.attributs.hautrevant.value options.vueDetaillee)}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.draconic) categorie="Draconic"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs" competences=(filtreTriCompetences byCateg.draconic) categorie="Draconic"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if (and options.vueDetaillee options.vueArchetype)}}
|
{{#if (and options.vueDetaillee options.vueArchetype)}}
|
||||||
@ -109,8 +109,8 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if options.isObserver}}{{!-- Combat Tab --}}
|
{{#if options.isObserver}}{{!-- Combat Tab --}}
|
||||||
<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.hbs"}}<hr>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/possessions.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/possessions.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
@ -118,7 +118,7 @@
|
|||||||
|
|
||||||
{{#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.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs"}}
|
||||||
@ -144,7 +144,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.hbs"}}
|
{{> "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.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-vehicules.hbs"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
@ -195,7 +195,7 @@
|
|||||||
<label for="system.heure">Heure de naissance</label>
|
<label for="system.heure">Heure de naissance</label>
|
||||||
<select type="text" name="system.heure" value="{{system.heure}}" data-dtype="String">
|
<select type="text" name="system.heure" value="{{system.heure}}" data-dtype="String">
|
||||||
{{#select system.heure}}
|
{{#select system.heure}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.hbs"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
@ -228,8 +228,8 @@
|
|||||||
<div class="form-group large-editor">
|
<div class="form-group large-editor">
|
||||||
{{editor notes target="system.notes" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
{{editor notes target="system.notes" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
||||||
</div>
|
</div>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/xp-journal.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/xp-journal.hbs"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.hbs"}}
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -46,7 +46,7 @@
|
|||||||
{{!-- Carac Tab --}}
|
{{!-- Carac Tab --}}
|
||||||
<div class="tab" data-group="primary" data-tab="description">
|
<div class="tab" data-group="primary" data-tab="description">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-2col">
|
<div class="grid grid-2col">
|
||||||
<div class="flex-group-left flexcol">
|
<div class="flex-group-left flexcol">
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<span class="carac-label">Catégorie</span>
|
<span class="carac-label">Catégorie</span>
|
||||||
<select name="system.categorie" class="categorie" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
<select name="system.categorie" class="categorie" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
||||||
{{#select system.categorie}}
|
{{#select system.categorie}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.hbs"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
@ -86,13 +86,13 @@
|
|||||||
<div class="form-group large-editor">
|
<div class="form-group large-editor">
|
||||||
{{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
{{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
|
||||||
</div>
|
</div>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{!-- 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.hbs"}}
|
{{> "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.hbs"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
@ -4,7 +4,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<label class="carac-xp"/>
|
<label class="carac-xp"/>
|
||||||
</li>
|
</li>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.hbs"}}
|
||||||
<li class="caracteristique flexrow list-item">
|
<li class="caracteristique flexrow list-item">
|
||||||
<span class="carac-label" name="catEntite">Catégorie</span>
|
<span class="carac-label" name="catEntite">Catégorie</span>
|
||||||
<select name="system.definition.categorieentite" value="{{system.definition.categorieentite}}" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
<select name="system.definition.categorieentite" value="{{system.definition.categorieentite}}" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user